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.

Previous Showing 21-30 of 36 results. Next

A120434 Triangle read by rows: counts permutations by number of big descents.

Original entry on oeis.org

2, 4, 2, 8, 14, 2, 16, 66, 36, 2, 32, 262, 342, 82, 2, 64, 946, 2416, 1436, 176, 2, 128, 3222, 14394, 16844, 5364, 366, 2, 256, 10562, 76908, 156190, 99560, 18654, 748, 2, 512, 33734, 381566, 1242398, 1378310, 528818, 61946, 1514, 2
Offset: 2

Views

Author

David Callan, Jul 14 2006, Sep 25 2006

Keywords

Comments

A big descent in a permutation (x_1,x_2,...,x_n) is a position i such that x_i - x_(i+1) >= 2. T(n,k) is the number of permutations on [n] with k big descents. The mean number of big descents in permutations on [n] is (n-1)(n-2)/(2n). For S(n,k):=number of permutations on [n] with k small descents, that is, indices i such that x_i - x_(i+1) = 1, the gf Sum_{n>=0,k>=0} S(n+1,k) x^n/n! y^k is 1/(E^(x(1 - y))*(1 - x)^2).
T(n,k) is also the number of recursive trees with n+1 vertices and k+2 leaves. (A recursive tree on n vertices is a rooted tree with the vertices labeled 1, 2, ... n, such that the root is labeled 1 and every path starting at the root is increasing with respect to the labels.) - Taral Guldahl Seierstad (seiersta(AT)informatik.hu-berlin.de), Oct 12 2006
In the comment by T. G. Seierstad, the term "leaf" means "vertex incident with exactly one edge." Thus if the root has only one child, the root is a leaf. T(n,k) is the number of trees rooted at 0 on vertex set {0,1,2,...,n} that contain k+1 leaves (here a leaf is a vertex with no children) and such that, for i = 0,1,...,n-1, there is exactly one vertex larger than i incident with i. For example, T(3,0) = 4 counts {0->1->2->3}, {0->1->3->2}, {0->2->3->1}, {0->3->2->1} and T(3,1) = 2 counts {0->2->1,2->3}, {0->3->1,3->2} (the arrows indicate edges directed away from the root). - David Callan, Feb 01 2007
From Peter Bala, Sep 19 2008: (Start)
If we divide the entries of this array by 2 and then read the rows in reverse order we obtain the array of 2-Eulerian numbers A144696.
Two equivalent interpretations of this array are:
A) Define a permutation p in the symmetric group S_n to have an r-excedance at position i, 1 <= i <= n-1, if p(i) >= i+r. This array gives the number of permutations in the symmetric group S_n having k 2-excedances (see the last chapter of [Riordan]). For example, in the symmetric group S_3, the two permutations (3,1,2) and (3,2,1) have a single 2-excedance, while the remaining four permutations have no 2-excedances. Hence T(3,0) = 4 and T(3,1) = 2. The triangle of Eulerian numbers A008292 enumerates permutations by 1-excedances (with an offset of 1 in the column indexing).
B) T(n,k) gives the number of permutations in the group S_(n+1) starting with a 2 and having k+1 descents [Conger]. For example, in the symmetric group S_4, the permutations (2,1,4,3) and (2,4,3,1) start with a 2 and have two descents so T(3,1) = 2, while the four permutations (2,1,3,4), (2,3,1,4), (2,3,4,1) and (2,4,1,3) start with a 2 and have a single descent giving T(3,0) = 4. (End)
Appears to be mirror image of A199335. - Dale Gerdemann, Apr 18 2015
T(n,k) gives the number of permutations in the group S_n with k+1 special descents, where a special descent is defined as either a normal descent or if the permutation starts with 1. For example, in the symmetric group S_3, the permutations (1,3,2) and (3,2,1) have 2 special descents so T(3,1)=2, while the permutations (1,2,3), (2,1,3), (2,3,1), and (3,1,2) have one special descent, giving T(3,0)=4. - Tanya Khovanova and Rich Wang, Jan 31 2023

Examples

			Table begins
  n\ k|  0     1     2     3     4     5
  ----+---------------------------------
    2 |  2
    3 |  4     2
    4 |  8    14     2
    5 | 16    66    36     2
    6 | 32   262   342    82     2
    7 | 64   946  2416  1436   176     2
