Solve project euler problem 62.