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.

A322427 Sum T(n,k) of k-th smallest parts of all compositions of n; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 3, 1, 6, 5, 1, 12, 12, 7, 1, 22, 28, 20, 9, 1, 42, 54, 54, 30, 11, 1, 79, 106, 115, 92, 42, 13, 1, 151, 200, 239, 218, 144, 56, 15, 1, 291, 376, 471, 486, 378, 212, 72, 17, 1, 566, 708, 904, 1014, 908, 612, 298, 90, 19, 1, 1106, 1346, 1709, 2030, 2014, 1584, 939, 404, 110, 21, 1
Offset: 1

Views

Author

Alois P. Heinz, Dec 07 2018

Keywords

Examples

			The 4 compositions of 3 are: 111, 12, 21, 3.  The sums of k-th smallest parts for k=1..3 give: 1+1+1+3 = 6, 1+2+2+0 = 5, 1+0+0+0 = 1.
Triangle T(n,k) begins:
    1;
    3,   1;
    6,   5,   1;
   12,  12,   7,    1;
   22,  28,  20,    9,   1;
   42,  54,  54,   30,  11,   1;
   79, 106, 115,   92,  42,  13,   1;
  151, 200, 239,  218, 144,  56,  15,  1;
  291, 376, 471,  486, 378, 212,  72, 17,  1;
  566, 708, 904, 1014, 908, 612, 298, 90, 19, 1;
  ...
		

Crossrefs

Column k=1 gives A097939.
Row sums give A001787.
Cf. A322428.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, add(l[i]*x^i,
          i=1..nops(l)), add(b(n-j, sort([l[], j])), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n, [])):
    seq(T(n), n=1..12);
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, Sum[l[[i]] x^i, {i, 1, Length[l]}], Sum[b[n - j, Sort[Append[l, j]]], {j, 1, n}]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][ b[n, {}]];
    Array[T, 12] // Flatten (* Jean-François Alcover, Dec 29 2018, after Alois P. Heinz *)