Project Euler, Problem 39, Mathematica