Solution to project Euler number Four