Problem 10.

Prime number generator still appears to be a bottleneck.
Updated prime number generator with sieve.

Similar benchmarks for 2M primes but better potential:
O(n log n log log n) vs O(n^2/(log n)^2).