User blog:LittlePeng9/Random Turing machines

Ikosarakt1 inspired me to get back to TM programming.

These machines are designed to work on this simulator.

Pólya conjecture test
Challenge - prove this machine halts ; Tape consists of three parts - prime, work value and function value ; Pólya conjecture states that so called summatory Liouville function is everywhere positive ; This is equivalent to 'function value is always non-zero' in my machine ; Number of 1's in function space is equal to -L(n)+1 ; These are setup states. They are here to make tape ready to work 0 _ 1 l 1 1 _ _ l 2 2 _ 1 l 3 3 _ 1 l 4 4 _ 1 l 5 5 _ _ l 6 6 _ 1 l 7 7 _ 1 r x0 ; This is 'get to work' state. It simply moves from leftmost symbol to work space x0 1 1 r x0 x0 x _ r x0 x0 _ _ l w1 ; These are working states. They check if work value is divisible by prime ; w states mark p symbols in work value (where p is value of prime) w1 1 x r w2 w1 x x l w1 w3 1 x l w0 w2 _ _ r w3 w3 _ _ l s0 ; If p doesn't divide work value, it skips to s w0 _ _ l w1 w0 * * l w0 w2 * * r w2 w3 * * r w3 w1 _ _ r c0 ; If we finished marking p, we check if it's end of work value c0 _ _ r c1 c0 * * r c0 c0 x 1 r c0 c1 _ p l d0 ; if it does, skip to d c1 p _ l d0 c1 1 1 l c2 c2 x y l w0 ; If it isn't, return to w c1 * * r c1 ; Division - we divide work value by p and we leave 'p' on tape, marking prime factor d0 x y l d1 d0 y y l d1 d1 x y r d2 d1 y y l d1 d2 p p l d3 d2 _ _ l d3 d2 * * r d2 d3 y _ l d0 d1 _ _ r d4 d4 y 1 r d4 d4 _ _ l d5 d5 1 1 l d6 d6 1 1 l w0 d6 _ _ r a0 ; This simply increments prime s0 x 1 l s0 s0 y 1 l s0 s0 _ _ l s1 s1 x 1 l s1 s1 1 1 l s1 s1 _ 1 r x0 ; Crucial part - depending on number of prime factors we increment or decrement function value ; It also sets work value to next number a0 * * r a1 a1 _ 1 r a1 a1 p 1 r a2 a2 _ 1 r a2 a2 p 1 r a1 a1 1 _ r a3 a3 _ _ r halt ; If function value reaches 0, Pólya conjecture is false, and machine halts a3 1 1 l r0 a2 1 _ r a4 a4 1 1 r a4 a4 _ 1 r a5 a5 _ 1 l r0 ; Return - after changing function value it starts dividing new number r0 1 1 l r0 r0 _ _ l r1 r1 1 1 l r1 r1 _ _ l r2 r2 1 1 l r3 r3 1 1 l r4 r4 1 x l r4 r4 _ _ r x0

Restricted Knuth up-arrow notation
Example input - x^^^x^^^^xx It corresponds to \(2\uparrow 2 \uparrow \uparrow 3\)

Question - how many states we need to add in order to compute Ackermann function? I found 7 is enough ; This machine computes restricted Knuth up-arrow notation ; It is able to compute 2^(a)2^(b)...2^(n)x, where ^(n) means n up-arrows and x is natural ; Setting input - one up arrow means addition, two mean multiplication, three exponentiation etc. ; Every '2' in notation is represented by ONE 'x'. Rightmost number must have one less 'x' than it represents. 0 * * r 0 ; State 0 simply moves to rightmost non-blank cell 0 _ _ l 1 ; State 1 searches for rightmost arrow 1 x x l 1 1 ^ x l 1a 1 _ _ r halt ; If there are no arrows, halt 1a x x r 1 ; If there is only one arrow, add two numbers and search for new arrow 1a ^ ^ r 1b 1b * * r 2 2 x _ l 3 ; Otherwise, we replace 2^(n)x with 2^(n-1)2^(n)x-1 3 x x l 3 3 ^ y r 4 4 * * r 4 4 x x r 5 5 ^ ^ r 5 5 _ ^ r 6 6 x _ r 7 6 _ _ l 11 ; At this point I use error which happens when last number is 2 7 x x r 7 7 _ x l 8 8 * * l 8 8 y y l 9 9 y y l 9 9 ^ y r 4 9 x x r 10 10 y ^ r 10 10 _ ^ r 0 10 * * r 10 11 x _ l 12 ; If last number is 2, no matter how many arrows there are we collapse to 4 11 ^ _ l 11 12 * _ l 12 12 x x r 13 13 _ x r 14 14 _ x l 1

Two color restricted Knuth up-arrow notation
Same rules as above - strings of x's and ^'s replace with strings of 1's with blanks inbetween. Output isn't decreased by 1 in here

Example input - 1 111 1 1111 11 It corresponds to \(2\uparrow 2 \uparrow \uparrow 3\) 0 1 1 r 0 0 _ _ r 1 1 1 1 r 0 1 _ _ l 2 2 _ _ l 2 2 1 1 l 3 3 _ 1 r c0 3 1 1 l 4 c0 1 _ l c0 c0 _ 1 r c1 c1 _ 1 r 1 4 1 1 l 4 4 _ 1 l 5a 5a _ _ r halt 5a 1 _ l 5b 5b 1 1 r 5c 5b _ 1 r a0 5c _ _ r 6 6 1 _ r 7 7 1 _ l 8 8 _ _ l 9 9 _ _ l 9 9 1 _ r 10 10 _ 1 r 11 11 1 1 r 11 11 _ _ r 12 12 1 1 r 12 12 _ 1 r 13 13 1 _ r 14 13 _ _ r 13 14 1 1 r 14 14 _ 1 l 15 15 1 1 l 15 15 _ _ l 16 16 1 1 l 16 16 _ _ l 17 17 1 1 l 17 17 _ _ l 18 18 _ _ r x0 18 1 1 r 9 x0 _ 1 r x1 x1 1 1 r x1 x1 _ 1 l x2 x2 1 _ r x3 x3 1 1 r x4 x4 1 _ r x5 x5 1 1 r x5 x5 _ 1 r x6 x6 1 1 r x7 x7 1 _ r x8 x7 _ _ r x9 x8 _ 1 r x9 x8 1 1 r x8 x9 _ 1 r 2 a0 _ 1 r a1 a1 1 1 r a1 a1 _ _ l a2 a2 1 _ l a3 a3 1 _ l 2

Two color Collatz conjecture tester
Works for one given number only ; This machine computes so called hailstone sequence for a number written in unary ; This machine is not checking Collatz conjecture. It tests it for only one given number ; First, machine checks if number is even or odd 0 1 1 r 1 1 1 1 r 0 0 _ _ l 00 1 _ _ l 10 ; If number is even, we divide it by 2 00 1 _ l 01 00 _ _ l r 01 1 _ l 02 02 1 1 l 02 02 _ _ l 03 03 1 1 l 03 03 _ 1 r 04 04 1 1 r 04 04 _ _ r 0 r 1 1 l r r _ _ r 0 ; If it is odd, we first check if it is 1 10 1 _ l x x _ _ l y y _ _ r halt ; If it isn't, we replace n with 3*n+1 10 _ 1 l r x 1 1 l 11 y 1 1 l 12 11 1 1 l 11 11 _ _ l 12 12 _ 1 l 13 12 1 1 l 12 13 _ 1 l 14 14 _ 1 r 15 15 1 1 r 15 15 _ _ r 16 16 _ _ l 10 16 1 1 r 16

3-color version
For every natural number it returns \(\lfloor \sqrt{n} \rfloor \) ; For every nonnegative integer, machine computes floor(sqrt(n)) ; It uses fact that n^2=1+3+5+...+(2n-1) ; Short setup ; On the left there is current addend, now it is 1 0 1 1 l 0 0 _ _ l 1 1 _ 1 r 5 ; We mark exactly that many 1's from input as there is in addend 2 _ 1 l 6 2 x x l 2 2 1 x r 3 3 x x r 3 3 _ _ r 4 4 x x r 4 4 1 x l 5 4 _ _ l 8 5 x x l 5 5 _ _ l 2 ; If we used whole addend, we increase it by 2 6 _ 1 r 7 7 1 1 r 7 7 x 1 r 7 7 _ _ l 2 ; If we marked whole input, we remove it, leaving only output 8 x _ l 8 8 _ 1 l 9 ; At this moment, addend is exactly 2n+1, where n is wanted output 9 _ _ l 9 9 x _ l 10 9 1 _ l 10 10 x _ r 11 10 1 _ r 11 10 _ _ r 14 11 _ _ r 11 11 1 1 r 12 12 1 1 r 12 12 _ 1 l 13 13 1 1 l 13 13 _ _ l 9 ; Now there is n+1 left on tape. We remove one 1 and we're done 14 _ _ r 14 14 1 _ r halt

2-color version
Works same way as previous machine, expect for marking. It uses single blank space as end of marked part. Suprisingly, time complexity haven't increased much.

Challenge: I didn't bother to make it work for all integers. Change it. It should be possible with 5 new states 0 1 1 l 1 0 _ _ l halt 1 _ _ l 2 2 _ 1 l 3 3 * _ l 4 4 * 1 l 5 5 * _ l 6 6 * 1 r 7 7 * _ r 8 8 1 1 l 8 8 _ 1 l 9 9 1 _ r 10 9 _ 1 l 14 10 1 1 r 10 10 _ _ r 11 11 1 1 r 11 11 _ 1 r 12 12 1 _ l 13 12 _ _ l 16 13 1 1 l 13 13 _ _ l 8 14 _ 1 r 15 15 1 1 r 15 15 _ _ l 4 16 1 _ l 16 16 _ _ l 17 17 1 1 l 17 17 _ _ l 18 18 1 _ l 19 19 _ _ l 19 19 1 _ l 20 20 _ _ r 24 20 1 _ r 21 21 _ _ r 21 21 1 1 r 22 22 1 1 r 22 22 _ 1 l 23 23 1 1 l 23 23 _ _ l 19 24 _ _ r 24 24 1 _ r halt

Arbitrary root calculator
Edit: machine fixed. It works now for every b>0 ; Input form - (a) (b) ; Output form - (floor(root(b,a))) 0 1 1 r 0 0 _ x r s0 ; This is my power-taking machine. With input (n) (m) it outputs (m^n) 0a 1 _ r 1 1 1 _ r 20 1 _ _ r 10 1 x _ r 11 2 * * r 2 2 _ _ r 3 3 1 _ r 4 3 x _ l 8 4 1 1 r 4 4 _ x r 5 4 x x r 5 5 1 1 r 5 5 _ 1 l 6 6 1 1 l 6 6 * * l 7 7 1 1 l 7 7 _ 1 r 3 8 1 1 l 8 8 x x l 8 8 _ x l 9 9 1 1 l 8 9 _ _ r 10 10 x _ r 1 10 1 1 l 15 11 1 1 r 11 11 x _ r 11 11 _ _ l 12 12 1 1 l 12 12 _ _ r m0 ; Multiplication subroutine m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r 13 13 1 1 r 13 13 _ _ l 14 14 1 _ l 15 15 1 1 l 15 15 _ 1 l 16 16 1 1 r 17 16 _ _ r 13 16 x _ r 18 17 1 _ l 12 18 1 1 r 18 18 _ _ l 19 19 1 _ l c1 20 * * r 2 20 _ x r 3 ; When machine starts, we add two 1's at the end ; As this number changes, we call it c s0 1 1 r s0 s0 _ _ r s1 s1 _ 1 r s2 s1 1 1 l s3 s2 _ 1 l s3 s3 * * l s3 s3 x _ r d0 ; We copy b and c d0 1 x r d1 d0 _ _ r d5 d1 1 1 r d1 d1 _ _ r d2 d2 1 1 r d2 d2 _ _ r d3 d3 _ 1 l d4 d3 1 1 r d3 d4 * * l d4 d4 x x r d0 d5 1 x r d6 d5 _ x r 0a d6 1 1 r d6 d6 _ _ r d7 d7 1 1 r d7 d7 _ _ r d8 d8 _ 1 l d9 d8 1 1 r d8 d9 * * l d9 d9 x x r d5 ; We compare a with c^b ; If c^b>a, then c-1 is result c0 1 * r c0 c0 x x r c5 c0 _ _ l c1 c1 1 _ l c2 c1 _ 1 l f0 c2 * * l c2 c2 _ * l c3 c3 1 * l c3 c3 _ 1 r c4 c3 x x l c2 c4 1 _ r c5 c4 _ _ l h0 c5 1 * r c5 c5 x x r c5 c5 _ _ r c0 ; Otherwise we increase c f0 x 1 l f0 f0 _ _ l f1 f1 x 1 l f0 f1 1 1 l f1 f1 _ 1 l f2 f2 1 1 l f2 f2 _ _ r f3 f3 1 _ r 0 ; We delete a, b, remains of c^b and leave c-1 h0 1 _ l h0 h0 _ _ r h1 h1 _ _ r h1 h1 x _ r h2 h2 x _ r h2 h2 _ _ r h3 h3 x 1 r h3 h3 _ _ r h4 h4 1 _ r h4 h4 _ _ l h5 h5 * * l h5 h5 1 _ l halt

Binary logarithm calculator
It works only for powers of 2. Even now it is very inefficient. Calculates \(log_2(1024)\) in 1082294 steps. 0 1 1 r 2 1 _ 1 r 2 2 _ _ r 2 2 1 _ r 10 3 _ _ r 3 3 1 _ r 4 4 1 _ r 5 4 _ _ l 9 5 1 1 r 5 5 _ _ r 6 6 1 1 r 6 6 _ 1 l 7 7 1 1 l 7 7 _ _ l 8 8 1 1 l 8 8 _ _ r 3 9 _ _ l 9 9 1 1 r 1 10 1 _ r 5 10 _ _ l 11 11 _ _ l 11 11 1 1 r halt

Prime factorization
I posted it in Turing golf, here is commented version ; Number we currently try to divide is n. Current prime is p ; Setup 0 1 1 l 1 1 _ _ l 2 2 _ 1 l 3 3 _ 1 r 4 4 1 1 r 4 4 _ _ l 5 ; Trying to add current prime to remaining number 5 x x l 5 5 1 x r 6 5 _ _ r 9 ; If succesful, we check if we filled number 6 x x r 6 6 _ _ r 7 7 x x r 7 7 y y r 7 7 1 x l 8 7 _ _ l 27 ; If unsuccesful, number isn't divisible by prime, so we increase prime 8 x x l 8 8 y y l 8 8 _ _ l 5 ; We have to mark number can fit another copy of prime 9 x 1 r 9 9 _ _ r 10 10 x x r 10 10 y y r 10 10 1 1 l 11 10 _ _ l 12 ; If we filled number, we can divide number by prime 11 x y l 8 ; It's important that number of y's is equal to n/p 12 x 1 l 13 13 y 1 l 13 13 1 1 l 13 13 x 1 r 14 13 _ y l 16 ; We finish dividing 14 1 1 r 14 14 _ _ l 15 15 1 _ l 13 ; Now p is prime factor of n, so we copy it to far left of tape 16 1 x l 17 16 x x l 16 16 _ _ l 21 17 1 1 l 17 17 _ _ l 18 18 1 1 l 17 18 _ x r 20 18 x x l 19 19 x x l 19 19 _ x r 20 20 * * r 20 20 y y l 16 ; We make tape ready for another division 21 * * l 21 21 x x l 22 22 x x l 22 22 _ _ r 23 23 x 1 r 23 23 * * r 23 23 y _ r 24 ; Here is check-if-n-is-1 subroutine 24 1 1 r 25 25 1 1 l 26 25 _ _ l 31 ; If it is, we have to finish job 26 1 1 l 4 ; Otherwise, we try to divide by same prime ; Here we have to increase prime ; At the same moment we move all known factors to the left 27 * 1 l 27 27 _ y l 28 28 * 1 l 28 28 _ 1 l 29 29 1 _ l 28 29 _ _ r 30 30 * * r 30 30 y _ l 5 ; And we repeat with new prime ; n is 1, so we delete it. We also delete current prime 31 1 _ l 31 31 _ _ l 32 32 1 _ l 32 32 _ _ l halt I used same principle as in Pólya conjecture checker

