# Version-3 check: python3 -I chk3.py # (1) recompute the 0-based Lean index nmin p (least N with Phi_p(N+1) >= 1) at p=1000,2000,5000 and # compare both index conventions with the two ceiling forms; (2) text checks on the candidate. import sys, re from decimal import Decimal as D, getcontext getcontext().prec = 40 L2 = D(2).ln() ok = True def rep(name, cond, detail=''): global ok ok = ok and cond print(('PASS ' if cond else 'FAIL ') + name + (': ' + detail if detail else '')) def Phi(P, n): s = D(0); j = 0 while True: t = (-P * (1 + D(j + 1) / n).ln()).exp() s += t; j += 1 if t < D(10) ** -35: return s def ceil(x): i = int(x); return i + 1 if x > i else i for p in (1000, 2000, 5000): N = int(p / L2 - D(5) / 2) - 3 while Phi(D(p), N + 1) < 1: N += 1 c52, c32 = ceil(p / L2 - D(5) / 2), ceil(p / L2 - D(3) / 2) print(f'p={p} nmin={N} n_min=nmin+1={N+1} ceil(p/log2-5/2)={c52} ceil(p/log2-3/2)={c32}') rep(f'p={p}: 0-based nmin = ceil(p/log2-5/2)', N == c52) rep(f'p={p}: 1-based n_min = ceil(p/log2-3/2)', N + 1 == c32) rep(f'p={p}: 1-based n_min != ceil(p/log2-5/2) (old abstract form fails)', N + 1 != c52) t = open(sys.argv[1], encoding='utf-8').read() abstract = t.split('\n')[8] rep('abstract: no 1-based n_min with the -5/2 ceiling', re.search(r'n_\{\\min\}\(p\)=\\lceil p/\\log ?2-\\tfrac52', abstract) is None) rep('abstract: ceiling law stated for 0-based nmin', '\\operatorname{nmin}p=\\lceil p/\\log 2-\\tfrac52\\rceil' in abstract) rep('abstract: 1-based translation uses -3/2', 'n_{\\min}(p)=\\lceil p/\\log 2-\\tfrac32\\rceil' in abstract) rep('no certified no-failure claim for p<=2e6', 'finds no failure' not in t and 'no (CEIL) failure for' not in t) rep('proxy scope stated', t.count('proxy') >= 2) print('ALL PASS' if ok else 'SOME FAIL')