Solved the 5th Euler problem.