#!/usr/bin/env python3 # Job #1454 (explore, lane adversarial) - the TRANSLATE CENSUS of the two-class covering # capacity on primorial periods. # # WHY THIS RUNS # The corpus reaches the twin object G2(x#) through two printed ladders it never relates to # each other term by term (research/OUTCOMES.md "Closed routes"; research/two-class-lower- # bounds.md section 1; research/sift-limit-attack.md section 7). Its object table # (two-class-lower-bounds.md section 1) asserts, without a finite check, that Ziller and # Morack's paired Jacobsthal h2(x#) = OEIS A288815 is "worst over even offsets" of the same # two-class family whose offset-2 member is this project's own G2 - 1 = OEIS A144311, and its # L7 calibration then measures the ratio of those two ladders and calls it the price of the # fixed translate. If A288815 is NOT that maximum, the ratio is between two different # objects and every sentence built on it needs rewording. # # THE OBJECT (one parameter, three printed ladders as three of its points) # x a prime; W = x# = product of primes <= x; C = {r mod W : gcd(r, W) = 1}; phi = |C|. # For an integer offset tau define the admissible set # adm(tau) = C intersect (C - tau) mod W = {r in C : (r + tau) mod W in C}, # and the CAPACITY # cover(tau) = maxwrapgap(adm(tau)) - 1. # Why that is the covering capacity: position r is killed by the two classes {0, -tau} at # prime p iff p | r or p | (r + tau); since W is squarefree and contains every p <= x, that # is gcd(r, W) > 1 or gcd(r + tau, W) > 1. So the survivors are exactly adm(tau) and a run # of killed positions is a gap between consecutive survivors. Hence # cover(2) + 1 = G2(x#) (the FIXED twin translate: classes {0,-2}, i.e. +-1) # cover(0) + 1 = g(x#) (tau = 0 collapses the pair to ONE class: the Jacobsthal # ladder itself, OEIS A048670) # max_tau cover(tau) + 1 (the FREE translate: what A288815 should be, if the # corpus's reading of it is right) # So one function reproduces the one-class ladder, the fixed two-class ladder and the free # paired ladder, and the whole even-tau family interpolates between them. This is the first # tau-RESOLVED measurement in the corpus's record: it says which offsets realise the free # optimum, not just what the optimum is. # # WHAT IT DECIDES # * custody: cover(0) + 1 must equal A048670(pi(x)) and cover(2) must equal A144311(pi(x)) # at every published level it reaches. If the census disagrees with either, the census is # wrong and nothing else here is read. # * the object identity: is 1 + max_tau cover(tau) equal to A288815(pi(x))? Verified or # refuted on the levels where the period is small enough to enumerate every offset. # * the census: the argmax set, the distribution of cover over offsets, and the price # max_tau cover(2) measured inside the family rather than between two printed ladders. # * the published conjecture, at its own statement: OEIS A288815 states "If a(n) < p_n^2 - # p_n holds for n >= 3 then Goldbach's conjecture and the twin prime conjecture hold as # well." Every available term is tested against p_n^2 - p_n, for the free ladder and, in # the implied weaker form (G2 <= h2), for the fixed ladder, whose term list is one prime # LONGER than the free ladder's. # # All published inputs are embedded below with their sources; no external count is regenerated # and no other researcher's numerical work is rerun. Output is one JSON document on stdout so # it reproduces byte for byte; progress goes to stderr. # # Invocation: python check-1454.py --out check-1454.out.json import argparse import json import math import sys import time # ---------------------------------------------------------------- published inputs # OEIS A144311, offset 1: a(n) = length of the longest run of consecutive integers each # equal to 1 or -1 mod at least one of the first n primes. a(1)-a(7) Carter 2008, # a(8)-a(16) Alekseyev 2009, a(17)-a(22) Wang 2024. Read at # https://oeis.org/search?q=id:A144311&fmt=text on 2026-09-16 (sha256 dbb54fe9...). A144311 = [1, 5, 11, 29, 41, 65, 107, 149, 203, 257, 347, 527, 545, 617, 707, 869, 965, 1079, 1283, 1397, 1529, 1709] # OEIS A288815, offset 1: paired Jacobsthal function applied to the primorial (Ziller and # Morack). Read at https://oeis.org/search?q=id:A288815&fmt=text on 2026-09-16 # (sha256 ab642b24...). Its own comment states the conjecture used below. A288815 = [2, 6, 18, 30, 66, 150, 192, 258, 366, 450, 570, 708, 894, 1044, 1284, 1422, 1656, 1902, 2190, 2460, 2622] # OEIS A072753, offset 3: maximum gap in two-stage prime-sieves (arbitrary per-prime pairs). # Read at https://oeis.org/search?q=id:A072753&fmt=text on 2026-09-16 (sha256 aaa62184...). A072753 = [2, 4, 10, 24, 31, 42, 60, 74, 94, 117, 148, 173, 213, 236, 275, 316, 364, 409, 436] # OEIS A048670, offset 1: one-class Jacobsthal function on the primorial. Read at # https://oeis.org/search?q=id:A048670&fmt=text on 2026-09-16 (sha256 603de962...). A048670 = [2, 4, 6, 10, 14, 22, 26, 34, 40, 46, 58, 66, 74, 90, 100, 106, 118, 132, 152, 174, 190, 200, 216, 234, 258, 264, 282, 300, 312, 330, 354, 378, 388, 414, 432, 450, 476, 492, 510, 538, 550, 574, 600, 616, 642, 660, 686, 718, 742, 762, 798, 810, 834, 858, 876, 908, 926, 954] CONJECTURE_TEXT = ("OEIS A288815 comment: 'There is a conjecture about an upper bound on this " "sequence. Let p_n be the n-th prime. If a(n) < p_n^2 - p_n holds for n>=3 " "then Goldbach's conjecture and the twin prime conjecture hold as well.'") def primes_upto(n): s = bytearray([1]) * (n + 1) s[0:2] = b"\x00\x00" for i in range(2, int(n ** 0.5) + 1): if s[i]: s[i * i::i] = bytearray(len(range(i * i, n + 1, i))) return [i for i in range(n + 1) if s[i]] def primorial(ps): w = 1 for p in ps: w *= p return w def coprime_list(W): """The sorted residues r in [0, W) with gcd(r, W) = 1 (W squarefree, so a sieve works).""" ok = bytearray([1]) * W ok[0] = 0 for p in primes_upto(W): if W % p == 0: ok[p::p] = bytearray(len(range(p, W, p))) return [r for r in range(W) if ok[r]] def census(W, C, taus, np): """cover(tau) for each tau in taus, by numpy, with a pure-python fallback. cover(tau) = max cyclic gap of adm(tau) - 1, adm(tau) = {c in C : c + tau mod W in C}. """ Carr = np.array(C, dtype=np.int64) isC = np.zeros(W, dtype=bool) isC[Carr] = True out = {} for tau in taus: shifted = (Carr + tau) % W kept = Carr[isC[shifted]] if kept.size == 0: out[tau] = None # no survivor at all: the run is the whole period continue if kept.size == 1: out[tau] = W - 1 # one survivor: the cyclic gap is the whole period continue gaps = np.diff(kept) wrap = int(kept[0]) + W - int(kept[-1]) mg = int(gaps.max()) if wrap > mg: mg = wrap out[tau] = mg - 1 return out def main(): ap = argparse.ArgumentParser() ap.add_argument("--out", required=True) ap.add_argument("--census-to", type=int, default=17, help="largest prime whose full even-offset census is enumerated") ap.add_argument("--custody-to", type=int, default=23, help="largest prime at which cover(0) and cover(2) are computed") a = ap.parse_args() try: import numpy as np except Exception as e: # pragma: no cover print("numpy required: %s" % e, file=sys.stderr) return 2 out = {"tool": "check-1454/1.0.0", "checks": [], "failures": [], "census": {}, "inputs": {"A144311": A144311, "A288815": A288815, "A072753": A072753, "A048670": A048670, "conjecture": CONJECTURE_TEXT}} def check(name, ok, observed, expected=None, note=None): rec = {"check": name, "ok": bool(ok), "observed": observed} if expected is not None: rec["expected"] = expected if note: rec["note"] = note out["checks"].append(rec) if not ok: out["failures"].append(name) return bool(ok) P = primes_upto(100) levels = [p for p in P if p <= a.custody_to] # ---------------------------------------------------------------- A. custody # cover(0) + 1 = one-class Jacobsthal g(x#); cover(2) = A144311(pi(x)). for x in levels: ps = [p for p in P if p <= x] W = primorial(ps) C = coprime_list(W) n = len(ps) # n = pi(x) res = census(W, C, [0, 2], np) c0, c2 = res[0], res[2] check("A1 cover(0)+1 = A048670(pi=%d) at x=%d" % (n, x), c0 + 1 == A048670[n - 1], c0 + 1, A048670[n - 1], "tau=0 collapses {0,-tau} to one class: the one-class Jacobsthal ladder") check("A2 cover(2) = A144311(pi=%d) at x=%d" % (n, x), c2 == A144311[n - 1], c2, A144311[n - 1], "tau=2 is the fixed twin translate (classes +-1)") # ---------------------------------------------------------------- B. census for x in [p for p in P if 5 <= p <= a.census_to]: ps = [p for p in P if p <= x] W = primorial(ps) C = coprime_list(W) n = len(ps) evens = [t for t in range(2, W, 2)] res = census(W, C, [0] + evens, np) # tau = 0 recorded as the one-class point vals = [res[t] for t in evens if res[t] is not None] mx = max(vals) argmax = sorted(t for t in evens if res[t] == mx) distinct = sorted(set(vals)) # the free printed ladder at this level, when it exists free_pub = A288815[n - 1] if n <= len(A288815) else None one_pub = A048670[n - 1] fixed_pub = A144311[n - 1] rec = {"x": x, "pi_x": n, "W": W, "phi_W": len(C), "even_offsets_enumerated": len(evens), "cover_0": res[0], "one_class_published": one_pub, "cover_2": res[2], "fixed_published": fixed_pub, "max_cover": mx, "max_plus1": mx + 1, "free_published": free_pub, "free_published_minus1": None if free_pub is None else free_pub - 1, "argmax": argmax, "argmax_count": len(argmax), "argmax_has_offset2": 2 in argmax, "distinct_cover_values": len(distinct), "cover_min": min(vals), "cover_mean": sum(vals) / len(vals), "price_max_over_fixed": (mx + 1) / (res[2] + 1), "price_free_pub_over_fixed_pub": (None if free_pub is None else free_pub / (fixed_pub + 1))} out["census"][str(x)] = rec if free_pub is not None: check("B1 1+max_tau cover = A288815(pi=%d) at x=%d" % (n, x), mx + 1 == free_pub, mx + 1, free_pub, "the corpus's 'worst over even offsets' reading of A288815, tested") check("B2 tau=2 is a maximiser iff the free optimum does not exceed it, x=%d" % x, rec["argmax_has_offset2"] == (mx == res[2]), {"argmax_has_offset2": rec["argmax_has_offset2"], "max": mx, "cover_2": res[2]}, note=("if tau=2 were already the maximiser the fixed statement would BE the " "free one, and no transfer would be needed")) check("B3 census at x=%d: cover(tau) >= cover(2) for the later twin levels" % x, True, {"cover_2": res[2], "max": mx}, note="recorded, not asserted") # ------------------------------------------------- C. Ziller-Morack's conjecture # a(n) < p_n^2 - p_n for n >= 3, and the implied fixed form G2 <= h2, tested on every # available term. The fixed ladder's term list is one prime longer than the free one's. pn = P[:max(len(A144311), len(A288815))] for n in range(3, len(A288815) + 1): p = pn[n - 1] rhs = p * p - p h2 = A288815[n - 1] check("C1 free A288815(%d) < %d^2-%d at p=%d" % (n, p, p, p), h2 < rhs, {"h2": h2, "p^2-p": rhs, "slack": rhs - h2, "ratio_h2_over_rhs": round(h2 / rhs, 6)}, note="the conjecture as its own OEIS entry states it") for n in range(3, len(A144311) + 1): p = pn[n - 1] rhs = p * p - p g2 = A144311[n - 1] + 1 check("C2 fixed G2(%d) < %d^2-%d at p=%d [implied: G2 <= h2]" % (n, p, p, p), g2 < rhs, {"G2": g2, "p^2-p": rhs, "slack": rhs - g2, "ratio_G2_over_rhs": round(g2 / rhs, 6)}) n_fixed = len(A144311) check("C3 the fixed ladder is longer than the free ladder by one prime", n_fixed == len(A288815) + 1, {"A144311 terms": n_fixed, "A288815 terms": len(A288815), "highest prime with a fixed term": pn[n_fixed - 1], "highest prime with a free term": pn[len(A288815) - 1]}, note="A144311 gained a(22) = 1709 (Wang 2024); A288815 stops at a(21) = 2622") check("C4 A288815 = 6*A072753 + 6 termwise (offset reconciled: A072753 has offset 3)", all(A288815[i - 1] == 6 * A072753[i - 3] + 6 for i in range(3, len(A072753) + 3)), {"checked": len(A072753), "first": [A288815[2], 6 * A072753[0] + 6], "last": [A288815[len(A072753) + 1], 6 * A072753[-1] + 6]}, note="A072753 (offset 3) indexes primes 5..p_n; the 6 is the mod-6 twin-slot factor") # ------------------------------------------------- D. the two printed log-ladders # The corpus states (two-class-lower-bounds.md section 8) that "every route checked, # theoretical and computational, says the second class is worth exactly one logarithm". # Measured here on the matched published terms: G2/g and h2/g against ln p. def ols(xs, ys): n = len(xs) mx = sum(xs) / n my = sum(ys) / n sxx = sum((t - mx) ** 2 for t in xs) sxy = sum((xs[i] - mx) * (ys[i] - my) for i in range(n)) b = sxy / sxx a0 = my - b * mx ss = sum((ys[i] - (a0 + b * xs[i])) ** 2 for i in range(n)) se = math.sqrt(ss / (n - 2) / sxx) if n > 2 else float("nan") return a0, b, se # matched levels where BOTH printed ladders have a term: p_n with n <= min(len, len) nmin = min(len(A048670), len(A144311)) matched = [(pn[n - 1], A048670[n - 1], A144311[n - 1] + 1) for n in range(1, nmin + 1)] # the twin-relevant stretch: p >= 11, where the covering economy's own arithmetic starts stretch = [(p, g, G) for (p, g, G) in matched if p >= 11] xs = [math.log(math.log(p)) for (p, g, G) in stretch] ys = [math.log(G / g) for (p, g, G) in stretch] a0, b, se = ols(xs, ys) check("D1 G2/g rises with ln p over the matched stretch", b > 0, {"levels": len(stretch), "first": [stretch[0][0], round(stretch[0][2] / stretch[0][1], 6)], "last": [stretch[-1][0], round(stretch[-1][2] / stretch[-1][1], 6)]}, note="the ratio and its growth, measured on the matched published terms") check("D2 the measured log-exponent of G2/g admits 2 and not 1 at 2 sigma", b - 2 * se > 1.0, {"slope": round(b, 4), "se": round(se, 4), "band_2sigma": [round(b - 2 * se, 4), round(b + 2 * se, 4)], "constant": round(math.exp(a0), 4), "levels": len(stretch)}, note=("the corpus's own table gives the two-class log-exponent as 3 unconditional / " "4 conjectural against the one-class 2, i.e. a gap of 1 unconditional and 2 " "conjectural; this band is what the printed ladders say")) # matched free ladder nfree = min(len(A048670), len(A288815)) mf = [(pn[n - 1], A048670[n - 1], A288815[n - 1]) for n in range(3, nfree + 1)] xf = [math.log(math.log(p)) for (p, g, h) in mf] yf = [math.log(h / g) for (p, g, h) in mf] a0f, bf, sef = ols(xf, yf) check("D3 the free paired ladder h2/g over the same frame", True, {"slope": round(bf, 4), "se": round(sef, 4), "constant": round(math.exp(a0f), 4), "levels": len(mf)}, note="recorded; the free ladder's own log-gap against the one-class ladder") # the translate price between the two printed two-class ladders ntr = min(len(A144311), len(A288815)) tr = [(pn[n - 1], A288815[n - 1] / (A144311[n - 1] + 1)) for n in range(3, ntr + 1)] xt = [math.log(math.log(p)) for (p, r) in tr] yt = [math.log(r) for (p, r) in tr] a0t, bt, set_ = ols(xt, yt) check("D4 the printed translate price h2/G2 has no measurable exponent", abs(bt) <= 2 * set_, {"slope": round(bt, 4), "se": round(set_, 4), "mean_price": round(sum(r for (_, r) in tr) / len(tr), 4), "range": [round(min(r for (_, r) in tr), 4), round(max(r for (_, r) in tr), 4)], "levels": len(tr)}, note="this is the price the corpus measures between the two printed ladders") # ------------------------------------------------- E. the section-10 ratio, extended # two-class-lower-bounds.md section 10 reads x^2/G2 on "the eleven exact terms" at # x = 5..41. The exact term list now reaches x = 79, and this measures whether the # flatness it reports is a property of the object or of the range. eleven = [(pn[n - 1], A144311[n - 1] + 1) for n in range(3, 14)] full = [(pn[n - 1], A144311[n - 1] + 1) for n in range(3, len(A144311) + 1)] r11 = [p * p / G for (p, G) in eleven] rf = [p * p / G for (p, G) in full] def trend(vals): n = len(vals) half = n // 2 return {"n": n, "min": round(min(vals), 4), "max": round(max(vals), 4), "max_over_min": round(max(vals) / min(vals), 4), "first_half_mean": round(sum(vals[:half]) / half, 4), "second_half_mean": round(sum(vals[half:]) / (n - half), 4), "values": [round(v, 4) for v in vals]} t11, tf = trend(r11), trend(rf) check("E1 section 10's flatness is a property of its range, not of the object", tf["second_half_mean"] > t11["second_half_mean"] and tf["max_over_min"] > t11["max_over_min"], {"eleven_terms": t11, "full_exact_list": tf, "primes": [p for (p, G) in full]}, note=("section 10 lists eleven exact terms x = 5..41; the exact list reaches x = 79 " "and the ratio's late half sits above its early half")) # ------------------------------------------------- F. the conjecture's tightness tight_free = min((A288815[n - 1] / (pn[n - 1] ** 2 - pn[n - 1]), n, pn[n - 1]) for n in range(3, len(A288815) + 1)) tight_fixed = min((A144311[n - 1] + 1) / (pn[n - 1] ** 2 - pn[n - 1]) for n in range(3, len(A144311) + 1)) check("F1 the conjectured bound is not close to binding on either ladder", True, {"tightest_free_ratio": round(tight_free[0], 6), "at_n": tight_free[1], "free_at_p": tight_free[2], "tightest_fixed_ratio": round(tight_fixed, 6)}, note=("A288815's conjecture is a ceiling far above both ladders' measured values; " "being far below it is not evidence for it")) # ------------------------------------------------- G. the instrument's reach # A FULL even-offset sweep at x = 19 costs p_new times the x = 17 offset count and 18 times # its array size, so the cost is measured here rather than extrapolated by hand, and the # object identity is carried as far as a DOCUMENTED candidate set can carry it: every lift # of the level-17 argmax set. A miss bounds this candidate family only and does not refute # the identity. W_prev = primorial([p for p in P if p <= 17]) top = out["census"].get("17") seeds = list(top["argmax"]) if top else [] reach = {} for x, kstride in ((19, 1),): ps = [p for p in P if p <= x] W = primorial(ps) C = coprime_list(W) n = len(ps) mult = W // W_prev ks = list(range(0, mult, kstride)) lifted = sorted({(t + W_prev * k) % W for t in seeds for k in ks}) t0 = time.time() res = census(W, C, lifted, np) dt = time.time() - t0 vals = [v for v in res.values() if v is not None] best = max(vals) if vals else None free_pub = A288815[n - 1] if n <= len(A288815) else None offsets = (W - 2) // 2 reach[str(x)] = { "W": W, "phi_W": len(C), "seed_offsets": len(seeds), "lifts_per_seed": len(ks), "candidates": len(lifted), "seconds": round(dt, 3), "seconds_per_candidate": round(dt / max(1, len(lifted)), 6), "best_cover_found": best, "best_plus1": None if best is None else best + 1, "free_published": free_pub, "free_published_minus1": None if free_pub is None else free_pub - 1, "reached_the_free_ladder": (None if (best is None or free_pub is None) else best + 1 == free_pub), "full_sweep_offsets": offsets, "extrapolated_full_sweep_hours": round(dt / max(1, len(lifted)) * offsets / 3600.0, 2), "lift_stride": kstride, } if free_pub is not None: # The ASSERTION is the finding, and the numbers are printed either way: the question # asked of the candidate family is whether it recovers the free ladder's level-19 # optimum at all. A miss bounds the family only and does not refute the identity, # which is carried at x <= 17 by the full census and is not claimed at x = 19. reached = best is not None and best + 1 == free_pub check("G1 no lift of the level-17 argmax set reaches A288815(pi=%d) at x=%d" % (n, x), not reached, {"best_plus1": None if best is None else best + 1, "A288815": free_pub, "shortfall": None if best is None else free_pub - (best + 1), "candidates": len(lifted), "seconds": round(dt, 2), "seed_offsets": len(seeds), "lifts_per_seed": len(ks)}, note=("the level-19 maximiser is therefore not any lift of any level-17 " "maximiser, on this candidate family; a miss bounds the family and does " "NOT refute the identity, which is verified at x <= 17 by the full census " "and is not claimed at x = 19")) # x = 23 and x = 29 are NOT executed: the residue list for x = 23 alone is phi(23#) = # 36,487,680 Python integers (about 1.3 GB), which is what the x = 17 run's 3.77 GiB peak # was already mostly made of, and the sweep itself would need an offset count 22 times # x = 19's. The cost is therefore stated from the measured per-candidate rate and the # analytic offset counts, and named as an extrapolation, not a measurement. rate = (reach.get("19", {}).get("seconds_per_candidate")) extrap = {} for x in (23, 29): ps = [p for p in P if p <= x] W = primorial(ps) phi = W for p in ps: phi = phi // p * (p - 1) offs = (W - 2) // 2 extrap[str(x)] = {"W": W, "phi_W": phi, "full_sweep_offsets": offs, "extrapolated_full_sweep_hours": (None if rate is None else round(rate * offs / 3600.0, 2))} out["reach"] = reach out["reach_extrapolated"] = extrap out["ok"] = not out["failures"] with open(a.out, "w", encoding="utf-8", newline="\n") as fh: fh.write(json.dumps(out, indent=1, sort_keys=True)) print(json.dumps({"wrote": a.out, "checks": len(out["checks"]), "failures": out["failures"], "ok": out["ok"], "census_levels": sorted(out["census"].keys(), key=int), "B1": [(k, v["max_plus1"], v["free_published"]) for k, v in sorted(out["census"].items(), key=lambda kv: int(kv[0])) if v["free_published"] is not None]}, indent=1)) return 0 if __name__ == "__main__": sys.exit(main())