Ackermann Function/Examples

Examples of Ackermann Function
The Ackermann function $A: \Z_{\ge 0} \times \Z_{\ge 0} \to \Z_{> 0}$ is defined as:


 * $A \left({m, n}\right) = \begin{cases} 2 n & : m = 1 \\

m & : m > 1, n = 1 \\ A \left({m - 1, A \left({m, n - 1}\right)}\right) & : \text{otherwise} \end{cases}$


 * $\begin{array}{c|c|c|c}

A \left({m, n}\right) & m = 1 & m = 2 & m = 3 & m = 4 & \cdots & m = k \\ \hline n = 1 & 2 & 2 & 3 & 4 & & k\\ n = 2 & 4 & A \left({1, A \left({2, 1}\right)}\right) & A \left({2, A \left({3, 1}\right)}\right) & A \left({3, A \left({4, 1}\right)}\right) & & A \left({k - 1, A \left({k, 1}\right)}\right) \\ n = 3 & 6 & A \left({1, A \left({2, 2}\right)}\right) & A \left({2, A \left({3, 2}\right)}\right) & A \left({3, A \left({4, 2}\right)}\right) & & A \left({k - 1, A \left({k, 2}\right)}\right) \\ n = 4 & 8 & A \left({1, A \left({2, 3}\right)}\right) & A \left({2, A \left({3, 3}\right)}\right) & A \left({3, A \left({4, 3}\right)}\right) & & A \left({k - 1, A \left({k, 3}\right)}\right) \\ n = 5 & 10 & A \left({1, A \left({2, 4}\right)}\right) & A \left({2, A \left({3, 4}\right)}\right) & A \left({3, A \left({4, 4}\right)}\right) & & A \left({k - 1, A \left({k, 4}\right)}\right) \\ \vdots &  &  &  &  & & \\ n = j & 2 j & A \left({1, A \left({2, j - 1}\right)}\right) & A \left({2, A \left({3, j - 1}\right)}\right) & A \left({3, A \left({4, j - 1}\right)}\right) & & A \left({k - 1, A \left({k, j - 1}\right)}\right) \\ \end{array}$

which leads to:


 * $\begin{array}{c|c|c|c}

A \left({m, n}\right) & m = 1 & m = 2 & m = 3 & m = 4 & \cdots & m = k \\ \hline n = 1 & 2 & 2 & 3 & 4 & & k \\ n = 2 & 4 & 4 & 8 & A \left({3, 4}\right) & & A \left({k - 1, k}\right) \\ n = 3 & 6 & 8 & 2^8 & A \left({3, A \left({4, 2}\right)}\right) & & A \left({k - 1, A \left({k, 2}\right)}\right) \\ n = 4 & 8 & 16 & 2^{2^8} & A \left({3, A \left({4, 3}\right)}\right) & & A \left({k - 1, A \left({k, 3}\right)}\right) \\ n = 5 & 10 & 32 & A \left({2, A \left({3, 4}\right)}\right) & A \left({3, A \left({4, 4}\right)}\right) & & A \left({k - 1, A \left({k, 4}\right)}\right) \\ \vdots &  &  &  &  \\ n = j & 2 j & 2^j & A \left({2, A \left({3, j - 1}\right)}\right) & A \left({3, A \left({4, j - 1}\right)}\right) & & A \left({k - 1, A \left({k, j - 1}\right)}\right) \\ \end{array}$