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-10 of 14 results. Next

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)

A258829 Number T(n,k) of permutations p of [n] such that the up-down signature of 0,p has nonnegative partial sums with a maximal value of k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 2, 1, 0, 5, 11, 3, 1, 0, 16, 38, 28, 4, 1, 0, 61, 263, 130, 62, 5, 1, 0, 272, 1260, 1263, 340, 129, 6, 1, 0, 1385, 10871, 8090, 4734, 819, 261, 7, 1, 0, 7936, 66576, 88101, 33855, 16066, 1890, 522, 8, 1, 0, 50521, 694599, 724189, 495371, 127538, 52022, 4260, 1040, 9, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 11 2015

Keywords

Examples

			p = 1432 is counted by T(4,2) because the up-down signature of 0,p = 01432 is 1,1,-1,-1 with partial sums 1,2,1,0.
q = 4321 is not counted by any T(4,k) because the up-down signature of 0,q = 04321 is 1,-1,-1,-1 with partial sums 1,0,-1,-2.
T(4,1) = 5: 2143, 3142, 3241, 4132, 4231.
T(4,2) = 11: 1324, 1423, 1432, 2134, 2314, 2413, 2431, 3124, 3412, 3421, 4123.
T(4,3) = 3: 1243, 1342, 2341.
T(4,4) = 1: 1234.
Triangle T(n,k) begins:
  1;
  0,    1;
  0,    1,     1;
  0,    2,     2,    1;
  0,    5,    11,    3,    1;
  0,   16,    38,   28,    4,   1;
  0,   61,   263,  130,   62,   5,   1;
  0,  272,  1260, 1263,  340, 129,   6, 1;
  0, 1385, 10871, 8090, 4734, 819, 261, 7, 1;
		

Crossrefs

Row sums give A258830.
T(2n,n) gives A266947.

