exact_checks.py

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

1118 bytes, as of the version from 2026-11-02 14:37 (current). Recorded here, not run.

import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from math import factorial
import json
from generate import upper_parameters, TEMPLATES
from checks import PAIRS
for t,a,b in PAIRS:
    r=QQ(1)/a; s=QQ(1)/b
    alpha=upper_parameters(t)
    assert sorted(alpha)==sorted([r,1-r,s,1-s])
    c=QQ(1); d=QQ(1); e=QQ(1)
    for n in range(201):
        if t=='5': assert c==QQ(factorial(5*n))/(QQ(factorial(n))**5*QQ(3125)**n)
        if t=='2.2.2.2': assert c==QQ(factorial(2*n))**4/(QQ(factorial(n))**8*QQ(256)**n)
        assert c==d*e
        q=QQ(1)
        for v in alpha: q*=n+v
        nextc=c*q/QQ(n+1)**4
        assert QQ(n+1)**4*nextc==q*c
        c=nextc
        d*=(n+r)*(n+1-r)/QQ(n+1)**2
        e*=(n+s)*(n+1-s)/QQ(n+1)**2
print(json.dumps({'passed':True,'exact_coefficients_per_template':201,'template_count':14,'checks':['independent pair-list versus cyclotomic fractions','coefficientwise product for every complementary-pair series','differential-equation coefficient identity','quintic factorial rescaling','all-half factorial rescaling','constant coefficients equal one']}))