7 kyu

Array of all primes up to number N

354 of 497otamm

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 Trained830
Total Skips9
Total Code Submissions1720
Total Times Completed497
JavaScript Completions354
Ruby Completions163
Total Stars12
% of votes with a positive feedback rating87% of 126
Total "Very Satisfied" Votes102
Total "Somewhat Satisfied" Votes16
Total "Not Satisfied" Votes8
Ad
Contributors
  • otamm Avatar
  • donaldsebleung Avatar
Ad