Solve problem10 using someone else's prime sieve.