Solved Euler 40