Solved Project Euler 3