Euler Project - Problem 3