Pair sequence number

Pair sequence number

Pair sequence number is a number calculated with a program that at googology thread of Japanese BBS 2ch.net in 2014. The algorithm of the program is called pair sequence system. It is supposed to calculate \(f_{\vartheta(\Omega_\omega)+1}(10)\), and this program is an extention of a program written by the same author which is supposed to calculate \(f_{\epsilon_0+1}(10)\).

Pair sequence is a finite sequence of pair of nonnegative integers, such as (0,0)(1,1)(2,2)(3,3)(3,2). Pair sequence P works as a function from natural numbers to natural numbers, and it can be denoted as P[n], such as (0,0)(1,1)(2,2)(3,3)(3,2)[n]. The function P[n] can be approximated with Hardy hierarchy, and the pair sequence itself represents the ordinal of the approximated Hardy hierarchy, such as \((0,0)(1,1)(2,2)(3,3)(3,2) = \psi(\psi_1(\Omega_2))\).

Original BASIC Code
In the loop of "for D=0 to 9" to "next", \(C=f_{\vartheta(\Omega_\omega)}(C)\) is calculated. Repetition of this loop 10 times results in \(f_{\vartheta(\Omega_\omega)+1}(10)\).

dim A(Infinity):dim B(Infinity):C=9 for D=0 to 9 for E=0 to C   A(E)=E:B(E)=E next for F=C to 0 step -1 C=C*C if B(F)=0 then G=1 else G=0 for H=0 to F*G if A(F-H)<A(F) or A(F)=0 then I=H:H=F*G next for J=1 to C*G*I A(F)=A(F-I):B(F)=B(F-I):F=F+1 next G=1-G for K=1 to F*G if A(F-K)<A(F) and B(F-K)<B(F) then L=A(F)-A(F-K):M=K:K=F*G next for N=1 to C*G*M A(F)=A(F-M)+L:B(F)=B(F-M):F=F+1 next next next print C

Equivalent C code
This code is optimized for short characters with Bignum Bakeoff rule. The pair sequence number is returned from main. It has 279 characters without whitespaces.


 * 1) define A a[f]
 * 2) define B b[f]
 * 3) define F for (
 * 4) define M = malloc(9),

main(f) { int *a M *b M c = 9, d = 9, h, i, k;  F ; d--;) {      F h = c; h--;) a[h] = b[h] = h;      F f = c; f--;) {         c *= c;         F h = f; h--;) (a[h] < A && (b[h] < B || !B) || A + B == 0)? (k = B ? A - a[h]: 0, i = f - h, h = 0): 0; h = f + c * i; a = realloc(a, h); b = realloc(b, h); F ; f < h; f++) A = a[f-i] + k, B = b[f-i];     }   }   return c; }

Verification code of C
This code is intended to show the calculation process and modified from original algorithm as follows.


 * Initial variable is different and written in the code.
 * D loop is eliminated
 * C is set as constant 2 and does not change
 * Calculation stops when the length of the sequence exceeds maxlength


 * 1) include 
 * 2) include 

const int maxlength = 200;

int main(void) { int a[maxlength], b[maxlength], c = 2, e, f, h, i, j, k;   int len=2; /* Position of the rightmost pair */ a[0]=0; b[0]=0; a[1]=1; b[1]=1; a[2]=2; b[2]=1; for (f = len; f >= 0; f--) { for (h = 0; h< f; h++) { printf("(%d,%d)", a[h], b[h]); }       printf("(%d,%d)[%d]\n",a[f], b[f], c); if (!b[f]) { for (h = 0; h <= f; h++) { if (a[f-h] < a[f] || !a[f]) { k = 0; i = h;                   h = f;                } }       } else { for (h = 1; h <= f; h++) { if (a[f-h] < a[f] && b[f-h] < b[f]) { k = a[f]-a[f-h]; i = h;                   h = f;                } }       }        for (j = 1; j <= c * i; j++) { a[f] = a[f-i] + k;           b[f] = b[f-i]; f++; if ( f > maxlength ) { return 0; } }   }    return 0; }

