Made a second solution to problem 10 using the Sieve of Eratosthenes