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.

Showing 1-7 of 7 results.

A000246 Number of permutations in the symmetric group S_n that have odd order.

Original entry on oeis.org

1, 1, 1, 3, 9, 45, 225, 1575, 11025, 99225, 893025, 9823275, 108056025, 1404728325, 18261468225, 273922023375, 4108830350625, 69850115960625, 1187451971330625, 22561587455281875, 428670161650355625, 9002073394657468125, 189043541287806830625
Offset: 0

Views

Author

Keywords

Comments

Michael Reid (mreid(AT)math.umass.edu) points out that the e.g.f. for the number of permutations of odd order can be obtained from the cycle index for S_n, F(Y; X1, X2, X3, ... ) := e^(X1 Y + X2 Y^2/2 + X3 Y^3/3 + ... ) and is F(Y, 1, 0, 1, 0, 1, 0, ... ) = sqrt((1 + Y)/(1 - Y)).
a(n) appears to be the number of permutations on [n] whose up-down signature has nonnegative partial sums. For example, the up-down signature of (2,4,5,1,3) is (+1,+1,-1,+1) with nonnegative partial sums 1,2,1,2 and a(3)=3 counts (1,2,3), (1,3,2), (2,3,1). - David Callan, Jul 14 2006
This conjecture has been confirmed, see Bernardi, Duplantier, Nadeau link.
a(n) is the number of permutations of [n] for which all left-to-right minima occur in odd locations in the permutation. For example, a(3)=3 counts 123, 132, 231. Proof: For such a permutation of length 2n, you can append 1,2,..., or 2n+1 (2n+1 choices) and increase by 1 the original entries that weakly exceed the appended entry. This gives all such permutations of length 2n+1. But if the original length is 2n-1, you cannot append 1 (for then 1 would be a left-to-right min in an even location) so you can only append 2,3,..., or 2n (2n-1 choices). This count matches the given recurrence relation a(2n)=(2n-1)a(2n-1), a(2n+1)=(2n+1)a(2n). - David Callan, Jul 22 2008
a(n) is the n-th derivative of exp(arctanh(x)) at x = 0. - Michel Lagneau, May 11 2010
a(n) is the absolute value of the Moebius number of the odd partition poset on a set of n+1 points, where the odd partition poset is defined to be the subposet of the partition poset consisting of only partitions using odd part size (as well as the maximum element for n even). - Kenneth M Monks, May 06 2012
Number of permutations in S_n in which all cycles have odd length. - Michael Somos, Mar 17 2019
a(n) is the number of unranked labeled binary trees compatible with the binary labeled perfect phylogeny that, among possible two-leaf binary labeled perfect phylogenies for a sample of size n+2, is compatible with the smallest number of unranked labeled binary trees. - Noah A Rosenberg, Jan 16 2025

Examples

			For the Wallis numerators, denominators and partial products see A001900. - _Wolfdieter Lang_, Dec 06 2017
		

References

  • H.-D. Ebbinghaus et al., Numbers, Springer, 1990, p. 146.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 87.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Bisections are A001818 and A079484.
Row sums of unsigned triangle A049218 and of A111594, A262125.
Main diagonal of A262124.
Cf. A002019.

