A235998 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)).
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, 677, 84, 6, 396, 1358, 288, 2, 606, 2666, 822, 4, 950, 5012, 2226, 4, 1414, 9542, 5304, 120, 5, 2238, 17531, 12514, 480, 2, 3418, 32412, 27904, 1800, 6, 5411, 58995, 61080, 5580
Offset: 1
Examples
Triangle begins: 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, 677, 84; 6, 396, 1358, 288; 2, 606, 2666, 822; 4, 950, 5012, 2226; 4, 1414, 9542, 5304, 120; 5, 2238, 17531, 12514, 480; 2, 3418, 32412, 27904, 1800; 6, 5411, 58995, 61080, 5580; ...
Links
- Alois P. Heinz, Rows n = 1..500, flattened
Programs
-
Maple
b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0, expand(add(b(n-i*j, i-1, p+j)/j!*`if`(j=0, 1, x), j=0..n/i)))) end: T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(b(n$2, 0)): seq(T(n), n=1..25); # Alois P. Heinz, Jan 20 2014, revised May 25 2014
-
Mathematica
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 *)
Extensions
More terms from Alois P. Heinz, Jan 19 2014
Comments