The result is as follows.
 * (0,0)(1,1)
 * (0,0)(1,1)(1,1)
 * (0,0)(1,1)(2,0)
 * (0,0)(1,1)(2,1)
 * (0,0)(1,1)(2,2)
 * (0,0)(1,1)(2,2)(3,3)
 * (0,0)(1,1)(2,2)(3,3)(4,4)

Corresponding ordinals
\begin{eqnarray*} (0,0) &=& 1 \\ (0,0)(0,0) &=& 2 \\ (0,0)(0,0)(0,0) &=& 3 \\ (0,0)(1,0) &=& \omega \\ (0,0)(1,0)(0,0)(0,0) &=& \omega+2 \\ (0,0)(1,0)(0,0)(0,1) &=& \omega \cdot 2 \\ (0,0)(1,0)(1,0) &=& \omega^2 \\ (0,0)(1,0)(1,0)(0,0)(0,1) &=& \omega^2+\omega &=& (0,1,1,0,1) \\ (0,0)(1,0)(2,0) &=& \omega^\omega \\ (0,0)(1,0)(2,0)(3,0) &=& \omega^{\omega^\omega} \\ (0,0)(1,0)(2,0)(3,0)(4,0) &=& \omega^{\omega^{\omega^\omega}} \\ (0,0)(1,1) = \epsilon_0 \\ (0,0)(1,1)(1,0)(2,1) &=& \epsilon_0^2 \\ (0,0)(1,1)(1,0)(2,1)(2,0)(3,1) &=& \epsilon_0^{\epsilon_0} \\ (0,0)(1,1)(1,0)(2,1)(2,0)(3,1)(3,0)(4,1) &=& \epsilon_0^{\epsilon_0^2} \\ (0,0)(1,1)(1,0)(2,1)(2,0)(3,1)(3,0)(4,1)(4,0)(5,1) &=& \epsilon_0^{\epsilon_0^{\epsilon_0}} \\ (0,0)(1,1)(1,1) = \epsilon_1 \\ (0,0)(1,1)(2,0) = \epsilon_{\omega} \\ (0,0)(1,1)(2,0)(2,0) &=& \psi(\omega^2) \\ (0,0)(1,1)(2,0)(3,0) &=& \psi(\omega^\omega) \\ (0,0)(1,1)(2,0)(3,1) &=& \psi(\psi(0)) \\ (0,0)(1,1)(2,1) &=& \psi(\Omega) \\ (0,0)(1,1)(2,1)(3,1) &=& \psi(\Omega^\Omega) \\ (0,0)(1,1)(2,2) &=& \psi(\psi_1(0)) \\ (0,0)(1,1)(2,2)(0,0) &=& \psi(\psi_1(0))+1 \\ (0,0)(1,1)(2,2)(1,0) &=& \psi(\psi_1(0)) \omega \\ (0,0)(1,1)(2,2)(2,0) &=& \psi(\psi_1(0) \omega) \\ (0,0)(1,1)(2,2)(3,0) &=& \psi(\psi_1(\omega)) \\ (0,0)(1,1)(2,2)(3,0)(4,0) &=& \psi(\psi_1(\omega^\omega)) \\ (0,0)(1,1)(2,2)(3,0)(4,1) &=& \psi(\psi_1(\psi(0)))=\psi(\psi_1(\epsilon_0)) \\ (0,0)(1,1)(2,2)(3,1) &=& \psi(\psi_1(\Omega)) \\ (0,0)(1,1)(2,2)(3,2) &=& \psi(\psi_1(\Omega_2)) \\ (0,0)(1,1)(2,2)(3,3) &=& \psi(\psi_1(\psi_2(0))) \\ (0,0)(1,1)(2,2)(3,3)(4,4) &=& \psi(\psi_1(\psi_2(\psi_3(0)))) \\ (0,0)(1,1)(2,2)(3,3)...(9,9) &=& \psi(\psi_1(\psi_2(\psi_3(\psi_4(\psi_5(\psi_6(\psi_7(\psi_8(0))))))))) \\ \end{eqnarray*}