## FANDOM

10,231 Pages

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 Edit

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) ;}


### SourcesEdit

1. Bignum Bakeoff contest recap by David Moews.