Project Euler problem 54