Divisor sum calculator
Again, just commented version as in Turing golf ; n is our number (input), d is current divisor to check ; Setup 0 1 1 l 1 1 _ _ l 2 2 _ 1 r 3 3 _ _ l 4 ; We try to fit copy of divisor to n 4 x x l 4 4 1 x r 5 4 _ _ r 8 5 x x r 5 5 _ _ r 6 6 x x r 6 6 1 x l 7 6 _ _ l 25 ; If unsuccesful, we must increase divisor by recycling states 18-20 7 x x l 7 7 _ _ l 4 ; If succeded, we check if we filled number 8 x 1 r 8 8 _ _ r 9 9 x x r 9 9 1 1 l 7 ; If we did not, we repeat 9 _ _ l 10 ; Otherwise, we have to copy divisor to far left 10 x 1 l 10 10 _ y l 11 11 1 x l 12 11 x x l 11 11 _ _ l 15 12 1 1 l 12 12 _ _ l 13 13 x x l 13 13 _ x r 14 13 1 1 l 12 14 * * r 14 14 y y l 11 15 * * l 15 15 x x l 16 16 x x l 16 16 _ _ r 17 17 x 1 r 17 17 * * r 17 17 y y l 18 ; We also have to increase divisor, because divisors don't form multiset 18 1 1 l 18 18 x 1 l 18 18 _ 1 l 19 19 1 _ l 18 19 _ _ r 20 20 * * r 20 20 y _ l c0 ; If d>n, then machine won't find any divisors, so we have to check that ; Otherwise, machine would loop to infinity ; This machine is made by Googleaarex, modified by me c0 1 1 l c0 c0 * * r c1 c1 1 x r c2 c1 _ _ r 21 ; If d<=n, we can repeat c2 1 1 r c2 c2 * * r c3 c3 1 1 r c3 c3 * * l c4 c4 1 x l c5 c4 _ x r 26 ; Otherwise, we can halt machine c5 1 1 l c5 c5 * * l c0 ; We must un-mark n and d before continuing 21 * * r 21 21 _ _ l 22 22 x 1 l 22 22 1 1 l 22 22 _ _ l 23 23 x x l 23 23 _ _ r 24 24 x 1 r 24 24 _ _ l 4 ; We must un-mark n before increasing divisor 25 x 1 l 25 25 _ y l 18 ; If we finished looking for divisors, we delete n and d and we add al divisors 26 x x r 26 26 _ _ l 27 27 x _ l 27 27 _ _ l 28 28 1 1 l 28 28 _ _ l 29 29 _ _ r halt 29 1 1 r 30 30 _ 1 r 31 31 1 1 r 31 31 _ _ l 32 32 1 _ l 28

