ackermann

Ackermann examples

Example implementations for Ackermann’s function.

boring_math.recursive_functions.ackermann.ackermann_list(m: int, n: int) int

Ackermann’s Function.

Note

This implementation models the recursion with a Python list instead of Python’s “call stack”. It then evaluates the innermost ackermann function first. To naively use call stack recursion would result in the loss of stack safety.

Parameters:
  • m – First argument to Ackermann’s function.

  • n – Second argument to Ackermann’s function.

Returns:

A very hard to calculate useless value.