Solved Euler problem 46