Multiplication
I found out trying to improve Ikosarakt's ideas is kind of fun. Machine doesn't handle a<2 and/or b=0. ; To multiply a by b we write strings of 1's of length a and b and put blank between them ; We remove 1 from a 0 1 _ r 1 1 1 1 r 1 1 _ _ r 2 ; Now we copy b to third string, which at the beginning is empty ; At the same moment, we check if remains of b is one or more 2 _ _ r 2 2 1 _ r 3 3 1 1 r 4 3 _ _ r 9 ; If it is, we must restore b 4 1 1 r 4 4 _ _ r 5 5 1 1 r 5 5 _ 1 l 6 6 1 1 l 6 6 _ _ l 7 7 _ _ l 7 7 1 1 l 8 8 1 1 l 8 8 _ _ r 2 ; Number of blanks between 1st and 3rd string is always b+2 ; We skip first blank and write b+1 ones on tape 9 1 1 r 9 9 _ 1 l 10 10 1 1 l 10 10 _ _ l 11 11 _ 1 l 11 11 1 1 r 12 ; We remove one unneeded 1 12 1 _ l 13 ; We check if remains of a is 1 or not 13 1 1 l 14 14 1 1 l 15 14 _ _ r 16 ; If it is, we are nearly at the end 15 1 1 l 15 15 _ _ r 0 ; Otherwise, we repeat from beginning ; Now tape is 1 (b 1's) (a*(b-1) 1's) ; If we delete leftmost 1 and connect 2nd and 3rd string, we get a*b 16 1 _ r 16 16 _ _ r 17 17 _ _ r 17 17 1 _ r 18 18 1 1 r 18 18 _ 1 l halt

Improved version
I swear! I found this one by accident! I tried to make separated copies of input, but something went wrong 0 1 _ r 1 0 _ _ r 9 1 1 1 r 1 1 _ _ r 2 2 1 _ r 3 2 _ _ l 7 3 1 1 r 3 3 _ _ r 4 4 1 1 r 4 4 _ 1 l 5 5 1 1 l 5 5 _ _ l 6 6 1 1 l 6 6 _ 1 r 2 7 1 1 l 7 7 _ _ l 8 8 1 1 l 8 8 _ _ r 0 9 1 _ r 9 9 _ _ r halt

List multiplication
Guess which Turing golf challenge I'm going to solve with help of this machine. Input format: (a1) (a2)...(an)  (b1) (b2)...(bn) where (m) means string of m 1's. Output: (a1*b1) (a2*b2)...(an*bn) 0 1 _ r 13 0 _ _ r halt 1 1 1 r 1 1 _ _ r 2 2 1 1 r 1 2 _ _ r 14 3 1 1 r 3 3 _ _ r 4 4 1 1 r 3 4 _ _ r 5 5 1 1 r 5 5 _ 1 l 6 6 1 1 l 6 6 _ _ l 7 7 _ _ l 8 8 1 1 l 8 8 _ _ l 9 9 1 1 l 8 9 _ _ l 31 10 1 1 l 10 10 _ _ l 11 10 x x r 15 11 1 1 l 10 11 _ _ r 12 12 _ _ r 0 13 _ x r 2 13 1 1 r 1 14 _ _ r 14 14 1 1 r 3 15 1 1 r 15 15 _ _ r 16 16 1 1 r 15 16 _ _ r 32 17 _ _ r 23 17 1 x r 18 18 1 1 r 18 18 _ _ r 19 19 1 1 r 18 19 _ _ r 20 20 1 1 r 20 20 _ _ r 21 21 1 1 r 21 21 _ 1 l 22 22 * * l 22 22 x _ r 17 23 1 1 r 23 23 _ _ r 24 24 1 1 r 23 24 _ x r m0 m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r 25 25 1 1 r 25 25 _ _ l 26 26 1 _ l 27 27 1 1 l 27 27 _ 1 r 25 27 x 1 r 28 28 1 1 r 28 28 _ _ l 29 29 1 _ l 30 30 * * l 30 30 x _ r 0 31 _ _ l 31 31 1 1 l 10 31 x x r 32 32 _ _ r 32 32 1 x r 18

Taking number to arbitrary power
Given input (a) (b) calculates b^a

Edit: machine fixed for a<3 0 1 1 l 0a 0 _ _ r 19 0a _ x r 0b 0b 1 _ r 1 1 1 _ r 21 1 _ _ r 10 1 x _ r 11 2 * * r 2 2 _ _ r 3 3 1 _ r 4 3 x _ l 8 4 1 1 r 4 4 _ x r 5 4 x x r 5 5 1 1 r 5 5 _ 1 l 6 6 1 1 l 6 6 * * l 7 7 1 1 l 7 7 _ 1 r 3 8 1 1 l 8 8 x x l 8 8 _ x l 9 9 1 1 l 8 9 _ _ r 10 10 x _ r 1 10 1 1 l 20 11 1 1 r 11 11 x _ r 11 11 _ _ l 12 12 1 1 l 12 12 _ _ r m0 m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r 13 13 1 1 r 13 13 _ _ l 14 14 1 _ l 15 15 1 1 l 15 15 _ 1 l 16 16 1 1 r 17 16 _ _ r 13 16 x _ r 18 17 1 _ l 12 18 1 _ r halt 19 1 _ r 19 19 _ 1 r halt 20 * * l 20 20 x _ r halt 21 * * r 2 21 _ x r 3

Factorial
We can reduce machine by 2 states, if we allow it to don't handle number 1 (and no else). In second transition we have to replace x0 with 1, so states x will never be used ; First part of setup 0 _ 1 r halt 0 1 1 r x0 1 _ _ l 2 2 _ 1 r 3 3 _ _ r s0 ; We must check if n is 1, if it is, machine runs infinitely x0 _ _ l halt x0 1 1 l x1 x1 1 1 l 1 ; Second part of setup. This is my string duplication machine s0 1 _ r s1 s0 _ _ r 4 s1 1 1 r s1 s1 _ _ r s2 s2 1 1 r s2 s2 _ 1 l s3 s3 1 1 l s3 s3 _ _ l s4 s4 1 1 l s4 s4 _ 1 r s0 ; After duplication we have to delete 1 from second string 4 1 1 r 4 4 _ _ l 5 5 1 _ l 6 5 _ _ l 7 ; If smaller string is 1, we end setup 6 1 1 l 6 6 _ _ r s0 ; Else we duplicate smaller string etc. ; We move left until we find string 11 1 7 _ _ l 8 8 1 1 l 9 8 _ 1 l halt 9 _ _ l 10 10 1 1 l 10 ; This state is also used to move to next multiplication 10 _ _ r m0 ; This is my multiplication machine m0 1 _ r m1 m1 1 1 r m1 m1 _ _ r m2 m2 _ _ r m2 m2 1 _ r m3 m3 1 1 r m4 m3 _ _ r m9 m4 1 1 r m4 m4 _ _ r m5 m5 1 1 r m5 m5 _ 1 l m6 m6 1 1 l m6 m6 _ _ l m7 m7 _ _ l m7 m7 1 1 l m8 m8 1 1 l m8 m8 _ _ r m2 m9 1 1 r m9 m9 _ 1 l m10 m10 1 1 l m10 m10 _ _ l m11 m11 _ 1 l m11 m11 1 1 r m12 m12 1 _ l m13 m13 1 1 l m14 m14 1 1 l m15 m14 _ _ r m16 m15 1 1 l m15 m15 _ _ r m0 m16 1 _ r m16 m16 _ _ r m17 m17 _ _ r m17 m17 1 _ r m18 m18 1 1 r m18 m18 _ 1 l 11 ; We have to move multiplication product to the left 11 1 1 l 11 11 _ _ l 12 12 1 1 l 13 12 _ _ r 14 13 1 1 r 10 ; Now we move to next number and multiply again 13 _ _ r 17 ; If there is no more numbers, we delete setup 14 _ 1 r 15 15 1 1 r 15 15 _ _ l 16 16 1 _ l 11 ; After deleting setup we halt 17 1 _ r halt

How to compute n(3)
This is my try to compute n(3). Here are needed elements and ready machine

String subsequence determiner
I improved Ikosarakt's design, and I think I improved it much. It works for any number of characters, for n characters it uses 5+2*n states, and has simplier input: write sequence we search for and sequence being search space. ; First machine checks what is first symbol on subsequence we search for 0 a _ r 1a 0 b _ r 1b 0 c _ r 1c 0 | _ r 4 ; If we found whole subsequence, we want to mark it ; Next five transitions repeat for every character 1a * * r 1a 1a _ | r 2a ; We search for blank space marking where we finished our search 2a * * r 2a 2a a _ l 3 ; If we find charachter we look for, we return to the beginning 2a _ _ l 6 ; Otherwise, there is no subsequence we need. We clear tape 1b * * r 1b 1b _ | r 2b 2b * * r 2b 2b b _ l 3 2b _ _ l 6 1c * * r 1c 1c _ | r 2c 2c * * r 2c 2c c _ l 3 2c _ _ l 6 3 * * l 3 3 _ _ r 0 ; This transitions looks for beginning of tape. Then we repeat 4 * _ r 4 4 _ _ r 5 5 * _ r 5 5 _ | l halt ; We clear tape, leaving '|' meaning 'subsequence found' 6 * _ l 6 6 _ _ r halt ; We clear tape, leaving nothing Note: this machine uses lemma I found - consider sequences \(a_1a_2...a_n\) and \(b_1b_2...b_m\). Search algorithm is as this: find smallest \(k_1\) such that \(a_1=b_{k_1}\). Now find smallest \(k_2>k_1\) such that \(a_2=b_{k_2}\) etc. We call sequence \(b_{k_1}b_{k_2}...b_{k_n}\) (if it exists) a minimal subsequence. If minimal subsequence exists, it is isomorphic to a, so a is subsequence of b. Lemma states inverse relation holds: if a is subsequence of b, there exists minimal subsequence.

Challenge: prove this lemma

Dividing string into elements to compare
For every n it gives, from given input, substring (n,2n). This is designed for 3 characters: a,b,c. Every character has a replacement - x,y,z, respectively. To add new character, for every transition containing a or x replace them with appropriate character or replacement. 0 * * r 0 0 _ _ r 1 1 _ 1 r 2 2 _ 1 l 3 3 1 1 l 3 3 _ _ l 4 4 * * l 4 4 _ _ r 5 5 a _ r 6a 6a * * r 6a 6a 1 a l 8 6a _ _ r 7a 7a _ 1 l 12 7a 1 a l 8 7a * * r 6a 5 b _ r 6b 6b * * r 6b 6b 1 b l 8 6b _ _ r 7b 7b _ 1 l 12 7b 1 b l 8 7b * * r 6b 5 c _ r 6c 6c * * r 6c 6c 1 c l 8 6c _ _ r 7c 7c _ 1 l 12 7c 1 c l 8 7c * * r 6c 8 * * l 8 8 _ _ l 9' 8 x x l 9 8 y y l 9 8 z z l 9 9 _ _ r 10 9 x x r 10 9 y y r 10 9 z z r 10 9 * * l 8 9' _ _ r 10 9' x _ l 21 9' y _ l 21 9' z _ l 21 9' * * l 8 10 _ _ r 11 10 x x r 11 10 y y r 11 10 z z r 11 11 a x r 6a 11 b y r 6b 11 c z r 6c 12 1 1 l 12 12 _ _ l 13 13 x x l 13 13 y y l 13 13 z z l 13 13 a x r 14 13 b y r 14 13 c z r 14 13 _ _ r 16 14 x x r 14 14 y y r 14 14 z z r 14 14 _ _ r 15 15 1 1 r 15 15 _ 1 l 12 16 * * r 16 16 _ _ l 17 17 x a l 17 17 y b l 17 17 z c l 17 17 _ _ l 18 18 x a l 18 18 y b l 18 18 z c l 18 18 * * l 18 18 _ _ l 19 19 _ _ r 20 19 * * l 18 19 x a l 18 19 y b l 18 19 z c l 18 20 _ _ r 5 21 x _ l 21 21 y _ l 21 21 z _ l 21 21 _ _ r 22 22 _ _ r 22 22 a a r 23 22 b b r 23 22 c c r 23 23 a a r 23 23 b b r 23 23 c c r 23 23 _ _ r 24 24 _ _ l halt 24 a a r 23 24 b b r 23 24 c c r 23 23 1 1 r 25 25 1 1 r 25 25 _ _ l 26 26 * _ l 26 26 _ _ l halt

Property * determiner
As defined by Friedman, set of strings has property * iff for no two strings this set one is subsequence of another. ​0 a x r 1a 0 b y r 1b 0 c z r 1c 0 | _ * halt 0 _ | * halt 1a * * r 1a 1a _ | r 2a 1a x m r 2a 1a y n r 2a 1a z o r 2a 2a * * r 2a 2a a x l 3 2a _ _ r 4a 1b * * r 1b 1b _ | r 2b 1b x m r 2b 1b y n r 2b 1b z o r 2b 2b * * r 2b 2b b y l 3 2b _ _ r 4a 1c * * r 1c 1c _ | r 2c 1c x m r 2c 1c y n r 2c 1c z o r 2c 2c * * r 2c 2c c z l 3 2c _ _ r 4a 3 * * l 3 3 _ _ r 0 3 x x r 0 3 y y r 0 3 z z r 0 4a _ _ l 6 4a * * l 4 4 a m l 4 4 x m l 4 4 b n l 4 4 y n l 4 4 c o l 4 4 z o l 4 4 * * l 4 4 | | l 5 5 x a l 5 5 y b l 5 5 z c l 5 5 * * l 5 5 _ _ r 0 6 _ _ l 7 7 m a l 7 7 x a l 7 7 n b l 7 7 y b l 7 7 o c l 7 7 z c l 7 7 | _ l 7 7 _ _ r 8 7 * * l 7 8 * _ r 8 8 _ _ r 0

Friedman string recognizer
String \(x_1x_2x_3...\) is called Friedman string iff set \(\lbrace x_1x_2,x_2x_3x_4,x_3x_4x_5x_6,...\) has property * (look above) 0 * * r 0 0 _ _ r 1 1 _ 1 r 2 2 _ 1 l 3 3 1 1 l 3 3 _ _ l 4 4 * * l 4 4 _ _ r 5 5 a _ r 6a 6a * * r 6a 6a 1 a l 8 6a _ _ r 7a 7a _ 1 l 12 7a 1 a l 8 7a * * r 6a 5 b _ r 6b 6b * * r 6b 6b 1 b l 8 6b _ _ r 7b 7b _ 1 l 12 7b 1 b l 8 7b * * r 6b 5 c _ r 6c 6c * * r 6c 6c 1 c l 8 6c _ _ r 7c 7c _ 1 l 12 7c 1 c l 8 7c * * r 6c 8 * * l 8 8 _ _ l 9' 8 x x l 9 8 y y l 9 8 z z l 9 9 _ _ r 10 9 x x r 10 9 y y r 10 9 z z r 10 9 * * l 8 9' _ _ r 10 9' x _ l 21 9' y _ l 21 9' z _ l 21 9' * * l 8 10 _ _ r 11 10 x x r 11 10 y y r 11 10 z z r 11 11 a x r 6a 11 b y r 6b 11 c z r 6c 12 1 1 l 12 12 _ _ l 13 13 x x l 13 13 y y l 13 13 z z l 13 13 a x r 14 13 b y r 14 13 c z r 14 13 _ _ r 16 14 x x r 14 14 y y r 14 14 z z r 14 14 _ _ r 15 15 1 1 r 15 15 _ 1 l 12 16 * * r 16 16 _ _ l 17 17 x a l 17 17 y b l 17 17 z c l 17 17 _ _ l 18 18 x a l 18 18 y b l 18 18 z c l 18 18 * * l 18 18 _ _ l 19 19 _ _ r 20 19 * * l 18 19 x a l 18 19 y b l 18 19 z c l 18 20 _ _ r 5 21 x _ l 21 21 y _ l 21 21 z _ l 21 21 _ _ r 22 22 _ _ r 22 22 a a r 23 22 b b r 23 22 c c r 23 23 a a r 23 23 b b r 23 23 c c r 23 23 _ _ r 24 24 _ _ l 27 24 a a r 23 24 b b r 23 24 c c r 23 23 1 1 r 25 25 1 1 r 25 25 _ _ l 26 26 * _ l 26 26 _ _ l 27 c0 a x r c1a c0 b y r c1b c0 c z r c1c c0 | _ * halt c0 _ | * halt c1a * * r c1a c1a _ | r c2a c1a x m r c2a c1a y n r c2a c1a z o r c2a c2a * * r c2a c2a a x l c3 c2a _ _ r c4a c1b * * r c1b c1b _ | r c2b c1b x m r c2b c1b y n r c2b c1b z o r c2b c2b * * r c2b c2b b y l c3 c2b _ _ r c4a c1c * * r c1c c1c _ | r c2c c1c x m r c2c c1c y n r c2c c1c z o r c2c c2c * * r c2c c2c c z l c3 c2c _ _ r c4a c3 * * l c3 c3 _ _ r c0 c3 x x r c0 c3 y y r c0 c3 z z r c0 c4a _ _ l c6 c4a * * l c4 c4 a m l c4 c4 x m l c4 c4 b n l c4 c4 y n l c4 c4 c o l c4 c4 z o l c4 c4 * * l c4 c4 | | l c5 c5 x a l c5 c5 y b l c5 c5 z c l c5 c5 * * l c5 c5 _ _ r c0 c6 _ _ l c7 c7 m a l c7 c7 x a l c7 c7 n b l c7 c7 y b l c7 c7 o c l c7 c7 z c l c7 c7 | _ l c7 c7 _ _ r c8 c7 * * l c7 c8 * _ r c8 c8 _ _ r c0 27 * * l 27 27 _ _ l 28 28 * * l 27 28 _ _ r 29 29 _ _ r c0

n(3) calculator
Putting everything together was easier than I thought. ; Tape consists of current length, current string and work space ; Machine checks every length until it can't find Friedman string of given length ; Setup is of form 'we already checked length 1' 0 _ 1 r w0 ; When we find Friedman string of current length, we clear current string and work space w0 _ _ l w0 w0 * _ l w0 w0 1 1 r s1 ; We increase length by 1 and at the same moment we create string of a's s0 1 _ r s1 s0 _ _ r d0 s1 1 1 r s1 s1 _ _ r s2 s2 a a r s2 s2 _ a l s3 s3 a a l s3 s3 _ _ l s4 s4 1 1 l s4 s4 _ 1 r s0 ; If current string isn't Friedman string we try lexicographically next one r0 _ _ r r1 r0 * _ r r0 r1 * _ r r0 r1 _ _ l r2 r2 _ _ l r2 r2 * _ l r2 r2 a a l r3 r2 b b l r3 r2 c c l r3 r3 * * l r3 r3 _ _ r i0 ; Strings are checked lexicographically, so we can use ternary counter i0 a b l i1 i0 b c l i1 i0 c a r i0 i0 _ _ l h0 i1 * * l i1 i1 _ _ r d0 ; If ccc...c wasn't Friedman string, none of given length is ; We clear current string and decrease output by 1, so we get n(3) h0 * _ l h0 h0 1 _ l halt ; We duplicate current string to work space d0 _ _ r 0' d0 a x r da0 da0 * * r da0 da0 _ _ r da1 da1 * * r da1 da1 _ a l d2 d0 b y r db0 db0 * * r db0 db0 _ _ r db1 db1 * * r db1 db1 _ b l d2 d0 c z r dc0 dc0 * * r dc0 dc0 _ _ r dc1 dc1 * * r dc1 dc1 _ c l d2 d2 * * l d2 d2 _ _ l d3 d3 * * l d3 d3 x a r d0 d3 y b r d0 d3 z c r d0 ; We divide string x1x2x3... into x1x2,x2x3x4,... 0' * * r 0' 0' _ _ r 1 1 _ 1 r 2 2 _ 1 l 3 3 1 1 l 3 3 _ _ l 4 4 * * l 4 4 _ _ r 5 5 a _ r 6a 6a * * r 6a 6a 1 a l 8 6a _ _ r 7a 7a _ 1 l 12 7a 1 a l 8 7a * * r 6a 5 b _ r 6b 6b * * r 6b 6b 1 b l 8 6b _ _ r 7b 7b _ 1 l 12 7b 1 b l 8 7b * * r 6b 5 c _ r 6c 6c * * r 6c 6c 1 c l 8 6c _ _ r 7c 7c _ 1 l 12 7c 1 c l 8 7c * * r 6c 8 * * l 8 8 _ _ l 9' 8 x x l 9 8 y y l 9 8 z z l 9 9 _ _ r 10 9 x x r 10 9 y y r 10 9 z z r 10 9 * * l 8 9' _ _ r 10 9' x _ l 21 9' y _ l 21 9' z _ l 21 9' * * l 8 10 _ _ r 11 10 * * r 11 11 a x r 6a 11 b y r 6b 11 c z r 6c 12 1 1 l 12 12 _ _ l 13 13 * * l 13 13 a x r 14 13 b y r 14 13 c z r 14 13 _ _ r 16 14 * * r 14 14 _ _ r 15 15 1 1 r 15 15 _ 1 l 12 16 * * r 16 16 _ _ l 17 17 x a l 17 17 y b l 17 17 z c l 17 17 _ _ l 18 18 x a l 18 18 y b l 18 18 z c l 18 18 * * l 18 18 _ _ l 19 19 _ _ r 20 19 * * l 18 19 x a l 18 19 y b l 18 19 z c l 18 20 _ _ r 5 21 * _ l 21 21 _ _ r 22 22 _ _ r 22 22 * * r 23 23 * * r 23 23 _ _ r 24 24 _ _ l 27 24 * * r 23 23 1 1 r 25 25 1 1 r 25 25 _ _ l 26 26 * _ l 26 26 _ _ l 27 27 * * l 27 27 _ _ l 28 28 * * l 27 28 _ _ r 29 29 _ _ r c0 ; Now we check if that set has property * c0 a x r c1a c0 b y r c1b c0 c z r c1c c0 1 _ l r0 c0 _ _ l w0 c1a * * r c1a c1a _ 1 r c2a c1a x m r c2a c1a y n r c2a c1a z o r c2a c2a * * r c2a c2a a x l c3 c2a _ _ r c4a c1b * * r c1b c1b _ 1 r c2b c1b x m r c2b c1b y n r c2b c1b z o r c2b c2b * * r c2b c2b b y l c3 c2b _ _ r c4a c1c * * r c1c c1c _ 1 r c2c c1c x m r c2c c1c y n r c2c c1c z o r c2c c2c * * r c2c c2c c z l c3 c2c _ _ r c4a c3 * * l c3 c3 _ _ r c0 c3 x x r c0 c3 y y r c0 c3 z z r c0 c4a _ _ l c6 c4a * * l c4 c4 a m l c4 c4 x m l c4 c4 b n l c4 c4 y n l c4 c4 c o l c4 c4 z o l c4 c4 * * l c4 c4 1 1 l c5 c5 x a l c5 c5 y b l c5 c5 z c l c5 c5 * * l c5 c5 _ _ r c0 c6 _ _ l c7 c7 m a l c7 c7 x a l c7 c7 n b l c7 c7 y b l c7 c7 o c l c7 c7 z c l c7 c7 1 _ l c7 c7 _ _ r c8 c7 * * l c7 c8 * _ r c8 c8 _ _ r c0 If someone counts states and colors, we'll have bound \(n(3)<\Sigma(s,c)\), although this bound is crushed by machine below (less states, less colors, much larger output).

How to modify machine to compute n(k)
Here I'll add character p with replacement q and second replacement r. You can add this exact ruleset and modify counter to compute n(4) easily. To add one character we need 3 new states.

Adding character consists of 2 steps: we need additional ruleset to handle new state: r2 p p l r3 d0 p q r dp0 dp0 * * r dp0 dp0 _ _ r dp1 dp1 * * r dp1 dp1 _ p l d2 d3 q p r d0 5 p _ r 6p 6p * * r 6p 6p 1 p l 8 6p _ _ r 7p 7p _ 1 l 12 7p 1 p l 8 7p * * r 6p 8 q q l 9 9 q q r 10 9' q _ l 21 11 p q r 6p 13 p q r 14 17 q p l 17 18 q p l 18 19 q p l 18 c0 p q r c1p c1a p r r c2a c1b p r r c2a c1c p r r c2a c1p * * r c1p c1p _ 1 r c2p c1p x m r c2p c1p y n r c2p c1p z o r c2p c1p p r r c2p ; You have to add similar transition for every character you add c2p * * r c2p c2p p q l c3 c2p _ _ r c4a c3 q q r c0 c4 p r l c4 c4 q r l c4 c5 q p l c5 c7 r p l c7 c7 q p l c7 Explanation of comment - if you already added, say, t with 2nd replacement u, we also need  c1p t u r c2p.

Secondly, we need to introduce new character. We must modify ternary counter like that: i0 a b l i1 i0 b c l i1 i0 c d l i1 i0 d e l i1 ... i0 p a r i0 It must cycle through all characters you want to use. Order is irrelevant.

Modified Goucher's T(n)
This is essentially same function as T(n)  function by Adam Goucher. However, in my machine, c is increased also when we delete trailing 0's.

This function is almost certainly at growth level of \(f_{\varepsilon_0}(n)\). If it is, then, as far as I know, it is first machine which is halting for every input such that it's halting isn't provable in Peano Arithmetic ; Let the number multiplier (number to the left of !) be denoted c ; Setup - state 2 is missing because it was unnecesarry and I forgot to change ordering 0 1 1 l 1 1 _ ! l 3 3 _ x r 4 ; First machine travels to rightmost number and checks if it's 0 ; If it is, number is deleted and we increase c ; Above is only difference between this and Goucher's function 4 x x r 4 4 ! ! r 5 4 _ _ r 5 5 1 1 r 5 5 _ _ r 6 6 1 1 r 5 6 _ _ l 7 7 _ _ l 7 7 1 _ l 8 8 _ _ l 9 8 1 1 l 11 8 ! 1 l 2 ; If there is no numbers, we can halt 9 * * l 9 9 x x l 10 10 x x l 10 10 _ x r 4 ; We seek for first number from right smaller than rightmost number ; In original problem, numbers to the left of it are called R ; Every time we copy only R-1 11 1 1 l 11 11 _ _ l 12 11 ! | l 19 ; If there is only one number, we copy just it 12 * * l 12 12 1 1 l 13 13 1 1 l 13 13 * * r c1 ; We find R by comparing rightmost number with all number to its left ; This is again modified Aarex's machine c0 1 1 l c0 c0 * * r c1 c0 y y l c5 c1 1 x r c2 c1 * | l 27 ; If we find smaller number, we proceed c2 1 1 r c2 c2 y y r c2 c2 * * r c3 c3 1 1 r c3 c3 y y r c2 c3 * * l c4 c4 1 x l c5 c4 * _ r 14 ; If given number isn't smaller, we'll check next one c5 1 1 l c5 c5 y y l c5 c5 * * l c0 ; We replace number we just compared with y's and we ignore it for now 14 x x r 14 14 _ _ l 15 15 x 1 l 15 15 y y l 15 15 _ _ l 16 16 x y l 16 16 1 y l 16 16 y y l 15 16 _ _ l 13 16 ! ! r 17 ; If there are no smaller numbers, whole string is R and we copy it 17 y 1 r 17 17 _ _ r 17 17 1 1 l 18 18 * * l 18 18 ! | l 19 19 x x l 19 19 _ _ r 20 ; These are setup states for duplication 20 x y r 21 20 _ _ r 23 21 x x r 21 21 _ _ r 22 21 | | r d0 22 * * r 22 22 | | r d0 ; Here is most imprtant part - we copy everything to the right of '|' ; At the end we have c+1 copies of R-1 d0 1 x r d1 d0 _ y r d8 d0 | | r d11 d1 1 1 r d1 d1 _ _ r d2 d1 | | r d6 d2 1 1 r d1 d2 _ 1 l d3 d3 _ | r d4 d4 1 1 r d4 d4 _ | l d5 d5 * * l d5 d5 x x r d0 d5 y y r d0 d6 * * r d6 d6 | 1 r d7 d7 _ | l d5 d8 * * r d8 d8 | | r d9 d9 * * r d9 d9 | _ r d10 d10 _ | l d5 d11 * * r d11 d11 | _ l d12 d12 * * l d12 d12 | | l d13 d13 x 1 l d13 d13 y _ l d13 d13 | _ l d14 d14 * * l d14 d14 y y r 20 ; After copying we can start everything all over again 23 * * r 23 23 | _ l 24 24 * * l 24 24 y y l 25 25 y y l 25 25 _ x r 26 26 y x r 26 26 _ ! r 5 ; After finding smaller number, we prepare everything for copying 27 x x l 27 27 _ _ r 28 28 x 1 r 28 28 | | r 29 29 y 1 r 29 29 _ _ r 29 29 x 1 r 30 30 x 1 r 30 30 _ _ l 31 31 * * l 31 31 ! _ l 19 ; Missing state 2 is used to replace multiplier with output 2 x 1 l 2 2 _ _ r halt

Kirby-Paris hydra game
This time we can construct function which certainly does grow at level of \(f_{\varepsilon_0}(n)\) (previous machine hasn't been proven to do that, although it seems sure).

This machine isn't computing actual function, it only collapses hydra, output must be of form ))...) A, where ))...) is 1 or more right parentheses and A is any tree in parenthesis form without outermost pair (i.e. root)

3-color version
; Number to the left is multiplier ; Machine runs to the right of hydra 0 * * r 0 0 _ _ r 1 1 * * r 1 1 _ _ l 2 ; Machine deletes rightmost )'s until it finds pair - rightmost head 2 ) _ l 3 2 _ _ l halt ; If there are no nodes left, hydra is dead 3 ( _ l 42 ; If rightmost head was child of node, we don't have to copy anything 3 ) _ l 4 4 ) _ l 4 4 ( _ r 5 ; Machine finds smallest pair enclosing head we cut ; We do it by 'balance searching' : We look for rightmost parenthesis such that everything to its right is balanced 5 _ ) r 6 6 * * r 6 6 _ _ r 7 7 ( ( r 7 7 _ ( l 8 8 ( ( l 8 8 _ _ l 9 9 * * l 9 9 _ _ l 10 10 ) _ r 5 10 ( _ r 11 11 _ ( r 12 12 * * r 12 12 _ _ r 13 13 ( ( r 13 13 _ _ l 14 14 ( _ l 15 15 ( ( l 8 15 _ _ l 16 ; We'll make that many copies as multiplier says 16 * * l 16 16 _ _ l 17 17 * * l 17 17 _ _ l 18 18 ) ) l 18 18 r 19 18 _ ) r 19 ; This increases multiplier for next run 19 ) ( r 20 19 _ _ r 22 ; If multiplier is used, we must put one hydra into one piece 20 ) ) r 20 20 _ _ r 21 21 * * r 21 21 _ _ r c0 ; This part makes one copy c0 ( _ l (1 c0 ) _ l )1 c0 _ ( r c3 (1 _ ( r (2 (2 _ _ r (3 (3 * * r (3 (3 _ _ r (4 (4 * * r (4 (4 _ ( l c1 )1 _ ) r )2 )2 _ _ r )3 )3 * * r )3 )3 _ _ r )4 )4 * * r )4 )4 _ ) l c1 c1 * * l c1 c1 _ _ l c2 c2 * * l c2 c2 _ _ r c0 c3 ( ( r c3 c3 ) ) l c4 c4 r c5 c5 ) ) r c5 c5 ( ( l c6 c5 _ _ l c7 c6 ) ( r c3 c7 ) _ l 16 ; We put hydra in one piece, but it still lacks rightmost )'s  22 ( _ r 23 23 ( ( r 23 23 ) ( r 24 24  r 23 24 ) ) r 24 24 _ ) l 25 ; We check parenthesis ony-by-one to check, how many )'s we need 25 * * l 25 25 _ _ r 26 26 ( _ l 27 26 ) _ l 32 26 _ ) l 38 27 _ ( r 28 28 _ _ r 29 29 * * r 29 29 _ _ r 30 30 ) ) r 30 30 _ ) l 31 31 ) ) l 31 31 _ _ l 25 32 _ ) r 33 33 _ _ r 34 34 * * r 34 34 _ _ r 35 35 * * r 35 35 _ _ l 36 36 ) _ l 37 37 * * l 37 37 _ _ l 25 ; When machine finishes, it puts hydra ready for next cut 38 _ ) r 39 39 * * r 39 39 _ _ l 40 40 ) _ l 41 41 ) _ l 2 ; Now it's only left to setup new multiplier to work 42 * * l 42 42 _ _ l 43 43 ) ) l 43 43 _ ) r 0

Heavily improved version!
I noticed one thing - previous machine at the beginning deletes rightmost )'s and later reconstructs them. So even if at the beginning they were unbalanced, they'd balance by themselves. So they are theoretically unnecessary. This version has lost 15 states thanks to this!

Now input must have ('s at the beginning instead of )'s, and it doesn't need rightmost )'s (e.g. ( (()) is equivalent to ( (( 0 * * r 0 0 _ _ r 1 1 * * r 1 1 _ _ l 2 2 * _ l 2 2 ( _ r 5 3 _ _ r 4 4 ( ( r 4' 4 ) _ r 27 4' * * r 4' 4' _ _ r 2 5 _ ) r 6 6 * * r 6 6 _ _ r 7 7 ) ) r 7 7 _ ) l 8 8 ) ) l 8 8 _ _ l 9 9 * * l 9 9 _ _ l 10 10 ) _ r 5 10 ( _ r 11 10 _ ( r 3 11 _ ( r 12 12 * * r 12 12 _ _ r 13 13 ) ) r 13 13 _ _ l 14 14 ) _ l 15 15 ) ) l 8 15 _ _ l 16 16 * * l 16 16 _ _ l 17 17 * * l 17 17 _ _ l 18 18 ( ( l 18 18 ) ( r 19 18 _ ( r 19 19 r 20 19 _ _ r 22 20 ( ( r 20 20 _ _ r 21 21 * * r 21 21 _ _ r c0 c0 ( _ l (1 c0 ) _ l )1 c0 _ ( r c3 (1 _ ( r (2 (2 _ _ r (3 (3 * * r (3 (3 _ _ r (4 (4 * * r (4 (4 _ ( l c1 )1 _ ) r )2 )2 _ _ r )3 )3 * * r )3 )3 _ _ r )4 )4 * * r )4 )4 _ ) l c1 c1 * * l c1 c1 _ _ l c2 c2 * * l c2 c2 _ _ r c0 c3 ( ( r c3 c3 ) ) l c4 c4 r c5 c5 ) ) r c5 c5 ( ( l c6 c5 _ _ l c7 c6 ) ( r c3 c7 ) _ l 16 22 * * r 22 22 _ _ r 23 23 * * r 23 23 _ _ l 24 24 ) _ l 25 25 ) ) l 25 25 l 26 26 ) ( l 25 26 ( ( l 26 26 _ ( r 1 27 _ _ r 27 27 ) _ l halt Using just 2 states this can be converted to function comparable with \(f_{\varepsilon_0}(n)\)!

7-color version
About half as many states, about twice as many colors 0 * * r 0 0 _ _ r 1 1 * * r 1 1 ] ) r 1 1 _ _ l 2 2 ) _ l 3 2 _ _ l halt 3 ( _ l 30 3 ) _ l 4 4 ) _ l 4 4 ( ] r 5 5 * * r 5 5 _ ) l 6 6 * * l 6 6 ] ] l 7 7 * * l 7 7 ) ] r 5 7 ( [ r 8 8 * * r 8 8 _ _ l 9 9 ) _ l 10 10 ) ) l 6 10 ] ) l 11 11 ] ) l 11 11 [ ( l 11 11 ) > l 11 11 ( < l 11 11 _ _ l 12 12 ) ) l 12 12 * ) r 13 13 ) ( r 14 13 _ _ r 22 14 * * r 14 14 _ _ r 15 15 ( [ r 16 15 ) ] r 17 15 * * r 15 16 * * r 16 16 _ [ l 18 17 * * r 17 17 _ ] l 18 18 [ [ l 18 18 ] ] l 18 18 * * l 19 19 * * l 19 19 [ ( r 15 19 ] ) r 15 19 < < r 20 19 > > r 20 19 _ _ r 20 20 * * r 20 20 ] ) l 21 21 * * l 21 21 _ _ l 12 21 < < l 21 21 > > l 21 22 * * r 22 22 > ) r 22 22 < ( r 22 22 _ _ l 23 23 [ ( l 23 23 ] ) l 23 23 * * l 23 23 _ _ r 24 24 ( [ r 25 24 ) ] r 26 25 * * r 25 25 _ ] l 28 26 * * r 26 26 _ _ l 27 27 ] _ l 28 28 * * l 28 28 ( ( l 29 28 ) ) l 29 29 * * l 29 29 _ _ r 1 29 [ ( r 24 29 ] ) r 24 30 * * l 30 30 _ _ l 31 31 * * l 31 31 _ ) r 0

