# kmodel2468.py -- route 93's first experiment at x = 11..19: per-prime cap2(q) (residues folded, no freshness) from the # note's definitions (same code path as check1426.py, K_pool = 0), then the Mertens-factor model # K*_model = least K with sum_q cap2(q) * prod_{q' in first K scour primes, q' < q} (1 - 1/(q'-1)) < N, # against the certified K* = 0, 0, 2, 10; and sum cap2 / N. Also the exact ladder for comparison at K <= 12. import sys, math, json, time sys.path.insert(0, '../job1426') from check1426 import primes_upto, spf_table def level(x): t0=time.time() wheel=primes_upto(x); W=math.prod(wheel); small=[p for p in wheel if p>=7] N=2*math.prod(p-2 for p in small); sq=math.isqrt(W); scour=[q for q in primes_upto(sq) if q>x] spf=spf_table((W+1)//scour[0]); s_of=lambda q: 1 if q%30 in (11,13,17,19) else 0 cap2={} for q in scour: tA=(W-1)//q; tB=(W+1)//q; c=0 for side,t in (('A',tA),('B',tB)): for m in range(2,t+1): if spf[m]