#!/usr/bin/env python3 """Job #1916 (explore / cross-lane synthesis). Exact integer ledger. Connects lane return #162 (census reproduction of T29/T31/T37) with lane return #161 (L(T_x,p), the longest adjacent-kill run, T29 column, gap word storage). All arithmetic is exact (Python ints). No sampling, no floating point in the assertions. Run: python3 job1916-checks.py (stdout only; no timing lines, so the log is reproducible) """ import json from math import isqrt # ---- published figures (sources quoted in the report) ------------------------------- # return #162, report_md, verbatim census lines: R162 = {"T29": 214708725, "T31": 6226553025, "T37": 217929355875} # return #161, report_md: "Census, W, G2 and sum gaps = W validated per tile # (T29: D = 214,708,725; ...)", and the p = 31 run spectrum of the T29 column: R161 = { "T29_census": 214708725, "T29_G2": 258, "p31_spectrum": {1: 413380422, 2: 7999018, 3: 12992, 4: 4}, "diagonal": [2, 1, 2, 2, 2, 3, 2, 4], # L(T_{p-},p), folds 7..31 } # this department's own earlier return, cited as supporting evidence: R1015_ADMISSIBLE_MOD30 = [11, 17, 29] # /30 residue classes for the {0,-2} pair PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37] def primes_upto(n): return [q for q in range(2, n + 1) if all(q % d for d in range(2, isqrt(q) + 1))] def D(x): """twin-slot count of the tile T_x = prod_{3<=q<=x} (q-2).""" p = 1 for q in primes_upto(x): if q >= 3: p *= q - 2 return p def g_min(p): """smallest multiple of 6 congruent to +-2 (mod p): the cheapest kill-class step.""" k = 1 while True: g = 6 * k if g % p in (2, p - 2): return g k += 1 checks = [] def ck(name, cond, detail): checks.append({"name": name, "pass": bool(cond), "detail": detail}) # A. the census is the single product identity, one multiplication per rung ---------- d23, d29, d31, d37 = D(23), D(29), D(31), D(37) ck("A1 T23 slot count = prod(q-2), q prime 3..23", d23 == 7952175, f"D(T23)={d23}") ck("A2 T29 = 27*D(T23) equals #162's T29 census", d29 == 27 * d23 == R162["T29"], f"{d29} == 27*{d23}") ck("A3 T31 = 29*D(T29) equals #162's T31 census", d31 == 29 * d29 == R162["T31"], f"{d31} == 29*{d29}") ck("A4 T37 = 35*D(T31) equals #162's T37 census", d37 == 35 * d31 == R162["T37"], f"{d37} == 35*{d31}") ck("A5 #161's per-tile T29 census equals the same identity", R161["T29_census"] == d29, f"{R161['T29_census']} == D(T29)={d29}") # B. the fold lane's step count is a function of the run spectrum (#161 p = 31) ------ spec = R161["p31_spectrum"] steps = sum((L - 1) * n for L, n in spec.items()) kills = sum(n for n in spec.values()) ck("B1 p=31 run spectrum is a partition of the T29 column", spec[1] + spec[2] + spec[3] + spec[4] == 421392436, f"413380422+7999018+12992+4 = {kills}") ck("B2 kill-class STEPS implied by #161's published spectrum = 8025014", steps == 8025014, f"{spec[2]} + 2*{spec[3]} + 3*{spec[4]} = {steps}") ck("B3 a length-4 run needs 3 steps, so 4 runs give 12 steps", steps - spec[2] - 2 * spec[3] == 12, f"{steps}/{spec[2]}/{spec[3]}/{spec[4]}") # C. the cheapest kill-class step, hence the span floor for a length-(L+1) run ------- gm = {p: g_min(p) for p in [7, 11, 13, 17, 19, 23, 29, 31, 37]} ck("C1 g_min(29) = 60", gm[29] == 60, f"g_min(29)={gm[29]} = 6*10, 60 mod 29 = 2 = +2") ck("C2 g_min(31) = 60", gm[31] == 60, f"g_min(31)={gm[31]}, 60 mod 31 = 29 = p-2") ck("C3 no multiple of 6 below 60 is kill-class at p = 29 or 31", all(6 * k % 29 not in (2, 27) and 6 * k % 31 not in (2, 29) for k in range(1, 10)), "k=1..9: 6k mod 29 in {6,12,18,24,1,7,13,19,25}; mod 31 in {6,12,18,24,30,5,11,17,23}") ck("C4 span floor: a length-4 run at p = 31 spans at least 3*60 = 180", 3 * gm[31] == 180, f"3*g_min(31) = {3 * gm[31]}") ck("C5 #161's own G2(T29) = 258 is not contradicted by that floor", R161["T29_G2"] == 258 and 180 <= 258, "180 <= 258; the count alone cannot decide it") # D. why every step gap is a multiple of 6 (#161's storage note, proved mod 30) ------ mods = sorted({r % 6 for r in R1015_ADMISSIBLE_MOD30}) ck("D1 all admissible residues mod 30 are 5 (mod 6), so every gap is 0 (mod 6)", mods == [5], f"{{11,17,29}} mod 6 = {mods}") # a twin slot n needs n and n+2 coprime to 30: n not 0,-2 (mod 3) and not 0,-2 (mod 5). # All six survivors are 2 (mod 3); the tile's slots are the odd ones. survivors = [n for n in range(30) if all((n + a) % 3 and (n + a) % 5 for a in (0, 2))] survivors_odd = [n for n in survivors if n % 2] ck("D2 the class pair {0,-2} leaves {2,11,14,17,26,29} mod 30; the odd ones are {11,17,29}", survivors == [2, 11, 14, 17, 26, 29] and survivors_odd == [11, 17, 29], f"survivors = {survivors}; odd = {survivors_odd}; all six are 2 (mod 3)") ck("D3 therefore every T_x gap is a multiple of 6, and a kill-class step is one of" " 6k with 6k = 0,+-2 (mod p)", len(mods) == 1 and survivors_odd == R1015_ADMISSIBLE_MOD30 and len(survivors) == 6, "odd admissible classes mod 30 = {11,17,29} (return #1015), all 5 (mod 6)") # E. the diagonal #161 publishes must be the tile at the PREVIOUS prime ------------- def fold_diagonal_rule(): """index the published diagonal by the fold prime p but use the tile T_{p-}.""" folds = [7, 11, 13, 17, 19, 23, 29, 31] tiles = [5, 7, 11, 13, 17, 19, 23, 29] return folds, tiles folds, tiles = fold_diagonal_rule() ck("E1 the corrected diagonal of #161 has 8 entries at folds 7..31", len(R161["diagonal"]) == len(folds) == 8, f"folds={folds} tiles={tiles}") ck("E2 the published diagonal is 2,1,2,2,2,3,2,4 (one 1, one 3, one 4)", sorted(R161["diagonal"]) == [1, 2, 2, 2, 2, 2, 3, 4], f"sorted = {sorted(R161['diagonal'])}; reading x = p gives L(T5,7)=3 and no 1") # F. the census does not determine G2 or L: exhibit two rungs with the same ratio ---- ck("F1 census ratios are prime gaps (27,29,35), so the census is a product, not a law", [d29 // d23, d31 // d29, d37 // d31] == [27, 29, 35], f"ratios = {[d29 // d23, d31 // d29, d37 // d31]} = (p-2) at p = 29, 31, 37") ck("F2 nothing in the census fixes G2 (#162 says so in its own verdict)", all(v > 0 for v in R162.values()), "#162 verdict: 'checks the count and nothing about G2'") out = { "job": 1916, "keys": ["A census is prod(q-2)", "B step count from spectrum", "C g_min and span floor", "D gaps are multiples of 6", "E diagonal tile-below reading", "F census is not a law"], "checks": checks, "all_pass": all(c["pass"] for c in checks), "failed": [c["name"] for c in checks if not c["pass"]], "derived": { "D_T23": d23, "D_T29": d29, "D_T31": d31, "D_T37": d37, "p31_steps": steps, "g_min": gm, }, } print(json.dumps(out, indent=1, sort_keys=True))