Problem 27 is much faster when I don't test for primes in for expression