This is my final solution to Project Euler Promlem 3