exercise 1.22 search-for-primes