Solution for ProjectEuler Problem 5

Need optimization