Project Euler 309 - Integer Ladders

Official link: https://projecteuler.net/problem=309