FANDOM


pete-7.c is the largest of the nine entries an anonymous "Pete" submitted to Bignum Bakeoff.[1] It placed third in the competition, behind marxen.c and loader.c.

pete-7.c uses a linear array notation defined by the following rules:

  • \(f_x(0, 0, \ldots, 0, 0) = x\)
  • \(f_x(a_1, a_2, a_3, \ldots, a_{n - 1}, a_n + 1) = f_y(a_1, a_2, a_3, \ldots, a_{n - 1}, 0)\) where \(y = f_x(a_1, a_2, a_3, \ldots, a_{n - 1}, a_n)^2\)
  • \(f_x(a_1, a_2, a_3, \ldots, a_n + 1, 0, 0, \ldots, 0, 0) = f_x(a_1, a_2, a_3, \ldots, a_n, x, x, \ldots, x, x)\)

Define the sequence \(n_0 = 99\) and \(n_{i + 1} = 9 \cdot 2^{n_i}\), letting \(N = n_{16}\). The output value is then \(f_N(N, 0, 0, \ldots, 0, 0)^2\) with \(N - 1\) copies of 0.

David Moews, the judge, estimated that pete-7.c is between \(f_{\omega^\omega}(2\uparrow\uparrow 35)\) and \(f_{\omega^\omega}(2 \uparrow\uparrow 36)\) in the fast-growing hierarchy.

Code Edit

#define F (9<<(9<<(9<<(9<<
#define D F F F F
#define E ))))))))))))))))

#define N D D 99 E E 

int B = N;

f(int *a)
{   
    int C = B, b[N], n = N;
    
    while(n--)
        b[n] = a[n];
    n = N - 1;
    if(b[n]--)
        while(C--)
            B = f(b);   
    while(n-- && !(b[n + 1] = B, b[n]--))
        ;   
    return n == -1 ? B * B : f(b);
}

main()
{
    int a[N] = {N};     

    return f(a);
}

Sources Edit

  1. http://djm.cc/bignum-results.txt

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.