The McCarthy 91 function is the nested recursive integer function
Its result is for every and for . For instance, . The striking feature is that the recursive case first increases its argument and then makes a second recursive call, so a naive decreasing-argument termination argument fails. It is a standard example for reasoning about nested recursion and proving equivalence between a recursive definition and a simple piecewise function.
A generalized McCarthy function replaces the constants or nesting depth in the McCarthy 91 function by parameters. One explicit two-call family is
The classical example has . This name covers several parameter conventions, so the recurrence and parameter restrictions must accompany a claim about termination or values. Arbitrary constants do not guarantee termination: with and , evaluation immediately depends on the same unresolved call again. The family is useful for separating a recursive definition from an established total function.

Articles by others on the same topic (1)

The McCarthy 91 function is a recursive function defined as follows: \[ M(n) = \begin{cases} n - 10 & \text{if } n > 100 \\ 91 & \text{if } n \leq 100 \end{cases} \] This means: - If \( n \) is greater than 100, the function returns \( n - 10 \).