Euler problem 57 solution.