Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Two trips, no lasting change

Write 6 and 10 in binary: and . Both end in one zero. Feed them to Turing machine 3626, and both runs end after five steps with the tape exactly as it started. Try 12 (): one more trailing zero, but thirteen steps. This machine doesn’t compute a new number. The interesting question is how long it takes to leave the old one intact.

The exit is on the right

Number the cells from right to left; cell holds the bit worth . The tape extends left forever, with zeros in all unused cells. The head starts at cell 0 in state . Each step writes a bit, moves one cell and updates the state. Moving right from cell 0 ends the run, and that move counts.

StateReads 0Reads 1
Write 0, move left, stay in Write 1, move right, enter
Write 1, move left, enter Write 0, move right, stay in

For 6, the tape reads 0 1 1 from the head leftward. The first two steps pass the zero and return from the first one. On step three, state changes the zero to a temporary one and sends the head left again. On step four, the same first one sends the head back. Step five erases the temporary mark and exits. The farther one is never touched. For 10 the higher bits are different, but the trip is the same.

What makes the machine take two trips?

Let , where is any finite string of higher bits followed by implicit zeros. There may or may not be cells to the right of the starting cell. Watch for a local event: the first move right past the starting cell, whether or not that move halts the whole machine.

Lemma 1.1 (Restoring first crossing)WRITTEN PROOF

Start in state on the first cell of , for any , any higher bits , and any finite right context . At the first rightward crossing of the starting cell, all tape symbols have been restored. If is empty, the move exits; if (nearest bit first), the state is with the head on , leftward string , and remaining right context . The time is independent of both strings:

Proof

Following Ma and Zhang, §2: with no zero before the first one, rule crosses immediately without changing the bit. For , rule enters . The induction hypothesis brings the head back to the saved zero in state after moves; the presence of that extra cell prevents any earlier exit from the full tape. Rule writes a temporary one and re-enters in state . A second full -step trip returns to the same cell, now marked one. Rule changes it back to zero and makes the first crossing of the original starting cell. Each trip restores its block and never passes its own start before its final move. The three single moves and the two trips give the recurrence. Adding three gives , with .

Why does a divisor sum give the same answer?

Every positive integer is uniquely with odd. The exponent , written , counts how many times you can divide by 2, or how many zeros end the binary numeral. For example, , so . Zero is excluded: there is no first one on an all-zero tape, and state moves left forever.

Euler’s totient counts integers from 1 to that are coprime to . For with , just the odd ones qualify, so . The Möbius function gives zero if a prime square divides ; otherwise it gives a sign according to the number of distinct primes, with . Bala’s two sums are

Remark 1.2 (The paper’s main theorem)

For every positive , the machine halts, restores every tape bit, and its first boundary-crossing time satisfies . The machine half of this result is the restoring argument with and an empty right context.

Pair each odd divisor with when is even. Both the Möbius sign and the sign from parity flip, so the pair contributes . Terms divisible by 4 give zero. If the odd part exceeds 1, choosing whether to include each distinct prime of gives the expansion of , and the contributions cancel. Only and for survive. In particular, , not 4: this is the paper’s correction to a comment in A296306.

For 12 the divisors are 1, 2, 3, 4, 6 and 12, but only the powers of two count. So . In general, . On odd inputs the sum is empty and the answer is one. The run and the divisor sum see the same feature of the input: how many factors of 2 can be peeled off.

Film 001 · Why the Machine Runs the Same Block Twice · 1:04

Watch how temporarily marking one zero turns one trip into two.

From one input to a whole range

Remark 1.3 (Timing distribution)

Among (), there are inputs with exactly trailing zeros and time : subtract the multiples with at least one extra zero. Split as , and the total time is . Among the inputs of binary length , the average is and the maximum is , reached only by . The average grows linearly in the number of bits, but the slowest runs grow much faster.

Remark 1.4 (The comparison machines)

Under the same initialization and boundary convention, both other machines restore all bits for positive inputs. Machine 3589 turns at the first one and exits directly in steps. Machine 3197 takes steps: one on even inputs, three on odd inputs. The recurrence for 3626 does not carry over to different rules.

Sources and scope

Haobo Ma and Wenlin Zhang, paper, version 3, §§1–4, CC BY 4.0. Peter Bala posed the question on September 11, 2026, in A393210, Comments revision 18, and A069517, Formula revision 31. The paper credits Sequence Machine’s April 18, 2026 record of the equivalent pointwise XOR formula and Stephen Wolfram’s 2026 worst-case formula. The contribution is not the first appearance of the answer: it is a proof for every positive input that connects a restoring trace to the signed divisor sum. The paper also credits Antti Karttunen and Amiram Eldar for prior descriptions of the support of the signed Möbius sum in A069517.

The pinned Lean code proves that the first boundary-crossing trace on positive inputs has length equal to the divisor sum. Its public halting endpoint does not carry the final tape. This does not certify the restoring lemma with arbitrary right context or all of the paper’s corollaries. The restoring-lemma request describes the missing statement and the proof it can reuse. The examples illustrate the proof, not replace it. The paper does not address the A000695 tree conjecture or the behavior of machine 924.