Sieve of Eratosthenes
Sieve of Eratosthenes
To get all the primes up to a certain number (the largest number in the array), strike out the multiples of the primes less than These are the numbers taken out: 4, 6, 8, 10, … , 6, 9, 12, 15, … , 10, 15, 20, 25, … , 14, 21, 28, 35, … , and so on.
w
w
.