Project Euler 3 solved