General Recursive Function
General recursive functions (GRFs), also called µ-recursive functions or partial recursive functions, are the collection of partial functions that are computable. This definition is equivalent using any Turing complete system of computation. See Wikipedia:general recursive function for background.
Historically it was defined as the smallest class of partial functions that is closed under composition, recursion, and minimization, and includes zero, successor, and all projections (see formal definitions below). In the rest of this article, this is the formulation that we focus on exclusively. In this way, it can be considered to be a Turing complete model of computation. In fact, it is one of the oldest Turing complete models, first formalized by Kurt Gödel and Jacques Herbrand in 1933, 3 years before λ-calculus and Turing machines.
BBµ(n) is a Busy Beaver function for GRFs:
where means that is a k-ary GRF and is the "structural size" of f (the number of atoms and combinators in the definition, see details below). In other words, it is the largest number computable via a 0-ary function (a constant) with a limited "program" size. It is more akin to the traditional Sigma score for a Turing machine rather than the Step function in the sense that it maximizes over the produced value, not the number of steps needed to reach that value.
Definition
Structure
Define inductively based on the following construction rules, start with Atoms and combine them using Combinators.
Atoms
- Zero: is the constant 0 function
- Successor: is the successor function
- Projection: is a projection function
Combinators
- Composition: is the composition or substitution of the gs into h:
- Primitive Recursion: is primitive recursion using g as the base case and h as the inductive step.
- Minimization / Unlimited Search: is the µ-operator which allows unlimited search.
The arity superscripts for C, R and M are redundant (except for ) and so are sometimes omitted below.
Size
The size of a GRF is the number of atoms and combinators in the definition:
Primitive Recursion
models a typical iterative function definition over ℕ.
Base case:
Iterative case (for ): where .
R can be recursively evaluated following its definition directly or it can be simulated as a bounded for loop like this python code:
# f = R(g,h)
def f(n, *xs):
acc = g(*xs)
for k in range(n):
acc = h(k, acc, *xs)
return acc
The iterative function h is passed two synthetic args in the front: (k) iteration number (0-indexed) and (acc) "accumulator" from previous iterations.
Both the base and iterative cases can be parameterized by values .
If you restrict functions to only those constructible with Z, S, P, C, R (no M) then this defines the Primitive Recursive Functions, a subset of the General Recursive Functions that always halt.
Minimization
In computational language, when M(f) is evaluated it can be considered to calculate with , then , then etc. until one of the calls to returns 0, at which point it returns the value of which first gave a result of 0. If no first argument causes to return 0, doesn't return (this is the only way for a GRF to not halt).
Macros
In order to improve readability we define the following macros. For all
| Macro | arity | Definition | Size | Function | |
|---|---|---|---|---|---|
| Constant | k | ||||
| Plus constant | 1 | ||||
| Triangular numbers | 1 | ||||
| Iteration | 2 | ||||
| Iteration on first arg | 2 | ||||
| Diagonalization & Iteration | 2 | ||||
| Diagonalization | 1 | ||||
| Ackermann iteration | 2 | ||||
| 1 |
Champions
We divide the champions tables up by enumeration categories. Starting from the simplest functions and moving to the most general.
Composition Functions
The simplest category are PRFs without Recursion. In other words, only atoms and Composition. All composition functions are equivalent to either , or . For BBµ, the only options are which is size 2n+1. These can be trivially extended to of size 2n+2. So this proves that . These are the best known champions up to size 13.
Primitive Recursive Functions
We get considerably more complexity by allowing all Primitive Recursive Functions (PRFs). But PRFs are still all guaranteed to be total, are decidable and are all dominated by Ackermann growth functions. They are convenient to enumerate since none diverge, so any holdouts that remain when running limited computations must eventually halt. All PRF champions up to size 13 are simple composition functions as mentioned above. PRFs with R begin at size 14. These represent the best known champions for sizes 21-24, although it seems clear that M(PRF) will surpass these values.
| n | Max Score | Champions | Champion Found | # Holdouts |
|---|---|---|---|---|
| 13 | 6 | K[6]
|
0 | |
| 14 | 7 | C(DiagS[RepSucc[S]], K[2])
|
Shawn Ligocki 10 Apr 2026 | 0 |
| 15 | 7 | K[7]
|
0 | |
| 16 | 10 | C(DiagS[RepSucc[Plus[2]]], K[1])
|
Shawn Ligocki 11 Apr 2026 | 0 |
| 17 | 15 | C(DiagS[DiagRep[RepSucc[S]]], K[1])
|
Shawn Ligocki 12 Apr 2026 | 0 |
| 18 | 21 | C(DiagS[RepSucc[Tri]], K[1])
|
Jacob Mandelson 9 Apr 2026 | 0 |
| 19 | 39 | C(DiagS[DiagRep[RepSucc[S]]], K[2])
|
Shawn Ligocki 12 Apr 2026 | 0 |
| 20 | 1540 | C(DiagS[RepSucc[Tri]], K[2])
|
Jacob Mandelson 9 Apr 2026 | 0 |
| 21 | 8,589,934,591 | C(DiagS[RepFirst[DiagRep[RepSucc[S]]]], K[1])
|
Shawn Ligocki 16 May 2026 | 0 |
| 22 | C(DiagS[RepFirst[RepSucc[Tri]]], K[1])
|
Shawn Ligocki 17 May 2026 | 11 | |
| 23 | C(DiagS[RepFirst[DiagRep[RepSucc[S]]]], K[2])
|
Shawn Ligocki 17 May 2026 | ||
| 24 | C(DiagS[RepFirst[RepSucc[Tri]]], K[2])
|
Shawn Ligocki 17 May 2026 |
M(PRF)
We get another level of complexity by allowing Minimization, but only at the very top level. In other words, all of these GRF are M(f) for some PRF f. We call this M(PRF) or min_prf. This is a convenient set to explore because (1) it is Turing complete, (2) it is a smaller domain and easier to enumerate than full GRF, (3) all small known champions are of this form. All M(PRF) champions up to size 13 are simple composition functions as mentioned above.
| n | Max Score | Champions | Champion Found | # Holdouts |
|---|---|---|---|---|
| 12 | 5 | C(K[5])
|
0 | |
| 13 | ≥ 6 | K[6]
|
51 | |
| 14 | ≥ 32 | Shawn Ligocki 29 Apr 2026 | 273 | |
| 15 | 1953 | |||
| 16 | ≥ 47 | Shawn Ligocki 5 May 2026 | 10,818 | |
| 17 | ≥ 2090 | Shawn Ligocki 8 May 2026 | 63,333 |
Full GRF
The final level is full GRF where Minimization is allowed at any level. The only champions currently at this level are hand-constructed GRF designed to surpass Graham's number.
| n | BBµ(n) | Champion | Champion Found | # Holdouts |
|---|---|---|---|---|
| 93 | Graham() from goodstein.mgrf | Racheline and Shawn Ligocki 19 May 2026 | ||
| ... | ||||
| 98 | Graham() from ack_worm.mgrf | Shawn Ligocki 17 May 2026 |
Analysis of Champions
BBµ(14) ≥ 32
This is the smallest non-trivial champion:
Expression: M(C(R(P(1,1), R(P(2,1), C(R(P(1,1), P(3,1)), P(4,2), P(4,1)))), P(1,1), S))
Arity: 0 | Size: 14 | GRF
=== Sub-expressions ===
a := R(P(1,1), P(3,1)) [arity 2, size 3, PRF, used={1,2}]
a(0, y) = y
a(x, _) = x-1
b := R(P(2,1), C(a, P(4,2), P(4,1))) [arity 3, size 8, PRF, used={1,2}]
if 0 ≤ x ≤ y: b(x,y) = y-x
if y+1 ≤ x ≤ 2y+1: b(x,y) = 2y+1-x
b(x, y) = (y+1) 2^k - 1 - x (where k is minimal such that this is ≥ 0)
c := R(P(1,1), b) [arity 2, size 10, PRF, used={1,2}]
def c(x, y):
acc = y
for i in range(x):
acc = b(i,acc)
return acc
=== Root ===
d := M(C(c, P(1,1), S)) [arity 0, size 14]
def d():
for n in 0..:
acc = n+1
for i in range(n):
while acc < i:
acc = 2*acc + 1
acc -= i
if acc == 0:
return n
d() = 32
This GRF subtracts numbers 0 to n-1 from accumulator starting at n+1 with a slightly complex underflow condition (what to do when the number goes negative). It repeats this on increasing n until this process happens to hit exactly 0. It appears to be chaotic. It can be parameterized in a couple of ways by swapping S <-> P(1,1). This parameterization seems to get the luckiest and make it up to n=32 before halting. The other co-champion has the exact same behavior, just by switching when we do S vs P(1,1) for the base case.
Cryptids
So far all Cryptids have been constructed by hand. None found "in the wild" yet.
| Size | Problem | Authors | Ref |
|---|---|---|---|
| 49 | Brocard's problem | aparker, star and Shawn 3 May 2026 | brocard.mgrf Discord |
| 56 | 5x+1 trajectory of 7 | Shawn Ligocki 2 May 2026 | collatz.mgrf |
| 81 | Erdos Ternary Conjecture | Shawn Ligocki 28 Apr 2026 | erdos.mgrf |
| 139 | Antihydra-like problem | Jacob Mandelson 8 Apr 2026 | Orig (size 141) Size 139 |
Notable GRF
Unsolved GRFs
- Size 16:
M(C(R(S, R(C(S, P(2,1)), C(R(P(1,1), P(3,1)), P(4,2), P(4,1)))), P(1,1), S))Discord Discord
Solved GRFs
Tetrahedral Divisibility
The GRF (Size 15) halts iff there exists some n ≥ 1 such that n+3 divides .[1] aparker[2] and star[3] proved that there is no such n, therefore this GRF diverges.
Chaotic size 15
Expression: M(C(R(P(1,1), R(R(S, P(3,1)), R(R(P(2,2), P(4,1)), P(5,2)))), S, P(1,1)))
Arity: 0 | Size: 15 | GRF
=== Sub-expressions ===
a := R(S, P(3,1)) [arity 2, size 3, PRF, used={1,2}]
a(0, y) = 1 + y
a(x, _) = x-1
b := R(P(2,2), P(4,1)) [arity 3, size 3, PRF, used={1,3}]
b(0, _, z) = z
b(x, _, _) = x-1
c := R(b, P(5,2)) [arity 4, size 5, PRF, used={1,2,4}]
c(_, 0, _, w) = w
c(_, y, _, _) = y-1
d := R(a, c) [arity 3, size 9, PRF, used={1,2,3}]
d(x, 0, z) = (1 + z - x) %< (1 + z)
d(x, y, z) = (y - x - 1) %< (1 + z)
e := R(P(1,1), d) [arity 2, size 11, PRF, used={1,2}]
M(C(e, S, P(1,1))) [arity 0, size 15]
Racheline proved this diverges.[4] The key here is that e(n+1, n) = d(n, y, n) for some y (the last step of the recursion) and for all y d(n, y, n) ≠ 0 since:
d(n, 0, n) = 1 d(n, y+1, n) = y+1
Macro Bounds
Let
AckDiag[k, S]
Let
- (for )
- (for )
- (for and )
AckDiag[k, Tri]
Let
- , ,
- (for )
- ,
- (for )
- ,
- (for )
Pairing Functions
In order to do arbitrary computation, GRF need to be able to store arbitrary data into a single integer (since the R combinator only passes a single accumulator). There are many ways to do that and the Graham champions above accomplish it via custom binary encodings. But the traditional way to store arbitrary data into an integer is to use a pairing function. Thus there is value in finding small pairing/unpairing functions.
We define two APIs here for pairing functions:
- A triple of GRF
Pair,Left,Rightsuch that for all a,b:Left(Pair(a,b)) = aandRight(Pair(a,b)) = b - A GRF
Pairand GRF MacroLRCall[f]such that for all a,b,f:LRCall[f](Pair(a,b)) = f(a,b)
The smallest known pairing functions are:
| Macro | arity | Definition | Size | Function |
|---|---|---|---|---|
| 2 | 20 | |||
| 1 | 38 | |||
| 1 | 36 | |||
| 1 |
Where these are based on the following definitions:
| Macro | arity | Definition | Size | Function | |
|---|---|---|---|---|---|
| Addition | Add | 2 | 5 | ||
| AddXA | 3 | 5 | |||
| AddS | 2 | 5 | |||
| Predecesor | Pred | 1 | 3 | ||
| Monus | RMonus | 2 | 7 | ||
| Triangular numbers | Tri | 1 | 7 | ||
| TriP | 1 | 7 | |||
| TriPXA | 2 | 7 | |||
| Inverting Tri | RMonusTri | 2 | 18 | ||
| InvTriCeil | 1 | 19 | |||
| Combined LRCall | RightPiece | 3 | 7 | ||
| LeftPiece | 3 | 12 | |||
| LRpart1[f] | 3 | ||||
| LRpart2[f] | 3 | ||||
| LRpart3[f] | 2 |