"""Job #4495, EXTENSION beyond the step (47#), with the census instrument of fresh4495.py validated there by G2/G3. PRE-REGISTERED (written before any full 47# run; a 20,000-slot timing slice showed CERT(660) > 0 and CERT(700) = 0 on that slice only): G5a CERT(r, 666) over all 378,675 T_19 slots: every covering vector reconstructs by CRT to a copy p mod 47#; the direct gcd test gives each copy's true forward gap g(p) >= 672; G* := max g(p). G5b CERT(r, G*) = 0 at every T_19 slot (so G2(47#) = G* exactly, with G5a's witness), sum CERT(G*-6) = sum COUNT(G*) = nmax > 0, and every COUNT(G*) vector reconstructs to a position that passes the direct gcd test (p, p+G* are T_47 slots, none inside); the set is closed under sigma(p) = -p-G*-2 mod 47#. Monotonicity check: G* >= G2(43#) = 618. """ import sys, os, json, time from math import gcd from concurrent.futures import ProcessPoolExecutor import numpy as np HERE = os.path.dirname(os.path.abspath(__file__)); sys.path.insert(0, HERE) import census4495 as C X = 47 PR = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47] P = 1 for q in PR: P *= q B19 = 9699690 def chunk(args): G, mode, lo, hi = args C.setbase(19); C.VCAP = 10 ** 6 g = globals() if 'F' not in g: g['F'] = C.slots19(); S = np.nonzero(g['F'])[0] g['S'] = [int(v) for v in S]; g['SX'] = g['S'] + [v + B19 for v in g['S']] Q = [q for q in C.FREE_ALL if q <= X] out = {} for r in g['S'][lo:hi]: c, vecs = C.problem(r, G, Q, mode, g['SX'], g['F']) if c: out[r] = (c, vecs) return (G, mode), out def census(G, mode, ex): res = {} for _, out in ex.map(chunk, [(G, mode, lo, lo + 25000) for lo in range(0, 378675, 25000)]): res.update(out) return res def crt(r, vec): p, M = r, B19 for q, m in vec: t = ((m - p) * pow(M, -1, q)) % q p += M * t; M *= q assert M == P return p % M def slot(n): return gcd(n * (n + 2), P) == 1 def fwd_gap(p): k = 6 while not slot(p + k): k += 6 return k def main(): t0 = time.time(); led = [] with ProcessPoolExecutor(8) as ex: c666 = census(666, 'cert', ex) cps = {} for r, (c, vecs) in c666.items(): assert vecs is not None and len(vecs) == c, (r, c) for v in vecs: p = crt(r, v) assert slot(p) cps[p] = fwd_gap(p) Gs = max(cps.values()) print(f" CERT(666): {len(c666)} T_19 residues, {sum(v[0] for v in c666.values())} vectors, {len(cps)} distinct copies; " f"true forward gaps {dict(sorted((g, list(cps.values()).count(g)) for g in set(cps.values())))}") g5a = all(g >= 672 for g in cps.values()) and len(cps) == sum(v[0] for v in c666.values()) led.append(f"{'PASS' if g5a else 'FAIL'} G5a_cert666_copies :: every CERT(666) vector is a T_47 slot copy with forward gap >= 672; G* = {Gs}") cG = census(Gs, 'cert', ex); cm = census(Gs - 6, 'cert', ex); cnt = census(Gs, 'count', ex) pos = set() for r, (c, vecs) in cnt.items(): assert vecs is not None and len(vecs) == c for v in vecs: pos.add(crt(r, v)) direct = all(slot(p) and slot(p + Gs) and not any(slot(n) for n in range(p + 1, p + Gs)) for p in pos) sig = all(((-p - Gs - 2) % P) in pos for p in pos) ncnt = sum(v[0] for v in cnt.values()); ncm = sum(v[0] for v in cm.values()) g5b = (not cG) and ncm == ncnt == len(pos) > 0 and direct and sig and Gs >= 618 print(f" CERT(G*={Gs}) nonzero at {len(cG)} T_19 slots; sum CERT(G*-6) = {ncm}; sum COUNT(G*) = {ncnt} over residues " f"{dict(sorted((r, v[0]) for r, v in cnt.items()))}") print(f" positions (mod 47#): {sorted(pos)}; direct gcd test {'all pass' if direct else 'FAIL'}; sigma-closed {sig}") orbits = sorted({tuple(sorted((p, (-p - Gs - 2) % P))) for p in pos}) print(f" sigma-orbits: {orbits}") led.append(f"{'PASS' if g5b else 'FAIL'} G5b_G2_47 :: G2(47#) = {Gs}: no gap > {Gs} at any T_19 slot, nmax = {ncnt} " f"({len(orbits)} sigma-orbits over {len(cnt)} T_19 residues), all positions certified by direct gcd test") print('\n'.join(led)) print('VERDICT ' + json.dumps({'G5a': g5a, 'G5b': g5b, 'G2_47': Gs, 'nmax_47': ncnt, 'residues19': sorted(cnt), 'positions': sorted(pos)})) json.dump({'G2_47': Gs, 'cert666_copies': {str(p): g for p, g in sorted(cps.items())}, 'count': {str(r): v[0] for r, v in cnt.items()}, 'positions': sorted(pos), 'orbits': orbits}, open(os.path.join(HERE, 'ext4495.json'), 'w'), indent=1) print(f'elapsed {time.time() - t0:.0f} s wall', file=sys.stderr) if __name__ == '__main__': main()