def fund(ord, n): if ord == 0: return 0 if is_successor(ord): return predecessor(ord) # limit case if ord == ω: return n if ord == ω^(a+1): return ω^a * n if ord == ω^λ where λ limit: return ω^(fund(λ, n)) if ord is sum: # α + β α = first_term(ord) β = rest(ord) if α is limit: return fund(α, n) + β else: # α is successor return (α - 1) + ω^α * (n-1) + β? # careful: need standard rules
By the time you reach (f_\Gamma_0(n)) (Feferman–Schütte ordinal), you are dealing with functions that cannot be proven total in Peano arithmetic. And beyond that lies the realm of large cardinal axioms. fast growing hierarchy calculator high quality