The permutation (5,1,4,2,3) has big descents at i=1 and i=3. T(3,1)=2 counts (3,1,2) and (2,3,1).
		

References

  • J. Riordan, An introduction to combinatorial analysis, J. Wiley, 1958.

Crossrefs

Column k=1 is twice A066810. See A010027 for small descents.

Programs

  • Maple
    U := proc(n,k) option remember: if k < 0 or k > n then 0 elif n = 0 then 1 else (k+2)*U(n-1, k) + (n-k)*U(n-1, k-1) fi end: T_row := n -> seq(U(n-1,k), k = 0..n-2): for n from 2 to 7 do T_row(n) od; # Peter Luschny, Oct 15 2017
  • Mathematica
    a[0,0] = 1; a[1,0] = 1; a[n_,k_]/;n<=1 && k>=1 := 0 a[n_,k_]/;k>=n-1>=1 || k<0 := 0 a[n_,k_]/;0<=k<=n-2 := a[n,k] = (k+1)Sum[a[i,k],{i,0,n-1}] + Sum[(i-k)a[i,k-1],{i,n-1}] Table[a[n,k],{n,0,10},{k,0, Max[0,n-2]}]

Formula

T(n,k) = Sum_{j=0..k} (-1)^j*(k + 1 - j)*binomial(n + 1, j)*(k + 2 - j)^(n - 1). The generating function F(x,y) := Sum_{n>=0,k>=0} T(n+2,k)*(x^n/n!)*y^k is given by F(x,y) = 2E^(2x(1-y)) G(x,y)^3 where G(x,y) := (1 - y)/(1 - E^(x(1 - y)) y) is 1 + Sum_{n>=1,k>=1} a(n,k)*(x^n/n!)*y^k and a(n,k) are the Eulerian numbers A008292. Note the offsets S(n+1) and T(n+2) in the definition of their g.f.s. A recurrence is given in the Mathematica code below.
From Peter Bala, Sep 19 2008: (Start)
The e.g.f. has the form (A(x,t))^2 = 1 + 2*t + (4 + 2*x)*t^2/2! + (8 + 14*x + 2*x^2)*t^3/3! + ..., where A(x,t) = (1 - x)/(exp(t*x - t) - x) = 1 + t + (1 + x)*t^2/2! + (1 + 4x + x^2)*t^3/3! + ... is the e.g.f. for the Eulerian numbers A008292.
Define the row polynomials R(n,x) := Sum_{k=0..n-2} T(n,k)*x^k. Then x^2*R(n,x) = A(n,x) + (x-1)*A(n-1,x), where the A(n,x) are the Eulerian polynomials. For example, when n = 4, R(4,x) = (1/x^2)*{(x + 11*x^2 + 11*x^3 + x^4) + (x-1)*(x + 4*x^2 + x^3)} = 8 + 14*x + 2*x^2.
The row polynomials are also related to the Eulerian polynomials via differentiation. For example, d/dx[(1 + 4*x + x^2)/(1-x)^4] = (8 + 14*x + 2*x^2)/(1-x)^5 and d/dx[(1 + 11*x + 11*x^2 + x^3)/(1-x)^5] = (16 + 66*x + 36*x^2 + 2*x^3)/(1-x)^6.
Let p be a permutation in the symmetric group S_n. Let cyc(p) denote the number of cycles of p. Let exc(p) denote the number of excedances of p. Then R(n+1,x) = Sum_{p in S_n} 2^cyc(p)*x^exc(p) [Foata & Schutzenberger p. 40]. For example, for n = 2, the identity permutation (1,2) has 2 cycles and no excedances and so contributes 4 to the sum, while the transposition (2,1) has a single cycle and one excedance and contributes 2*x to the sum; hence R(3,x) = 4 + 2*x.
R(n+1,x) = Sum_{k = 1..n} (k+1)!*Stirling2(n,k)*(x-1)^(n-k) for n = 1,2,... (see [Riordan p. 214]).
Worpitzky type identities:
Sum_{k = 0..n-2} T(n,k)*binomial(x+k,n) = x*(x-1)^(n-1);
Sum_{k = 0..n-2} T(n,n-2-k)*binomial(x+k,n) = (x-1)*x^(n-1). (End)
If enumerated like the Eulerian numbers by Knuth (A173018) with 1 prepended, i.e., as 1; 2, 0; 4, 2, 0; 8, 14, 2, 0; ... with 0 <= k <= n the numbers have the recurrence (k+2)*U(n-1, k) + (n-k)*U(n-1, k-1). - Peter Luschny, Oct 15 2017