Buchholz's hydra
Yes, I started work on Buchholz's hydra game. For now I'm not planning implementing whole game, rather just parts for machines or partial results. Never mind, I did it anyway :D

Important - every part of hydra not inside parenthesis (i.e. connected to root) must be inside pair. For example, is invalid, so is ([])[()]

Cutting 1-labelled head
If I'm able to extend one of above machines to cut heads while preserving [] pairs we'll be able to reach Bachmann-Howard ordinal! ; This part looks for rightmost head (for sake of this machine it MUST be [] pair) 0 * * r 0 0 _ _ l 1 1 ) ) l 1 1 ] ] l 1 1 [ ( r 2 ; From hydra behavior we know head will become 2 ] x r 3 ; x marks where head was 3 ) ) r 3 3 ] ) r 4 4 ) ] r 3 4 ] ] r 4 3 _ ) l 5 4 _ ] l 5 5 * * l 5 5 x ) r 6 ; We search for 0-labelled node in hydra, i.e. ) parenthesis 6 ) ] r 7 7 ] ] r 7 7 ) x l 8 8 ] > l 13 ; Now, by balance searching, we look for part of hydra going to be copied 9 * * r 9 9 _ _ r 10 10 x x r 10 10 _ x l 11 11 * * l 11 11 _ _ l 12 12 * * l 12 12 x x l 13 13 * * l 13 13 ) > r 9 13 ] } r 9 13 ( < r 14 13 [ { r 14 14 * * r 14 14 _ _ r 15 15 * * r 15 15 _ _ l 16 16 x _ l 11 16 _ _ l 17 ; Now we copy it to the side 17 * * l 17 17 x x l 18 18 * * l 18 18 _ _ r 19 18 ( ( r 19 18 [ [ r 19 18 ) ) r 19 18 ] ] r 19 19 < ( r 0( 19 > ) r 0) 19 { [ r 0[ 19 } ] r 0] 19 x _ l 20 ; We have 2 states per parenthesis type to copy it 0( * * r 0( 0( _ _ r 1( 1( * * r 1( 1( _ ( l 17 0) * * r 0) 0) _ _ r 1) 1) * * r 1) 1) _ ) l 17 0[ * * r 0[ 0[ _ _ r 1[ 1[ * * r 1[ 1[ _ [ l 17 0] * * r 0] 0] _ _ r 1] 1] * * r 1] 1] _ ] l 17 ; Now we have to once again find reduced head 20 * * l 20 20 ( ( r 21 21 ) x r 22 22 ) ) r 22 22 ] ) r 23 22 _ ) r 24 23 ) ] r 22 23 ] ] r 23 ; ...putting hydra part into place 24 * * r 24 24 _ _ r 25 25 ( _ l (2 25 ) _ l )2 25 [ _ l [2 25 ] _ l ]2 25 _ _ l 29 ; Here one state per parenthesis was enough (2 * * l (2 (2 x ( r 26 )2 * * l )2 )2 x ) r 26 [2 * * l [2 [2 x [ r 26 ]2 * * l ]2 ]2 x ] r 26 26 ) x r 27 26 ] x r 28 27 ) ) r 27 27 ] ) r 28 27 _ ) r 24 28 ) ] r 27 28 ] ] r 28 ; Getting everything in place and stop 29 _ _ l 29 29 ) _ l 30 30 ) ) l 30 30 ] ) l 30 30 x ) l halt 31 ) ] l 30 31 ] ] l 30 31 x ] l halt

Cutting 0-labelled head
Now it should work well.

Input format: multiplier represented by string of x's followed by space and hydra ; Searching for head and deleting it 0 x x r 0 0 _ _ r 1 1 * * r 1 1 _ _ l 2 2 ) ) l 2 2 ] ] l 2 2 ( x r 3 3 ) x l 4 ; Balance searching 4 * * l 4 4 ) > r 5 4 ] } r 5 4 ( < r 8 4 [ { r 8 4 _ _ r 45 5 * * r 5 5 _ _ r 6 6 _ ( l 7 6 ( ( r 6 7 * * l 7 7 x x l 4 8 * * r 8 8 _ _ r 9 9 ( ( r 9 9 _ _ l 10 ; Setting everything for copying 10 ( _ l 7 10 _ _ l 11 11 * * l 11 11 x x l 12 12 * * l 12 12 ( ( r 13 12 ) ) r 13 12 [ [ r 13 12 ] ] r 13 12 _ _ r 13 13 < x r 14 13 { x r 15 14 < < r 14 14 { < r 15 14 > < r 16 14 } < r 17 14 x < r 18 15 < { r 14 15 { { r 15 15 > { r 16 15 } { r 17 15 x { r 18 16 < > r 14 16 { > r 15 16 > > r 16 16 } > r 17 16 x > r 18 17 < } r 14 17 { } r 15 17 > } r 16 17 } } r 17 17 x } r 18 18 x x r 18 18 ) x l 19 18 ] x l 20 19 x > l 22 20 x } l 22 ; We copy piece of hydra between x's as many times as multiplier says 22 * * l 22 22 _ _ l 23 23 x x l 23 23 _ _ r 24 23 > x r 24 24 x > r 25 24 _ x r 31 25 x x r 25 25 _ _ r 26 26 * * r 26 26 < ( r (0 26 { [ r [0 26 > ) r )0 26 } ] r ]0 26 _ _ l 29 27 * * l 27 27 _ _ l 28 28 * * l 28 28 _ _ r 26 ; We copy parentheses one-by-one (0 * * r (0 (0 _ _ r (1 (1 * * r (1 (1 _ ( l 27 [0 * * r [0 [0 _ _ r [1 [1 * * r [1 [1 _ [ l 27 )0 * * r )0 )0 _ _ r )1 )1 * * r )1 )1 _ ) l 27 ]0 * * r ]0 ]0 _ _ r ]1 ]1 * * r ]1 ]1 _ ] l 27 ; If we finished copy, we look if we need another (decrement multiplier) 29 x x l 30 29 * * l 29 30 ( < l 30 30 [ { l 30 30 ) > l 30 30 ] } l 30 30 x x l 22 ; If we don't, we set everything up for inserting hydra 31 ( _ r 32 31 x _ r 36 32 ( ( r 32 32 [ ( r 33 32 ) ( r 34 32 ] ( r 35 32 x ( r 36 33 ( [ r 32 33 [ [ r 33 33 ) [ r 34 33 ] [ r 35 33 x [ r 36 34 r 32 34 [ ) r 33 34 ) ) r 34 34 ] ) r 35 34 x ) r 36 35 ( ] r 32 35 [ ] r 33 35 ) ] r 34 35 ] ] r 35 35 x ] r 36 36 < ( r 36 36 { [ r 36 36 > ) r 36 36 } ] r 36 36 x x r 37 ; Same mechanism as for 1-labelled head deleting 37 * * r 37 37 _ _ r 38 38 ( _ l (2 38 [ _ l [2 38 ) _ l )2 38 ] _ l ]2 38 _ _ l 42 (2 * * l (2 (2 x ( r 39 [2 * * l [2 [2 x [ r 39 )2 * * l )2 )2 x ) r 39 ]2 * * l ]2 ]2 x ] r 39 39 ) x r 40 39 ] x r 41 39 _ x r 37 40 ) ) r 40 40 ] ) r 41 40 _ ) r 37 41 ) ] r 40 41 ] ] r 41 ; When finished, halt 42 _ _ l 42 42 ) _ l 43 42 x _ l halt 43 ) ) l 43 43 ] ) l 44 43 x ) l halt 44 ) ] l 43 44 ] ] l 44 44 x ] l halt ; In case deleted head is root child 45 < ( r 45 45 > ) r 45 45 { [ r 45 45 } ] r 45 45 x _ r 45 45 _ _ l 46 46 * * l 46 46 x x l 47 47 _ x r halt 47 * * l 47

(0,1)-labelled hydra game
I did it! I made hydra game on hydras labelled with 0's and 1's! If strength of these hydras is indeed Bachmann-Howard ordinal, I just made Turing machine undecidable within Kripke-Platek set theory!

