Solved Euler problem 8