Programs

  • Maple
    b:= proc(u, o, c, k) option remember;
          `if`(c<0 or c>k, 0, `if`(u+o=0, 1,
           add(b(u-j, o-1+j, c+1, k), j=1..u)+
           add(b(u+j-1, o-j, c-1, k), j=1..o)))
        end:
    A:= (n, k)-> b(n, 0$2, k):
    T:= (n, k)-> A(n, k) -`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..n), n=0..12);
  • Mathematica
    b[u_, o_, c_, k_] := b[u, o, c, k] = If[c < 0 || c > k, 0, If[u + o == 0, 1, Sum[b[u - j, o - 1 + j, c + 1, k], {j, 1, u}] + Sum[b[u + j - 1, o - j, c - 1, k], {j, 1, o}]]];
    A[n_, k_] := b[n, 0, 0, k];
    T[n_, k_] :=  A[n, k] - If[k == 0, 0, A[n, k - 1]];
    Table[T[n, k], {n, 0, 12}, { k, 0, n}] // Flatten (* Jean-François Alcover, Jun 09 2018, after Alois P. Heinz *)

Formula

T(n,k) = A262163(n,k) - A262163(n,k-1) for k>0, T(n,0) = A262163(n,0).

A262124 Number A(n,k) of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 2, 0, 1, 1, 1, 3, 5, 0, 1, 1, 1, 3, 8, 16, 0, 1, 1, 1, 3, 9, 40, 61, 0, 1, 1, 1, 3, 9, 44, 162, 272, 0, 1, 1, 1, 3, 9, 45, 219, 1134, 1385, 0, 1, 1, 1, 3, 9, 45, 224, 1445, 6128, 7936, 0, 1, 1, 1, 3, 9, 45, 225, 1568, 9985, 55152, 50521, 0
Offset: 0

Views

Author

Alois P. Heinz, Sep 11 2015

Keywords

Examples

			p = 1423 is counted by T(4,1) because the up-down signature of p = 1423 is 1,-1,1 with partial sums 1,0,1.
q = 1432 is not counted by any T(4,k) because the up-down signature of q = 1432 is 1,-1,-1 with partial sums 1,0,-1.
A(4,1) = 5: 1324, 1423, 2314, 2413, 3412.
A(4,2) = 8: 1243, 1324, 1342, 1423, 2314, 2341, 2413, 3412.
A(4,3) = 9: 1234, 1243, 1324, 1342, 1423, 2314, 2341, 2413, 3412.
Square array A(n,k) begins:
  1,   1,    1,    1,    1,    1,    1,    1, ...
  1,   1,    1,    1,    1,    1,    1,    1, ...
  0,   1,    1,    1,    1,    1,    1,    1, ...
  0,   2,    3,    3,    3,    3,    3,    3, ...
  0,   5,    8,    9,    9,    9,    9,    9, ...
  0,  16,   40,   44,   45,   45,   45,   45, ...
  0,  61,  162,  219,  224,  225,  225,  225, ...
  0, 272, 1134, 1445, 1568, 1574, 1575, 1575, ...
		

Crossrefs

Main diagonal gives A000246.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0, 0, `if`(u+o=0, x^c,
          (p-> add(coeff(p, x, i)*x^max(i, c), i=0..degree(p)))(add(
           b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
        end:
    A:= (n,k)-> `if`(n=0, 1, (p-> add(coeff(p, x, i), i=0..min(n, k))
                  )(add(b(j-1, n-j, 0), j=1..n))):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[u_, o_, c_] := b[u, o, c] = If[c<0, 0, If[u+o == 0, x^c, Function[p, Sum[ Coefficient[p, x, i]*x^Max[i, c], {i, 0, Exponent[p, x]}]][Sum[b[u-j, o - 1+j, c-1], {j, 1, u}] + Sum[b[u+j-1, o-j, c+1], {j, 1, o}]]]]; A[n_, k_] := If[n==0, 1, Function[p, Sum[Coefficient[p, x, i], {i, 0, Min[n, k]}]][ Sum[b[j-1, n-j, 0], {j, 1, n}]]]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Feb 22 2016, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{i=0..k} A262125(n,i).

A321280 Number T(n,k) of permutations p of [n] with exactly k descents such that the up-down signature of p has nonnegative partial sums; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-1)/2)), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 8, 1, 22, 22, 1, 52, 172, 1, 114, 856, 604, 1, 240, 3488, 7296, 1, 494, 12746, 54746, 31238, 1, 1004, 43628, 330068, 518324, 1, 2026, 143244, 1756878, 5300418, 2620708, 1, 4072, 457536, 8641800, 43235304, 55717312, 1, 8166, 1434318, 40298572, 309074508, 728888188, 325024572
Offset: 0

Views

Author

Alois P. Heinz, Nov 01 2018

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  1;
  1;
  1,     2;
  1,     8;
  1,    22,      22;
  1,    52,     172;
  1,   114,     856,       604;
  1,   240,    3488,      7296;
  1,   494,   12746,     54746,      31238;
  1,  1004,   43628,    330068,     518324;
  1,  2026,  143244,   1756878,    5300418,    2620708;
  1,  4072,  457536,   8641800,   43235304,   55717312;
  1,  8166, 1434318,  40298572,  309074508,  728888188,  325024572;
  1, 16356, 4438540, 180969752, 2026885824, 7589067592, 8460090160;
  ...
		

Crossrefs

Columns k=0-3 give: A000012, A005803 (for n>0), A321268, A321269.
Row sums give A000246.
T(2n+1,n) gives A177042.
T(2n+2,n) gives A303285(n+1).

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0, 0, `if`(u+o=0, 1/x,
           add(expand(x*b(u-j, o-1+j, c-1)), j=1..u)+
           add(b(u+j-1, o-j, c+1), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(`if`(n=0, 1, b(n, 0, 1))):
    seq(T(n), n=0..14);
  • Mathematica
    b[u_, o_, c_] := b[u, o, c] = If[c < 0, 0, If[u + o == 0, 1/x, Sum[Expand[ x*b[u - j, o - 1 + j, c - 1]], {j, 1, u}] + Sum[b[u + j - 1, o - j, c + 1], {j, 1, o}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ If[n == 0, 1, b[n, 0, 1]]];
    Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Dec 08 2018, after Alois P. Heinz *)

A262127 Number of permutations p of [2n] such that the up-down signature of p has nonnegative partial sums with a maximal value of n.

Original entry on oeis.org

1, 1, 3, 57, 778, 47673, 1477381, 196352061, 10896848134, 2539183745028, 220995092995233, 79875004816604671, 10032237471596350240, 5198811549997063847059, 890008776794671492878641, 626002734896306246681963237, 140112228518254335504033414806
Offset: 0

Views

Author

Alois P. Heinz, Sep 11 2015

Keywords

Crossrefs

Cf. A262125.

Formula

a(n) = A262125(2n,n).

A320976 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value of two.

Original entry on oeis.org

0, 1, 3, 24, 101, 862, 4743, 47216, 322039, 3744368, 30517747, 409498400, 3884904379, 59360223088, 642766195887, 11046815693568, 134468538125519, 2571506053105408, 34764547687430955, 732881798335913984, 10895866774781276947, 251184536044504689152
Offset: 2

Views

Author

Alois P. Heinz, Oct 25 2018

Keywords

Crossrefs

Column k=2 of A262125.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0 or c>2, 0, `if`(u+o=0,
           x^c, (p-> add(coeff(p, x, i)*x^max(i, c), i=0..2))(add(
           b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
        end:
    a:= n-> coeff(add(b(j-1, n-j, 0), j=1..n), x, 2):
    seq(a(n), n=2..30);

Formula

a(n) = A262126(n) - A000111(n).

A320977 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value of three.

Original entry on oeis.org

0, 1, 4, 57, 311, 3857, 27589, 355751, 3185258, 44435241, 479927081, 7311147055, 92603527295, 1540826943617, 22398016781688, 405865410503155, 6658173453910401, 130871330990044897, 2390845313044048301, 50759828657781860167, 1021623022236754343662
Offset: 3

Views

Author

Alois P. Heinz, Oct 25 2018

Keywords

Crossrefs

Column k=3 of A262125.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0 or c>3, 0, `if`(u+o=0,
           x^c, (p-> add(coeff(p, x, i)*x^max(i, c), i=0..3))(add(
           b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
        end:
    a:= n-> coeff(add(b(j-1, n-j, 0), j=1..n), x, 3):
    seq(a(n), n=3..30);

Formula

a(n) = A262128(n) - A262126(n).

A320978 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value of four.

Original entry on oeis.org

0, 1, 5, 123, 778, 14126, 111811, 1957924, 18846572, 342736488, 3904186779, 75626480215, 996651530998, 20739117286767, 310506509296055, 6952893022274589, 116561453850733664, 2805243168612301480, 52046467944203248643, 1342921799608903158968
Offset: 4

Views

Author

Alois P. Heinz, Oct 25 2018

Keywords

Crossrefs

Column k=4 of A262125.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0 or c>4, 0, `if`(u+o=0,
           x^c, (p-> add(coeff(p, x, i)*x^max(i, c), i=0..4))(add(
           b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
        end:
    a:= n-> coeff(add(b(j-1, n-j, 0), j=1..n), x, 4):
    seq(a(n), n=4..30);

Formula

a(n) = A262129(n) - A262128(n).

A320979 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value of five.

Original entry on oeis.org

0, 1, 6, 254, 1835, 47673, 416221, 9565156, 99383961, 2250472801, 27333591309, 635688426842, 8878319017022, 215812184750821, 3416973303551969, 87455366666951644, 1550782738938548075, 41903722165381482287, 823596208419940694670, 23503436481574417378942
Offset: 5

Views

Author

Alois P. Heinz, Oct 25 2018

Keywords

Crossrefs

Column k=5 of A262125.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0 or c>5, 0, `if`(u+o=0,
           x^c, (p-> add(coeff(p, x, i)*x^max(i, c), i=0..5))(add(
           b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
        end:
    a:= n-> coeff(add(b(j-1, n-j, 0), j=1..n), x, 5):
    seq(a(n), n=5..30);

Formula

a(n) = A262130(n) - A262129(n).

A320980 Number of permutations p of [n] such that the up-down signature of p has nonnegative partial sums with a maximal value of six.

Original entry on oeis.org

0, 1, 7, 514, 4189, 154261, 1477381, 44169020, 493190771, 13821362271, 177705152975, 4949371839867, 72355179873697, 2058206624313873, 33818827542140211, 995975339452380880, 18206096557050382759, 558929622195992201388, 11264684856271486133087
Offset: 6

Views

Author

Alois P. Heinz, Oct 25 2018

Keywords

Crossrefs

Column k=6 of A262125.

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0 or c>6, 0, `if`(u+o=0,
           x^c, (p-> add(coeff(p, x, i)*x^max(i, c), i=0..6))(add(
           b(u-j, o-1+j, c-1), j=1..u)+add(b(u+j-1, o-j, c+1), j=1..o))))
        end:
    a:= n-> coeff(add(b(j-1, n-j, 0), j=1..n), x, 6):
    seq(a(n), n=6..30);

Formula

a(n) = A262131(n) - A262130(n).
Showing 1-10 of 14 results. Next