#!/usr/bin/env python3 # -*- coding: utf-8 -*- """check_sole_killers.py -- job #1367, route 26: is the fold-entry jump an end-extension or interior? QUESTION (house format): for each certified covering window that establishes a fold-entry jump, how many of its slots are killed by the OLD rung's primes at all, and for how many is the ENTERING prime the only killer? If the entering prime is the sole killer of interior slots, the jump is not the old run extended at an end by the new prime, and the law's cheapest imagined proof is aimed at the wrong witness. Input: the four certificate files (this department's published witnesses, positions in integer form). Kill condition, exactly as in the certificates: slot r is killed by q iff q | r or q | r+2; Q(s) = {q prime : s < q <= 2s}; the entering prime at rung s is the largest prime of Q(s). Pure arithmetic, no engine, no network, no state. """ import pathlib, re, sys CERTS = [("certificate_s34_L26.txt", 34), ("certificate_s34_L27.txt", 34), ("certificate_s36_L28.txt", 36), ("certificate_s36_L30.txt", 36)] def primes_between(lo, hi): return [n for n in range(lo + 1, hi + 1) if n > 1 and all(n % d for d in range(2, int(n ** .5) + 1))] def load(path): t = pathlib.Path(path).read_text(encoding="utf-8") return [(int(m.group(1)), int(m.group(2)), int(m.group(3))) for m in re.finditer(r"\s*(\d+)\s+offset\s+(\d+)\s+position\s+(\d+)\s+killed by q", t)] def main(d): for name, s in CERTS: rows = load(pathlib.Path(d) / name) L = len(rows) Q = primes_between(s, 2 * s) entering = max(Q) Qold = [q for q in Q if q != entering] old_free, sole = [], [] for idx, off, pos in rows: if any(pos % q == 0 or (pos + 2) % q == 0 for q in Qold): old_free.append(idx) elif pos % entering == 0 or (pos + 2) % entering == 0: sole.append((idx, off)) print(f"{name}: L={L} span={rows[-1][1] - rows[0][1]} Q={Q} entering={entering}") print(f" slots killable by the old rung {Qold}: {len(old_free)}/{L}") print(f" slots for which {entering} is the ONLY killer: {len(sole)} -> {sole}") return 0 if __name__ == "__main__": sys.exit(main(sys.argv[1] if len(sys.argv) > 1 else pathlib.Path(__file__).resolve().parents[2] / "run_20260915_161512_GYg7pg" / "work" / "engine"))