Input format: multiplier represented by string of x's followed by space and hydra 0 x x r 0 0 _ _ r 1 1 * * r 1 1 _ _ l 2 2 ) ) l 2 2 ] ] l 2 2 ( x r 3 2 [ ( r 2' 2 _ _ l halt ; Deleting head 3 ) x l 4 4 * * l 4 4 ) > r 5 4 ] } r 5 4 ( < r 8 4 [ { r 8 4 _ _ r 45 5 * * r 5 5 _ _ r 6 6 _ ( l 7 6 ( ( r 6 7 * * l 7 7 x x l 4 8 * * r 8 8 _ _ r 9 9 ( ( r 9 9 _ _ l 10 10 ( _ l 7 10 _ _ l 11 11 * * l 11 11 x x l 12 12 * * l 12 12 ( ( r 13 12 ) ) r 13 12 [ [ r 13 12 ] ] r 13 12 _ _ r 13 13 < x r 14 13 { x r 15 14 < < r 14 14 { < r 15 14 > < r 16 14 } < r 17 14 x < r 18 15 < { r 14 15 { { r 15 15 > { r 16 15 } { r 17 15 x { r 18 16 < > r 14 16 { > r 15 16 > > r 16 16 } > r 17 16 x > r 18 17 < } r 14 17 { } r 15 17 > } r 16 17 } } r 17 17 x } r 18 18 x x r 18 18 ) x l 19 18 ] x l 20 19 x > l 22 20 x } l 22 22 * * l 22 22 _ _ l 23 23 x x l 23 23 _ _ r 24 23 > x r 24 24 x > r 25 24 _ x r 31 25 x x r 25 25 _ _ r 26 26 * * r 26 26 < ( r (0 26 { [ r [0 26 > ) r )0 26 } ] r ]0 26 _ _ l 29 27 * * l 27 27 _ _ l 28 28 * * l 28 28 _ _ r 26 (0 * * r (0 (0 _ _ r (1 (1 * * r (1 (1 _ ( l 27 [0 * * r [0 [0 _ _ r [1 [1 * * r [1 [1 _ [ l 27 )0 * * r )0 )0 _ _ r )1 )1 * * r )1 )1 _ ) l 27 ]0 * * r ]0 ]0 _ _ r ]1 ]1 * * r ]1 ]1 _ ] l 27 29 x x l 30 29 * * l 29 30 ( < l 30 30 [ { l 30 30 ) > l 30 30 ] } l 30 30 x x l 22 31 ( _ r 32 31 x _ r 36 32 ( ( r 32 32 [ ( r 33 32 ) ( r 34 32 ] ( r 35 32 x ( r 36 33 ( [ r 32 33 [ [ r 33 33 ) [ r 34 33 ] [ r 35 33 x [ r 36 34 r 32 34 [ ) r 33 34 ) ) r 34 34 ] ) r 35 34 x ) r 36 35 ( ] r 32 35 [ ] r 33 35 ) ] r 34 35 ] ] r 35 35 x ] r 36 36 < ( r 36 36 { [ r 36 36 > ) r 36 36 } ] r 36 36 x x r 37 37 * * r 37 37 _ _ r 38 38 ( _ l (2 38 [ _ l [2 38 ) _ l )2 38 ] _ l ]2 38 _ _ l 42 (2 * * l (2 (2 x ( r 39 [2 * * l [2 [2 x [ r 39 )2 * * l )2 )2 x ) r 39 ]2 * * l ]2 ]2 x ] r 39 39 ) x r 40 39 ] x r 41 39 _ x r 37 40 ) ) r 40 40 ] ) r 41 40 _ ) r 37 41 ) ] r 40 41 ] ] r 41 42 _ _ l 42 42 ) _ l 43 42 x _ l 1 43 ) ) l 43 43 ] ) l 44 43 x ) l 1 44 ) ] l 43 44 ] ] l 44 44 x ] l 1 45 < ( r 45 45 > ) r 45 45 { [ r 45 45 } ] r 45 45 x _ r 45 45 _ _ l 46 46 * * l 46 46 x x l 47 47 _ x r 0 47 * * l 47 ; Deleting [] head 2' ] x r 3' 3' ) ) r 3' 3' ] ) r 4' 4' ) ] r 3' 4' ] ] r 4' 3' _ ) l 5' 4' _ ] l 5' 5' * * l 5' 5' x ) r 6' 6' ) ] r 7' 7' ] ] r 7' 7' ) x l 8' 8' ] > l 13' 9' * * r 9' 9' _ _ r 10' 10' x x r 10' 10' _ x l 11' 11' * * l 11' 11' _ _ l 12' 12' * * l 12' 12' x x l 13' 13' * * l 13' 13' ) > r 9' 13' ] } r 9' 13' ( < r 14' 13' [ { r 14' 14' * * r 14' 14' _ _ r 15' 15' * * r 15' 15' _ _ l 16' 16' x _ l 11' 16' _ _ l 17' 17' * * l 17' 17' x x l 18' 18' * * l 18' 18' _ _ r 19' 18' ( ( r 19' 18' [ [ r 19' 18' ) ) r 19' 18' ] ] r 19' 19' < ( r 0(' 19' > ) r 0)' 19' { [ r 0[' 19' } ] r 0]' 19' x _ l 20' 0(' * * r 0(' 0(' _ _ r 1(' 1(' * * r 1(' 1(' _ ( l 17' 0)' * * r 0)' 0)' _ _ r 1)' 1)' * * r 1)' 1)' _ ) l 17' 0[' * * r 0[' 0[' _ _ r 1[' 1[' * * r 1[' 1[' _ [ l 17' 0]' * * r 0]' 0]' _ _ r 1]' 1]' * * r 1]' 1]' _ ] l 17' 20' * * l 20' 20' ( ( r 21' 21' ) x r 22' 22' ) ) r 22' 22' ] ) r 23' 22' _ ) r 24' 23' ) ] r 22' 23' ] ] r 23' 24' * * r 24' 24' _ _ r 25' 25' ( _ l (2' 25' ) _ l )2' 25' [ _ l [2' 25' ] _ l ]2' 25' _ _ l 29' (2' * * l (2' (2' x ( r 26' )2' * * l )2' )2' x ) r 26' [2' * * l [2' [2' x [ r 26' ]2' * * l ]2' ]2' x ] r 26' 26' ) x r 27' 26' ] x r 28' 27' ) ) r 27' 27' ] ) r 28' 27' _ ) r 24' 28' ) ] r 27' 28' ] ] r 28' 29' _ _ l 29' 29' ) _ l 30' 30' ) ) l 30' 30' ] ) l 30' 30' x ) l 46 31' ) ] l 30' 31' ] ] l 30' 31' x ] l 46

Finite Buchholz hydra - cutting >0 head
Differs a bit from original definition - top node becomes u instead of 0

Input format - consider standard representation of hydra using brackets with labels, e.g. 0( 3( 3) 0) where n( n) pair means node labelled with n. Each such pair we replace with n+1 left parentheses and n+1 right parentheses, e.g. above would be ( (()) ). Now place any number of x's to the right as a multiplier. 0 * * r 0 0 _ _ r 1 1 * * r 0 1 _ x l 2' 2 * * l 2 2 ( [ r c0 2' * * l 2' 2' ( ( l 3' 3' ( ( r 2 c0 * * r c0 c0 _ _ r c1 c0 x x r c0 c1 * * r c1 c1 _ _ l 4 c1 x x r c0 c1 ) ] l c2 c2 * * l c2 c2 _ _ l c3 c2 x x l c2 c3 * * l c3 c3 x x l c2 c3 _ _ r 3 c3 ( [ r c0 3 [ ( r 3 3 ] x r 3 3 * * r 3 3 ) ) l 2 4 * * l 4 4 x ) l 4 4 [ ( l 5 5 [ ( l 5 5 * * r 6 6 * * r 6 6 ] ] l 7 7 ] ] l 7 7 [ [ l 7 7 _ _ l 8 8 ] ] l 7 8 [ [ l 7 8 * * l 8 8 _ _ r 9 9 ) ] r 10 9 ( [ r 13 10 ) ] r 10 10 _ _ r 11 11 * * r 11 11 x ( r 12 12 _ x l 16 13 ( [ r 13 13 _ _ r 14 14 * * r 14 14 x _ l 15 15 ( x l 16 15 _ _ r 17 16 * * l 16 16 ] ] l 7 17 _ x l 18 18 * * l 18 18 ] ] l 19 19 ] ] l 19 19 [ [ l 19 19 _ x l 20 20 ] ] l 19 20 [ [ l 19 20 * * r 21 21 x _ r 22 22 [ ( r 23 22 ] ) r 26 22 x _ r 29 23 * * r 23 23 _ _ r 24 24 * * r 24 24 x [ r 25 25 _ x l 32 26 * * r 26 26 _ _ r 27 27 * * r 27 27 x } r 28 28 _ x l 32 29 * * r 29 29 _ _ r 30 30 * * r 30 30 x _ r 31 31 _ x l 32 32 * * l 32 32 ] ] l 33 32 x x l 34 33 * * l 33 33 ( ( r 22 33 ) ) r 22 33 _ _ r 22 34 x x l 34 34 _ x r 35 35 x x r 35 35 _ _ r 36 36 * * r 36 36 x x l 37 37 * * l 37 37 } ] l 37 37 ( _ r 38 38 _ x r 39 39 ) _ r 40 40 * * r 40 40 [ _ r 41 41 _ y l 43 41 * * l 43 42 _ y l 45 42 * * l 45 43 * * l 43 43 x ( r 44 44 _ x r 49 45 * * l 45 45 x ) r 46 46 _ x r 49 47 * * l 47 47 x _ r 48 48 _ x r 49 49 _ _ r 49 49 ) _ r 50 49 [ _ r 41 49 ] _ r 42 49 y _ l 47 49 x _ l 51 50 _ ) r 49 50 ) ) r 50 51 _ _ l 51 51 ) _ l 52 51 x _ r 53 52 _ ) l 51 52 ) ) l 52 53 ) ) r 53 53 _ _ r 54 54 ) ) r 53 54 _ _ l 55 55 _ _ l 55 55 ) _ l 56 55 ( x r 57 55 x _ * halt 56 _ ) l 55 56 ) ) l 56 57 ) _ r 58 58 ) ) r 58 58 _ _ r 59 59 ) ) r 58 59 _ _ l 55

Finite Buchholz hydra game
At last my machine is done! Input format is as above. If you find any error in this, please comment it together with input.

Oh, and I forgot - multiplier of n x's actually behaves like n+1. Technical reasons.

141 states (I think) and 7 symbols - and we reached limits of  \(\Pi_1^1\)-\(\text{CA}_0\) ! 0 * * r 0 0 _ _ r 1 1 * * r 0 1 _ x l 28 2 * * l 2 2 ( [ r c0 28 * * l 28 28 ( ( l 31 28 x x r 117 31 ( ( r 2 31 _ x r 60 c0 * * r c0 c0 _ _ r c1 c0 x x r c0 c1 * * r c1 c1 _ _ l 4 c1 x x r c0 c1 ) ] l c2 c2 * * l c2 c2 _ _ l c3 c2 x x l c2 c3 * * l c3 c3 x x l c2 c3 _ _ r 3 c3 ( [ r c0 3 [ ( r 3 3 ] x r 3 3 * * r 3 3 ) ) l 2 4 * * l 4 4 x ) l 4 4 [ ( l 5 5 [ ( l 5 5 * * r 6 6 * * r 6 6 ] ] l 7 7 ] ] l 7 7 [ [ l 7 7 _ _ l 8 8 ] ] l 7 8 [ [ l 7 8 * * l 8 8 _ _ r 9 9 ) ] r 10 9 ( [ r 13 10 ) ] r 10 10 _ _ r 11 11 * * r 11 11 x ( r 12 12 _ x l 16 13 ( [ r 13 13 _ _ r 14 14 * * r 14 14 x _ l 15 15 ( x l 16 15 _ _ r 17 16 * * l 16 16 ] ] l 7 17 _ x l 18 18 * * l 18 18 ] ] l 19 19 ] ] l 19 19 [ [ l 19 19 _ x l 20 20 ] ] l 19 20 [ [ l 19 20 * * r 21 21 x _ r 22 22 [ ( r 23 22 ] ) r 26 22 x _ r 29 23 * * r 23 23 _ _ r 24 24 * * r 24 24 x [ r 25 25 _ x l 32 26 * * r 26 26 _ _ r 27 27 * * r 27 27 x y r 25 ; State 28 is used elsewhere 29 * * r 29 29 _ _ r 30 30 * * r 30 30 x _ r 25 ; State 31 is used elsewhere 32 * * l 32 32 ] ] l 33 32 x x l 34 33 * * l 33 33 ( ( r 22 33 ) ) r 22 33 _ _ r 22 34 x x l 34 34 _ x r 35 35 x x r 35 35 _ _ r 36 36 * * r 36 36 x x l 37 37 * * l 37 37 y ] l 37 37 ( _ r 38 38 _ x r 39 39 ) _ r 40 40 * * r 40 40 [ _ r 41 41 _ y l 43 41 * * l 43 42 _ y l 45 42 * * l 45 43 * * l 43 43 x ( r 44 43 y ( r 44' 44 _ x r 49 44' _ y r 49 45 * * l 45 45 x ) r 46 45 y ) r 46' 46 _ x r 49 46' _ y r 49 47 * * l 47 47 x _ r 48 47 y _ r 48' 48 _ x r 49 48' _ y r 49 49 _ _ r 49 49 ) _ r 50 49 [ _ r 41 49 ] _ r 42 49 y _ l 47 49 x _ l 51 50 _ ) r 49 50 ) ) r 50 51 _ _ l 51 51 ) _ l 52 51 x _ r 53 51 y _ l 0 52 _ ) l 51 52 ) ) l 52 53 ) ) r 53 53 _ _ r 54 54 ) ) r 53 54 _ _ l 55 55 _ _ l 55 55 ) _ l 56 55 ( x r 57 55 x _ r 0 56 _ ) l 55 56 ) ) l 56 57 ) _ r 58 58 ) ) r 58 58 _ _ r 59 59 ) ) r 58 59 _ _ l 55 60 ( _ r 60 60 _ _ r 60 60 ) _ r 61 61 * * r 61 61 x _ l 62 62 _ x l 63 63 _ _ r 61 63 ) _ l 64 63 x _ r 65 64 _ ) l 63 64 ) ) l 64 65 ) ] r 65 65 _ _ l 66 65 x _ l 115 66 * * l 66 66 ] ] l 67 67 * * l 67 67 _ _ l 68 68 * * l 68 68 ] ] l 67 68 [ [ l 67 68 _ _ r 69 69 ) ] r 70 69 ( [ r 73 70 ) ] r 70 70 _ _ r 71 71 * * r 71 71 x ) r 72 72 _ x l 66 73 ( [ r 73 73 _ _ r 74 74 * * r 74 74 x _ l 75 75 ) x l 66 75 _ _ r 76 76 _ x l 77 77 * * l 77 77 ] ] r 77' 77' _ y l 78 78 * * l 78 78 _ x l 78 78 ( ( r 79 78 ) ) r 79 78 x * r 79 79 x _ r 80 80 [ ( r 81 80 ] ) r 83 80 x _ r 85 81 * * r 81 81 y y r 82 82 * * r 82 82 x [ r 87 83 * * r 83 83 y y r 84 84 * * r 84 84 x y r 87 85 * * r 85 85 y y r 86 86 * * r 86 86 x _ r 87 87 _ x l 88 88 * * l 88 88 ] ] l 89 88 x x r 90 89 * * l 89 89 ( ( r 80 89 ) ) r 80 89 _ _ r 80 90 * * r 90 90 y ] r 90 90 x _ l 91 91 * * l 91 91 ) ) r 92' 92' ] ] r 93 92' * * l 92 92 * * l 92 92 ] ] r 93 93 _ _ l 97 93 ) _ r 94 93 [ _ r 95 93 ] _ r 96 94 _ ) r 93 94 ) ) r 94 95 _ [ r 93 95 [ [ r 95 95 ] [ r 96 96 _ ] r 93 96 [ ] r 95 96 ] ] r 96 97 * * l 97 97 ) ) r 98' 98' ] _ r 99 98' * * l 98 98 * * l 98 98 x x r 100 98 ] _ r 99 99 _ x r 93 100 * * r 100 100 [ [ l 101 101 * y l 102 102 * * r 102 102 _ x r 103 103 * * r 102 103 _ _ l 104 104 x y l 105 105 * * l 105 105 y y l 106' 106' * * l 106' 106' x x l 106 106 * * l 106 106 y x r 110 106 x x l 107 107 x x l 107 107 * x r 108 108 x y r 109 109 * * r 109 109 y y r d0 d0 [ ( r [0 d0 ] ) r ]0 d0 x _ r x0 d0 y y r d3 d0 * * r d0 d1 * * l d1 d1 y y l d2 d2 * * l d2 d2 y y r d0 [0 * * r [0 [0 y y r [1 [1 * * r [1 [1 _ [ l d1 ]0 * * r ]0 ]0 y y r ]1 ]1 * * r ]1 ]1 _ ] l d1 x0 * * r x0 x0 y y r x1 x1 * * r x1 x1 _ x l d1 d3 * * r d3 d3 _ y l d4 d4 * * l d4 d4 ) ) l d5 d5 * * l d5 d5 y _ l 106' 110 * * r 110 110 x y r 111 111 * * r 111 111 ( [ r 112 112 ( [ r 112 112 ) ] r 112 112 _ _ r 112 112 y _ r 113 113 * * r 113 113 x _ r 113 113 y x l 114 114 * * l 114 114 y y r 40 115 * * l 115 115 x x l 116 116 x x l 116 116 _ x r 0 117 * * r 117 117 x _ l halt

