Euler Project Problem 4