Here is the PRoject Euler problem 6.