The below is an ackermann function implementation in awk based on the one on rosettacode.org and modified for higher verbosity to illustrate the details of calculations behind the ackermann function's recursion.
For example, the following shows Ackermann(2,2)
> awk -v m=2 -v n=2 -f ackermann_illustrated.awk
a(2,2) = a(1, a(2,1))
a(2,1) = a(1, a(2,0))
a(2,0) = a(1,1)
a(1,1) = a(0, a(1,0))
a(1,0) = a(0,1)
a(0,1) = 2
a(1,0) = 2
a(1,1) = a(0, 2)
a(0,2) = 3
a(1,1) = 3
a(2,0) = 3
a(2,1) = a(1, 3)
a(1,3) = a(0, a(1,2))
a(1,2) = a(0, a(1,1))
a(1,1) = a(0, a(1,0))
a(1,0) = a(0,1)
a(0,1) = 2
a(1,0) = 2
a(1,1) = a(0, 2)
a(0,2) = 3
a(1,1) = 3
a(1,2) = a(0, 3)
a(0,3) = 4
a(1,2) = 4
a(1,3) = a(0, 4)
a(0,4) = 5
a(1,3) = 5
a(2,1) = 5
a(2,2) = a(1, 5)
a(1,5) = a(0, a(1,4))
a(1,4) = a(0, a(1,3))
a(1,3) = a(0, a(1,2))
a(1,2) = a(0, a(1,1))
a(1,1) = a(0, a(1,0))
a(1,0) = a(0,1)
a(0,1) = 2
a(1,0) = 2
a(1,1) = a(0, 2)
a(0,2) = 3
a(1,1) = 3
a(1,2) = a(0, 3)
a(0,3) = 4
a(1,2) = 4
a(1,3) = a(0, 4)
a(0,4) = 5
a(1,3) = 5
a(1,4) = a(0, 5)
a(0,5) = 6
a(1,4) = 6
a(1,5) = a(0, 6)
a(0,6) = 7
a(1,5) = 7
a(2,2) = 7