A004731 a(0) = 1; thereafter a(n) = denominator of (n-2)!! / (n-1)!!.
1, 1, 1, 2, 3, 8, 15, 16, 35, 128, 315, 256, 693, 1024, 3003, 2048, 6435, 32768, 109395, 65536, 230945, 262144, 969969, 524288, 2028117, 4194304, 16900975, 8388608, 35102025, 33554432, 145422675, 67108864, 300540195, 2147483648, 9917826435, 4294967296, 20419054425
Offset: 0
Examples
1, 1, (1/2)*Pi, 2, (3/4)*Pi, 8/3, (15/16)*Pi, 16/5, (35/32)*Pi, 128/35, (315/256)*Pi, ... The sequence Gamma(n/2+1)/Gamma(n/2+1/2), n >= 0, begins 1/Pi^(1/2), 1/2*Pi^(1/2), 2/Pi^(1/2), 3/4*Pi^(1/2), 8/3/Pi^(1/2), 15/16*Pi^(1/2), 16/5/Pi^(1/2), ...
References
- D. A. Klain and G.-C. Rota, Introduction to Geometric Probability, Cambridge, p. 67.
Links
- T. D. Noe, Table of n, a(n) for n=0..302
- Joseph E. Cooper III, A recurrence for an expression involving double factorials, arXiv:1510.00399 [math.CO], 2015.
- Svante Janson, On the traveling fly problem, Graph Theory Notes of New York Vol. XXXI, 17, 1996.
Crossrefs
Programs
-
Haskell
import Data.Ratio ((%), numerator) a004731 0 = 1 a004731 n = a004731_list !! n a004731_list = map numerator ggs where ggs = 0 : 1 : zipWith (+) ggs (map (1 /) $ tail ggs) :: [Rational] -- Reinhard Zumkeller, Dec 08 2011
-
Maple
if n mod 2 = 0 then k := n/2; 2*k*Pi*binomial(2*k-1,k)/4^k else k := (n-1)/2; 4^k/binomial(2*k,k); fi; f:=n->simplify(GAMMA(n/2+1)/GAMMA(n/2+1/2)); # [1, seq(denom(doublefactorial(n-2)/doublefactorial(n-1)), n = 1..36)]; # Peter Luschny, Feb 09 2025
-
Mathematica
Table[ Denominator[ (n-2)!! / (n-1)!! ], {n, 0, 31}] (* Jean-François Alcover, Jul 16 2012 *) Denominator[#[[1]]/#[[2]]&/@Partition[Range[-2,40]!!,2,1]] (* Harvey P. Dale, Nov 27 2014 *) Join[{1},Table[Numerator[(n/2-1/2)!/((n/2-1)!Sqrt[Pi])], {n,1,31}]] (* Peter Luschny, Feb 08 2025 *)
-
PARI
f(n) = prod(i=0, (n-1)\2, n - 2*i); \\ A006882 a(n) = if (n==0, 1, denominator(f(n-2)/f(n-1))); \\ Michel Marcus, Feb 08 2025
-
Python
from sympy import gcd, factorial2 def A004731(n): if n <= 1: return 1 a, b = factorial2(n-2), factorial2(n-1) return b//gcd(a,b) # Chai Wah Wu, Apr 03 2021
Extensions
Name corrected by Michel Marcus, Feb 08 2025
Comments