The Ackermann function is a total computable function that is not primitive recursive. That means that it will theoretically always produce a result, but it can not be reduced to a function that only uses loops instead of recursion.

The function uses very many of recursive calls and gets very large results even for rather small inputs.

In my implementation of the Ackermann function in Pd, it looks at first glance as if it would only use [until], so just a loop, and no recursion.

But really the recursion is implemented using [text], where all the incomplete intermediate results are saved until they are completed and used as inputs for the next iteration, respectively.

You can watch the process by opening the [text] and click the step button for each step of the calculation.

Be careful, while Ackermann(3,5) and Ackermann(4,0) are getting calculated quickly, it didn't finish calculating Ackermann(4,1) on my computer even after two hours.