program to solve Euler's problem 2