Project Euler: Problem 4