Programs

  • Haskell
    a000246 n = a000246_list !! n
    a000246_list = 1 : 1 : zipWith (+)
       (tail a000246_list) (zipWith (*) a000246_list a002378_list)
    -- Reinhard Zumkeller, Feb 27 2012
    
  • Magma
    I:=[1,1]; [n le 2 select I[n] else Self(n-1)+(n^2-5*n+6)*Self(n-2): n in [1..30]]; // Vincenzo Librandi, May 02 2015
  • Maple
    a:= proc(n) option remember; `if`(n<2, 1,
          a(n-1) +(n-1)*(n-2)*a(n-2))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, May 14 2018
  • Mathematica
    a[n_] := a[n] = a[n-1]*(n+Mod[n, 2]-1); a[0] = 1; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Nov 21 2011, after Pari *)
    a[n_] := a[n] = (n-2)*(n-3)*a[n-2] + a[n-1]; a[0] := 0; a[1] := 1; Table[a[i], {i, 0, 20}] (* or *)  RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(n-2)*(n-3)a[n-2]+a[n-1]}, a, {n, 20}] (* G. C. Greubel, May 01 2015 *)
    CoefficientList[Series[Sqrt[(1+x)/(1-x)], {x, 0, 20}], x]*Table[k!, {k, 0, 20}] (* Stefano Spezia, Oct 07 2018 *)
  • PARI
    a(n)=if(n<1,!n,a(n-1)*(n+n%2-1))
    
  • PARI
    Vec( serlaplace( sqrt( (1+x)/(1-x) + O(x^55) ) ) )
    
  • PARI
    a(n)=prod(k=3,n,k+k%2-1) \\ Charles R Greathouse IV, May 01 2015
    
  • PARI
    a(n)=(n!/(n\2)!>>(n\2))^2/if(n%2,n,1) \\ Charles R Greathouse IV, May 01 2015
    

Formula

