The problem defines a function as $f(x,0)=f(x-1,1)$, $f(0,y) = (y+1) \mod 5$ and $f(x,y) = f(x-1, f(x,y-1))$, want to compute $f(333,3)$?
Recursively with tedious algebra, the problem can be computed, but I really hope to learn some nice trick to reveal an easy path. Tried but couldn't find one. Thank you~~