"""THE TILL WHEEL - instrument (2026-07-22). Claim (PROVED in the landmark, two lines): along any fertile compulsory-doubling ray, consecutive branch values satisfy b_{j+1} = 4 * b_j exactly, hence their classes mod 18 rotate through the three tills in the fixed order 4 -> 16 -> 10 -> 4 forever. Corollary checked here too: the ray's ENTRY till is a function of the seed's residue u mod 9 alone. This script verifies both on a large census of fertile odd seeds. """ def branch_values(u, n_branches): """Branch values (b = 2^k * u with b = 4 mod 6) along u's doubling ray.""" out, v = [], u while len(out) < n_branches: v *= 2 if v % 6 == 4: out.append(v) return out def main(): N_SEEDS = 200_000 N_BR = 12 wheel = {4: 16, 16: 10, 10: 4} entry_by_u9 = {} checked = rays = 0 for u in range(1, 2 * N_SEEDS, 2): if u % 3 == 0: continue # sterile ray (THE FERTILE RAY): never branches rays += 1 bs = branch_values(u, N_BR) cls = [b % 18 for b in bs] assert all(c in (4, 10, 16) for c in cls), (u, cls) for a, b in zip(cls, cls[1:]): assert wheel[a] == b, ("wheel broken", u, cls) checked += 1 # integer relation, not just modular for x, y in zip(bs, bs[1:]): assert y == 4 * x, ("4x broken", u) entry_by_u9.setdefault(u % 9, set()).add(cls[0]) print("rays checked: %d | wheel transitions verified: %d | zero exceptions" % (rays, checked)) print("entry till by u mod 9 (each must be a single class):") for r in sorted(entry_by_u9): assert len(entry_by_u9[r]) == 1, (r, entry_by_u9[r]) print(" u = %d (mod 9) -> enters at till %d" % (r, entry_by_u9[r].pop())) if __name__ == "__main__": main()