E.g.f.: sqrt(1-x^2)/(1-x) = sqrt((1+x)/(1-x)).
a(2*k) = (2*k-1)*a(2*k-1), a(2*k+1) = (2*k+1)*a(2*k), for k >= 0, with a(0) = 1.
Let b(1)=0, b(2)=1, b(k+2)=b(k+1)/k + b(k); then a(n+1) = n!*b(n+2). - Benoit Cloitre, Sep 03 2002
a(n) = Sum_{k=0..floor((n-1)/2)} (2k)! * C(n-1, 2k) * a(n-2k-1) for n > 0. - Noam Katz (noamkj(AT)hotmail.com), Feb 27 2001
Also successive denominators of Wallis's approximation to Pi/2 (unreduced): 1/1 * 2/1 * 2/3 * 4/3 * 4/5 * 6/5 * 6/7 * .., for n >= 1.
D-finite with recurrence: a(n) = a(n-1) + (n-1)*(n-2)*a(n-2). - Benoit Cloitre, Aug 30 2003
a(n) is asymptotic to (n-1)!*sqrt(2*n/Pi). - Benoit Cloitre, Jan 19 2004
a(n) = n! * binomial(n-1, floor((n-1)/2)) / 2^(n-1), n > 0. - Ralf Stephan, Mar 22 2004
E.g.f.: e^atanh(x), a(n) = n!*Sum_{m=1..n} Sum_{k=m..n} 2^(k-m)*Stirling1(k,m) *binomial(n-1,k-1)/k!, n > 0, a(0)=1. - Vladimir Kruchinin, Dec 12 2011
G.f.: G(0) where G(k) = 1 + x*(4*k-1)/((2*k+1)*(x-1) - x*(x-1)*(2*k+1)*(4*k+1)/(x*(4*k+1) + 2*(x-1)*(k+1)/G(k+1))); (continued fraction, 3rd kind, 3-step). - Sergei N. Gladkovskii, Jul 24 2012
G.f.: 1 + x*(G(0) - 1)/(x-1) where G(k) = 1 - (2*k+1)/(1-x/(x - 1/(1 - (2*k+1)/(1-x/(x - 1/G(k+1) ))))); (continued fraction). - Sergei N. Gladkovskii, Jan 15 2013
G.f.: G(0), where G(k) = 1 + x*(2*k+1)/(1 - x*(2*k+1)/(x*(2*k+1) + 1/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 07 2013
For n >= 1, a(2*n) = (2*n-1)!!^2, a(2*n+1) = (2*n+1)*(2*n-1)!!^2. - Vladimir Shevelev, Dec 01 2013
E.g.f.: arcsin(x) - sqrt(1-x^2) + 1 for a(0) = 0, a(1) = a(2) = a(3) = 1. - G. C. Greubel, May 01 2015
Sum_{n>1} 1/a(n) = (L_0(1) + L_1(1))*Pi/2, where L is the modified Struve function. - Peter McNair, Mar 11 2022
From Peter Bala, Mar 29 2024: (Start)
a(n) = n! * Sum_{k = 0..n} (-1)^(n+k)*binomial(1/2, k)*binomial(-1/2, n-k).
a(n) = (1/4^n) * (2*n)!/n! * hypergeom([-1/2, -n], [1/2 - n], -1).
a(n) = n!/2^n * A063886(n). (End)

A001902 Successive denominators of Wallis's approximation to Pi/2 (reduced).

Original entry on oeis.org

1, 1, 3, 9, 45, 75, 175, 1225, 11025, 19845, 43659, 160083, 693693, 1288287, 2760615, 41409225, 703956825, 1329696225, 2807136475, 10667118605, 44801898141, 85530896451, 178837328943, 1371086188563, 11425718238025
Offset: 0

Views

Author

Keywords

Examples

			From _Wolfdieter Lang_, Dec 07 2017: (Start)
See the table in A001901 for details.
n = 5: numerator(1*2*2*4*4*6/(1*1*3*3*5*5)) = denominator(384/225) = denominator(128/75) = 75. (End)
		

References

  • H.-D. Ebbinghaus et al., Numbers, Springer, 1990, p. 146.

Crossrefs

Numerators are A001901. For the unreduced form see A001900(n)/A000246(n+1), n >= 0.

Programs

  • Mathematica
    a[n_?EvenQ] := n!!^2/((n - 1)!!^2*(n + 1)); a[n_?OddQ] := (n - 1)!!^2*(n + 1)/n!!^2; Table[a[n] // Denominator, {n, 0, 23}] (* Jean-François Alcover, Jun 19 2013 *)

Formula

(2*2*4*4*6*6*8*8*...*2n*2n*...)/(1*3*3*5*5*7*7*9*...*(2n-1)*(2n+1)*...) for n >= 1.
From Wolfdieter Lang, Dec 07 2017: (Start)
1/1 * 2/1 * 2/3 * 4/3 * 4/5 * 6/5 * 6/7 * ...; partial products (reduced). Here the denominators with offset 0.
a(n) = denominator(W(n)), for n >= 0, with W(n) = Product_{k=0..n} N(k)/D(k) (reduced), with N(k) = 2*floor((k+1)/2) for k >= 1 and N(0) = 1, and D(k) = 2*floor(k/2) + 1, for k >= 0. (End)
a(n) is the denominator of the continued fraction [1;1,1/2,1/3,...,1/n]. - Thomas Ordowski, Oct 19 2024

A284230 Number of self-avoiding planar walks starting at (0,0), ending at (n,0), remaining in the first quadrant and using steps (0,1), (1,0), (1,1), (-1,1), and (1,-1) with the restriction that (0,1) is never used below the diagonal and (1,0) is never used above the diagonal.

Original entry on oeis.org

1, 2, 5, 24, 111, 762, 5127, 45588, 400593, 4370634, 47311677, 611446464, 7857786015, 117346361778, 1745000283087, 29562853594284, 499180661754849, 9458257569095826, 178734707493557301, 3744942786114870888, 78294815164675006479, 1797384789345147560298
Offset: 0

Views

Author

Alois P. Heinz, Mar 23 2017

Keywords

Examples

			a(0) = 1: [(0,0)].
a(1) = 2: [(0,0),(1,0)], [(0,0),(0,1),(1,0)].
a(2) = 5: [(0,0),(1,0),(2,0)], [(0,0),(0,1),(1,0),(2,0)], [(0,0),(1,1),(2,0)], [(0,0),(0,1),(0,2),(1,1),(2,0)], [(0,0),(1,0),(0,1),(0,2),(1,1),(2,0)].
		

Crossrefs

Row sums of A284414.
Bisection (even part) gives A284461.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, n+1,
          (n+irem(n, 2))*a(n-1)+(n-1)*a(n-2))
        end:
    seq(a(n), n=0..25);
  • Mathematica
    a[n_]:=If[n<2, n + 1, (n + Mod[n,2]) * a[n - 1] + (n - 1) a[n - 2]]; Table[a[n], {n, 0, 25}] (* Indranil Ghosh, Mar 27 2017 *)

Formula

a(n) ~ c * n^(n+2) / exp(n), where c = 0.7741273379869056907732932906458364317717498069987762339667734187318... - Vaclav Kotesovec, Mar 27 2017
Conjecture: a(n) -a(n-1) +(-n^2-n+3)*a(n-2) +(-n+2)*a(n-3) +(n-2)*(n-3)*a(n-4)=0. - R. J. Mathar, Apr 09 2017

A001901 Successive numerators of Wallis's approximation to Pi/2 (reduced).

Original entry on oeis.org

1, 2, 4, 16, 64, 128, 256, 2048, 16384, 32768, 65536, 262144, 1048576, 2097152, 4194304, 67108864, 1073741824, 2147483648, 4294967296, 17179869184, 68719476736, 137438953472, 274877906944, 2199023255552
Offset: 0

Views

Author

Keywords

Comments

If p is prime, then a(p-2) == - A001902(p-2) (mod p). Cf. A064169 (third comment) and my formula here. Such pseudoprimes are 1467, 7831, ... Primes p such that a(p-2) == - A001902(p-2) (mod p^2) are 5, 45827, ... Cf. A355959, see also A330719 (third comment). - Thomas Ordowski, Oct 19 2024

Examples

			From _Wolfdieter Lang_, Dec 07 2017: (Start)
The Wallis numerators (N) and denominators (D) with partial products A(n) = A001900(n) and B(n) = A000246(n+1) in unreduced form, and a(n) and b(n) = A001902(n) in reduced form.
n, k:     0  1  2  3  4   5    6     7      8        9       10 ...
N(k):     1  2  2  4  4   6    6     8      8       10       10 ...
D(k):     1  1  3  3  5   5    7     7      9        9        9 ...
A(n):     1  2  4 16 64 384 2304 18432 147456  1474560 14745600 ...
B(n):     1  1  3  9 45 225 1575 11025  99225   893025  9823275 ...
a(n):     1  2  4 16 64 128  256  2048  16384    32768    65536 ...
b(n):     1  1  3  9 45  75  175  1225  11025    19845    43659 ...
n = 5: numerator(1*2*2*4*4*6/(1*1*3*3*5*5)) = numerator(384/225) = numerator(128/75) = 128. (End)
		

References

  • H.-D. Ebbinghaus et al., Numbers, Springer, 1990, p. 146.

Crossrefs

Denominators are A001902. Subsequence of A000079.

Programs

  • Mathematica
    a[n_?EvenQ] := n!!^2/((n - 1)!!^2*(n + 1)); a[n_?OddQ] := ((n - 1)!!^2*(n + 1))/n!!^2; Table[a[n] // Numerator, {n, 0, 23}] (* Jean-François Alcover, Jun 19 2013 *)

Formula

(2*2*4*4*6*6*8*8*...*2n*2n*...)/(1*3*3*5*5*7*7*9*...*(2n-1)*(2n+1)*...) for n >= 1.
From Wolfdieter Lang, Dec 07 2017: (Start)
1/1 * 2/1 * 2/3 * 4/3 * 4/5 * 6/5 * 6/7 * ...; partial products (reduced). Here the numerators with offset 0.
a(n) = numerator(W(n)), for n >= 0, with W(n) = Product_{k=0..n} N(k)/D(k) (reduced), with N(k) = 2*floor((k+1)/2) for k >= 1 and N(0) = 1, and D(k) = 2*floor(k/2) + 1, for k >= 0. (End)
a(n) is the numerator of the continued fraction [1;1,1/2,1/3,...,1/n]. - Thomas Ordowski, Oct 19 2024

A092798 Numerator of partial products in an approximation of Pi/2.

Original entry on oeis.org

2, 16, 8192, 274877906944, 5070602400912917605986812821504, 115792089237316195423570985008687907853269984665640564039457584007913129639936
Offset: 1

Views

Author

Ralf Stephan, Mar 05 2004

Keywords

Examples

			The first approximations are 2^(1/2), (16/3)^(1/4), (8192/243)^(1/8), (274877906944/215233605)^(1/16).
		

Crossrefs

Denominators are in A092799.

Programs

  • PARI
    for(m=1, 7, p=1; for(n=1, m, p=p*p*(prod(k=1, ceil(n/2), (2*k)^binomial(n, 2*k-1))/(prod(k=1, floor(n/2)+1, (2*k-1)^binomial(n, 2*k-2))))); print1(numerator(p), ", "))

Formula

a(n) = Product_{k=1..n+1} A122214(k)^2^(n-k+1). - Jonathan Sondow, Sep 13 2006
a(n) = Numerator(Product_{k=1..n+1} (A122216(k)/A122217(k))^2^(n-k+1)). - Jonathan Sondow, Sep 13 2006

A046126 Denominators q[ n ] of convergents to Stern's non-simple continued fraction for Pi/2.

Original entry on oeis.org

1, 3, -3, -15, 45, 315, -1575, -14175, 99225, 1091475, -9823275, -127702575, 1404728325, 21070924875, -273922023375, -4656674397375, 69850115960625, 1327152203251875, -22561587455281875, -473793336560919375
Offset: 0

Views

Author

Keywords

Crossrefs

Numerators p[ n ] are (-1)^[n/2]*A001900(n). See also A013069.
Cf. A079484.

Programs

  • Mathematica
    b[ n_ ] := 2-(-1)^n; a[ 1 ] := -1; a[ n_Integer?EvenQ ] := -n(n+1); a[ n_Integer?OddQ ] := -(n-2)(n-1); then use the standard algorithm to get p[ n ]/q[ n ].
    a[n_] := Product[If[OddQ[k], k+2, 1-k], {k, 1, n}]; Table[a[n], {n, 0, 19}] (* Jean-François Alcover, Nov 06 2012, after 1st Pari program *)
  • PARI
    a(n)=if(n<0,0,prod(k=1,n,if(k%2,k+2,1-k)))
    
  • PARI
    {a(n)=local(A); if(n<0, 0, A=matrix(2,n+1); for(k=0, n, A[2, k+1]=if(k%2, 3, 1); A[1, k+1]=if(k<2, (-1)^k, if(k%2, -(k-2)*(k-1), -k*(k+1)))); contfracpnqn(A)[2,1])} /* Michael Somos, Jul 15 2003 */

Formula

E.g.f.: exp(asinh(x))((1+x)/(1+x^2)+(2-x+x^2)/(1+x^2)^(3/2))-2. - Michael Somos, Mar 11 2004
E.g.f.: (1+3*x+2*x^3)/(1+x^2)^(3/2). - Vaclav Kotesovec, Oct 05 2013
a(n) ~ 2*(cos(Pi*n/2)+sin(Pi*n/2)) * n^(n+1) / exp(n). - Vaclav Kotesovec, Oct 05 2013

A092799 Denominator of partial products in an approximation to Pi/2.

Original entry on oeis.org

1, 3, 243, 215233605, 2849452841966467687734375, 34139907905802495953388390516678108673704867996275424957275390625
Offset: 1

Views

Author

Ralf Stephan, Mar 05 2004

Keywords

Examples

			The first approximations are 2^(1/2), (16/3)^(1/4), (8192/243)^(1/8), (274877906944/215233605)^(1/16).
		

Crossrefs

Numerators are in A092798.

Programs

  • PARI
    for(m=1, 7, p=1; for(n=1, m, p=p*p*(prod(k=1, ceil(n/2), (2*k)^binomial(n, 2*k-1))/(prod(k=1, floor(n/2)+1, (2*k-1)^binomial(n, 2*k-2))))); print1(denominator(p), ", "))

Formula

a(n) = Product_{k=1..n+1} A122215(k)^2^(n-k+1). - Jonathan Sondow, Sep 13 2006
a(n) = Denominator(Product_{k=1..n+1} (A122216(k)/A122217(k))^2^(n-k+1)). - Jonathan Sondow, Sep 13 2006
Showing 1-7 of 7 results.