Project Euler Problem 10 (Sieve of Eratosthenes version)