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-3 of 3 results.

A238343 Triangle T(n,k) read by rows: T(n,k) is the number of compositions of n with k descents, n>=0, 0<=k<=n.

Original entry on oeis.org

1, 1, 0, 2, 0, 0, 3, 1, 0, 0, 5, 3, 0, 0, 0, 7, 9, 0, 0, 0, 0, 11, 19, 2, 0, 0, 0, 0, 15, 41, 8, 0, 0, 0, 0, 0, 22, 77, 29, 0, 0, 0, 0, 0, 0, 30, 142, 81, 3, 0, 0, 0, 0, 0, 0, 42, 247, 205, 18, 0, 0, 0, 0, 0, 0, 0, 56, 421, 469, 78, 0, 0, 0, 0, 0, 0, 0, 0, 77, 689, 1013, 264, 5, 0, 0, 0, 0, 0, 0, 0, 0, 101, 1113, 2059, 786, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 25 2014

Keywords

Comments

Counting ascents gives the same triangle.
For n > 0, also the number of compositions of n with k + 1 maximal weakly increasing runs. - Gus Wiseman, Mar 23 2020

Examples

			Triangle starts:
00:    1;
01:    1,    0;
02:    2,    0,    0;
03:    3,    1,    0,    0;
04:    5,    3,    0,    0,   0;
05:    7,    9,    0,    0,   0, 0;
06:   11,   19,    2,    0,   0, 0, 0;
07:   15,   41,    8,    0,   0, 0, 0, 0;
08:   22,   77,   29,    0,   0, 0, 0, 0, 0;
09:   30,  142,   81,    3,   0, 0, 0, 0, 0, 0;
10:   42,  247,  205,   18,   0, 0, 0, 0, 0, 0, 0;
11:   56,  421,  469,   78,   0, 0, 0, 0, 0, 0, 0, 0;
12:   77,  689, 1013,  264,   5, 0, 0, 0, 0, 0, 0, 0, 0;
13:  101, 1113, 2059,  786,  37, 0, 0, 0, 0, 0, 0, 0, 0, 0;
14:  135, 1750, 4021, 2097, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
15:  176, 2712, 7558, 5179, 751, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
...
From _Gus Wiseman_, Mar 23 2020: (Start)
Row n = 5 counts the following compositions:
  (5)          (3,2)
  (1,4)        (4,1)
  (2,3)        (1,3,1)
  (1,1,3)      (2,1,2)
  (1,2,2)      (2,2,1)
  (1,1,1,2)    (3,1,1)
  (1,1,1,1,1)  (1,1,2,1)
               (1,2,1,1)
               (2,1,1,1)
(End)
		

Crossrefs

