# Ackermann-Péter Function/Examples

The Ackermann-Péter function $A: \Z_{\ge 0} \times \Z_{\ge 0} \to \Z_{> 0}$ is defined as:
$\map A {m, n} = \begin{cases} n + 1 & : m = 0 \\ \map A {m - 1, 1} & : m > 0, n = 0 \\ \map A {m - 1, \map A {m, n - 1} } & : \text{otherwise} \end{cases}$
$\begin {array} {c|c|c|c} \map A {m, n} & m = 0 & m = 1 & m = 2 & m = 3 \\ \hline n = 0 & 1 & \map A {0, 1} & \map A {1, 1} & \map A {2, 1} \\ n = 1 & 2 & \map A {0, \map A {1, 0} } & \map A {1, \map A {2, 0} } & \map A {2, \map A {3, 0} } \\ n = 2 & 3 & \map A {0, \map A {1, 1} } & \map A {1, \map A {2, 1} } & \map A {2, \map A {3, 1} } \\ n = 3 & 4 & \map A {0, \map A {1, 2} } & \map A {1, \map A {2, 2} } & \map A {2, \map A {3, 2} } \\ n = 4 & 5 & \map A {0, \map A {1, 3} } & \map A {1, \map A {2, 3} } & \map A {2, \map A {3, 3} } \\ \end{array}$
$\begin{array}{c|c|c|c} \map A {m, n} & m = 0 & m = 1 & m = 2 & m = 3 \\ \hline n = 0 & 1 & 2 & 3 & 5 \\ n = 1 & 2 & 3 & 5 & 13 \\ n = 2 & 3 & 4 & 7 & \map A {2, 13} \\ n = 3 & 4 & 5 & 9 & \map A {2, \map A {3, 2} } \\ n = 4 & 5 & 6 & 11 & \map A {2, \map A {3, 3} } \\ \end{array}$