How to translate this machine into long-halting Busy Beaver
Take some 2-state 7-color machine which leaves large number of consecutive symbols (like this candidate ). Use third and fourth state to replace whole string with ('s. Now use, for example, this machine: 0 ( _ r 1 0 _ _ l halt 1 ( ( r 1 1 _ _ r 2 2 ) ) r 2 2 _ ) l 3 3 ) ) l 3 3 _ _ l 4 4 ( ( l 4 4 _ ( r 0 To make it into 2 enclosing wide parentheses. Use similar machine to make long string of x's on the left. With about 5 more states we add pair to make hydra working. So about 19 new states are sufficient to make HUGE number! This gives BB(160,7)>>most of defined computable numbers.

Transfinite Buchholz hydra!
Just 17 states more! I hope you enjoy limits of ! You know label 0 is represented as, label 1 as etc. Label \(\omega\) is )). If you find any issues please comment them below.

While trying to find mistakes in code I thought "Halting times on this machine are unimaginably large, I can't know if machine properly halts." So I added some transitions and now, if we place [ to the left of multiplier, it will never increase, thus greatly reducing halting time. It still works for very long time, though. 0 * * r 0 0 _ _ r 1 0 ] _ r 1 1 * * r 0 1 _ x l 28 2 * * l 2 2 ( [ r c0 28 * * l 28 28 ( ( l 31 28 x x r 117 31 ( ( r 2 31 ) ( r 123 31 _ x r 60 c0 * * r c0 c0 _ _ r c1 c0 x x r c0 c1 * * r c1 c1 _ _ l 4 c1 x x r c0 c1 ) ] l c2 c2 * * l c2 c2 _ _ l c3 c2 x x l c2 c3 * * l c3 c3 x x l c2 c3 _ _ r 3 c3 ( [ r c0 3 [ ( r 3 3 ] x r 3 3 * * r 3 3 ) ) l 2 4 * * l 4 4 x ) l 4 4 [ ( l 5 5 [ ( l 5 5 * * r 6 6 * * r 6 6 ] ] l 7 7 ] ] l 7 7 [ [ l 7 7 _ _ l 8 8 ] ] l 7 8 [ [ l 7 8 * * l 8 8 _ _ r 9 9 ) ] r 10 9 ( [ r 13 10 ) ] r 10 10 ( [ r 118 10 _ _ r 11 11 * * r 11 11 x ( r 12 12 _ x l 16 13 ( [ r 13 13 _ _ r 14 14 * * r 14 14 x _ l 15 15 ( x l 16 15 _ _ r 17 16 * * l 16 16 ] ] l 7 17 _ x l 18 18 * * l 18 18 ] ] l 19 19 ] ] l 19 19 [ [ l 19 19 _ x l 20 20 ] ] l 19 20 [ [ l 19 20 * * r 21 21 x _ r 22 22 [ ( r 23 22 ] ) r 26 22 x _ r 29 23 * * r 23 23 _ _ r 24 24 * * r 24 24 x [ r 25 25 _ x l 32 26 * * r 26 26 _ _ r 27 27 * * r 27 27 x y r 25 ; State 28 is used elsewhere 29 * * r 29 29 _ _ r 30 30 * * r 30 30 x _ r 25 ; State 31 is used elsewhere 32 * * l 32 32 ] ] l 33 32 x x l 34 33 * * l 33 33 ( ( r 22 33 ) ) r 22 33 _ _ r 22 34 x x l 34 34 [ [ r 35 34 _ x r 35 35 x x r 35 35 _ _ r 36 36 * * r 36 36 x x l 37 37 * * l 37 37 y ] l 37 37 ( _ r 38 38 _ x r 39 39 ) _ r 40 40 * * r 40 40 [ _ r 41 40 ] _ r 42 41 _ y l 43 41 * * l 43 42 _ y l 45 42 * * l 45 43 * * l 43 43 x ( r 44 43 y ( r 44' 44 _ x r 49 44' _ y r 49 45 * * l 45 45 x ) r 46 45 y ) r 46' 46 _ x r 49 46' _ y r 49 47 * * l 47 47 x _ r 48 47 y _ r 48' 48 _ x r 49 48' _ y r 49 49 _ _ r 49 49 ) _ r 50 49 [ _ r 41 49 ] _ r 42 49 y _ l 47 49 x _ l 51 50 _ ) r 49 50 ) ) r 50 51 _ _ l 51 51 ) _ l 52 51 x _ r 53 51 y _ l 0 52 _ ) l 51 52 ) ) l 52 53 ) ) r 53 53 _ _ r 54 54 ) ) r 53 54 _ _ l 55 55 _ _ l 55 55 ) _ l 56 55 ( x r 57 55 x _ r 0 56 _ ) l 55 56 ) ) l 56 57 ) _ r 58 58 ) ) r 58 58 _ _ r 59 59 ) ) r 58 59 _ _ l 55 60 ( _ r 60 60 _ _ r 60 60 ) _ r 61 61 * * r 61 61 x _ l 62 62 _ x l 63 63 _ _ r 61 63 ) _ l 64 63 x _ r 65 64 _ ) l 63 64 ) ) l 64 65 ) ] r 65 65 _ _ l 66 65 x _ l 115 66 * * l 66 66 ] ] l 67 67 * * l 67 67 _ _ l 68 68 * * l 68 68 ] ] l 67 68 [ [ l 67 68 _ _ r 69 69 ) ] r 70 69 ( [ r 73 70 ) ] r 70 70 ( [ r 73 70 _ _ r 71 71 * * r 71 71 x ) r 72 72 _ x l 66 73 ( [ r 73 73 _ _ r 74 74 * * r 74 74 x _ l 75 75 ) x l 66 75 _ _ r 76 76 _ x l 77 77 * * l 77 77 ] ] r 77' 77' _ y l 78 78 * * l 78 78 _ x l 78 78 ( ( r 79 78 ) ) r 79 78 x * r 79 79 x _ r 80 80 [ ( r 81 80 ] ) r 83 80 x _ r 85 81 * * r 81 81 y y r 82 82 * * r 82 82 x [ r 87 83 * * r 83 83 y y r 84 84 * * r 84 84 x y r 87 85 * * r 85 85 y y r 86 86 * * r 86 86 x _ r 87 87 _ x l 88 88 * * l 88 88 ] ] l 89 88 x x r 90 89 * * l 89 89 ( ( r 80 89 ) ) r 80 89 _ _ r 80 90 * * r 90 90 y ] r 90 90 x _ l 91 91 * * l 91 91 ) ) r 92' 92' ] ] r 93 92' * * l 92 92 * * l 92 92 ] ] r 93 93 _ _ l 97 93 ) _ r 94 93 [ _ r 95 93 ] _ r 96 94 _ ) r 93 94 ) ) r 94 95 _ [ r 93 95 [ [ r 95 95 ] [ r 96 96 _ ] r 93 96 [ ] r 95 96 ] ] r 96 97 * * l 97 97 ) ) r 98' 98' ] _ r 99 98' * * l 98 98 * * l 98 98 x x r 100 98 ] _ r 99 99 _ x r 93 100 * * r 100 100 [ [ l 101 100 ] ] l 101 101 * y l 102 102 * * r 102 102 _ x r 103 103 * * r 102 103 _ _ l 104 104 x y l 105 105 * * l 105 105 y y l 106' 106' * * l 106' 106' x x l 106 106 * * l 106 106 y x r 110 106 x x l 107 107 x x l 107 107 [ [ r 108 107 * x r 108 108 x y r 109 109 * * r 109 109 y y r d0 d0 [ ( r [0 d0 ] ) r ]0 d0 x _ r x0 d0 y y r d3 d0 * * r d0 d1 * * l d1 d1 y y l d2 d2 * * l d2 d2 y y r d0 [0 * * r [0 [0 y y r [1 [1 * * r [1 [1 _ [ l d1 ]0 * * r ]0 ]0 y y r ]1 ]1 * * r ]1 ]1 _ ] l d1 x0 * * r x0 x0 y y r x1 x1 * * r x1 x1 _ x l d1 d3 * * r d3 d3 _ y l d4 d4 * * l d4 d4 ) ) l d5 d5 * * l d5 d5 y _ l 106' 110 * * r 110 110 x y r 111 111 * * r 111 111 ( ( l 112 112 ( [ r 112 112 ) ] r 112 112 _ _ r 112 112 y _ r 113 113 * * r 113 113 x _ r 113 113 y x l 114 114 * * l 114 114 y y r 40 115 * * l 115 115 x x l 116 116 x x l 116 116 _ x r 0 116 [ [ r 0 117 * * r 117 117 x _ l halt 118 * * r 118 118 x x l 119 119 ( ( l 14 119 _ _ l 120 120 * * l 120 120 ] x l 120 120 [ ( l 121 121 [ ( l 121 121 ] ) l 121 121 _ _ l 121 121 * * r 122 122 * * r 122 122 x x l 2 123 ( ( r 123 123 _ ] r 124 124 * * r 124 124 x _ l 125 125 * * l 125 125 x x l 127 125 y x r 0 ; NOTE: No state 126 127 x x l 127 127 [ [ r 128 127 * x r 128 128 x y r 129 129 * * r 129 129 x x r 129 129 _ _ r 130 130 * * r 130 130 ] ( r 131 131 ) ] r 132 132 ) ) r 132 132 _ ) r 133 133 ) _ r 132 133 _ _ l 134 134 * * l 134 134 ] ] r 135 134 y ) l 125 135 ) y r 132

Linear array notation
This machine computes version of linear arrays where {a,b}=a^b. If replace it with Bowers' original rule {a,b}=a+b, we'd save around 35 states. But I decided to go harder way.

Input format: x|A| where A is array in form of strings of 1's divided by blanks, e.g. x|111 111 111| calculates tritri 0 * * r 0 0 _ _ r 1 0 | | r 0' 0' * * r 0' 0' _ _ r 1 0' | _ l h0 1 _ _ r 1 1 1 1 r 2 2 _ _ r 3 2 | _ l 4 2 1 1 r 5 3 * _ r 3 3 | _ l 4 4 * * l 4 4 1 _ l r0 5 1 1 r 5 5 | _ l 6 5 _ _ r 9 6 1 x l 7 6 _ 1 l s1 7 * * l 7 7 | | r 8 7 x x r 8 8 1 x r s0 8 _ 1 r s3 9 1 1 r 10 9 _ _ r 9 9 y y l b0 10 1 1 r 11 10 _ _ r 9 10 | _ l 12 11 1 1 r 11 11 _ _ r 9 11 | | l 15 12 1 _ l 13 13 _ | l 14 14 * * l 14 14 | | r 0 15 * * l 15 15 | | r c0 15 x x r c0 15 y y r c0 c0 1 x r c1 c0 _ y r c3 c0 | | r c6 c1 * * r c1 c1 | | r c2 c2 * * r c2 c2 _ x l c5 c3 * * r c3 c3 | | r c4 c4 * * r c4 c4 _ y l c5 c5 * * l c5 c5 | | l 15 c6 x 1 r c6 c6 y _ r c6 c6 _ | l 16 16 * * l 16 16 | | r 17 17 1 1 r 17 17 _ _ r 18 18 1 1 r 18 18 _ 1 l 19 18 | _ l 20 19 1 _ r 18 20 1 | l 21 21 * * l 21 21 | | l 22 22 x 1 l 22 22 y _ l 22 22 | | r 23 23 1 1 r 23 23 _ _ r 24 24 1 1 r 24 24 _ _ r 25 25 1 y r 26 26 1 1 l 27 26 _ _ r 25 27 y _ l 27 27 _ _ l 28 28 1 1 l 28 28 y y l 27 28 _ _ r 29 29 1 x r 30 30 * * r 30 30 | | r 0 r0 _ _ l r0 r0 1 _ l r1 r0 | _ l r7 r1 * * l r1 r1 x 1 r r2 r2 1 x r r3 r2 _ x r r5 r2 | | r h0 r3 * * r r3 r3 | | r r4 r4 1 1 r r4 r4 _ _ l r0 r5 _ _ r r6 r5 1 _ r r10 r5 y _ r r13 r6 * * r r6 r6 | | r r4 r7 1 | l r8 r8 1 1 l r8 r8 _ 1 l r9 r8 x x r 32 r9 1 _ l r8 r9 _ _ l r9 r9 y _ l r14 r9 x _ r r9' r9' _ _ l 31 r9' * * l 14 r10 _ 1 r r11 r10 1 1 r r10 r10 | 1 r r12 r11 _ _ r r11 r11 1 _ r r10 r12 _ _ l r7 r12 1 | l r1 r13 _ y r r5 r14 _ y l r9 b0 * * l b0 b0 | | r b0' b0' 1 x r b0 b0 x 1 r b1 b1 _ _ r b7 b1 1 x r b2 b2 * * r b2 b2 y 1 r b3 b3 _ y r b4 b4 y _ r b3 b4 1 _ r b5 b5 1 1 r b5 b5 _ 1 r b4 b5 | 1 r b6 b6 _ | l b0 b7 * * r b7 b7 y 1 r 9 h0 * * l h0 h0 | 1 l h1 h1 * _ r halt s0 * * r s0 s0 x x l 6 s1 * * l s1 s1 x x r s2 s2 1 _ r s4 s3 1 1 r s3 s3 x _ r s4 s4 * 1 r s4 s4 _ _ l s5 s5 * * l s5 s5 x 1 l s5 s5 | | r p0 p0 1 1 l p0a p0 _ _ r p19 p0a | | r p0b p0b 1 _ r p1 p1 1 _ r p21 p1 _ _ r p10 p1 x _ r p11 p2 * * r p2 p2 _ _ r p3 p3 1 _ r p4 p3 x _ l p8 p4 1 1 r p4 p4 _ x r p5 p4 x x r p5 p5 1 1 r p5 p5 _ 1 l p6 p6 1 1 l p6 p6 * * l p7 p7 1 1 l p7 p7 _ 1 r p3 p8 1 1 l p8 p8 x x l p8 p8 _ x l p9 p9 1 1 l p8 p9 _ _ r p10 p10 x _ r p1 p10 1 1 l p20 p11 1 1 r p11 p11 x _ r p11 p11 _ _ l p12 p12 1 1 l p12 p12 _ _ r m0 m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r p13 p13 1 1 r p13 p13 _ _ l p14 p14 1 _ l p15 p15 1 1 l p15 p15 _ 1 l p16 p16 1 1 r p17 p16 _ _ r p13 p16 x _ r p18 p16 | | r p22 p17 1 _ l p12 p18 1 _ r halt p19 1 _ r p19 p19 _ 1 r halt p20 * * l p20 p20 x _ r halt p21 * * r p2 p21 _ x r p3 p22 1 1 r p22 p22 _ _ l p23 p23 1 _ l r0 31 _ x r 32 32 * * r 32 32 | _ l r7

Unrestricted Knuth's up-arrow notation
Same as restricted one, expect it doesn't have 2-in-base limitation and strings have right length (we don't decrease by 1). Again, one ^ is addition, ^^ is multiplication. Proper hyper operators require two arrows more 0 * * r 0 0 _ _ l 1 1 1 _ l 2 2 ^ _ l 3 2 1 1 l 4 3 ^ _ l 3 3 1 _ l 2 4 1 1 l 4 4 ^ 1 l 4' 4 _ 1 l halt 4' ^ ^ l 5 4' 1 1 r 0 5 ^ ^ l 5 5 1 1 r 6 6 ^ x r 7 6 1 y r 9 6 | ^ l 12 7 * * r 7 7 _ | r 8 7 | | r 8 8 * * r 8 8 _ ^ l 11 9 * * r 9 9 | | r 10 10 * * r 10 10 _ 1 l 11 11 * * l 11 11 x ^ r 6 11 y 1 r 6 12 * * l 12 12 ^ ^ l 12' 12' ^ ^ l 12' 12' * * l 13 12' 1 x r 14 13 * * l 13 13 ^ ^ r 20 13 _ _ r 20 13 1 x r 14 14 * * r 14 14 ^ ^ r 15 15 ^ ^ r 15 15 x x r 16 15 1 x l 12 16 x x r 16 16 1 x l 12 16 ^ x r 17 17 ^ ^ r 17 17 1 ^ r 18 18 ^ 1 r 17 18 1 1 r 18 18 _ 1 l 19 19 * * l 19 19 x x l 12 20 x 1 r 20 20 ^ ^ r 21 21 ^ ^ r 21 21 x x r 22 22 x x r 22 22 1 _ r 23 22 ^ ^ l 30 23 1 _ r 23 23 ^ ^ l 24 24 _ ^ r 25 25 ^ ^ r 25 25 1 1 l 26 26 ^ 1 r 27 27 1 1 r 27 27 _ _ l 28 28 1 _ l 29 29 * * l 29 29 _ ^ r 25 29 x 1 l 30 30 x 1 l 30 30 ^ ^ r 31 31 * * r 31 31 _ _ l 32 32 1 _ l 1

