Sieve of Eratosthenes implementation.