A384891 Number of permutations of {1..n} with all distinct lengths of maximal runs (increasing by 1).

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 23, 25, 43, 63, 345, 365, 665, 949, 1513, 8175, 9003, 15929, 23399, 36949, 51043, 293715, 314697, 570353, 826817, 1318201, 1810393, 2766099, 14180139, 15600413, 27707879, 40501321, 63981955, 88599903, 134362569, 181491125, 923029217
Offset: 0

Views

Author

Gus Wiseman, Jun 19 2025

Keywords

Examples

			The permutation (1,2,6,7,8,9,3,4,5) has maximal runs ((1,2),(6,7,8,9),(3,4,5)), with lengths (2,4,3), so is counted under a(9).
The a(0) = 1 through a(7) = 25 permutations:
  ()  (1)  (12)  (123)  (1234)  (12345)  (123456)  (1234567)
                 (231)  (2341)  (23451)  (123564)  (1234675)
                 (312)  (4123)  (34512)  (123645)  (1234756)
                                (45123)  (124563)  (1245673)
                                (51234)  (126345)  (1273456)
                                         (145623)  (1456723)
                                         (156234)  (1672345)
                                         (231456)  (2314567)
                                         (234156)  (2345167)
                                         (234561)  (2345671)
                                         (312456)  (3124567)
                                         (345126)  (3456127)
                                         (345612)  (3456712)
                                         (412356)  (4567123)
                                         (451236)  (4567231)
                                         (456231)  (4567312)
                                         (456312)  (5123467)
                                         (561234)  (5612347)
                                         (562341)  (5671234)
                                         (564123)  (6712345)
                                         (612345)  (6723451)
                                         (634512)  (6751234)
                                         (645123)  (7123456)
                                                   (7345612)
                                                   (7561234)
		

Crossrefs

Counting by number of maximal anti-runs gives A010027, for runs A123513.
For subsets instead of permutations we have A384175, complement A384176.
For partitions we have A384884 (anti-runs A384885), strict A384178 (anti-runs A384880).
For equal instead of distinct lengths we have A384892.
For anti-runs instead of runs we have A384907.
A000041 counts integer partitions, strict A000009.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A356606 counts strict partitions without a neighborless part, complement A356607.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Permutations[Range[n]],UnsameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]
  • PARI
    lista(n)=my(b(n)=sum(i=0,n-1,(-1)^i*(n-i)!*binomial(n-1,i)), d=floor(sqrt(2*n)), p=prod(i=1,n,1+x*y^i,1+O(y*y^n)*((1-x^(n+1))/(1-x))+O(x*x^d))); Vec(1+sum(i=1,d,i!*b(i)*polcoef(p,i))) \\ Christian Sievers, Jun 22 2025

Formula

a(n) = Sum_{k=1..n} ( T(n,k) * A000255(k-1) ) for n>=1, where T(n,k) is the number of compositions of n into k distinct parts (cf. A072574). - Christian Sievers, Jun 22 2025

Extensions

a(11) and beyond from Christian Sievers, Jun 22 2025

A384892 Number of permutations of {1..n} with all equal lengths of maximal runs (increasing by 1).

Original entry on oeis.org

1, 1, 2, 4, 13, 54, 314, 2120, 16700, 148333, 1468512, 16019532, 190899736, 2467007774, 34361896102, 513137616840, 8178130784179, 138547156531410, 2486151753462260, 47106033220679060, 939765362754015750, 19690321886243848784, 432292066866187743954
Offset: 0

Views

Author

Gus Wiseman, Jun 19 2025

Keywords

Examples

			The permutation (1,2,5,6,3,4,7,8) has maximal runs ((1,2),(5,6),(3,4),(7,8)), with lengths (2,2,2,2), so is counted under a(8).
The a(0) = 1 through a(4) = 13 permutations:
  ()  (1)  (12)  (123)  (1234)
           (21)  (132)  (1324)
                 (213)  (1432)
                 (321)  (2143)
                        (2413)
                        (2431)
                        (3142)
                        (3214)
                        (3241)
                        (3412)
                        (4132)
                        (4213)
                        (4321)
		

