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.

A382312 Irregular triangle read by rows: T(n,k) is the number of compositions of n with k records.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 3, 1, 0, 5, 3, 0, 8, 8, 0, 14, 17, 1, 0, 24, 36, 4, 0, 43, 72, 13, 0, 77, 143, 36, 0, 140, 281, 90, 1, 0, 256, 550, 213, 5, 0, 472, 1073, 484, 19, 0, 874, 2093, 1068, 61, 0, 1628, 4079, 2308, 177, 0, 3045, 7950, 4912, 476, 1, 0, 5719, 15498, 10328, 1217, 6
Offset: 0

Views

Author

John Tyler Rascoe, Mar 21 2025

Keywords

Comments

A record in a composition is a part that is greater than all parts before it, reading left to right. The first part of any nonempty composition is considered a record.

Examples

			Triangle begins:
    k=0    1    2   3  4
 n= 0 1;
 n= 1 0,   1;
 n= 2 0,   2;
 n= 3 0,   3,   1;
 n= 4 0,   5,   3;
 n= 5 0,   8,   8;
 n= 6 0,  14,  17,  1;
 n= 7 0,  24,  36,  4;
 n= 8 0,  43,  72, 13;
 n= 9 0,  77, 143, 36;
 n=10 0, 140, 281, 90, 1;
 ...
The composition (2,1,1,2,4,2,1,5,7) has 4 records.
                 ^       ^     ^ ^
T(4,1) = 5 counts: (4), (3,1), (2,2), (2,1,1), (1,1,1,1).
T(4,2) = 3 counts: (1,1,2), (1,2,1), (1,1,3).
		

Crossrefs

Cf. A002024 (row lengths), A011782 (row sums), A079500 (column k=1), A336482, A352525.

Programs

  • Maple
    b:= proc(n, m) option remember; expand(`if`(n=0, 1, add(
          b(n-j, max(m, j))*`if`(j>m, x, 1), j=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..16);  # Alois P. Heinz, Mar 28 2025
  • PARI
    T_xy(max_row) = {my(N=max_row+1, x='x+O('x^N), h=prod(i=1,N,1+y*x^i*(1-x)/(1-2*x+x^(i+1)))); vector(N, n, Vecrev(polcoeff(h, n-1)))}
    T_xy(12)

Formula

G.f.: Product_{i>0} (1 + y*x^i * (1 - x)/(1 - 2*x + x^(i+1))).
Sum_{k>0} T(n,k)*k = A336482(n).