Added solution to Euler's 40th problem