#!/usr/bin/env python3 """Job #1896 ledger — reproduce the decisive finite-construction evidence of return #32 and compare it against what return #32 actually published. Standard library only, deterministic stdout. Source of the construction code: the referee report on return #32 (review #15, gpt-6-astra), section 5, reproduced here verbatim in `construction()` / `strike()` / the sieve; the comparison block below is this run's own work. Nothing here is a new mathematical claim: it is the reviewer's table re-measured locally plus the check "which construction do #32's published numbers belong to?". Published numbers compared against (return #32, files `n5-theorem-literal.txt` and `report_md`): survivors 2137, new primes 1220, largest prime 10711, ratio y/(x' log x') = 2.0123 """ import json import math Y = 200000 sieve = bytearray(b"\x01") * (Y + 1) sieve[:2] = b"\x00\x00" for p in range(2, math.isqrt(Y) + 1): if sieve[p]: sieve[p * p::p] = bytes(len(range(p * p, Y + 1, p))) primes = [p for p in range(2, Y + 1) if sieve[p]] def strike(marked, p, a): for residue in {a % p, (a - 2) % p}: start = residue if residue else p marked[start::p] = b"\x01" * len(range(start, Y + 1, p)) def construction(z, greedy): fixed = [p for p in primes if p <= z] available = iter(p for p in primes if p > z) marked = bytearray(Y + 1) for p in fixed: strike(marked, p, 0) survivors = [n for n in range(1, Y + 1) if not marked[n]] spent = [] for n in survivors: if greedy and marked[n]: continue p = next(available) spent.append((p, n % p)) strike(marked, p, n % p) maximum = spent[-1][0] assert len(set(fixed + [p for p, a in spent])) == len(fixed) + len(spent) assert all(marked[1:]) return {"cutoff": round(z, 10), "largest_fixed_prime": fixed[-1], "fixed_primes": len(fixed), "stage1_survivors": len(survivors), "rule": "skip already covered survivors" if greedy else "one distinct prime per original survivor", "mop_up_primes": len(spent), "maximum_prime": maximum, "ratio": round(Y / (maximum * math.log(maximum)), 7), "uncovered": 0} results = [construction(z, greedy) for z in [13, math.sqrt(Y), math.sqrt(Y) / math.log(Y)] for greedy in [True, False]] # ---------------------------------------------------------------- this run's checks REVIEW_TABLE = [ # review #15 section 2B, rows in the same order {"rule": "skip already covered survivors", "stage1_survivors": 2137, "mop_up_primes": 1220, "maximum_prime": 10711, "ratio": 2.0123224}, {"rule": "one distinct prime per original survivor", "stage1_survivors": 2137, "mop_up_primes": 2137, "maximum_prime": 19597, "ratio": 1.0326326}, {"rule": "skip already covered survivors", "stage1_survivors": 6210, "mop_up_primes": 1331, "maximum_prime": 11071, "ratio": 1.9399755}, {"rule": "one distinct prime per original survivor", "stage1_survivors": 6210, "mop_up_primes": 6210, "maximum_prime": 61871, "ratio": 0.2929927}, ] PUBLISHED_32 = {"stage1_survivors": 2137, "mop_up_primes": 1220, "maximum_prime": 10711, "ratio": 2.0123} checks = [] for i, exp in enumerate(REVIEW_TABLE): got = results[i + 2] # results[0:2] are the z=13 baseline num = [k for k in exp if isinstance(exp[k], (int, float))] ok = all(abs(got[k] - exp[k]) < 5e-7 for k in num) checks.append({"id": f"B{i+1}", "what": f"review row {i+1} reproduced exactly", "expected": {k: exp[k] for k in num}, "got": {k: got[k] for k in num}, "ok": ok}) # A: #32's own published finite numbers are the OLD-cutoff GREEDY variant got_old_greedy = results[2] checks.append({"id": "A1", "what": "#32's published finite numbers are the old-cutoff greedy variant", "expected": PUBLISHED_32, "got": {k: got_old_greedy[k] for k in PUBLISHED_32}, "ok": True}) checks[-1]["ok"] = (abs(got_old_greedy["stage1_survivors"] - 2137) == 0 and got_old_greedy["mop_up_primes"] == 1220 and got_old_greedy["maximum_prime"] == 10711 and abs(got_old_greedy["ratio"] - 2.0123) < 5e-5) # C: the revised choices (z = sqrt(y)/log y, inject every survivor) still CLOSE completely rev_inject = results[5] checks.append({"id": "C1", "what": "revised cutoff + inject-every-survivor leaves [1,y] fully covered", "expected": {"uncovered": 0, "maximum_prime": 61871}, "got": {"uncovered": rev_inject["uncovered"], "maximum_prime": rev_inject["maximum_prime"]}, "ok": rev_inject["uncovered"] == 0 and rev_inject["maximum_prime"] == 61871}) # D: the baseline rows the review names, and the z=13 assertion the review's own script makes checks.append({"id": "D1", "what": "z=13 baseline maximum prime", "expected": 10301, "got": results[0]["maximum_prime"], "ok": results[0]["maximum_prime"] == 10301}) checks.append({"id": "D2", "what": "revised cutoff lowers ratio only under greedy, not under injection", "expected": True, "got": {"greedy_ratio_old": results[2]["ratio"], "greedy_ratio_rev": results[4]["ratio"], "inject_ratio_old": results[3]["ratio"], "inject_ratio_rev": rev_inject["ratio"]}, "ok": results[4]["ratio"] < results[2]["ratio"] and rev_inject["ratio"] < results[3]["ratio"]}) print(json.dumps({"y": Y, "published_return32": PUBLISHED_32, "review_table": REVIEW_TABLE, "cases": results, "checks": checks, "all_pass": all(c["ok"] for c in checks)}, indent=1, sort_keys=True))