Project Euler.

Solution of problem 79.