Paul's solution to Euler 1