7 kyu

Array of all primes up to number N

351 of 494otamm

Description:

Code a function which will return an array with all prime numbers smaller than or equal to an arbitrary parameter "n".

Assume that all parameters will be numbers.

Remember that in some test cases with a big enough "n", performance might be (more) important.

Mathematics
Algorithms

More By Author:

Check out these other kata created by otamm

Stats:

CreatedFeb 25, 2016
PublishedFeb 25, 2016
Warriors Trained821
Total Skips9
Total Code Submissions1712
Total Times Completed494
JavaScript Completions351
Ruby Completions161
Total Stars13
% of votes with a positive feedback rating87% of 123
Total "Very Satisfied" Votes99
Total "Somewhat Satisfied" Votes16
Total "Not Satisfied" Votes8
Ad
Contributors
  • otamm Avatar
  • donaldsebleung Avatar
Ad