Project Euler problem 4