from mpmath import mp
def regularized_bessel_moment(n, j, normalization='bessel', dps=120):
# Corollary 28 on the divergent compactly supported period-basis slice.
n, j = int(n), int(j)
if n < 4 or n % 4 or not n//4 <= j <= n//2-1:
raise ValueError('n=4m and m<=j<=2m-1')
if normalization not in ('bessel', 'period'):
raise ValueError('normalization bessel or period')
with mp.workdps(dps):
m = n//4
def moment(a):
def f(t):
if not t: return mp.mpf(0)
return mp.besseli(0,t)**a * mp.besselk(0,t)**(n-a) * t**(2*j)
return mp.quad(f, [0, 1, 4, 16, mp.inf])
F = (-1)**(m-1)/mp.pi**(2*m) * sum(
(-1)**a * mp.binomial(2*m,2*a) * mp.pi**(2*a) * moment(2*a)
for a in range(m))
if normalization == 'period':
F *= (-1)**m * mp.mpf(2)**(n-2*j) * mp.pi**(2*m)
return +F
# A higher-factor example beyond the initial n<=16 selection:
# regularized_bessel_moment(20, 5, 'bessel')
# This invocation is numerical; it supplies no certified error bound.
Chuang–Yu, Corollary 28 expresses each selected finite part as a signed sum of exponentially convergent ordinary moments. Complex Arb quadrature in SageMath 10.9 at 460 bits integrates that combined kernel after t=exp(-u) on 0<=u<=128, and directly on 1<=t<=128, using panels of length at most four and absolute/relative tolerance 2^(-400).
The omitted endpoints are bounded explicitly. From [3], I_0(t)<=exp(t), K_0(t)<=log(2/t)+1 for 0<t<=1, and K_0(t)<=sqrt(pi/(2t))*exp(-t) for t>0. The generator integrates the resulting positive elementary majorants exactly apart from enclosing ball arithmetic, adds their absolute bounds to the quadrature result, then propagates the period conversion. This encloses the defined finite part through the proved sum rule, without assigning a remainder bound to a divergent asymptotic series. The computed balls retain 394–403 bits of relative accuracy before checkpoint serialization; the stored decimals give 100 significant digits. Saved ball checkpoints conservatively include decimal rounding of both center and radius.
A separate check evaluates the defining balanced integral, subtracts its specified polynomial counterterms, and adds the integrated asymptotic tail, at (cutoff, retained order)=(256,120) and (384,160), using tanh–sinh quadrature at 150 and 190 working decimal digits, with 1800-bit Arb midpoint Bessel evaluations. Both estimates agree with every one of the 20 stored-convention values within its last-place interval. The checker does not use the generating convergent sum rule; it shares Arb Bessel evaluation but uses a different quadrature. Its quadrature and asymptotic tail remainder are heuristic, so this independent check is corroboration, not the basis for the proven label. Known-answer controls integral t*K_0(t)^2 dt=1/2 and integral t^3*K_0(t)^2 dt=1/3 pass; one-percent shifts and sign reversals are rejected for all entries. Executable code, source-fingerprinted checkpoints and detailed comparisons are attached. The default generator resumes those certified checkpoints; --recompute performs the full integrations. Its default enumeration and the completeness note describe the same 20 entries.