solution to Euler Project