Implementation of the algorithm, Sieve of Eratosthenes.