problem 7 and moderately faster prime number generator