import numberdb.sage
from math import factorial
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
def moment(n):
"""Raw moment of the unit-duration standard bridge absolute area."""
if n < 1:
raise ValueError('n must be positive')
d = [QQ(1)]
for j in range(1, n+1):
d.append(QQ(3*j-2)/QQ(4)*d[j-1]
- sum((d[k]*d[j-k] for k in range(1,j)), QQ(0))/QQ(2))
m = n//2
if n%2:
r = RealBallField(513)
q = QQ(factorial(n))*d[n]/QQ(2**m*factorial(3*m+1))
return r(q)*(r.pi()/r(2)).sqrt()
return QQ(factorial(n)*4**(3*m)*factorial(3*m))*d[n]/QQ(2**m*factorial(6*m))
# For example, the mean:
print(moment(1))
The recurrence for $D_n$ and all rational prefactors were evaluated exactly over $\mathbb Q$. Even moments are stored as exact rational numbers. Odd moments use an Arb enclosure of $\sqrt{\pi/2}$ at 513 bits, with a measured minimum relative accuracy of 509 bits, and are written to 100 significant digits. Each decimal denotes an interval within one unit of its last place.
All twelve orders were compared with an independent polynomial solution of the Feynman-Kac resolvent equation and with an exact quotient of Airy asymptotic series [1], Appendix C.2 and equations (104)–(107), (137). The mean was independently obtained from the folded-normal marginal mean and a beta integral. The first four positive moments agree with Table 2 of [1]. The attached checks test the actual written intervals, the recurrence on the stored values, and strict log-convexity including $M_0=1$. See checks.py and numerical-evidence.json for methods, controls and measurements.