Project Euler.

Solutioin of problem 49.