Pair sequence number

Pair sequence number is a number calculated with a program that posted 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 of primitive sequence system written by the same author which calculates \(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 the pair sequence number of \(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 278 characters without whitespaces.


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

main(f) { int *a M *b M c = 9, d = 10, h, i, k;  W d--) {      f = h = c + 1;      W h--) a[h] = b[h] = h;      W f--) {         c *= c;         h = f + 1;         W 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); W f < h) A = a[f-i] + k, B = b[f-i], f++;     }   }   return c; }

Verification code
Bashicu matrix calculator can show the calcultion process of pair sequence system.

Here is some examples of the calculation of pair sequence. In the calculation, original algorithm was modified so that n=2 is not changed.


 * (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,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 = \psi(1) \\ (0,0)(1,1)(2,0) &=& \epsilon_{\omega} = \psi(\omega) \\ (0,0)(1,1)(2,0)(2,0) &=& \epsilon_{\omega^2} = \psi(\omega^2) \\ (0,0)(1,1)(2,0)(3,0) &=& \epsilon_{\omega^\omega} = \psi(\omega^\omega) \\ (0,0)(1,1)(2,0)(3,1) &=& \epsilon_{\epsilon_0} = \psi(\psi(0)) \\ (0,0)(1,1)(2,0)(3,1)(4,0)(5,1) &=& \epsilon_{\epsilon_{\epsilon_0}} = \psi(\psi(\psi(0))) \\ (0,0)(1,1)(2,1) &=& \zeta_0 = \phi(2,0) = \psi(\Omega) \\ (0,0)(1,1)(2,1)(3,1) &=& \Gamma_0 = \phi(1,0,0) = \psi(\Omega^\Omega) \\ (0,0)(1,1)(2,1)(3,1)(4,0) &=& ψ(\Omega^{\Omega \cdot \omega}) \\ (0,0)(1,1)(2,1)(3,1)(4,1) &=& ψ(\Omega^{\Omega \cdot \Omega}) = ψ(\Omega^{\Omega^2}) \\ (0,0)(1,1)(2,1)(3,1)(4,1)(4,0) &=& ψ(\Omega^{\Omega^2 \cdot \omega}) \\ (0,0)(1,1)(2,1)(3,1)(4,1)(4,1) &=& ψ(\Omega^{\Omega^2 \cdot \Omega}) = ψ(\Omega^{\Omega^3}) \\ (0,0)(1,1)(2,1)(3,1)(4,1)(5,0) &=& ψ(\Omega^{\Omega^\omega}) \\ (0,0)(1,1)(2,1)(3,1)(4,1)(5,1) &=& ψ(\Omega^{\Omega^\Omega}) \\ (0,0)(1,1)(2,1)(3,1)(4,1)(5,1)(6,1) &=& ψ(\Omega^{\Omega^{\Omega^2}}) \\ (0,0)(1,1)(2,1)(3,1)(4,1)(5,1)(6,1)(7,1) &=& ψ(\Omega^{\Omega^{\Omega^\Omega}}) \\ (0,0)(1,1)(2,2) &=& \psi(\epsilon_{\Omega+1}) = \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*}