T(3n,n) gives A000045(n+1).
T(3n+1,n) = A136376(n+1).
Row sums are A011782.
Compositions by length are A007318.
The version for co-runs or levels is A106356.
The case of partitions (instead of compositions) is A133121.
The version for runs is A238279.
The version without zeros is A238344.
The version for weak ascents is A333213.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, expand(
           add(b(n-j, j)*`if`(j (p-> seq(coeff(p, x, i), i=0..n))(b(n, 0)):
    seq(T(n), n=0..20);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[b[n-j, j]*If[jJean-François Alcover, Jan 08 2015, translated from Maple *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],n==0||Length[Split[#,LessEqual]]==k+1&]],{n,0,9},{k,0,n}] (* Gus Wiseman, Mar 23 2020 *)

Formula

Sum_{k=0..n} k * T(n,k) = A045883(n-2) for n>=2.

A238344 Irregular triangle T(n,k) read by rows: T(n,k) is the number of compositions of n with k descents, n>=0, 0<=k<=floor(n/3).

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 3, 7, 9, 11, 19, 2, 15, 41, 8, 22, 77, 29, 30, 142, 81, 3, 42, 247, 205, 18, 56, 421, 469, 78, 77, 689, 1013, 264, 5, 101, 1113, 2059, 786, 37, 135, 1750, 4021, 2097, 189, 176, 2712, 7558, 5179, 751, 8, 231, 4128, 13780, 11998, 2558, 73, 297, 6208, 24440, 26400, 7762, 429
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 25 2014

Keywords

Comments

Same as A238343, with zeros omitted.
Row sums are A011782.
T(3n,n) = A000045(n+1).
T(3n+1,n) = A136376(n+1).

Examples

			Triangle starts:
00:    1;
01:    1;
02:    2;
03:    3,     1;
04:    5,     3;
05:    7,     9;
06:   11,    19,      2;
07:   15,    41,      8;
08:   22,    77,     29;
09:   30,   142,     81,      3;
10:   42,   247,    205,     18;
11:   56,   421,    469,     78;
12:   77,   689,   1013,    264,      5;
13:  101,  1113,   2059,    786,     37;
14:  135,  1750,   4021,   2097,    189;
15:  176,  2712,   7558,   5179,    751,     8;
16:  231,  4128,  13780,  11998,   2558,    73;
17:  297,  6208,  24440,  26400,   7762,   429;
18:  385,  9201,  42358,  55593,  21577,  1945,  13;
19:  490, 13502,  71867, 112814,  55867,  7465, 139;
20:  627, 19585, 119715, 221639, 136478, 25317, 927;
...
		

Crossrefs

Cf. A045883.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, expand(
           add(b(n-j, j)*`if`(j (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..20);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, Expand[Sum[b[n-j, j]*If[jJean-François Alcover, Feb 11 2015, after Maple *)

Formula

Sum_{k=0..floor(n/3)} k * T(n,k) = A045883(n-2) for n>=2.

A374702 Number of integer compositions of n whose leaders of maximal weakly decreasing runs sum to 3. Column k = 3 of A374748.

Original entry on oeis.org

0, 0, 0, 2, 3, 6, 9, 13, 17, 23, 28, 35, 42, 50, 58, 68, 77, 88, 99, 111, 123, 137, 150, 165, 180, 196, 212, 230, 247, 266, 285, 305, 325, 347, 368, 391, 414, 438, 462, 488, 513, 540, 567, 595, 623, 653, 682, 713, 744, 776, 808, 842, 875, 910, 945, 981
Offset: 0

Views

Author

Gus Wiseman, Aug 12 2024

Keywords

Comments

The weakly decreasing run-leaders of a sequence are obtained by splitting it into maximal weakly decreasing subsequences and taking the first term of each.

Examples

			The a(0) = 0 through a(8) = 17 compositions:
  .  .  .  (3)   (31)   (32)    (33)     (322)     (332)
           (12)  (112)  (122)   (321)    (331)     (3221)
                 (121)  (311)   (1122)   (1222)    (3311)
                        (1112)  (1221)   (3211)    (11222)
                        (1121)  (3111)   (11122)   (12221)
                        (1211)  (11112)  (11221)   (32111)
                                (11121)  (12211)   (111122)
                                (11211)  (31111)   (111221)
                                (12111)  (111112)  (112211)
                                         (111121)  (122111)
                                         (111211)  (311111)
                                         (112111)  (1111112)
                                         (121111)  (1111121)
                                                   (1111211)
                                                   (1112111)
                                                   (1121111)
                                                   (1211111)
		

Crossrefs

The version for k = 2 is A004526.
The version for partitions is A069905 or A001399 (shifted).
For reversed partitions we appear to have A137719.
For length instead of sum we have A241627.
For leaders of constant runs we have A373952.
The opposite rank statistic is A374630, row-sums of A374629.
The corresponding rank statistic is A374741 row-sums of A374740.
Column k = 3 of A374748.
A003242 counts anti-run compositions.
A011782 counts integer compositions.
A238130, A238279, A333755 count compositions by number of runs.
A274174 counts contiguous compositions, ranks A374249.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n],Total[First/@Split[#,GreaterEqual]]==3&]],{n,0,15}]
  • PARI
    seq(n)={Vec((2 + x + x^2)/((1 + x + x^2)*(1 + x)*(1 - x)^3) + O(x^(n-2)), -n-1)} \\ Andrew Howroyd, Aug 14 2024

Formula

G.f.: x^3*(2 + x + x^2)/((1 + x + x^2)*(1 + x)*(1 - x)^3). - Andrew Howroyd, Aug 14 2024

Extensions

a(27) onwards from Andrew Howroyd, Aug 14 2024
Showing 1-3 of 3 results.