Problem 780 · Hard
Walk backwards from the target with a Euclid-style modulo until it hits the start or can no longer shrink.
Open the interactive visualisation