Googology Wiki
Advertisement
Googology Wiki

View full site to see MathJax equation

marxen.c is an entry by Heiner Marxen for the Bignum Bakeoff contest, whose objective is to write a C program (in 512 characters or less) that generates the largest possible output. It came in second place in the competition, behind Loader's number.

The program uses a variant of the Goodstein sequence. Its output is lower bounded by \(f_{\omega^{\omega}}(2\uparrow\uparrow 500)\) and upper bounded by \(f_{\varepsilon_{0}+{\omega^3}}(1,000,000)\) in the fast-growing hierarchy.[1]

Code[]

typedef int	J;
J P(J x,J y)	{ return x+y ? x%2 + y%2*2 + P(x/2,y/2)*4 : 0 ;}
J H(J z)	{ return z ? z%2 + 2*H(z/4) : 0 ;}
J I(J f,J e,J r){ return f ? P(P(f,e),r) : r ;}
J M(J x,J e)	{ return x ? I(x%2, M(e,0), M(x/2, e+1)) : 0 ;}
J D(J,J);	 
J E(J f,J e,J r,J b)
{
    return e ? E(1, D(e,b), I(b-1, D(e,b), I(f-1,e,r)), b) : I(f-1,e,r) ;
}
J D(J x,J b)	{ return x ? E( H(H(x)), H(H(x)/2), H(x/2), b) : 0 ;}
J F(J x,J b)	{ return x ? F(D(x,b+1),b+1) : b ;}
J G(J x)	{ return F(M(x,9), 9) ;}
J f(J n,J x)	{ return n ? f(n-1, G(x ? f(n,x-1) : n)) : G(x) ;}
J g(J x)	{ return f(x,x) ;}
J h(J n,J x)	{ return n ? h(n-1, g(x ? h(n,x-1) : n)) : g(x) ;}
J main(void)	{ return h(g(9),9) ;}

Functions defined in Marxen.c[]

In the following, the operator symbol / denotes the integral division and a % b is equivalent to a (mod b).

P(x,y)[]

  1. If x+y = 0, then P(x,y)=0.
  2. Otherwise, P(x,y)=x%2 + y%2*2 + 4P(x/2,y/2).

H(z)[]

  1. If z = 0, then H(z)=0.
  2. Otherwise, H(z)=z%2 + 2H(z/4)

I(f,e,r)[]

  1. If f = 0, then I(f,e,r)=r.
  2. Otherwise, I(f,e,r)=P(P(f,e),r)

M(x,e)[]

  1. If x = 0, then M(x,e)=0.
  2. Otherwise, M(x,e)=I(x%2, M(e,0), M(x/2,e+1))

D(x,b)[]

  1. If x = 0, then D(x,b)=0.
  2. Otherwise, D(x,b)=E(H(H(x)), H(H(x)/2), H(x/2), b)

E(f,e,r,b)[]

  1. If e = 0, then E(f,e,r,b)=I(f-1,e,r)
  2. Otherwise, E(f,e,r,b)=E(1, D(e,b), I(b-1, D(e,b), I(f-1,e,r)), b)

F(x,b)[]

  1. If x = 0, then F(x,b)=b.
  2. Otherwise, F(x,b)=F(D(x,b+1),b+1)

G(x)[]

G(x)=F(M(x,9),9)

f(n,x)[]

  1. If n = 0, then f(n,x)=G(x).
  2. Else if x = 0, then f(n,x)=f(n-1,G(n))
  3. Otherwise, f(n,x)=f(n-1,G(f(n,x-1)))

g(x)[]

g(x)=f(x,x)

h(n,x)[]

  1. If n = 0, then h(n,x)=g(x).
  2. Else if x = 0, then h(n,x)=h(n-1,g(n))
  3. Otherwise, h(n,x)=h(n-1,g(h(n,x-1)))

main()[]

main()=h(g(9),9)

This is the number produced by the program, and thus the number submitted to the Bignum Bakeoff.

Sources[]

See also[]

Advertisement