Graham's number
Okay, this machine consists of 3 parts: Short setup, long setup and compute

Short setup
First, we need to write some setup by-hand. Namely, we need 161_111^111| with head on left end. This is made by this 20-state machine, using 2^m machine by Deedlit: 0 _ 1 l 1 1 _ 1 l 2 2 _ 1 l 3 3 _ 1 l 4 4 _ 1 l s3 s0 1 _ l s5 s0 _ 1 r halt s5 1 1 l s5 s5 _ _ r s3 s3 1 _ l s1 s3 _ 1 r s4 s1 1 1 l s1 s1 _ 1 r s2 s2 1 1 r s2 s2 _ 1 r s3 s4 1 _ l s5 s4 _ 1 l 5 5 1 1 l 6 6 1 x r 7 7 * * r 7 7 _ 1 r 8 8 _ ^ r 9 9 _ 1 r 10 10 _ 1 r 11 11 _ 1 r 12 12 _ | l 13 13 * * l 13 13 x _ l 13 13 _ _ r 1' Where 1' means state 1 in next machine.

Long setup
This machine translates above into (111^111|)63111^^^^^^11 with head on right end end. Remember that above machine moves to state 1 in this machine!

This is achieved by following 20-state machine 0 1 _ r 1 0 _ _ r 9 1 * * r 1 1 _ _ r 2 2 1 x r 3 2 ^ y r 4 2 | | r 6 3 * * r 3 3 _ 1 l 5 4 * * r 4 4 _ ^ l 5 5 * * l 5 5 x 1 r 2 5 y ^ r 2 6 * * r 6 6 _ | l 7 7 * * l 7 7 _ _ l 8 8 * * l 8 8 _ _ r 0 9 * * r 9 9 _ 1 r 10 10 _ 1 r 11 11 _ 1 r 12 12 _ ^ r 13 13 _ ^ r 14 14 _ ^ r 15 15 _ ^ r 16 16 _ ^ r 17 17 _ ^ r 18 18 _ 1 r 19 19 _ 1 r 1' Where 1' means state 1 in next machine.

Compute
Now this is core of machine. Shortly, it computes rightmost number and after computing it computes 3^^^...^^3 with that many arrows+2 (because of way my machine works). It repeats 63 times. This 40-state machine does all the work: 0 * * r 0 0 _ _ l 1 1 1 _ l 2 1 _ _ l 2 2 ^ _ l 3 2 1 1 l 4 3 ^ _ l 3 3 1 _ l 2 4 1 1 l 4 4 ^ 1 l 4' 4 _ 1 l halt 4 | | r 33 4' ^ ^ l 5 4' 1 1 r 0 5 ^ ^ l 5 5 1 1 r 6 6 ^ x r 7 6 1 y r 9 6 | ^ l 12 7 * * r 7 7 _ | r 8 7 | | r 8 8 * * r 8 8 _ ^ l 11 9 * * r 9 9 | | r 10 10 * * r 10 10 _ 1 l 11 11 * * l 11 11 x ^ r 6 11 y 1 r 6 12 * * l 12 12 ^ ^ l 12' 12' ^ ^ l 12' 12' * * l 13 12' 1 x r 14 13 * * l 13 13 ^ ^ r 20 13 _ _ r 20 13 | | r 20 13 1 x r 14 14 * * r 14 14 ^ ^ r 15 15 ^ ^ r 15 15 x x r 16 15 1 x l 12 16 x x r 16 16 1 x l 12 16 ^ x r 17 17 ^ ^ r 17 17 1 ^ r 18 18 ^ 1 r 17 18 1 1 r 18 18 _ 1 l 19 19 * * l 19 19 x x l 12 20 x 1 r 20 20 ^ ^ r 21 21 ^ ^ r 21 21 x x r 22 22 x x r 22 22 1 _ r 23 22 ^ ^ l 30 23 1 _ r 23 23 ^ ^ l 24 24 _ ^ r 25 25 ^ ^ r 25 25 1 1 l 26 26 ^ 1 r 27 27 1 1 r 27 27 _ _ l 28 28 1 _ l 29 29 * * l 29 29 _ ^ r 25 29 x 1 l 30 30 x 1 l 30 30 ^ ^ r 31 31 * * r 31 31 _ _ l 32 32 1 _ l 1 33 1 1 r 33 33 _ 1 l 34 34 * * l 34 34 ^ ^ r 35 35 1 ^ r 36 36 1 1 r 36 36 | 1 r 37 37 1 | l 34 37 _ _ l 1 Accidentaly, state numbers form nice round numbers. After summing we get 80 states. Number of colors is 5, so Turing golf score is: \(80+(5+2)^2-16=80+49-16=113<1000\), so it still applies for competition! Within new scoring system my machine has exactly 2000 points, but, as Deedlit said, not that anyone scores their TMs anyway :P

Goldbach conjecture
This machine halts iff Goldbach conjecture is false. If this is a case, we have pretty long lasting machine in here. But for now, as we don't know for sure if this conjecture is true or false, we can't know if this machine halts. ; Dividing number into two parts - p and q ; Check if p is prime 0 * 1 r 1 1 * 1 r 2 2 * _ l 3 3 1 1 l 3 3 _ _ r p0 ; If p is prime we test q 4 1 1 r 4 4 _ _ r 5 5 1 1 r 5 5 _ _ l q0 ; If both numbers are prime, conjecture doesn't fail for that number 6 _ 1 l 7 7 1 1 l 7 7 _ 1 l 8 8 1 1 l 8 8 _ _ r 0 ; If either number isn't prime, we replace p and q with p+1 and q-1 9 * 1 l 9 9 _ 1 r 10 10 1 _ r 11 11 1 1 r 12 12 1 1 l 13 12 _ _ l halt ; If q=1, number witnesses falsity of conjecture. Halt 13 * * l 13 13 _ _ l 3 14 * 1 r 14 14 _ 1 r 10 ; Primality test for left number p0 1 1 l p1 p0 _ _ r p0 p1 _ _ l p2 p2 _ 1 l p3 p3 _ 1 r p4 p4 x x l p4 p4 1 x r p5 p4 _ _ r p8 p5 x x r p5 p5 _ _ r p6 p6 x x r p6 p6 1 x l p7 p6 _ _ l p11 p7 x x l p7 p7 _ _ l p4 p8 * 1 r p8 p8 _ _ r p9 p9 x x r p9 p9 1 1 l p10 p9 _ _ l p14 p10 x x l p10 p10 _ _ l p4 p11 x 1 l p11 p11 _ _ l p12 p12 * * l p12 p12 _ 1 r p8 p13 * * r p13 p13 _ _ l p14 p13 1 1 l p14 p14 * _ l p15 p14 x 1 l p15 p14 _ _ r 4 p15 * * l p15 p15 _ _ l p16 p16 * * l p16 p16 _ _ r p17 p17 * _ r p18 p17 _ _ r 14 p18 * * r p18 p18 _ _ r p13 ; Primality test for right number q0 1 1 r q1 q0 _ _ l q0 q1 _ _ r q2 q2 _ 1 r q3 q3 _ 1 l q4 q4 x x r q4 q4 1 x l q5 q4 _ _ l q8 q5 x x l q5 q5 _ _ l q6 q6 x x l q6 q6 1 x r q7 q6 _ _ r q11 q7 x x r q7 q7 _ _ r q4 q8 * 1 l q8 q8 _ _ l q9 q9 x x l q9 q9 1 1 r q10 q9 _ _ r q14 q10 x x r q10 q10 _ _ r q4 q11 x 1 r q11 q11 _ _ r q12 q12 * * r q12 q12 _ 1 l q8 q13 * * l q13 q13 _ _ r q14 q13 1 1 r q14 q14 * _ r q15 q14 x 1 r q15 q14 _ 1 r 6 q15 * * r q15 q15 _ _ r q16 q16 * * r q16 q16 _ _ l q17 q17 * _ l q18 q17 _ _ l 9 q18 * * l q18 q18 _ _ l q13 (I know Goldbach conjecture is widely believed to be true, i.e. machine won't halt, but we aren't sure)

Computing pi (WIP)
I'm going to use Wallis' product for computing pi. This series is slowly converging, multiplying elements up to 1000 gives 2 digits of precision.

Numerator
Given input 2n, machine makes list of numbers 2n, 2n-2, 2n-4..., 4, 2, copies it and uses my list multiplication to do the job. Then we multiply by 2, because Wallis' formula computes half of pi, and we want whole pi. 0 1 _ r 1 0 _ _ r 5 1 1 1 r 1 1 _ _ r 2 2 1 1 r 2 2 _ 1 l 3 3 1 1 l 3 3 _ _ l 4 4 1 1 l 4 4 _ 1 r 0 5 1 1 r 5 5 _ _ l 6 6 1 _ l 6' 6' 1 _ l 7 6 _ x l 8 7 1 1 l 7 7 _ _ r 0 8 _ _ l 8 8 1 y l 9 9 1 y l 9 9 _ x l 10 10 1 y l 9 10 _ _ r 12 11 * * r 11 11 x _ l 21 11 y _ r 11 12 y 1 r 13 12 x _ r 18 12 _ _ r 11 13 * * r 13 13 _ _ r 14 14 * * r 14 14 x 1 r 15 15 _ x l 16 16 * * l 16 16 _ _ l 17 17 * * l 17 17 1 1 r 12 17 _ _ r 12 18 * * r 18 18 _ _ r 19 19 * * r 19 19 x y r 20 20 _ x l 16 21 1 1 l 21 21 _ _ l 22 22 1 1 l 21 22 _ _ l 23 23 1 1 l 21 23 _ _ r 24 24 _ _ r 24 24 1 _ r l13 l0 1 _ r l13 l0 _ _ r 25 l1 1 1 r l1 l1 _ _ r l2 l2 1 1 r l1 l2 _ _ r l14 l3 1 1 r l3 l3 _ _ r l4 l4 1 1 r l3 l4 _ _ r l5 l5 1 1 r l5 l5 _ 1 l l6 l6 1 1 l l6 l6 _ _ l l7 l7 _ _ l l8 l8 1 1 l l8 l8 _ _ l l9 l9 1 1 l l8 l9 _ _ l l31 l10 1 1 l l10 l10 _ _ l l11 l10 x x r l15 l11 1 1 l l10 l11 _ _ r l12 l12 _ _ r l0 l13 _ x r l2 l13 1 1 r l1 l14 _ _ r l14 l14 1 1 r l3 l15 1 1 r l15 l15 _ _ r l16 l16 1 1 r l15 l16 _ _ r l32 l17 _ _ r l23 l17 1 x r l18 l18 1 1 r l18 l18 _ _ r l19 l19 1 1 r l18 l19 _ _ r l20 l20 1 1 r l20 l20 _ _ r l21 l21 1 1 r l21 l21 _ 1 l l22 l22 * * l l22 l22 x _ r l17 l23 1 1 r l23 l23 _ _ r l24 l24 1 1 r l23 l24 _ x r m0 m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r l25 l25 1 1 r l25 l25 _ _ l l26 l26 1 _ l l27 l27 1 1 l l27 l27 _ 1 r l25 l27 x 1 r l28 l28 1 1 r l28 l28 _ _ l l29 l29 1 _ l l30 l30 * * l l30 l30 x _ r l0 l31 _ _ l l31 l31 1 1 l l10 l31 x x r l32 l32 _ _ r l32 l32 1 x r l18 25 _ _ r 25 25 1 1 r 26 26 1 1 r 26 26 _ _ r 27 27 1 1 r 26 27 _ 1 r 28 28 _ 1 l 29 29 1 1 l 29 29 _ _ l 30 30 1 1 l 30 30 _ x r n0 n0 1 _ r n1 n0 _ _ r n9 n1 1 1 r n1 n1 _ _ r n2 n2 1 _ r n3 n2 _ _ l n7 n3 1 1 r n3 n3 _ _ r n4 n4 1 1 r n4 n4 _ 1 l n5 n5 1 1 l n5 n5 _ _ l n6 n6 1 1 l n6 n6 _ 1 r n2 n7 1 1 l n7 n7 _ _ l n8 n8 1 1 l n8 n8 _ _ r n0 n9 1 _ r n9 n9 _ 1 r n10 n10 1 1 r n10 n10 _ _ l n11 n11 1 _ l n12 n12 1 1 l n12 n12 _ 1 r n10 n12 x _ l n13 n13 1 1 l n14 n13 _ _ r halt n14 1 1 l n14 n14 _ x r n0

Denominator
Given input 2n, machine makes list of numbers 2n, 2n-2, 2n-4..., 4, 2, copies it and uses my list multiplication to do the job. From every product we subtract 1 and multiply everything together. 0 1 _ r 1 0 _ _ r 5 1 1 1 r 1 1 _ _ r 2 2 1 1 r 2 2 _ 1 l 3 3 1 1 l 3 3 _ _ l 4 4 1 1 l 4 4 _ 1 r 0 5 1 1 r 5 5 _ _ l 6 6 1 _ l 6' 6' 1 _ l 7 6 _ x l 8 7 1 1 l 7 7 _ _ r 0 8 _ _ l 8 8 1 y l 9 9 1 y l 9 9 _ x l 10 10 1 y l 9 10 _ _ r 12 11 * * r 11 11 x _ l 21 11 y _ r 11 12 y 1 r 13 12 x _ r 18 12 _ _ r 11 13 * * r 13 13 _ _ r 14 14 * * r 14 14 x 1 r 15 15 _ x l 16 16 * * l 16 16 _ _ l 17 17 * * l 17 17 1 1 r 12 17 _ _ r 12 18 * * r 18 18 _ _ r 19 19 * * r 19 19 x y r 20 20 _ x l 16 21 1 1 l 21 21 _ _ l 22 22 1 1 l 21 22 _ _ l 23 23 1 1 l 21 23 _ _ r 24 24 _ _ r 24 24 1 _ r l13 l0 1 _ r l13 l0 _ _ r 25 l1 1 1 r l1 l1 _ _ r l2 l2 1 1 r l1 l2 _ _ r l14 l3 1 1 r l3 l3 _ _ r l4 l4 1 1 r l3 l4 _ _ r l5 l5 1 1 r l5 l5 _ 1 l l6 l6 1 1 l l6 l6 _ _ l l7 l7 _ _ l l8 l8 1 1 l l8 l8 _ _ l l9 l9 1 1 l l8 l9 _ _ l l31 l10 1 1 l l10 l10 _ _ l l11 l10 x x r l15 l11 1 1 l l10 l11 _ _ r l12 l12 _ _ r l0 l13 _ x r l2 l13 1 1 r l1 l14 _ _ r l14 l14 1 1 r l3 l15 1 1 r l15 l15 _ _ r l16 l16 1 1 r l15 l16 _ _ r l32 l17 _ _ r l23 l17 1 x r l18 l18 1 1 r l18 l18 _ _ r l19 l19 1 1 r l18 l19 _ _ r l20 l20 1 1 r l20 l20 _ _ r l21 l21 1 1 r l21 l21 _ 1 l l22 l22 * * l l22 l22 x _ r l17 l23 1 1 r l23 l23 _ _ r l24 l24 1 1 r l23 l24 _ x r m0 m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r l25 l25 1 1 r l25 l25 _ _ l l26 l26 1 _ l l27 l27 1 1 l l27 l27 _ 1 r l25 l27 x 1 r l28 l28 1 1 r l28 l28 _ _ l l29 l29 1 _ l l33 l33 1 _ l l30 l30 * * l l30 l30 x _ r l0 l31 _ _ l l31 l31 1 1 l l10 l31 x x r l32 l32 _ _ r l32 l32 1 x r l18 25 _ _ r 25 25 1 1 r 26 26 1 1 r 26 26 _ _ r 27 27 1 1 r 26 27 _ _ l 28 28 _ _ l 29 29 1 1 l 29 29 _ _ l 30 30 1 1 l 30 30 _ x r n0 n0 1 _ r n1 n0 _ _ r n9 n1 1 1 r n1 n1 _ _ r n2 n2 1 _ r n3 n2 _ _ l n7 n3 1 1 r n3 n3 _ _ r n4 n4 1 1 r n4 n4 _ 1 l n5 n5 1 1 l n5 n5 _ _ l n6 n6 1 1 l n6 n6 _ 1 r n2 n7 1 1 l n7 n7 _ _ l n8 n8 1 1 l n8 n8 _ _ r n0 n9 1 _ r n9 n9 _ 1 r n10 n10 1 1 r n10 n10 _ _ l n11 n11 1 _ l n12 n12 1 1 l n12 n12 _ 1 r n10 n12 x _ l n16 n13 1 1 r n13 n13 _ _ l n14 n14 1 _ l n15 n15 * * l n15 n15 _ _ l n16 n16 1 1 l n17 n16 _ _ r halt n17 1 1 l n17 n17 _ x r n0

