Fork me on GitHub

Sieve of Eratosthenes

In mathematics, the sieve of Eratosthenes , is a simple, ancient algorithm for finding all prime numbers up to any given limit. It does so by iteratively marking as composite (i.e. not prime) the multiples of each prime, starting with the multiples of 2.

You can reed the full description ...