login
A389357
Numerators E(n) in the closed form of the integral J(2n+1) = Integral_{x=0..Pi/2} x * cos(x)^(2n+1) dx = binomial(2n+1,n)/2^(2n+2) * Pi - E(n)/F(n).
0
1, 7, 149, 2161, 53089, 1187803, 62566171, 126420629, 34676275663, 1327006348769, 762860964413, 35274884855393, 1417459086247517, 8539282786885727, 994152675906323707, 61839074498178353459, 1984721470514398782313, 27861319566938771335907, 4133713434815611021027361, 8286341865806624403560347
OFFSET
0,2
COMMENTS
Appears in the exact evaluation of integrals with odd powers of cosine.
Companion denominators are sequence F(n).
For example, J(5) = 252/2^13 * Pi - 21/100 so E(5)=21, F(5)=100.
FORMULA
a(n) = numerator(R(n)) where R(n) = E(n)/F(n) = (1/2^(2*n)) * Sum_{1 <= j <= 2n+1, j odd} binomial(2*n+1,(2*n+1-j)/2)/j^2.
J(2*n+1) = (2*n)!!/(2*n+1)!! * Pi/2 - R(n).
Proof for odd powers J(2n+1) = Integral_{0..Pi/2} x*cos(x)^(2n+1) dx.
1) Expand cos(x)^(2n+1) = ( (e^{ix}+e^{-ix})/2 )^(2n+1); only odd harmonics survive.
2) Integrate termwise: Integral_{0..Pi/2} x*cos(jx) dx = (Pi/2)*sin(jPi/2)/j - 1/j^2, valid for odd j.
3) Summing gives J(2n+1) = (2n)!!/(2n+1)!! * Pi/2 - (1/2^(2n)) * Sum_{j odd<=2n+1} binomial(2n+1,(2n+1-j)/2)/j^2.
4) Writing the rational sum in lowest terms as E(n)/F(n) with gcd(E,F)=1 yields J(2n+1) = (2n)!!/(2n+1)!! * Pi/2 - E(n)/F(n).
EXAMPLE
n=3: J(7) = 8/35 * Pi - 2161/3675, so E(3)=2161, F(3)=3675.
PROG
(Python)
# generates sequence and numerical validation between the numerical integration using high-precision quadrature and the closed form formula.
import mpmath as mp
from math import comb
from fractions import Fraction
mp.mp.dps = 80
eps = mp.mpf('1e-12')
def factorial2(n):
if n <= 0: return 1
res = 1
for k in range(n, 0, -2): res *= k
return mp.mpf(res)
def R_frac(n):
s = Fraction(0, 1)
for j in range(1, 2*n+2, 2): # odd j
s += Fraction(comb(2*n+1, (2*n+1-j)//2), j*j)
return s / 2**(2*n)
def E(n): return R_frac(n).numerator
def F(n): return R_frac(n).denominator
# Numeric integral
def J_numeric(n):
f = lambda x: x * mp.cos(x)**(2*n+1)
return mp.quad(f, [0, mp.pi/2])
# Closed form
def J_formula(n):
coeff = factorial2(2*n) / factorial2(2*n+1) * mp.pi/2
return coeff - mp.mpf(E(n)) / mp.mpf(F(n))
print([E(k) for k in range(1, 20)])
for n in [1, 2, 3, 5, 7]:
val_num = J_numeric(n)
val_form = J_formula(n)
err = abs(val_num - val_form)
match = err < 10*eps
print(f"n={n}: match={match}, error={err}")
CROSSREFS
Cf. A000984 (central binomial coefficients), A389342 and A387583 for sequences C(n) and D(n) for even case, F(n) denominators for odd case.
Sequence in context: A384787 A152552 A349286 * A308581 A305467 A229806
KEYWORD
nonn,frac
AUTHOR
Patrick Demichel, Oct 01 2025
STATUS
approved