Project Euler, Mathematica Problem 1