Division
Given input of form (a) (b) where (n) means string of n 1's machine outputs integer part written in binary, binary dot and binary expansion of fraction 0 1 1 r 0 0 * . r 3 0' 1 _ l 1 0' _ _ r 3 1 _ 1 r 2 1 1 1 l 1 2 1 1 r 2 2 _ 1 r 0' 3 x x r 3 3 1 x l 4 3 _ _ r 8 4 x x l 4 4 * * l 5 5 1 1 l 5 5 * * r 6 6 1 x r 7 6 x x r 6 6 _ _ r 13 6 . . l 20 7 1 1 r 7 7 * * r 3 8 * * r 8 8 _ 1 l 9 9 * * l 9 9 _ _ l 10 10 x 1 l 10 10 _ _ l 11 10 . . l 18 11 * * l 11 11 _ _ r 12 12 x _ r 12 12 1 _ l 1 12 _ _ r 17 13 * 1 r 13 13 _ _ r 14 14 * * r 14 14 _ 0 l 15 15 * * l 15 15 x 1 l 16 16 x 1 l 16 16 _ _ r 0' 17 1 _ r 17 17 _ _ r halt 18 1 1 l 18 18 x _ l 18 18 _ _ r 19 19 _ _ r 19 19 1 1 r 0 19 . _ r 26 20 x 1 l 20 20 _ _ r 21 21 * * r 21 21 x 1 r 22 22 * 1 r 22 22 _ _ r 23 23 1 1 r 23 23 _ . l 24 24 * * l 24 24 . _ l 25 25 1 1 l 25 25 _ _ r 0' 26 1 _ r 26 26 _ _ r halt

Complete machine
Input is a bit complicated - yy...yxxx1xxx11...1 with number of y's same as number of 1's and even. Machine is very inefficient. Given 4 y's and 4 1's it takes 70000 steps before starting division. But then output is \({45\over 128}\approx 2.844...\neq \pi\). To get better results we need literally millions of y's. Very slow convergence. At least division is pretty efficient 0 x x r 0 0 1 y r 0' 0 _ _ r 5 0 y 1 r 0 0' x _ r 0' 0' 1 _ r 1 0' _ _ r 5 1 1 1 r 1 1 _ _ r 2 2 1 1 r 2 2 _ 1 l 3 3 1 1 l 3 3 _ _ l 4 4 1 1 l 4 4 _ 1 r 0' 5 1 1 r 5 5 _ _ l 6 6 1 _ l 6' 6' 1 _ l 7 6 _ x l 8 7 1 1 l 7 7 _ _ r 0' 8 _ _ l 8 8 1 y l 9 9 1 y l 9 9 _ x l 10 10 1 y l 9 10 _ _ r 12 11 * * r 11 11 x _ l 21 11 y _ r 11 12 y 1 r 13 12 x _ r 18 12 _ _ r 11 13 * * r 13 13 _ _ r 14 14 * * r 14 14 x 1 r 15 15 _ x l 16 16 * * l 16 16 _ _ l 17 17 * * l 17 17 1 1 r 12 17 _ _ r 12 18 * * r 18 18 _ _ r 19 19 * * r 19 19 x y r 20 20 _ x l 16 21 1 1 l 21 21 _ _ l 22 22 1 1 l 21 22 _ _ l 23 23 1 1 l 21 23 _ _ r 24 24 _ _ r 24 24 1 _ r l13 l0 1 _ r l13 l0 _ _ r 25 l1 1 1 r l1 l1 _ _ r l2 l2 1 1 r l1 l2 _ _ r l14 l3 1 1 r l3 l3 _ _ r l4 l4 1 1 r l3 l4 _ _ r l5 l5 1 1 r l5 l5 _ 1 l l6 l6 1 1 l l6 l6 _ _ l l7 l7 _ _ l l8 l8 1 1 l l8 l8 _ _ l l9 l9 1 1 l l8 l9 _ _ l l31 l10 1 1 l l10 l10 _ _ l l11 l10 x x r l15 l11 1 1 l l10 l11 _ _ r l12 l12 _ _ r l0 l13 _ x r l2 l13 1 1 r l1 l14 _ _ r l14 l14 1 1 r l3 l15 1 1 r l15 l15 _ _ r l16 l16 1 1 r l15 l16 _ _ r l32 l17 _ _ r l23 l17 1 x r l18 l18 1 1 r l18 l18 _ _ r l19 l19 1 1 r l18 l19 _ _ r l20 l20 1 1 r l20 l20 _ _ r l21 l21 1 1 r l21 l21 _ 1 l l22 l22 * * l l22 l22 x _ r l17 l23 1 1 r l23 l23 _ _ r l24 l24 1 1 r l23 l24 _ x r m0 m0 1 _ r m1 m0 _ _ r m9 m1 1 1 r m1 m1 _ _ r m2 m2 1 _ r m3 m2 _ _ l m7 m3 1 1 r m3 m3 _ _ r m4 m4 1 1 r m4 m4 _ 1 l m5 m5 1 1 l m5 m5 _ _ l m6 m6 1 1 l m6 m6 _ 1 r m2 m7 1 1 l m7 m7 _ _ l m8 m8 1 1 l m8 m8 _ _ r m0 m9 1 _ r m9 m9 _ 1 r l25 l25 1 1 r l25 l25 _ _ l l26 l26 1 _ l l27 l27 1 1 l l27 l27 _ 1 r l25 l27 x 1 r l28 l28 1 1 r l28 l28 _ _ l l29 l29 1 _ l l30 l30 * * l l30 l30 x _ r l0 l31 _ _ l l31 l31 1 1 l l10 l31 x x r l32 l32 _ _ r l32 l32 1 x r l18 25 _ _ r 25 25 1 1 r 26 26 1 1 r 26 26 _ _ r 27 27 1 1 r 26 27 _ 1 r 28 28 _ 1 l 29 29 1 1 l 29 29 _ _ l 30 30 1 1 l 30 30 _ x r n0 n0 1 _ r n1 n0 _ _ r n9 n1 1 1 r n1 n1 _ _ r n2 n2 1 _ r n3 n2 _ _ l n7 n3 1 1 r n3 n3 _ _ r n4 n4 1 1 r n4 n4 _ 1 l n5 n5 1 1 l n5 n5 _ _ l n6 n6 1 1 l n6 n6 _ 1 r n2 n7 1 1 l n7 n7 _ _ l n8 n8 1 1 l n8 n8 _ _ r n0 n9 1 _ r n9 n9 _ 1 r n10 n10 1 1 r n10 n10 _ _ l n11 n11 1 _ l n12 n12 1 1 l n12 n12 _ 1 r n10 n12 x _ l n13 n12 y y l a0 n13 1 1 l n14 n13 _ _ r n12 n14 1 1 l n14 n14 _ x r n0 a0 x _ l a0 a0 1 _ l a1 a0 _ _ l a5 a1 1 1 l a1 a1 _ _ l a2 a2 1 1 l a2 a2 _ 1 r a3 a3 1 1 r a3 a3 _ _ r a4 a4 1 1 r a4 a4 _ 1 l a0 a5 1 1 l a5 a5 _ _ r a6 a6 1 _ r a6' a6' 1 _ r a7 a6 _ x r a8 a7 1 1 r a7 a7 _ _ l a0 a8 _ _ r a8 a8 1 y r a9 a9 1 y r a9 a9 _ x r a10 a10 1 y r a9 a10 _ _ l a12 a11 * * l a11 a11 x _ r a21 a11 y _ l a11 a12 y 1 l a13 a12 x _ l a18 a12 _ _ l a11 a13 * * l a13 a13 _ _ l a14 a14 * * l a14 a14 x 1 l a15 a15 _ x r a16 a16 * * r a16 a16 _ _ r a17 a17 * * r a17 a17 1 1 l a12 a17 _ _ l a12 a18 * * l a18 a18 _ _ l a19 a19 * * l a19 a19 x y l a20 a20 _ x r a16 a21 1 1 r a21 a21 _ _ r a22 a22 1 1 r a21 a22 _ _ r a23 a23 1 1 r a21 a23 _ _ l a24 a24 _ _ l a24 a24 1 _ l al13 al0 1 _ l al13 al0 _ _ l a25 al1 1 1 l al1 al1 _ _ l al2 al2 1 1 l al1 al2 _ _ l al14 al3 1 1 l al3 al3 _ _ l al4 al4 1 1 l al3 al4 _ _ l al5 al5 1 1 l al5 al5 _ 1 r al6 al6 1 1 r al6 al6 _ _ r al7 al7 _ _ r al8 al8 1 1 r al8 al8 _ _ r al9 al9 1 1 r al8 al9 _ _ r al31 al10 1 1 r al10 al10 _ _ r al11 al10 x x l al15 al11 1 1 r al10 al11 _ _ l al12 al12 _ _ l al0 al13 _ x l al2 al13 1 1 l al1 al14 _ _ l al14 al14 1 1 l al3 al15 1 1 l al15 al15 _ _ l al16 al16 1 1 l al15 al16 _ _ l al32 al17 _ _ l al23 al17 1 x l al18 al18 1 1 l al18 al18 _ _ l al19 al19 1 1 l al18 al19 _ _ l al20 al20 1 1 l al20 al20 _ _ l al21 al21 1 1 l al21 al21 _ 1 r al22 al22 * * r al22 al22 x _ l al17 al23 1 1 l al23 al23 _ _ l al24 al24 1 1 l al23 al24 _ x l am0 am0 1 _ l am1 am0 _ _ l am9 am1 1 1 l am1 am1 _ _ l am2 am2 1 _ l am3 am2 _ _ r am7 am3 1 1 l am3 am3 _ _ l am4 am4 1 1 l am4 am4 _ 1 r am5 am5 1 1 r am5 am5 _ _ r am6 am6 1 1 r am6 am6 _ 1 l am2 am7 1 1 r am7 am7 _ _ r am8 am8 1 1 r am8 am8 _ _ l am0 am9 1 _ l am9 am9 _ 1 l al25 al25 1 1 l al25 al25 _ _ r al26 al26 1 _ r al27 al27 1 1 r al27 al27 _ 1 l al25 al27 x 1 l al28 al28 1 1 l al28 al28 _ _ r al29 al29 1 _ r al33 al33 1 _ r al30 al30 * * r al30 al30 x _ l al0 al31 _ _ r al31 al31 1 1 r al10 al31 x x l al32 al32 _ _ l al32 al32 1 x l al18 a25 _ _ l a25 a25 1 1 l a26 a26 1 1 l a26 a26 _ _ l a27 a27 1 1 l a26 a27 _ _ r a28 a28 _ _ r a29 a29 1 1 r a29 a29 _ _ r a30 a30 1 1 r a30 a30 _ x l an0 an0 1 _ l an1 an0 _ _ l an9 an1 1 1 l an1 an1 _ _ l an2 an2 1 _ l an3 an2 _ _ r an7 an3 1 1 l an3 an3 _ _ l an4 an4 1 1 l an4 an4 _ 1 r an5 an5 1 1 r an5 an5 _ _ r an6 an6 1 1 r an6 an6 _ 1 l an2 an7 1 1 r an7 an7 _ _ r an8 an8 1 1 r an8 an8 _ _ l an0 an9 1 _ l an9 an9 _ 1 l an10 an10 1 1 l an10 an10 _ _ r an11 an11 1 _ r an12 an12 1 1 r an12 an12 _ 1 l an10 an12 x _ r an16 an12 y _ r s0 an13 1 1 l an13 an13 _ _ r an14 an14 1 _ r an15 an15 * * r an15 an15 _ _ r an16 an16 1 1 r an17 an16 _ _ l an12 an17 1 1 r an17 an17 _ x l an0 s0 1 1 r s0 s0 _ _ l d0 d0 1 1 l d0 d0 *. l d3 d0' 1 _ r d1 d0' _ _ l d3 d1 _ 1 l d2 d1 1 1 r d1 d2 1 1 l d2 d2 _ 1 l d0' d3 x x l d3 d3 1 x r d4 d3 _ _ l d8 d4 x x r d4 d4 * * r d5 d5 1 1 r d5 d5 * * l d6 d6 1 x l d7 d6 x x l d6 d6 _ _ l d13 d6. . r d20 d7 1 1 l d7 d7 * * l d3 d8 * * l d8 d8 _ 1 r d9 d9 * * r d9 d9 _ _ r d10 d10 x 1 r d10 d10 _ _ r d11 d10. . r d18 d11 * * r d11 d11 _ _ l d12 d12 x _ l d12 d12 1 _ r d1 d12 _ _ l d17 d13 * 1 l d13 d13 _ _ l d14 d14 * * l d14 d14 _ 0 r d15 d15 * * r d15 d15 x 1 r d16 d16 x 1 r d16 d16 _ _ l d0' d17 1 _ l d17 d17 _ _ l halt d18 1 1 r d18 d18 x _ r d18 d18 _ _ l d19 d19 _ _ l d19 d19 1 1 l d0 d19. _ l d26 d20 x 1 r d20 d20 _ _ l d21 d21 * * l d21 d21 x 1 l d22 d22 * 1 l d22 d22 _ _ l d23 d23 1 1 l d23 d23 _. r d24 d24 * * r d24 d24. _ r d25 d25 1 1 r d25 d25 _ _ l d0' d26 1 _ l d26 d26 _ _ l halt

Odd perfect numbers
This machine runs until it finds odd perfect number (so possibly forever). It can start on blank tape, so is potential Busy Beaver. You can check that it works by starting with input of 8 1's and waiting until it finds 28 (less than half a million steps). ; This is part of divisor sum calculator responsible for finding divisors 0 1 1 l 1 0 x 1 r 0 0 _ 1 l 32 1 1 1 l 1 1 _ _ l 2 2 _ 1 r 3 3 _ _ l 4 4 x x l 4 4 1 x r 5 4 _ _ r 8 5 x x r 5 5 _ _ r 6 6 x x r 6 6 1 x l 7 6 _ _ l 25 7 x x l 7 7 _ _ l 4 8 x 1 r 8 8 _ _ r 9 9 x x r 9 9 1 1 l 7 9 _ _ l 10 10 x 1 l 10 10 _ y l 11 11 1 x l 12 11 x x l 11 11 _ _ l 15 12 1 1 l 12 12 _ _ l 13 13 x x l 13 13 _ x r 14 13 1 1 l 12 14 * * r 14 14 y y l 11 15 * * l 15 15 x x l 16 16 x x l 16 16 _ _ r 17 17 x 1 r 17 17 * * r 17 17 y y l 18 18 1 1 l 18 18 x 1 l 18 18 _ 1 l 19 19 1 _ l 18 19 _ _ r 20 20 * * r 20 20 y _ r c0 c0 1 1 r c0 c0 * * l c1 c1 1 x l c2 c1 _ _ l 26 c2 1 1 l c2 c2 * * l c3 c3 1 1 l c3 c3 * * r c4 c4 1 x r c5 c4 _ _ r 21 c5 1 1 r c5 c5 * * r c0 21 * * r 21 21 _ _ l 22 22 x 1 l 22 22 1 1 l 22 22 _ _ l 23 23 x x l 23 23 _ _ r 24 24 x 1 r 24 24 _ _ l 4 25 x 1 l 25 25 _ y l 18 ; We sum all divisors together 26 * * l 26 26 _ _ l 27 27 * * l 26 27 _ _ r 28 28 1 1 l 28 28 _ _ r 29 29 1 _ r 30 29 x _ r 29 29 _ _ r 31 30 1 1 r 30 30 _ 1 l 28 30 x x r d1 ; We check how sum of proper divisors compares to number d1 * * r d1 d1 _ _ l d2 d2 x _ l d3 d2 1 _ l d4 d3 x x l d4 d3 _ _ r halt ; If there is equality, done d3 1 _ l d5 d4 * * l d4 d4 _ _ r 29 d5 * _ l d5 d5 _ _ r 31 ; Otherwise we increase number by 2 and repeat 31 _ _ r 31 31 x 1 r 0 32 1 1 l 33 32 _ _ l 2 33 1 1 l 33 33 _ 1 l 1