Project Euler problem 50.