import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.arith.misc import bernoulli
from math import factorial
def orbifold_chi(g, n):
if g < 0 or n < 0 or 2*g - 2 + n <= 0:
raise ValueError("A stable pair is required")
if g == 0:
return QQ((-1)**(n-3) * factorial(n-3))
return (QQ((-1)**n * (2*g-1) * factorial(2*g+n-3))
* QQ(bernoulli(2*g)) / QQ(factorial(2*g)))
orbifold_chi(2, 0) # -1/240Every entry is an exact rational number. The generator starts with $\chi_{1,1}=-1/12$ or $\chi_{g,0}=B_{2g}/(2g(2g-2))$ and applies the forgetful-map recurrence using Sage rational arithmetic. No rounding or floating-point division enters the stored values.
The independent checker evaluates the closed formula using Python fractions and Bernoulli numbers obtained from a Stirling-number sum. It also compares every entry with a 512-bit Arb computation from positive even zeta values and the zeta functional equation. The checker first tests known values and deliberately incorrect inputs. It checks every adjacent pair in the stored range against the forgetful-map recurrence, the genus-one factorial formula, and every one-marked and unmarked value. The same checks run on values read back from the database. The generator, checks and numerical evidence are attached.