Write a Primes program that finds prime numbers using the Sieve of Eratosthenes, an algorithm devised by a Greek mathematician of the same name who lived in the third century BC. The algorithm finds all prime numbers up to some maximum value n, as described by the following pseudocode:
create a queue of numbers to process.fill the queue with the integers 2 through n inclusive.create an empty result queue to store primes.
repeat the following steps: obtain the next prime p by removing the first value from the queue of numbers. put p into the result queue of primes. loop through the queue of numbers, eliminating all numbers that are divisible by p.while (p is less than the square root of n).
all remaining values in the numbers queue are prime,so transfer them to the result primes queue.
Wikipedia has a nice description and animation of this algorithm in action: http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.