Project Euler #244: Sliders