timed-prime-test procedure from book
search-for-primes procedure for exercise 1.22