Project Euler Solution 2