import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.arith.misc import bernoulli
from math import factorial
def lambda_g_integral(g, d):
n = len(d)
if g < 0 or min(d, default=0) < 0 or 2*g-2+n <= 0:
raise ValueError('A stable pair and nonnegative exponents are required')
if sum(d) != 2*g-3+n:
raise ValueError('The exponent profile must have degree 2*g-3+n')
b = QQ(1) if g == 0 else ((1-QQ(1)/QQ(2**(2*g-1)))
* abs(bernoulli(2*g))/QQ(factorial(2*g)))
result = b*QQ(factorial(sum(d)))
for exponent in d:
result /= QQ(factorial(exponent))
return result
print(lambda_g_integral(3, [1,2,3])) # 31/16128
Every entry is an exact rational number. The generator inverts the formal series $\sin(t/2)/(t/2)$ coefficient by coefficient over $\mathbb Q$ and multiplies by an exact integer multinomial coefficient, using (2) and (4).
A separate checker obtains Bernoulli numbers by a rational recurrence and evaluates (3) independently. It agrees on all 232 entries. Additional checks cover three published Macaulay2 examples [2], the five even Bernoulli numbers in Bernoulli_numbers, a 512-bit Arb calculation from even zeta values, all 155 applicable string equations and 122 applicable dilaton equations within the stored range, and an independent enumeration of the parameter range. All twelve genus-one entries also agree with boundary reduction to genus-zero cotangent intersections, computed by the string equation; four of these genus-zero values are present in the companion table T458. The checker tests known answers and deliberately incorrect controls before comparing data. The generator, checker and numerical evidence are attached, and the same checks are applied to the stored values.