Algorithm to find primes.