Second problem on Project Euler.net