Reduced Problem 12 time to 0.144329 seconds by vastly reducing the number of primes generated.