Project Euler #227: The Chase