Sieve Of Eratosthenes Article Index for
Sieve
Shopping
Sieve
Website Links For
Sieve
 

Information About

Sieve Of Eratosthenes





ALGORITHM


# Write a list of numbers from 2 to the largest number you want to test for primality. Call this List A. (This is the list on the left-hand-side of the picture.)
# Write the number 2, the first prime number, in another list for primes found. Call this List B. (This is the list on the right-hand-side of the picture.)
# Strike off 2 and all multiples of 2 from List A.
# The first remaining number in the list is a prime number. Write this number into List B.
# Strike off this number and all multiples of this number from List A. The crossing-off of multiples can be started at the square of the number, as lower multiples have already been crossed out in previous steps.
# Repeat steps 4 through 6 until no more numbers are left in List A.


REFERENCES


Κοσκινον Ερατοσθενους ''or, The Sieve of Eratosthenes. Being an Account of His Method of Finding All the Prime Numbers'', by the Rev. Samuel Horsley, F. R. S.,
Philosophical Transactions (1683-1775), Vol. 62. (1772), pp. 327-347.

For more advanced developments, see:



EXTERNAL LINKS