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 Brownian absolute area."""
if n < 1:
raise ValueError('n must be positive')
d, ell = [QQ(1)], [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))
ell.append(QQ(3*j-1)/QQ(2)*ell[j-1]
- sum((d[j-k]*ell[k] for k in range(1,j)), QQ(0)))
m = n//2
if n%2 == 0:
return QQ(factorial(n))*ell[n]/QQ(2**m*factorial(3*m))
k = 3*m+2
q = QQ(factorial(n)*4**k*factorial(k))*ell[n]/QQ(2**(m+1)*factorial(2*k))
r = RealBallField(513)
return r(q)*(r(2)/r.pi()).sqrt()
# For example, the mean:
print(moment(1))
The recurrences for $D_n$ and $L_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{2/\pi}$ 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, using the framework of [1], Appendix C.1. The independent computation evaluates Gamma factors directly in Arb at 768 bits. The mean follows separately by integrating the folded-normal marginal mean, and the second moment follows from the joint-normal absolute product integral. The first four positive moments agree with Table 3 of [1]. The attached checks test the actual written intervals, the recurrence on stored values, and strict log-convexity including $M_0=1$. See checks.py, derivation.md and numerical-evidence.json for the methods, controls and measurements.