sieve of Eratosthenes, a simple implementation.