Copies code for calculating primes.