#!/usr/bin/env python3 """job2456 addendum — the T23 side of the loose-support ladder, for the T23 vs T29 comparison. The main ledger (`job2456-checks.py`) ran the T23 control on D/G2 and on R(29),R(31),R(37) plus max R, and the whole T29 ladder. For the ladder comparison itself the record needs, at T23, the SET of primes with R >= 1 and the first prime where the ladder drops to 0 — the same quantities that were measured at T29. This addendum measures exactly those, using the same whole-sieve builder and the same R routine as the ledger (no new convention). Deterministic JSON on stdout, timing on stderr. """ import importlib.util import json import os import sys import time _HERE = os.path.dirname(os.path.abspath(__file__)) _spec = importlib.util.spec_from_file_location( "job2456_checks", os.path.join(_HERE, "job2456-checks.py")) _jc = importlib.util.module_from_spec(_spec) _spec.loader.exec_module(_jc) P23, SMALL23 = _jc.P23, _jc.SMALL23 word_in_memory, R_of, primes_up_to = _jc.word_in_memory, _jc.R_of, _jc.primes_up_to def main(): t0 = time.time() w23, n23 = word_in_memory(P23, SMALL23) primes = [p for p in primes_up_to(1009) if p >= 29] r = {p: R_of(w23, p) for p in primes} ge1 = sorted(p for p in primes if r[p] >= 1) ge2 = sorted(p for p in primes if r[p] >= 2) ge3 = sorted(p for p in primes if r[p] >= 3) first_zero_above = min([p for p in primes if r[p] == 0 and p > min(ge1, default=29)], default=None) out = { "job": 2456, "artifact": "T23 loose-support ladder (addendum to job2456-checks.py)", "T23": { "D": n23, "G2": int(w23.max()), "primes_with_R_ge_1": ge1, "primes_with_R_ge_2": ge2, "primes_with_R_ge_3": ge3, "first_prime_with_R_0_above_the_ladder": first_zero_above, "max_R": max(r.values()), "loose_support_bound": max(r.values()) + 1, }, "comparison": { "T23": {"max_R": max(r.values()), "support_bound": max(r.values()) + 1, "ladder_primes": len(ge1)}, "T29": {"max_R": 3, "support_bound": 4, "ladder_primes": 21}, }, "wall_s_excluded": True, } print(json.dumps(out, indent=1, sort_keys=True)) print("[stderr] elapsed %.1fs" % (time.time() - t0), file=sys.stderr) if __name__ == "__main__": main()