Project Euler 479 - Roots on the Rise

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