| Bytes | Lang | Time | Link |
|---|---|---|---|
| 512 | Python 3.8 prerelease | 250801T115845Z | The Empt |
| 512 | Python 3.8 prerelease | 250731T143902Z | The Empt |
| 512 | Python 3.8 prerelease | 250730T124651Z | The Empt |
| nan | 241027T095529Z | The Empt | |
| nan | Binary Lambda Calclus | 240923T080113Z | John Tro |
| nan | 241017T084848Z | The Empt | |
| nan | 240929T102403Z | The Empt | |
| nan | 240925T162633Z | The Empt | |
| nan | 240924T174946Z | The Empt | |
| 200 | Python 3 | 240924T170829Z | The Empt |
| 206 | Python 3 | 240420T012921Z | Kip the |
| 181 | Python 2 | 220223T190455Z | autumn |
| 000 | Python 3 | 220222T230533Z | Tsumiki |
| nan | Python 3 | 220115T183441Z | Tsumiki |
| 483 | Javascript | 211120T164310Z | Caelus |
| 271 | Ruby | 180705T194629Z | Simply B |
| 323 | Python 3 | 171220T160508Z | fejfo |
| 512 | python | 171212T061023Z | i.. |
| nan | Pyth | 171212T015717Z | Steven H |
| 999 | Python 3 | 171209T011748Z | Leaky Nu |
| nan | Pyth | 171125T105325Z | Steven H |
| nan | Python 3 | 171203T013720Z | Steven H |
| nan | Ruby | 171124T200550Z | Simply B |
| nan | Ruby | 171126T151449Z | Simply B |
Python 3.8 (pre-release), 512 bytes, \$f_{\Gamma_0}^{f_{\Gamma_0}(9^{99})}(9^{99})\$
class w:
def __init__(s,f):s.f=f
__pow__=lambda s,o:w(lambda x:s.f(x)**p(o).f(x));__rpow__=lambda s,o:w(lambda x:p(o).f(x)**s.f(x))
p=lambda t:w(lambda x:t)if type(t)==int else t
f=lambda x,y:(y+1if x<1else[y:=f(x-1,y)for _ in[0]*y][-1])if type(x)==int else f(x.f(y),y)
v=lambda d,a:(w(lambda x:x)**a if d<1else(w(lambda x:([n:=a]+[n:=v(d-1,n)for _ in[0]*x])[-1])))if type(d)==int else w(lambda x:v(d.f(x),a))
R=w(lambda x:([a:=0]+[a:=v(a,0)for _ in[0]*x])[-1])
n=9**99
print([n:=f(R,n)for _ in[0]*f(R,n)][-1])
Try it online if you want to see a memory monster!
w and p are just relating to defining a custom class for limit ordinals.
f is your normal fast-growing hierarchy.
v implements the Veblen function \$\phi_d(a)\$, or at least when \$a=0\$.
R is the representation for \$\Gamma_0\$, the Feferman-Schutte ordinal.
The print statement just sets n to f(R, n), f(R, n) times, with n initialized to \$9^{99}\$.
Python 3.8 (pre-release), 512 bytes, At least \$f_{ε_\omega}\left(9^{9^9}\right)\$ May be extremely large with unknown limit (unlikely though)
class w:
def __init__(s,f=(lambda x:x)):s.f=f
__pow__=lambda s,o:w(lambda x:s.f(x)**p(o).f(x))
p=lambda t:w(lambda x:t)if type(t)==int else t
f=lambda x,y:((y**y if x<1else [y:=f(x-1,y)for _ in[0]*y][-1])if type(x)==int else f(x.f(y),y))if type(y)==int else w(lambda t:f(x,y.f(t)))
def h(x):
r=''
for c in range(16**x):
try:n=c;a=''.join(['1234567890w,()*f'[n%16],n:=n//16][0]for _ in[0]*x);r+=str(int(eval(a,{'f':f,'w':w()})))
except:pass
return int(r)
n=9**9**9
print(h([n:=h(n)for _ in[0]*h(n)][-1]))
Try it online if you want the CPU monster to eat you alive!
Similar to my previous answer, but just with a way of handling w as a second argument in f.
Class w is basically just used as a limit ordinal inside the fast growing hierarchy variation.
Function f just is the fast growing hierarchy, but with the first function being \$x^x\$ instead of \$x+1\$. f(x, y) happens to have a lower bound of \$y↑^xy\$, thus in an informal sense, f(2, w()) would be omega^omega^omega... infinitely many times, making this around \$ε_0\$. So f(2, ε0) would be ε1, and so on...
The function h evaluates all the expressions using numerals, the limit ordinal omega, and the function f, and concatenates them together. Thus, it will generate an expression like the one I mentioned above.
Python 3.8 (pre-release), 512 bytes
class w:
def __init__(s,f=(lambda x:int(x))):s.f=f
__pow__=lambda s,o:w(lambda x:s.f(x)**p(o).f(x))
p=lambda t:w(lambda x:t)if type(t)==int else t
f=lambda x,y:(y**y if x<1else [y:=f(x-1,y)for _ in[0]*y][-1])if type(x)==int else f(x.f(y),y)
def h(x):
r=''
for c in range(16**x):
try:n=c;a=''.join(['1234567890w,()*f'[n%16],n:=n//16][0]for _ in [0]*x);r+=str(int(eval(a,{'f':f,'w':w()})))
except:pass
return int(r)
n=9**9
print([eval('['*h(n)+'n:=h(n)'+'for _ in[0]*h(n)][-1]'*h(n))for _ in[0]*h(n)][-1])
w is just a class that I defined so that I can use it as omega in the variation of the fast growing hierarchy.
f(n,x) is the fast growing hierarchy, but instead of \$f_0(x)\$ being \$x+1\$, it is \$x^x\$. Basically, \$f_n(x)=x↑^{x+1}x=x↑^{x+2}2\$. Yes, this grows more quickly then the actual fast growing hierarchy.
h(x) is where the good stuff happens. It creates all possible python expressions that are x characters long with the characters 1234567890w,()*f, with w defined to be an instance of the class of the same name, and f defined to be the function of the same name I mentioned earlier. It evaluates the expressions, concatenates the values of all those which do not error, and returns the number.
Then, n is set to \$9^9\$, and the print statement has three loops.
The inner loop sets n to h(n), h(n) times.
The middle loop repeats the inner loop h(n) times.
The outer loop repeats the middle loop h(n) times. Since the outer loop is only run once, it loops \$h(9^9)\$ times.
Note: I had to use lambda x:int(x) instead of lambda x:x, or otherwise, f(w(),w()) would never terminate.
Hopefully much better answer
Python 3.8 (pre-release), 321 bytes, \$f_{\omega^3}^2(f_{\omega2}^2(f_{\omega+1}(999^{999})))\$
f=lambda g,y,x:g(x)if y<1else ([a:=x]+[(a:=f(g,y-1,a))for _ in range(x)])[-1]
def g(x):
a=x
for _ in range(x):a=f(lambda x:x+1,a,x)
return a
a=lambda x:f(g,g(x),g(x))
n=a(g(999**999))
for x in range(a(g(n))):
for y in range(a(g(n))):
a=(lambda x:lambda y:f(lambda z:x(g(z)),x(y),x(y)))(a)
n=a(g(n))
print(a(g(n)))
All my previous answers are apparently bounded by \$f_{\omega^\omega}\$, but this one shouldn't be.
Attempted explanation
Function f is a generalized version of the fast growing hierarchy. The first argument is the initial function, which we will call ii. This means that f(0,x) with that function will equal ii(x).
Function g already makes a pretty large number. It accepts one argument.
Function g
Function g takes one argument x and does this (pseudocode):
INITIALISE p = x
REPEAT x TIMES:
SET p TO f(p,x) # f(p,x) is the Wainer fast growing hierarchy
RETURN p
Changeable Function a
a is initialised to a function, accepting one argument x, and returning the value of f(g,g(x),g(x)).
Variable n
Set to a(g(999**999))
Loop
Let c(x) = a(g(x)). Here is what happens in pseudocode:
REPEAT c(n) TIMES:
REPEAT (EVALUATE VALUE OF c(n)) TIMES:
UPDATE FUNCTION a TO (FUNCTION (arg x): f(FUNCTION (arg z): a(g(z)), a(x), a(x)))
UPDATE NUMBER n TO a(n)
Output
c(n) is printed, with n being the final updated value of that variable.
How big is this number?
Binary Lambda Calclus, 1864 bits (233 bytes)
0100010101011010100100010001000100010000010001010110000110000000000101111111000110011111111111011001011100001010111000010101111000000001010111111111011110111001110101100010100001011000010101100000100000000001110000011000000000011100000100000100000101100001000110100000011000000001011111110111001010111111011111011010000001110000000011111000010101010111111111110111111101111010000001000001010111001000000010110111011000010101100001011011111011111110000111111111100110000010000111111111001100000100010010101010111111111111110111111100000011100001010111111111111111000111011111110000100000001011011101100100000101011011111111111001011101111111111111011111111100101110111111111111011111111100000000101010101011110100000000111100011000001000001000000000010101111000001001111111101111101111001110100000100000100101111110000001000000010110111011001000001010110111001010111111100010010111000001101111011111111001010111011111101111011111110000000000000000101011110000001110111111111001111111011110000111111100001011011011111100101110000101100001010110000101101111110111111110000111111100110000010000110000011011010000101010111111111111101110000000001000001110000010000000100000010101111110000001011101001011011000001100111101100111101000010101010001101000010000000001000100010101111100000000111111001010111111111101111111101100101111000011111110000101101100101011111111111100000011100101111111111111011010011110000000011001111111111111100001100000101111111100111110010101111111111011111111010111111000011100111100001011011011111000011001011111110110011100111101111000000101100000101100000010110000011011001101000001001110100000100001100101000110100000010000010110000000011011111001011111011110110000111000010110000010110001000010001101000010000000101110000000010111110000001010111111111110111110110010111111111011110100000100101100000001111100000110011010100000011100111010
from Golf a number bigger than Loader's number for exceeding Loader's number in 233 bytes handily beats all entries on this page.
Fifth Submission
Python 3.8 (pre-release), 175 bytes
f=lambda x,z,y:y+z if x==0 else eval(f"f({x-1},{z},"*(a:=eval(f"f({x-1},{z},"*z+f"{y}"+")"*z))+f"{y}"+f")"*a)
n=9**9
for _ in range(f(*[99**99]*3)):
n=f(n,n,n)**_**_
print(n)
Explanation coming later.
Fourth Submission
Python 3, 166 bytes
f=lambda x,y:y+1 if x==0 else eval(f"f({x-1},"*y+f"{y}"+")"*y)
g=lambda x:eval("**".join([f"{x}"]*x))
a=f(g(1000000),g(1000000))
for _ in range(a):
a=f(a,a)
print(a)
Explanation coming later
Third Submission
Python 3, 200 bytes
f=lambda a,b:b+1 if a<1 else eval(f"f({a-1},"*f(a-1,b)+f"{b}"+")"*f(a-1,b))
g=lambda x:eval("**".join(f"{x}"*x))
c=lambda x:eval("g("*g(x)+f"f({x},{x})"+")"*g(x))
print(f(c(c(c(1000))),c(c(c(1000)))))
Uses a modified fast-growing hierarchy.
Explanation
Definitions
$$\\a^n(x) = a \text{ applied } n \text{ times to } x\\$$
Function \$f\$
$$\\f_0(x) = x + 1\\f_n(x) = f^{f_{n-1}(x)}_{n-1}(x)\\$$
Function \$g\$
$$\\g(x) = x \uparrow\uparrow x = x \uparrow\uparrow\uparrow 2\\$$
Function \$c\$
$$\\c(x) = g^{g(x)}\left(f_x(x)\right)\\$$
Output \$o\$
$$\\h(x) = f_x(x)\\o=h\left(c^3(1000)\right)\\$$
Second Submission
Python 3, 200 bytes
b=lambda x:x**x**x**x**x**x**x**x**x**x**x**x**x
def c(a):
for x in range(eval("b("*a+str(a)+")"*a)):
a=eval("b("*a+str(a)+")"*a)
return a
print(eval("c("*9999999999+"99999999999"+")"*9999999999))
Don't try it online as it runs into a memory error
Very similar to my first submission except b(x) is now \$x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^{x^x}}}}}}}}}}}\$ instead of \$x!\$.
Python 3, 200 bytes
def b(x):
a=1
while x>1:
a*=x;x-=1
return a
def c(a):
for x in range(eval("b("*a+str(a)+")"*a)):
a=eval("b("*a+str(a)+")"*a)
return a
print(eval("c("*9999999999+"99999999999"+")"*9999999999))
Don’t try it online as it runs into a memory error
Couldn’t use the builtin math.factorial as it only accepts values up to something like 9 quadrillion.
Explanation
Assume l(x,y) means "take the factorial of x, y times."
Assume m(x,y) means "do function c to x, y times."
b(x) literally just calculates the factorial of a number.
c(x) does this l(x,x) times:
- It sets
atol(a,a).
c then returns a.
The program returns m(99999999999, 99999999999)
Python 3, 206 bytes, \$\approx f_{9e99}(9e99)\$
def f(n):
c=1;i=0;v=[n]*n
while 1:
while v[0]:c+=1;v[0]-=1
if any(v):
while i<n and v[i]==0:v[i]=c;i+=1
v[i]-=1;c+=1;i=0
else:return c
h="9"*f(9e99);q=int(h);exec("print("+"f("*q+h+")"*(q+1)))
Unsure of the exact growth of the function, but here's the math for it:
\$f(n)=g([n,n,\ldots,n];1)\$, where there are \$n\$ \$n\$s. \$g([n_1,n_2,\ldots,n_k];x)=\begin{cases} x & \text{if }n_i=0\ \forall i\leq k \\ h([n_1-1,n_2,\ldots,n_k];x+1) & \text{if }n_1>0 \\ h([x,x,x,\ldots,x, n_q-1, n_{q+1},\ldots,n_k];x+1)&\text{otherwise, where }n_q>0\text{ and }n_j=0\ \forall j<q \end{cases}\$
The answer sets \$q=9*10^{99}\$, and then returns \$f^q(q)\$, where \$f^q\$ is function iteration and not exponentiation.
\$f(n)\$ produces an array of \$n\$ \$n\$s, starts a counter at 1, and performs the following actions:
- If the list is all zeroes, return the counter.
- Increment the counter.
- If the first item in the list is greater than 0, subtract 1 from it.
- Otherwise, look for the first non-zero entry in the list, subtract 1 from it, and replace all of the numbers before it with the value of the counter.
This is a modified version of the function I started out with, which I have a slightly better grasp on the math for. The original version created an array of \$n\$ 1s, and then did the same process. For that one, the counter doubled and incremented once every time you decremented the second item in the list. Calling the original function \$F(n)\$, I was able to determine that \$F(1)=2\$, \$F(2)=5\$, \$F(3)=343\$, and then at \$F(4)\$, I found that once I had decremented the last element, it took \$384*2^{384}-1\$ steps to decrement the third entry in the list again. From there, I estimated that \$F(4)\approx10^{10^{\ldots^{117.658459}}}\$, where there are 384 10s in the stack.
Python 2, 181 bytes
def B(s):
D=range(1,s);B=[[A]for A in D]+[[0]]
for C in B[::-1]:
for F in D:C+=[B[C[-1]][C[0]]]
A=1;E=B[0]
while s//A*E[:A]!=E:A*=2
return A
A=0
while B(2**A)<99:A+=1
print A
Much, much larger than Loader’s number. It is well defined.
Nothing new. This is known as the Inverse Laver function.
Python 3, Greater than fSVO(Z)≈fψ0(ΩΩω)(Z)
Where Z = (...((9^9)^(9^9))^((9^9)^(9^9))...) with about 9^9 parenthesis
def R(a,n):
if type(a)==int:return a-1
if n<1:return 0
if not a:return n
if a[-1]==0:return a[:-1]
if a[0]!=0:a[0]=R(a[0],n);return a
i=0
while a[i]==0:i+=1
a[i-1]=R(a[:],n-1);a[i]=R(a[i],n);return a
def G(a,n,m=0):
A='\t'
if a==0:return n+1
if m:
prgm='';b=G(a,n)
for i in range(b):prgm+=A*i+'for _ in range(n):\n'
prgm+=A*b+'n=G(R(a,n),n,m-1)';exec(prgm)
m=0
if type(a)==list:m=n
for i in range(n):n=G(R(a,n),n,m)
return n+1
z=Z=9**9
for i in range(z):Z=Z**Z
Z=G([Z]*Z,Z)
print(Z)
I wrote this mess a while back but didn't upload it because I was thinking I should just go for First Place Or Bust. Turns out: First Place is hard. So here's my 4th place submission.
Ungolfed program: https://github.com/cpaca/BignumReboot/blob/main/VeblenMethod.py
Website to minify a python program: https://python-minifier.com/
Unfortunately, because I wrote it so long ago, I've forgotten most of what I wrote. I remembered what my goal was, I remembered finishing it, but I don't remember the mathematics behind the mess very well. The ungolfed program has comments (lots of them, actually, looking at it) but there are a few hints that I do remember:
G(a,n,m) accepts either a list, int, int or an int, int, int. If the last variable isn't given, it's defaulted to 0.
All integers are positive. Negative integers should be inaccessible.
G(a,n,0) for int, int, 0 should be equivalent to fa(n) under the fast growing hierarchy. This evidently isn't the case, as it's calculating G(1,1) = 3, G(1,2) = 5, G(1,5) = 11, G(2,2) = 12. (Best guess, it's actually f0(fa(n)) but I can't really confirm.)
G([],n,0) - in other words, for empty list - should be equivalent to G(n,n,0)
R(a,n) is φ(a)[n] under the Veblen hierarchy.
G(a,n,0) should be greater than fφ(a)(n), where φ is the veblen function.
However, there is one thing that could make this function less than what I expect. In the analysis of the FGH, and the Veblen function, I made one assumption which MIGHT not be true:
$$f_{\alpha+\beta}(n) < f_{\alpha+f_\beta(n)}(n)$$
Python 3, probably fε0(99) I have no idea
def f(n,d,a,i):
if d < 0 or i >= len(a):
return n
k = a[i]
if type(k) == int:
if k < 0:
a[i] = [-2]*n
a = f(n,d,a,i+k+2)
else:
a[i] -= 1
else:
a[i] = f(n,d-1,k,0)
return a
def g(n):
d=n
a=[-2]*n
while type(a) != int:
a = f(n,d,a,0)
n += 1
print(g(99))
Edit: Accidentally left d=2 from the slower-growing format, fixed and it's now d=n.
First, this is my first CGSE post (and my first SE post in general) so this definitely looks weird. Second, I'm not sure it's fε0(99) I have no idea what this is. Third, I did no golfing on this, just trying to get something out there that I can understand (and build upon in later edits). I consider this to be "v0.1",
Equivalent equation
Fourth, I'm not sure that g(n) grows at fε0. I sent it to the mathematics stackex discord, and ended up making an approximation of this program.
\$g(n) = f(n,n,\{-2,-2,\cdots\ n\ times\},0)\\a=\{a_0,a_1,\cdots a_k\}\$
\$f(n,d,a,i) =\left\{ \begin{array}{cl} n & : \ d < 0 \\ n & : \ i > k\\ f(n,d,\{a_0,\cdots a_{i-1},\{-2,-2,-2,\cdots n\ times\},a_{i+1}\cdots a_k \},i+k+2) & : \ a_i \in \mathbb{Z}\ \cap\ a_i<0\\ f(n+1,d-1,\{a_0\cdots a_{i-1},a_i-1,a_{i+1},\cdots a_k\},0) & : \ a_i \in \mathbb{Z}\ \cap\ a_i\geq 0 \\ \{a_0,a_1\cdots a_{i-1},f(n,d-1,a_i,0),a_{i+1},\cdots a_k\}&:\ a_i\notin\mathbb{Z} \end{array} \right.\$
If f(n,d,a,i) is cutting off on the side of the screen, then use these links to an image of the equation, both with a White background and with a Discord Dark Mode background.
Slower growing formats
Lastly, while testing it, to make sure it worked, I made a version that grows significantly slower.
Slower growing function. For this, it increments an unrelated q variable instead of incrementing n directly, then outputs q. With n=2 and d=2, it outputs 714025. With n=3 and d=2 or n=2 and d=3, tio.run gives me a "Program has exceeded the 60 second time limit."
def f(n,d,a,i):
if d < 0 or i >= len(a):
return n
k = a[i]
if type(k) == int:
if k < 0:
a[i] = [-2]*n
a = f(n,d,a,i+k+2)
else:
a[i] -= 1
else:
a[i] = f(n,d-1,k,0)
return a
n=3
d=2
a=[-2]*n
q=0
while type(a) != int:
a = f(n,d,a,0)
q += 1
print(q)
Javascript, 483 bytes
So, I'm just reusing a program I wrote for "Golf a number bigger than TREE(3)". The program results in \$f_{TFBO+1}(3) = f_{TFBO}(f_{TFBO}(f_{TFBO}(3)))\$ in the fast-growing hierarchy (3rd place), where \${TFBO}\$ is the Takeuti-Feferman-Buchholz Ordinal \$\psi(\Omega_{\omega+1})\$. It uses Buchholz hydras and implements the BH function. Here is my compressed code, which was done with Naruyoko's Javascript compressor:
_="69{%t.length-1D*6m#{%B]}*6s#{t.splice(m#,14*@n=1;*6e#{7==0/s#;if(9>1/$i=0;i<n;i:t'B-1]4}}7>0&&typeof t==\"number\"/$i=98t[i]<m#8i--/}@s;$j5i8j <= 98j:s't[j]4@?5s;?[j]=?[i]-1;?[l(?)]=0;s#;$k508k <= l(?)8k:t'?[k]4}7==A/B]=n+1Dn += 1;%tD*6b(k/i5[\"+\",0];$l508l < k-28l:i'A)}while(l(i)>=0/i=e(i4%nD*Console.log(b(b(b(3))));#(t)$for(let %return '.push(*\n /){4)D5 = 6function 7if(m#8; 9l#:++/?sa@var A\"w\"Bt[9D;}";for($ of"DBA@?:987654/*'%$#")with(_.split($))_=join(pop());eval(_)
This is basically incomprehensible, with only fragments of the original code revealing themselves, so here is the original code:
function l(t){return t.length-1;}
function m(t){return t[l(t)]}
function s(t){t.splice(m(t),1);}
var n=1;
function e(t){if(m(t)==0){s(t);if(l(t)>1){for(let i=0;i<n;i++){t.push(t[l(t)-1]);}}}if(m(t)>0&&typeof t=="number"){for(let i=l(t); t[i]<m(t); i--){}var s;for(let j = i; j <= l(t); j++){s.push(t[j]);}var sa = s;sa[j]=sa[i]-1;sa[l(sa)]=0;s(t);for(let k = 0; k <= l(sa); k++){t.push(sa[k]);}}if(m(t)=="w"){t[l(t)]=n+1;}n += 1;return t;}
function b(k){i = ["+",0];for(let l = 0; l < k-2; l++){i.push("w")}while(l(i)>=0){i=e(i);}return n;}
Console.log(b(b(b(3))));
Explanation
This program, as I mentioned earlier implements Buchholz hydras, which are stored as arrays. The program has functions l, m and s, which just serve as shorthand for commonly repeated chunks of code. The function e takes a given hydra and expands it using rules.
It was proven by Buchholz that you can always kill a hydra in a very large, yet finite, amount of steps, so this is what the program uses. The function b(n) produces the hydra [+,0] and then a string of n-2 \$\omega\$s, and returns the number of steps it took to be killed.
The number which it returns is \$BH^3(3)\$, which is around \$f_{\psi_0(\varepsilon_{\Omega_\omega+1})+1}(3)\$ in the FGH.
Size
The function \$BH(n)\$ which this program implements is proven to eventually dominate (overtakes) any function which is provably total in \$\Pi^1_1\$-comprehension with bar induction (\$\Pi^1_1-CA+BI\$).
In fact, even if I replaced "chain of n-2 \$\omega\$s" with "chain of n-2 ones", I would still get third place. However, I have to say, Simply Beautiful Art, your achievement of second place is simply beautiful, and I could never beat it just by trivially this program. Since \$TFBO = \psi_0(\varepsilon_{\Omega_\omega + 1})\$, I could say that \$TFBO_2 = \psi_0(\varepsilon_{\Omega_{TFBO} + 1})\$, and so on, if I allowed labels up to \$TFBO_{TFBO_{...}}\$ instead of just \$\omega\$, my new growth rate would fall around \$\psi_0(\chi(\Omega))+1\$, which is tiny compared to \$\psi_0(\chi(\Omega_{M+\chi(\Omega_M+1^{Ω_{M+1}})}))+29\$
Ruby, fε02(5), 271 bytes
m=->n{x="";(0..n).map{|k|x+="->f#{k}{"};x+="->k{"+"y=#{n<1??k:"f1"};k.times{y=f0[y]};y";(2..n).map{|l|x+="[f#{l}]"};eval x+(n<1?"":"[k]")+"}"*(n+2)}
g=->z{t="m[#{z}]";(0...z).map{|j|t+="[m[#{z-j-1}]]"};eval t+"[->n{n+n}][#{z}]"}
p m[5][m[4]][m[3]][m[2]][m[1]][m[0]][g][6]
This is based off of the m(n) map.
Explanation:
m[0][f0][k] = f0[f0[...f0[k]...]] with k iterations of f0.
m[1][f0][f1][k] = f0[f0[...f0[f1]...]][k] with k iterations of f0.
m[2][f0][f1][f2][k] = f0[f0[...f0[f1]...]][f2][k] with k iterations of f0.
In general, m[n] takes in n+2 arguments, iterates the first argument, f0, k times onto the second argument, and then applies the resulting function onto the third argument (if it exists), then applies the resulting function onto the fourth argument (if it exists), etc.
Examples
m[0][n↦n+1][3] = (((3+1)+1)+1 = 6
In general, m[0][n↦n+1] = n↦2n.
m[0][m[0][n↦n+1]][3] = m[0][n↦2n][3] = 2(2(2(3))) = 24
In general, m[0][m[0][n↦n+1]] = n↦n*2^n.
m[1][m[0]][3]
= m[0][m[0][m[0][n↦n+1]]][3]
= m[0][m[0][n↦2n]][3]
= m[0][n↦n*2^n][3]
= (n↦n*2^n)[(n↦n*2^n)[n↦n*2^n(3)]]
= (n↦n*2^n)[(n↦n*2^n)[24]]
= (n↦n*2^n)[402653184]
= 402653184*2^402653184
In general, m[1][m[0]][n↦n+1] = f_ω in the fast-growing hierarchy.
g[z] = m[z][m[z-1]][m[z-2]]...[m[1]][m[0]][n↦2n][z]
and the final output being
m[5][m[4]][m[3]][m[2]][m[1]][m[0]][g][6]
Python 3, 323 bytes, g9e9(9)
exec("""a=`x:9**x
n=`a,f:`x:a and n(a-1,f)(f(x))or x
c=`n:`l:l[~n](l)
e=`x:n(x,c(0))([x,`l:[a(l[0]),n(*l)],c(0),`l:[a(l[0]),l[2](l[:2])[1]]+map(`i:l[1]((l[0],i))[1],l[2:])]+list(map(c,range(a(x),1,-1))))[1]
f=`l:[l[1](l[0]),e(l[1](l[0]))(l)[1]]
g=`x:e(x)((x,f))[1]((x,a))[1](x)
print(n(9e9,g)(9))""".replace('`','lambda '))
Explanation
Python 3 is a truly recursive language, this means that not only can a function call itself, a function can also take other functions as input or output functions. Using functions to make themselves better is what my program is based on.
f=lambda x,a:[a(x),e(x)((x,a))[1]]
Definition
a(x)=9^x
b(x,f)=a(x), f^x
c(n)(*l)=l[~n](l)
c(0)=c0 <=> c0(…,f)=f(…,f)
d(x,b,c,*l)=a(x), c0(x,b), b(x,c0), b(x,f) for f in l
e(x)=c0^x(x,b,c0,d,c(a(x)),c(a(x)-1),c(a(x)-2),…,c(3),c(2),c(1))[1]
f(x,a)=a(x),e(a(x))(x,a)[1](x)
g(x)=e(x)(x,f)[1](x,a)[1](x)
myNumber=g^9e9(9)
Definition explained
a(x)=9^x a is the base function, I chose this function because x>0=>a(x)>x` which avoids fixed points.
b(x,f)=a(x), f^x b is the general improving function, it takes in any function and outputs a better version of it.
b can even be applied to itself: b(x,b)[1]=b^x b(x,b^x)[1]=b^(x*x)
but to fully use the power of b to improve b you need to take the output of b and use it as the new b, this is what c0 does:
c0(…,f)=f(…,f)
c0(x,b^x)=b^x(x,b^x)[1]>b^(9↑↑x)
the more general c(n) function takes the n last argument (starting from 0) so
c(1)(…,f,a)=f(…,f,a) and c(2)(…,f,a,b)=f(…,f,a,b). *l means l is an array and l[~n] takes the n last argument
d(x,b,c,*l)=a(x), c0(x,b), b(x,c0), b(x,f) for f in l d uses c0 to upgrade b and b to upgrade all of the other input functions (of which there can be any amount because of the list)
d(x,b,c,d)>9^x,b^x,c^x,d^x and d²(x,b,c,d)>a²(x), b^(9↑↑x), c^(9↑↑x), d^(9↑↑x)
but d gets even better if you combine it with c:
c0²(x,b,c0,d)=d^x(9^x,b^x,c0^x,d^x)=…
c0(x,b,c0,d,c1)=c1(x,b,c0,d,c1)=d(x,b,c0,d,c1)=9^x,b^x,c0^x,d^x,c1^x
c0²(x,b,c0,d,c1)=c0(9^x,b^x,c0^x,d^x,c1^x)=c1^x(9^x,b^x,c0^x,d^x,c1^x)=…
the more c(x) you add at the end the more powerful it becomes. The first c0 always remains d: c0(x,b,c0,d,c4,c3,c2,c1)=c1(…)=c2(…)=c3(…)=c4(…)=d(x,b,c0,d,cX,cX-1,…,c3,c2,c1)=…
But the second leaves iterated versions behind:
c0²(x+1,b,c0,d,c4,c3,c2,c1)
=c0(9^x+1,b^x+1,c0^x+1,d^x+1,c4^x+1,c3^x+1,c2^x+1,c1^x+1)
=c1^x(c2^x(c3^x(c4^x(d^x(9^x+1,b^x+1,c0^x+1,d^x+1,c4^x+1,c3^x+1,c2^x+1,c1^x+1)))))
When d^x is finally calculated c4 will take a much more iterated version of d the next time. When c4^x is finally calculated c3 will take a much more iterated version of c4,…
This creates a really powerful version of iteration because d:
- Improves
busingc0 - Improves
c0usingb - Improves all the layers of nesting using
bThe improves themselves improve, this means d becomes more powerful when it is iterated more.
Creating this long chain of c is what what e(x)=c0^x(x,b,c0,d,c(a(x)),c(a(x)-1),c(a(x)-2),…,c(3),c(2),c(1))[1] does.
It uses c0^x to bypass that c0 would just give d.
The [1] means that it will eventually return the second output of d^…. So b^….
At this point I couldn't think of any thing to do with e(x) to significantly increase it's output except increasing input.
So f(x,a)=a(x),e(a(x))(x,a)[1](x) uses the b^… generated by e(x) to output a better base function and uses that base function to call e(x) with a bigger input.
g(x)=e(x)(x,f)[1](x,a)[1](x) uses a final e(x) to nest f and produces a really powerful function.
Fgh approximation
I will need help approximating this number with any sort of fgh.
Old version: fωω6(fωω5 (9e999)), Try it online! Revision history of explanation
python, f3(f3(141)), 512 bytes
import math
def f(x):
return math.factorial(x)
x=9
for j in range(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(x))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))):
x=f(x)
print x
This isn't really a valid answer, but I wanted to post it anyway. A quick rundown:
import math # imports the factorial function
def f(x):
return math.factorial(x) # shortens the factorial operation
x=9 # sets x to highest available number
for j in range(f(...f(x)...)): # repeats * A LOT *
x=f(x) # does the factorial of x
print x # outputs the result
Anyway, I don't know if this answer technically legal, but it was fun to write. Feel free to edit any errors you find in the code.
Pyth, f3+σ-1+ω2(25626)
Where σm[n] is the Busy Beaver function Σ of order m called on n: σm[n] = Σm(n). The order -1 is to denote that the Busy Beaver here is not being called on a true Turing Machine, but rather an approximation with a finite wrapping tape of Q elements. This allows the halting problem to be solvable for these programs.
=QCGM.x-Hlhf!-/T4/T5.__<GH0M.x+Hlhf!-/T4/T5._>GHlGL=.<QC`m.uX@[XN2%h@N2l@N1XN2%t@N2l@N1XN1X@N1@N2%h@@N1@N2l@N1XN1X@N1@N2%t@@N1@N2l@N1XW!@@N1@N2N2nFKtPNXW@@N1@N2N2gFK)@hNeN3%heNlhNd)bLym*F[]d^UQQUQUld)^U6QJ"s*].v*\mQ"
.v+PPPP*JQ"+*\mQ\'
The TL;DR is that this creates all possible BrainF**k programs of length Q, runs them in an environment where the maximum value of an integer is Q and the tape length is Q, and compiles all the states from these operations together to append (that's the 3+) to Q, repeating the above on a scale of fω2.
I still have ~half the characters to work with if I wanted to do something more, but until we figure out where this is I'll just leave it as is.
Python 3, ~ fε0(999)
N=9**9**9
def f(a,n):
if a[0]==[]:return a[1:]
if a[0][0]==[]:return[a[0][1:]]*n+a[1:]
return [f(a[0],n)]+a[1:]
a=eval("["*N+"]"*N)
n=2
while a:a=f(a,n);n+=1
print(n)
Pyth, fψ(ΩΩ)+ω2+183(~25627!)
=QC`.pGL&=^QQ?+Ibt]0?htb?eb[Xb2yeby@b1hb)hbXb2yeb@,tb&bQ<b1=Y_1VQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQVQ.v%%Fms["*s[.v"*\\^2d"\"%s"*\\^2d"\"")Qs["=Y.v+*"*\\^2Q"\"*3]"*\\^2Q"\"Q\YuyFYHpQ)
Requires any non-empty input, but the value thereof is not used.
Explanation (for the new and actually-reasonably-scoring version):
=QC`.pG Sets the value of the autofill variable to app. 256^27!
27! ~= the number of characters in the string
containing all permutations of the alphabet.
We interpret that string as a base-256 number.
L Define a function y(b,global Q):
&=^QQ Set Q to Q^Q and:
?+Ibt]0 If (?) the variable (b) is (I)nvariant on (+)adding itself
to the empty array (i.e. if it's an array itself):
?htb If the second element of b is not 0:
?eb If the last element is not 0
[Xb2yeby@b1hG) return [b with its last element replaced with y(b[-1]), y(b[1]), b[0]]
hb else return b[0]
Xb2yeb else return b with its last element replaced with y(b[-1])
@,tb&bQ<b1 If b isn't an array,return:
either b-1 if it's a standard ordinal (1 or more)
or Q if b is ω
or 0 if b is 0
=Y_1 Set the global variable Y to -1 (representing ω)
VQ Q times, do (the rest of the explanation):
VQVQ....VQ Iterate from 0 to Q-1 183 times, each subiteration
reading the most recent value of Q when it starts:
.v%%Fms["*s[.v"*\\^2d"\"%s"*\\^2d"\"")Q
Iterate from 0 to Q-1 Q times, each subiteration
reading the most recent value of Q when it starts:
s["=Y.v+*"*\\^2Q"\"*3]"*\\^2Q"\"Q
Y = [Y,Y,Y] Q times, stacking with previous iterations.
uyFYHpQ) Run y_x(Y) for x incrementing until y_(x-1)(Y)=0
It's very hard for me to compute the size of this, mostly because it's late in the day and I'm not super familiar with fast-growing hierarchies or how I'd even go about trying to figure out how many times Q goes through the While I now know more about ordinals, I still have no idea how to calculate the value of the ordinal represented by the recursive definition in my program. I'd join the Discord server, but that's under a pseudonym I'd rather not be linked to my real name.y() wringer.
Unfortunately, because I know relatively little about said fast-growing hierarchies, I'm likely to have already lost to the Ruby answer. It's hard for me to tell. I may have beaten the Ruby answer, but I'm not 100% sure. ¯\_(ツ)_/¯
Python 3, fωω+ω*ω(99999)
from functools import*
h=lambda a,x,b:h(h(a,x,b-1),x-1,a)if x*b else a+b
def f(*x):
if(any(x[:2]):return reduce(lambda y,z:h(z,y,f(x[0],x[1]-1,*x[2:])),x[::-1])if x[0]*x[1]else(f(x[0]-1,f(x[0]-1,x[0],*x[2:]))if x[0]>x[1]else(f(x[1]-1,f(*([x[1]-1]*2+x[2:])),*x[2:])))
for a,k in enumerate(x):if k:return f(*[f(*[k]*a,k-1,*x[a+1:])]*a,k-1,*x[a+1:])
return 0
x,s,g,e,r,z=9**9**9**99,"f(*[%s]*%s)",lambda a,b:a%((b,)*a.count("%")),"x*=eval(\"%s\");","x","x=g(e,g(reduce(g,[s]*x,s),r));"
print(exec(z*x)or eval(r))
I'll get an explanation up soon.
Ruby, fψ0(X(ΩM+X(ΩM+1ΩM+1)))+29(999)
where M is the first Mahlo 'ordinal', X is the chi function (Mahlo collapsing function), and ψ is the ordinal collapsing function.
f=->a,n,b=a,q=n{c,d,e=a;!c ?[q]:a==c ?a-1:e==0||e&&d==0?c:e ?[[c,d,f[e,n,b,q]],f[d,n,b,q],c]:n<1?9:!d ?[f[b,n-1],c]:c==0?n:[t=[f[c,n],d],n,c==-1?[]:d==0?n:[f[d,n,b,t]]]};(x=9**9**9).times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{x.times{h=[];x.times{h=[h,h,h]};h=[[-1,1,[h]]];h=f[h,p x*=x]until h!=0}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
Code Breakdown:
f=->a,n,b=a,q=n{ # Declare function
c,d,e=a; # If a is an integer, c=a and d,e=nil. If a is an array, a=[c,d,e].compact, and c,d,e will become nil if there aren't enough elements in a (e.g. a=[1] #=> c=1,d=e=nil).
!c ?[q]: # If c is nil, return [q], else
a==c ?a-1: # If a==c, return a-1, else
e==0||e&&d==0?c: # If e==0 or e is not nil and d==0, return c, else
e ?[[c,d,f[e,n,b,q]],f[d,n,b,q],c]: # If e is not nil, return an array inside an array, else
n<1?9: # If n<1, return 9, else
!d ?[f[b,n-1],c]: # If d is nil, return [f[b,n-1],c], else
c==0?n: # If c==0, return n, else
[t=[f[c,n],d],n,c==-1?[]:d==0?n:[f[d,n,b,t]]] # t=[f[c,n],d]. If c==-1, return [t,n,[]], else if d==0, return [t,n,n], else return [t,n,[f[d,n,b,t]]].
}; # End of function
(x=9**9**9) # Declare x
x.times{...} # Looped within 33 x.times{...} loops
h=[]; # Declare h
x.times{h=[h,h,h]}; # Nest h=[h,h,h] x times
h=f[h,p x*=x] # Apply x*=x, print x, then h=f[h,x]
until h==0 # Repeat previous line until h==0
Math Breakdown:
f reduces a based on n,b,q.
The basic idea is to have an extremely nested a and reduce it repeatedly until it reduces down to a=0. For simplicity, let
g[0,n]=n
g[a,n]=g[f[a,n],n+1]
For now, let's only worry about n.
For any integer k, we get f[k,n]=k-1, so we can see that
g[k,n]=n+k
We then have, for any d, f[[0,d],n]=n, so we can see that
g[[0,d],n]
= g[f[[0,d],n],n+1]
= g[n,n+1]
= n+n+1
We then have, for any c,d,e, f[[c,0,e],n]=f[[c,d,0],n]=c. For example,
g[[[0,d],0,e],n]
= g[f[[[0,d],0,e]],n+1]
= g[[0,d],n+1]
= (n+1)+(n+1)+1
= 2n+3
We then have, for any c,d,e such that it does not fall into the previous case, f[[c,d,e],n]=[[c,d,f[e,n]],f[d,n],e]. This is where it starts to get complicated. A few examples:
g[[[0,d],1,1],n]
= g[f[[[0,d],1,1],n],n+1]
= g[[[0,d],1,0],0,[0,d]],n+1]
= g[f[[[0,d],1,0],0,[0,d]],n+1],n+2]
= g[[[0,d],1,0],n+2]
= g[f[[[0,d],1,0],n+2],n+3]
= g[[0,d],n+3]
= (n+3)+(n+3)+1
= 2n+7
#=> Generally g[[[0,d],1,k],n] = 2n+4k+3
g[[[0,d],2,1],n]
= g[f[[[0,d],2,1],n],n+1]
= g[[[[0,d],2,0],1,[0,d]],n+1]
= g[f[[[[0,d],2,0],1,[0,d]],n+1],n+2]
= g[[[[[0,d],2,0],1,n+1],0,[[0,d],2,0]]],n+2]
= g[f[[[[[0,d],2,0],1,n+1],0,[[0,d],2,0]]],n+2],n+3]
= g[[[[0,d],2,0],1,n+1],n+3]
= ...
= g[[[0,d],2,0],3n+6]
= g[f[[[0,d],2,0],2n+6],3n+7]
= g[[0,d],3n+7]
= (3n+7)+(3n+7)+1
= 6n+15
It quickly ramps up from there. Some points of interest:
g[[[0,d],3,[0,d]],n] ≈ Ack(n,n), the Ackermann function
g[[[0,d],3,[[0,d],0,0]],63] ≈ Graham's number
g[[[0,d],5,[0,d]],n] ≈ G(2^^n), where 2^^n = n applications of 2^x, and G(x) is the length of the Goodstein sequence starting at x.
Eventually introducing more arguments of the f function as well as more cases for the array allows us to surpass most named computable notations. Some particularly known ones:
g[[[0],3,[0,d]],n] ≈ tree(n), the weak tree function
g[[[[0],3,[0,d]],2,[0,d]],n] ≈ TREE(n), the more well-known TREE function
g[[[[0,d]],5,[0,d]],n] >≈ SCG(n), sub-cubic graph numbers
g[[[0]],n] ≈ S(n), Chris Bird's S function
Ruby, probably ~ fω+35(9999)
G=->n,k{n<1?k:(f=->b,c,d{x=[]
c<G[b,d]?b-=1:(x<<=b;c-=G[b,d])while c>=d
x<<[c]}
x=f[n-1,k,b=1]
(b+=1;*u,v=x;x=v==[0]?u:v==[*v]?u<<[v[0]-1]:u+f[n-1,G[v,b]-1,b])while x[0]
b)};(n=9**9**99).times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n.times{n=G[n,n]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}};p n
Approximate Math Explanation:
The below is approximately equal to the program above, but simplified so that its easier to understand.
G(0,k) = k is our base function.
To evaluate G(n,k), we take k and write it as G(n-1,1) + ... + G(n-2,1) + ... + G(0,1).
Then change all of the G(x,1)'s into G(x,2)'s and subtract 1 from the entire result.
Rewrite it in the above form using G(x,2), where x<n, and leave the remainder at the end. Repeat, changing G(x,2) to G(x,3), etc.
When the result reaches -1, return the base (the b that would be in G(x,b).)
Examples:
G(1,1):
1: 1 = G(0,1)
2: G(0,2) - 1 = 1
3: 1 - 1 = 0
4: 0 - 1 = -1 <----- G(1,1) = 4
G(1,2):
1: 2 = G(0,1) + G(0,1)
2: G(0,2) + G(0,2) - 1 = G(0,2) + 1
3: G(0,3) + 1 - 1 = G(0,3)
4: G(0,4) - 1 = 3
5: 3 - 1 = 2
6: 2 - 1 = 1
7: 1 - 1 = 0
8: 0 - 1 = -1 <----- G(1,2) = 8
G(1,3):
1: 3 = G(0,1) + G(0,1) + G(0,1)
2: G(0,2) + G(0,2) + G(0,2) - 1 = G(0,2) + G(0,2) + 1
3: G(0,3) + G(0,3)
4: G(0,4) + 3
5: G(0,5) + 2
6: G(0,6) + 1
7: G(0,7)
8: 7
9: 6
10:5
11:4
12:3
13:2
14:1
15:0
16:-1 <----- G(1,3) = 16
G(2,5):
1: 5 = G(1,1) + G(0,1)
2: G(1,2) + 1
3: G(1,3)
4: G(0,4) + G(0,4) + G(0,4) + G(0,4) + G(0,4) + G(0,4) + G(0,4) + 3
5: G(0,5) + G(0,5) + G(0,5) + G(0,5) + G(0,5) + G(0,5) + G(0,5) + 2
6: G(0,6) + G(0,6) + G(0,6) + G(0,6) + G(0,6) + G(0,6) + G(0,6) + 1
...
1024: -1 <----- G(2,5) = 1024
Doing some math, I found that
G(1,n-1) = 2ⁿ
G(2,n+6) ~ 2^G(2,n), large enough n.
And beyond that it tends to get a bit hairy.
In general, we have
G(n,k+G(n-1,1)) ~ G(n-1,G(n,k)), large enough n.