Project Euler Solution to problem 15