Project Euler Problem 2,3 solved