solution to project Euler problems