login
Triangle read by rows: T(n,k) is the number of compositions of n having k distinct parts (n>=1, 1<=k<=floor((sqrt(1+8*n)-1)/2)).
12

%I #54 Oct 18 2021 08:18:36

%S 1,2,2,2,3,5,2,14,4,22,6,2,44,18,4,68,56,3,107,146,4,172,312,24,2,261,

%T 677,84,6,396,1358,288,2,606,2666,822,4,950,5012,2226,4,1414,9542,

%U 5304,120,5,2238,17531,12514,480,2,3418,32412,27904,1800,6,5411,58995,61080,5580

%N Triangle read by rows: T(n,k) is the number of compositions of n having k distinct parts (n>=1, 1<=k<=floor((sqrt(1+8*n)-1)/2)).

%C Row n has length A003056(n) hence the first element of column k is in row A000217(k).

%C The equivalent sequence for partitions is A116608.

%C For the number of compositions of n see A011782.

%C For the connection to overcompositions see A235999.

%C Row sums give A011782(n), n >= 1.

%C First column is A000005, second column is A131661.

%C T(k*(k+1)/2,k) = T(A000217(k),k) = A000142(k) = k!. - _Alois P. Heinz_, Jan 20 2014

%H Alois P. Heinz, <a href="/A235998/b235998.txt">Rows n = 1..500, flattened</a>

%e Triangle begins:

%e 1;

%e 2;

%e 2, 2;

%e 3, 5;

%e 2, 14;

%e 4, 22, 6;

%e 2, 44, 18;

%e 4, 68, 56;

%e 3, 107, 146;

%e 4, 172, 312, 24;

%e 2, 261, 677, 84;

%e 6, 396, 1358, 288;

%e 2, 606, 2666, 822;

%e 4, 950, 5012, 2226;

%e 4, 1414, 9542, 5304, 120;

%e 5, 2238, 17531, 12514, 480;

%e 2, 3418, 32412, 27904, 1800;

%e 6, 5411, 58995, 61080, 5580;

%e ...

%p b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,

%p expand(add(b(n-i*j, i-1, p+j)/j!*`if`(j=0, 1, x), j=0..n/i))))

%p end:

%p T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n$2, 0)):

%p seq(T(n), n=1..25); # _Alois P. Heinz_, Jan 20 2014, revised May 25 2014

%t b[n_, i_, p_] := b[n, i, p] = If[n==0, p!, If[i<1, 0, Sum[b[n-i*j, i-1, p+ j]/j!*If[j==0, 1, x], {j, 0, n/i}]]]; T[n_] := Function[p, Table[ Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 1, 25}] // Flatten (* _Jean-François Alcover_, Dec 10 2015, after _Alois P. Heinz_ *)

%Y Cf. A003056, A116608, A235790, A235999, A236002.

%K nonn,tabf,nice,look

%O 1,2

%A _Omar E. Pol_, Jan 19 2014

%E More terms from _Alois P. Heinz_, Jan 19 2014