The Sieve of Erathostenes is a more efficient (and
ancient) algorithm for finding all primes up to a given number. It
starts with a list of all numbers from 2 to the desired limit. It
traverses this list, starting at two. Whenever it encounteres a
new number, it strikes all multiples of it from the list. What
remains at the end is a list of prime numbers.
Example:
Initial list: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Striking multiples of 2: 2 3 5 7 9 11 13 15
Striking multiples of 3: 2 3 5 7 11 13
(There are no multiples of any remainig number, so we skip the rest)
Use the Sieve algorithm in a second program,
primes_sieve, that prints all primes between 0 and
10000. Hint: Use an array!