Solved Projece Euler Problem 4