Crossrefs

For subsets instead of permutations we have A243815, for anti-runs A384889.
For strict partitions and distinct lengths we have A384178, anti-runs A384880.
For integer partitions and distinct lengths we have A384884, anti-runs A384885.
For distinct lengths we have A384891, for anti-runs A384907.
For partitions we have A384904, strict A384886.
A010027 counts permutations by maximal anti-runs, for runs A123513.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Permutations[Range[n]],SameQ@@Length/@Split[#,#2==#1+1&]&]],{n,0,10}]
  • PARI
    a(n)=if(n,sumdiv(n,d,sum(i=0,d-1,(-1)^i*(d-i)!*binomial(d-1,i))),1) \\ Christian Sievers, Jun 22 2025

Formula

a(n) = Sum_{d|n} A000255(d-1). - Christian Sievers, Jun 22 2025

Extensions

a(11) and beyond from Christian Sievers, Jun 22 2025

A001260 Number of permutations of length n with 4 consecutive ascending pairs.

Original entry on oeis.org

0, 0, 0, 0, 1, 5, 45, 385, 3710, 38934, 444990, 5506710, 73422855, 1049946755, 16035550531, 260577696015, 4489954146860, 81781307674780, 1570201107355980, 31698434854748604, 671260973394676605, 14879618243581997745
Offset: 1

Views

Author

Keywords

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • 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

A diagonal in triangle A010027.

Programs

  • Maple
    a:=n->sum((n+2)!*sum((-1)^k/k!/4!, j=1..n), k=0..n): seq(a(n), n=2..19); # Zerinvary Lajos, May 25 2007
    series(hypergeom([2, 5],[],x/(x+1))/(x+1)^5,x=0,30); # Mark van Hoeij, Nov 07 2011
  • Mathematica
    Drop[CoefficientList[Series[x^4/4! Exp[-x]/(1 - x)^2, {x, 0, 20}], x] Range[0, 20]!, 4] (* Vaclav Kotesovec, Mar 26 2014 *)

Formula

(n-1)*a(n) = (n+3)*(a(n-1)*n + a(n-2)*n - a(n-1) + 2*a(n-2)).
E.g.f.: (for offset 4): (x^4/4!)*exp(-x)/(1-x)^2. - Vladeta Jovovic, Jan 03 2003
G.f.: (for offset 0): hypergeom([2, 5],[],x/(x+1))/(x+1)^5. - Mark van Hoeij, Nov 07 2011
Recurrence (for offset 5): (n-5)*a(n) = (n-5)*(n-1)*a(n-1) + (n-2)*(n-1)*a(n-2). - Vaclav Kotesovec, Mar 26 2014
a(n) ~ n! * exp(-1)/24. - Vaclav Kotesovec, Mar 26 2014

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Name clarified and offset changed by N. J. A. Sloane, Apr 12 2014

A081923 Expansion of e.g.f.: exp(2x)/(1-x)^2.

Original entry on oeis.org

1, 4, 18, 92, 536, 3552, 26608, 223456, 2085504, 21450752, 241320704, 2949474816, 38933066752, 552141672448, 8374148696064, 135274709700608, 2318995023429632, 42051109758173184, 804227474125029376
Offset: 0

Views

Author

Paul Barry, Apr 01 2003

Keywords

Comments

Binomial transform of A001339.
Polynomials in A010027 evaluated at 3. - Ralf Stephan, Dec 15 2004
From Dennis P. Walsh, Sep 18 2013: (Start)
a(n) is the number of rooted labeled forests that satisfy the following conditions:
(i) there are 4 roots labeled 1, 2, 3, and 4;
(ii) there are n non-root vertices labeled 5,..., n+4;
(iii) the trees with roots 1 and 2 have width one;
(iv) the trees with roots 3 and 4 have height at most one.
To construct such a forest, for k=0,...,n, we take the following steps:
(1) choose k non-root vertices for trees with roots 1 and 2;
(2) construct width-one trees on roots 1 and 2 with the k non-root vertices;
(3) with the n-k remaining non-root vertices construct trees of height at most one on roots 3 and 4.
Thus a(n) is the sum (over k) of the product of the number of ways to do each step: a(n)=sum(k=0..n, binomial(n,k)*(k+1)!*2^(n-k)). (End)

Examples

			For n=2, the a(2)=18 forests that satisfy the specified conditions are given in the link above. - _Dennis P. Walsh_, Sep 20 2013
		

Crossrefs

Cf. A081923(n) (sum(k=0..n, binomial(n,k)*A000522(n-k)*A000522(k))).

Programs

  • Maple
    seq(n!*add((k+1)*2^(n-k)/(n-k)!,k=0..n),n=0..40); # Dennis P. Walsh, Sep 18 2013
    seq(simplify(KummerU(-n, -n - 1, 2)), n = 0..24); # Peter Luschny, May 10 2022
  • Mathematica
    With[{nn=20},CoefficientList[Series[Exp[2x]/(1-x)^2,{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, May 10 2025 *)

Formula

E.g.f.: exp(2*x)/(1-x)^2
E.g.f.: 1/U(0) where U(k)= 1 - 2*x/( 1 + x/(2 - x - 4/( 2 - x*(k+1)/U(k+1)))) ; (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Oct 28 2012
Conjecture: a(n) +(-n-3)*a(n-1) +2*(n-1)*a(n-2)=0. - R. J. Mathar, Nov 24 2012
G.f.: 2/x/G(0) - 1/x, where G(k)= 1 + 1/(1 - x*(2*k+2)/(x*(2*k+4) - 1 + x*(2*k+2)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 31 2013
G.f.: (sum(k>=0, k!*(x/(1-2*x))^k ) - 1)/x = Q(0)/(2*x) - 1/x, where Q(k)= 1 + 1/(1 - x*(k+1)/(x*(k+1) + (1-2*x)/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 09 2013
G.f.: W(0)/x - 1/x, where W(k) = 1 - x*(k+1)/( x*(k+3) - 1/(1 - x*(k+1)/( x*(k+1) - 1/W(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Aug 26 2013
a(n) = n!*sum(k=0..n, (k+1)*2^(n-k)/(n-k)!). [Dennis P. Walsh, Sep 18 2013]
a(n) = n!*sum(k=0..n, (n-k+1)*2^k/k!). [Dennis P. Walsh, Sep 18 2013]
From Peter Bala, Sep 25 2013: (Start)
a(n) ~ n!*n*e^2.
Applying Maple's ZeilbergerRecurrence command to the above series of Walsh for a(n) results in the first-order recurrence equation (n - 1)*a(n+1) = n*(n + 1)*a(n) - 2^(n+2) with a(0) = 1 and a(2) = 18. Using this it is easy to verify that a(n) satisfies the second-order recurrence a(n) = (n + 3)*a(n-1) - 2*(n - 1)*a(n-2) conjectured above by Mathar.
The sequence b(n) = n!*(n - 1) satisfies the same second-order recurrence but with the initial conditions b(0) = -1 and b(1) = 0. This leads to the finite continued fraction expansion a(n)/b(n) = 9 - 2*( 4/(6 - 6/(7 - 8/(9 - ... - 2*n/(n + 4)))) ) valid for n >= 2. Letting n tend to infinity produces the infinite continued fraction expansion e^2 = 9 - 2*( 4/(6 - 6/(7 - 8/(9 - ... - 2*n/(n + 4 - ...)))) ). (End)
a(n) = KummerU(-n, -n - 1, 2). - Peter Luschny, May 10 2022

Extensions

Definition clarified by Harvey P. Dale, May 10 2025

A001261 Number of permutations of length n with 5 consecutive ascending pairs.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 6, 63, 616, 6678, 77868, 978978, 13216104, 190899423, 2939850914, 48106651593, 833848627248, 15265844099324, 294412707629208, 5966764207952724, 126793739418994416, 2819296088257641741, 65470320271760790078
Offset: 1

Views

Author

Keywords

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • 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

A diagonal in triangle A010027.

Programs

  • Maple
    a:=n->sum((n+3)!*sum((-1)^k/k!/5!, j=1..n), k=0..n): seq(a(n), n=2..19); # Zerinvary Lajos, May 25 2007
  • Mathematica
    Range[0, 30]! CoefficientList[Series[x^5/5!*Exp[-x]/(1 - x)^2, {x, 0, 40}], x] (* Vincenzo Librandi, Apr 13 2014 *)

Formula

E.g.f.: (x^5/5!)*exp(-x)/(1-x)^2. - Vladeta Jovovic, Jan 03 2003

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Name clarified and offset changed by N. J. A. Sloane, Apr 12 2014

A202023 Triangle T(n,k), read by rows, given by (1, 0, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 3, 0, 0, 1, 6, 1, 0, 0, 1, 10, 5, 0, 0, 0, 1, 15, 15, 1, 0, 0, 0, 1, 21, 35, 7, 0, 0, 0, 0, 1, 28, 70, 28, 1, 0, 0, 0, 0, 1, 36, 126, 84, 9, 0, 0, 0, 0, 0, 1, 45, 210, 210, 45, 1, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Dec 10 2011

Keywords

Comments

Riordan array (1/(1-x), x^2/(1-x)^2).
A skewed version of triangular array A085478.
Mirror image of triangle in A098158.
Sum_{k, 0<=k<=n} T(n,k)*x^k = A138229(n), A006495(n), A138230(n),A087455(n), A146559(n), A000012(n), A011782(n), A001333(n),A026150(n), A046717(n), A084057(n), A002533(n), A083098(n),A084058(n), A003665(n), A002535(n), A133294(n), A090042(n),A125816(n), A133343(n), A133345(n), A120612(n), A133356(n), A125818(n) for x = -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 respectively.
Sum_{k, 0<=k<=n} T(n,k)*x^(n-k) = A009116(n), A000007(n), A011782(n), A006012(n), A083881(n), A081335(n), A090139(n), A145301(n), A145302(n), A145303(n), A143079(n) for x = -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 respectively.
From Gus Wiseman, Jul 08 2025: (Start)
After the first row this is also the number of subsets of {1..n-1} with k maximal runs (sequences of consecutive elements increasing by 1) for k = 0..n. For example, row n = 5 counts the following subsets:
{} {1} {1,3} . . .
{2} {1,4}
{3} {2,4}
{4} {1,2,4}
{1,2} {1,3,4}
{2,3}
{3,4}
{1,2,3}
{2,3,4}
{1,2,3,4}
Requiring n-1 gives A202064.
For anti-runs instead of runs we have A384893.
(End)

Examples

			Triangle begins :
1
1, 0
1, 1, 0
1, 3, 0, 0
1, 6, 1, 0, 0
1, 10, 5, 0, 0, 0
1, 15, 15, 1, 0, 0, 0
1, 21, 35, 7, 0, 0, 0, 0
1, 28, 70, 28, 1, 0, 0, 0, 0
		

Crossrefs

Column k = 1 is A000217.
Column k = 2 is A000332.
Row sums are A011782 (or A000079 shifted right).
Removing all zeros gives A034839 (requiring n-1 A034867).
Last nonzero term in each row appears to be A093178, requiring n-1 A124625.
Reversing rows gives A098158, without zeros A109446.
Without the k = 0 column we get A210039.
Row maxima appear to be A214282.
A116674 counts strict partitions by number of maximal runs, for anti-runs A384905.
A268193 counts integer partitions by number of maximal runs, for anti-runs A384881.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n-1]],Length[Split[#,#2==#1+1&]]==k&]],{n,0,10},{k,0,n}] (* Gus Wiseman, Jul 08 2025 *)

Formula

T(n,k) = binomial(n,2k).
G.f.: (1-x)/((1-x)^2-y*x^2).
T(n,k)= Sum_{j, j>=0} T(n-1-j,k-1)*j with T(n,0)=1 and T(n,k)= 0 if k<0 or if n
T(n,k) = 2*T(n-1,k) + T(n-2,k-1) - T(n-2,k) for n>1, T(0,0) = T(1,0) = 1, T(1,1) = 0, T(n,k) = 0 if k>n or if k<0. - Philippe Deléham, Nov 10 2013

A081924 E.g.f.: exp(3*x)/(1-x)^2.

Original entry on oeis.org

1, 5, 27, 159, 1029, 7353, 58095, 506691, 4860297, 51023277, 583097859, 7215769575, 96210083853, 1375803720801, 21012273704151, 341449444105227, 5883436565417745, 107162594556721749, 2057521815411573483
Offset: 0

Author

Paul Barry, Apr 01 2003

Keywords

Comments

Binomial transform of A081923
Polynomials in A010027 evaluated at 4. - Ralf Stephan, Dec 15 2004

Programs

  • Maple
    seq(simplify(KummerU(-n, -n - 1, 3)), n = 0..20); # Peter Luschny, May 10 2022
  • Mathematica
    With[{nn=20},CoefficientList[Series[Exp[3x]/(1-x)^2,{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Aug 14 2013 *)
  • PARI
    my(x='x+O('x^66)); Vec( serlaplace(exp(3*x)/(1-x)^2) ) \\ Joerg Arndt, Aug 15 2013

Formula

E.g.f.: exp(3*x)/(1-x)^2.
Define f_1(x), f_2(x), ... such that f_1(x) = x*e^x, f_{n+1}(x) = (d/dx)(x*f_n(x)), for n=2,3,.... Then a(n-1) = e^{-1/2}*2^n*f_n(1/2). - Milan Janjic, May 30 2008
G.f.: hypergeom([1,2],[],x/(1-3*x))/(1-3*x). - Mark van Hoeij, Nov 08 2011
a(n) + (-n-4)*a(n-1) + 3*(n-1)*a(n-2) = 0. - R. J. Mathar, Nov 24 2012
G.f.: 2/x/G(0) - 1/x, where G(k) = 1 + 1/(1 - x*(2*k+2)/(x*(2*k+5) - 1 + x*(2*k+2)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 31 2013
G.f.: G(0)/x - 1/x, where G(k) = 1 + (2*k + 1)*x/(1-3*x - 2*x*(1-3*x)*(k+1)/(2*x*(k+1) + (1-3*x)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 26 2013
E.g.f.: 1/E(0), where E(k) = 1 - 2*x/(1 - x/(x - 2 + 6/(3 - x*(k+1)/E(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Jun 26 2013
G.f.: (Sum_{k>=0} (k!*(x/(1-3*x))^k) - 1)/x = Q(0)/(2*x) - 1/x, where Q(k) = 1 + 1/(1 - x*(k+1)/(x*(k+1) + (1-3*x)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Aug 09 2013
a(n) ~ exp(3) * n! * n. - Vaclav Kotesovec, Oct 05 2013
From Peter Bala, Jul 22 2021: (Start)
a(n) = n!*Sum_{k = 0..n} (n - k + 1)*3^k/k!.
a(n) = (n+1)!*hypergeom([-n],[-n-1],3).
(n-2)*a(n+1) = (n^2-1)*a(n) - 3^(n+2). (End)
a(n) = KummerU(-n, -n - 1, 3). - Peter Luschny, May 10 2022

A385572 Number of subsets of {1..n} with the same number of maximal runs (increasing by 1) as maximal anti-runs (increasing by more than 1).

Original entry on oeis.org

1, 2, 3, 4, 7, 12, 19, 34, 63, 112, 207, 394, 739, 1398, 2687, 5152, 9891, 19128, 37039, 71754, 139459, 271522, 528999, 1032308, 2017291, 3945186, 7723203, 15134440, 29679407, 58245068, 114389683, 224796210, 442021743, 869658304, 1711914351, 3371515306
Offset: 0

Author

Gus Wiseman, Jul 04 2025

Keywords

Comments

Also the number of subsets of {1..n} with the same number of adjacent elements increasing by 1 as adjacent elements increasing by more than 1.

Examples

			The set {2,3,5,6,8} has maximal runs ((2,3),(5,6),(8)) and maximal anti-runs ((2),(3,5),(6,8)) so is counted under a(8).
The a(0) = 1 through a(6) = 19 subsets:
  {}  {}   {}   {}   {}       {}       {}
      {1}  {1}  {1}  {1}      {1}      {1}
           {2}  {2}  {2}      {2}      {2}
                {3}  {3}      {3}      {3}
                     {4}      {4}      {4}
                     {1,2,4}  {5}      {5}
                     {1,3,4}  {1,2,4}  {6}
                              {1,2,5}  {1,2,4}
                              {1,3,4}  {1,2,5}
                              {1,4,5}  {1,2,6}
                              {2,3,5}  {1,3,4}
                              {2,4,5}  {1,4,5}
                                       {1,5,6}
                                       {2,3,5}
                                       {2,3,6}
                                       {2,4,5}
                                       {2,5,6}
                                       {3,4,6}
                                       {3,5,6}
		

Crossrefs

The LHS is counted by A034839 (for partitions A384881, strict A116674), rank statistic A069010.
The case containing n + 1 is A217615.
The RHS is counted by A384893 or A210034 (for partitions A268193, strict A384905), rank statistic A384890.
Subsets of this type are ranked by A385575.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.
A384877 gives lengths of maximal anti-runs in binary indices, firsts A384878.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<5, [1, 2, 3, 4, 7][n+1], ((3*n-4)*a(n-1)-
          (3*n-5)*a(n-2)+(5*n-12)*a(n-3)-2*(4*n-11)*a(n-4)+4*(n-3)*a(n-5))/(n-1))
        end:
    seq(a(n), n=0..35);  # Alois P. Heinz, Jul 06 2025
  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Length[Split[#,#2==#1+1&]]==Length[Split[#,#2!=#1+1&]]&]],{n,0,10}]
  • PARI
    a(n)=polcoef([1,1,1]*[x,0,0;x,x^2,1;0,x,x]^n*[1,0,0]~,n) \\ Christian Sievers, Jul 06 2025

Formula

Let M be the matrix [1,0,0; 1,x,1/x; 0,1,1]. Then a(n) is the sum of the constant terms of the entries in the left column of M^n. - Christian Sievers, Jul 06 2025

Extensions

a(21) and beyond from Christian Sievers, Jul 06 2025

A384907 Number of permutations of {1..n} with all distinct lengths of maximal anti-runs (not increasing by 1).

Original entry on oeis.org

1, 1, 1, 5, 17, 97, 587, 4291, 33109, 319967, 3106433, 35554459, 419889707, 5632467097, 77342295637, 1201240551077, 18804238105133, 328322081898745, 5832312989183807, 113154541564902427, 2229027473451951265, 47899977701182298255, 1037672943682453127645
Offset: 0

Author

Gus Wiseman, Jun 21 2025

Keywords

Examples

			The permutation (1,2,4,3,5,7,8,6,9) has maximal anti-runs ((1),(2,4,3,5,7),(8,6,9)), with lengths (1,5,3), so is counted under a(9).
The a(0) = 1 through a(4) = 17 permutations:
  ()  (1)  (2,1)  (1,3,2)  (1,2,4,3)
                  (2,1,3)  (1,3,2,4)
                  (2,3,1)  (1,4,2,3)
                  (3,1,2)  (1,4,3,2)
                  (3,2,1)  (2,1,3,4)
                           (2,1,4,3)
                           (2,3,1,4)
                           (2,4,1,3)
                           (2,4,3,1)
                           (3,1,4,2)
                           (3,2,1,4)
                           (3,2,4,1)
                           (3,4,2,1)
                           (4,1,3,2)
                           (4,2,1,3)
                           (4,3,1,2)
                           (4,3,2,1)
		

Crossrefs

For subsets instead of permutations we have A384177.
For strict partitions we have A384880, for runs A384178.
For partitions we have A384885, for runs A384884.
For runs instead of anti-runs we have A384891.
A010027 counts permutations by maximal anti-runs, for runs A123513.
A034839 counts subsets by number of maximal runs, for strict partitions A116674.
A098859 counts Wilf partitions (distinct multiplicities), complement A336866.
A384893 counts subsets by number of maximal anti-runs, for partitions A268193, A384905.

Programs

  • Mathematica
    Table[Length[Select[Permutations[Range[n]],UnsameQ@@Length/@Split[#,#2!=#1+1&]&]],{n,0,10}]
  • PARI
    a(n)=if(n,my(b(n)=sum(i=0,n-1,(-1)^i*(n-i)!*binomial(n-1,i)), d=floor(sqrt(2*n)), p=polcoef(prod(i=1,n,1+x*y^i,1+O(y*y^n)*((1-x^(d+1))/(1-x))),n,y)); sum(i=1,d,b(n+1-i)*i!*polcoef(p,i)),1) \\ Christian Sievers, Jun 22 2025

Formula

a(n) = Sum_{k=1..n} ( T(n,k) * A000255(n-k) ) for n>=1, where T(n,k) is the number of compositions of n into k distinct parts (cf. A072574).

Extensions

a(11) and beyond from Christian Sievers, Jun 22 2025
Previous Showing 21-30 of 36 results. Next