selection_check.py

back to table · edit · history · where entries came from · files · download

1285 bytes, as of the version from 2026-11-17 04:25 (current). Recorded here, not run.

"""Independent integer-only field/splitting enumeration for T732."""
import json,math,pathlib
G=[11,14,15,17,19,20,21,24,27,32,36,49]
def squarefree(a):return all(a%(p*p) for p in range(2,math.isqrt(abs(a))+1))
def fundamental(D):return (D%4==1 and squarefree(D)) or (D%4==0 and (D//4)%4 in [2,3] and squarefree(D//4))
def primes(n):return [p for p in range(2,n+1) if n%p==0 and all(p%q for q in range(2,math.isqrt(p)+1))]
def split(D,p):return D%8==1 if p==2 else pow(D%p,(p-1)//2,p)==1
args=[];counts={}
for N in G:
 pairs=0;start=len(args)
 for d in range(3,101):
  D=-d
  if not fundamental(D) or math.gcd(D,N)!=1 or not all(split(D,p) for p in primes(N)):continue
  pairs+=1
  beta=[b for b in range(2*N) if (b*b-D)%(4*N)==0]
  assert len(beta)==2**len(primes(N))
  args.extend(dict(N=N,D=D,beta=b) for b in beta)
 counts[N]={'pairs':pairs,'entries':len(args)-start}
assert len(args)==262 and sum(c['pairs'] for c in counts.values())==106
out=pathlib.Path(__file__).parent
(out/'selection-check.json').write_text(json.dumps(dict(method='squarefree radicands and primewise splitting; independent of Sage fundamental-discriminant predicate',counts=counts,entries=args),indent=2))
print('Independent selection:',len(args),'triples,',sum(c['pairs'] for c in counts.values()),'pairs')