cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A004731 a(0) = 1; thereafter a(n) = denominator of (n-2)!! / (n-1)!!.

This page as a plain text file.
%I A004731 #75 Feb 09 2025 15:30:46
%S A004731 1,1,1,2,3,8,15,16,35,128,315,256,693,1024,3003,2048,6435,32768,
%T A004731 109395,65536,230945,262144,969969,524288,2028117,4194304,16900975,
%U A004731 8388608,35102025,33554432,145422675,67108864,300540195,2147483648,9917826435,4294967296,20419054425
%N A004731 a(0) = 1; thereafter a(n) = denominator of (n-2)!! / (n-1)!!.
%C A004731 Also numerator of rational part of Haar measure on Grassmannian space G(n,1).
%C A004731 Also rational part of numerator of Gamma(n/2+1)/Gamma(n/2+1/2) (cf. A036039).
%C A004731 Let x(m) = x(m-2) + 1/x(m-1) for m >= 3, with x(1)=x(2)=1. Then the numerator of x(n+2) equals the denominator of n!!/(n+1)!! for n >= 0, where the double factorials are given by A006882. - Joseph E. Cooper III (easonrevant(AT)gmail.com), Nov 07 2010, as corrected in Cooper (2015).
%C A004731 Numerator of (n-1)/( (n-2)/( .../1)), with an empty fraction taken to be 1. - _Flávio V. Fernandes_, Jan 31 2025
%D A004731 D. A. Klain and G.-C. Rota, Introduction to Geometric Probability, Cambridge, p. 67.
%H A004731 T. D. Noe, <a href="/A004731/b004731.txt">Table of n, a(n) for n=0..302</a>
%H A004731 Joseph E. Cooper III, <a href="http://arxiv.org/abs/1510.00399">A recurrence for an expression involving double factorials</a>, arXiv:1510.00399 [math.CO], 2015.
%H A004731 Svante Janson, <a href="http://www2.math.uu.se/~svante/papers/sj114.pdf">On the traveling fly problem</a>, Graph Theory Notes of New York Vol. XXXI, 17, 1996.
%e A004731 1, 1, (1/2)*Pi, 2, (3/4)*Pi, 8/3, (15/16)*Pi, 16/5, (35/32)*Pi, 128/35, (315/256)*Pi, ...
%e A004731 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), ...
%p A004731 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;
%p A004731 f:=n->simplify(GAMMA(n/2+1)/GAMMA(n/2+1/2));
%p A004731 #
%p A004731 [1, seq(denom(doublefactorial(n-2)/doublefactorial(n-1)), n = 1..36)]; # _Peter Luschny_, Feb 09 2025
%t A004731 Table[ Denominator[ (n-2)!! / (n-1)!! ], {n, 0, 31}] (* _Jean-François Alcover_, Jul 16 2012 *)
%t A004731 Denominator[#[[1]]/#[[2]]&/@Partition[Range[-2,40]!!,2,1]] (* _Harvey P. Dale_, Nov 27 2014 *)
%t A004731 Join[{1},Table[Numerator[(n/2-1/2)!/((n/2-1)!Sqrt[Pi])], {n,1,31}]] (* _Peter Luschny_, Feb 08 2025 *)
%o A004731 (Haskell)
%o A004731 import Data.Ratio ((%), numerator)
%o A004731 a004731 0 = 1
%o A004731 a004731 n = a004731_list !! n
%o A004731 a004731_list = map numerator ggs where
%o A004731    ggs = 0 : 1 : zipWith (+) ggs (map (1 /) $ tail ggs) :: [Rational]
%o A004731 -- _Reinhard Zumkeller_, Dec 08 2011
%o A004731 (Python)
%o A004731 from sympy import gcd, factorial2
%o A004731 def A004731(n):
%o A004731     if n <= 1:
%o A004731         return 1
%o A004731     a, b = factorial2(n-2), factorial2(n-1)
%o A004731     return b//gcd(a,b) # _Chai Wah Wu_, Apr 03 2021
%o A004731 (PARI) f(n) = prod(i=0, (n-1)\2, n - 2*i); \\ A006882
%o A004731 a(n) = if (n==0, 1, denominator(f(n-2)/f(n-1))); \\ _Michel Marcus_, Feb 08 2025
%Y A004731 Cf. A001803, A004730, A006882 (double factorials), A036069.
%Y A004731 Cf. A036039, A046161, A001790, A001803, A101926.
%K A004731 nonn,easy,nice,frac
%O A004731 0,4
%A A004731 _N. J. A. Sloane_
%E A004731 Name corrected by _Michel Marcus_, Feb 08 2025