OFFSET
0,3
COMMENTS
Perhaps surprisingly, the double factorial is also defined for n = -1. The reason for this is that (-1/2)! is well defined. See the first formula.
LINKS
Paolo Xausa, Table of n, a(n) for n = 0..1000
Gamma Function, Digital library of mathematical functions, Feb. 2024.
FORMULA
r(n) = ((n/2)! / ((n - 1) / 2)!) * [sqrt(Pi) if n is even otherwise 2/sqrt(Pi)].
r(n) = n / r(n - 1) for n >= 1.
r(n) ~ sqrt(n)*exp(1/(4*n))*(Pi/2)^(cos(Pi*n)/2).
Product_{k=0..n} r(k) = A006882(n).
a(n) = numerator(r(n)).
a(n) = A004731(n+1). - R. J. Mathar, Feb 10 2025
MAPLE
seq(numer(doublefactorial(n) / doublefactorial(n - 1)), n = 0..20);
# Alternative:
a := n -> numer((GAMMA(n/2 + 1) / GAMMA(n/2 + 1/2)) * ifelse(n::even, sqrt(Pi), 2/sqrt(Pi))):
seq(a(n), n = 0..35);
MATHEMATICA
Numerator[FoldList[#2/# &, 1, Range[49]]] (* Paolo Xausa, Feb 11 2025 *)
PROG
(Python)
from fractions import Fraction
from functools import cache
@cache
def R(n: int) -> Fraction:
if n == 0: return Fraction(1, 1)
return Fraction(n, 1) / R(n - 1)
def aList(upto:int) -> list[int]:
return [R(n).numerator for n in range(upto + 1)]
print(aList(35))
CROSSREFS
KEYWORD
nonn,frac,new
AUTHOR
Peter Luschny, Feb 09 2025
STATUS
approved