Project Euler Ex 3