Solution for Euler 4