Solve Project Euler Problem 1