Problem 1, 7.  Some common code for computing primes by sieve.