"""JAM 3 opening instrument (2026-07-23): THE SETTLED LEXICON measured look-and-say's 6-block census decaying with per-step factor ~0.87 and ARGUED it is |lambda2|/lambda1 of Conway's 92-element matrix. The eigenvalue reading makes a falsifiable prediction WITHOUT Conway's table: an eigenvalue is basis-independent, so EVERY census functional (2-blocks, 4-blocks, 6-blocks, bare digits) must relax at the SAME per-step factor. Measured here: consecutive-step total-variation ratios per census, steps 45..58.""" from itertools import groupby def las_step(s: str) -> str: return "".join(str(len(list(g))) + k for k, g in groupby(s)) def census(s: str, k: int) -> dict: counts: dict = {} for i in range(len(s) - k + 1): b = s[i:i + k] counts[b] = counts.get(b, 0) + 1 total = len(s) - k + 1 return {b: c / total for b, c in counts.items()} def tv(p: dict, q: dict) -> float: return 0.5 * sum(abs(p.get(x, 0.0) - q.get(x, 0.0)) for x in set(p) | set(q)) def main(): s = "1" hist = {} for n in range(1, 59): s = las_step(s) if n >= 44: hist[n] = s print("census | per-step TV ratios (geometric mean over steps 45..58)") for k in (1, 2, 4, 6): prev, ratios, last_tv = None, [], None for n in sorted(hist): c = census(hist[n], k) if prev is not None: t = tv(prev, c) if last_tv is not None and last_tv > 0: ratios.append(t / last_tv) last_tv = t prev = c gm = 1.0 for r in ratios: gm *= r gm **= 1.0 / len(ratios) print(" %d-blocks: factor %.4f (n=%d ratios, min %.3f max %.3f)" % (k, gm, len(ratios), min(ratios), max(ratios))) if __name__ == "__main__": main()