Implemented problem 10 using the sieve of eratosthenes algorithm.