Ackermann's function is a recursive function (like factorial) which can't be easily rewritten in a non-recursive way (unlike factorial which is just a loop). It's an expensive function to calculate, and when written the simple way like this, some calls to the function take so long to complete that there's no point in doing them. Compare the code in this demo to the version in http://scratch.mit.edu/projects/28293808/ which uses a technique called 'memo functions' to remember previously computed results, allowing it to avoid most of the recursive calls and execute in far less time. This technique can be applied to any function where the same arguments always give the same results (ie no internal state. These are what computer scientists (but maybe not mathematicians) call 'idempotent' functions.)
See http://en.wikipedia.org/wiki/Ackermann_function for an explanation of Ackermann's Function.