OFFSET
1,3
LINKS
Alois P. Heinz, Rows n = 1..141, flattened
EXAMPLE
First six rows:
1
1 2
1 2 3
1 4 3 4
1 4 6 4 5
1 6 9 8 5 6
partition of 5 into 1 part: 5
partitions of 5 into 2 parts: 4+1, 3+2
partitions of 5 into 3 parts: 3+1+1, 2+2+1
partition of 5 into 4 parts: 2+1+1+1
partition of 5 into 5 parts: 1+1+1+1+1;
consequently row 5 of the triangle is 1,4,6,4,5
MAPLE
b:= proc(n, i, k) option remember; `if`(n=0, [`if`(k=0, 1, 0), 0],
`if`(i<1 or k=0, [0$2], ((f, g)-> f+g+[0, g[1]])(b(n, i-1, k),
`if`(i>n, [0$2], b(n-i, i, k-1)))))
end:
T:= (n, k)-> b(n$2, k)[2]:
seq(seq(T(n, k), k=1..n), n=1..14); # Alois P. Heinz, Aug 04 2014
MATHEMATICA
p[n_] := IntegerPartitions[n];
l[n_, j_] := Length[p[n][[j]]]
t = Table[l[n, j], {n, 1, 13}, {j, 1, Length[p[n]]}]
f[n_, k_] := k*Count[t[[n]], k]
t = Table[f[n, k], {n, 1, 13}, {k, 1, n}]
TableForm[t] (* A172467 as a triangle *)
Flatten[t] (* A172467 as a sequence *)
(* second program: *)
b[n_, i_, k_] := b[n, i, k] = If[n==0, {If[k==0, 1, 0], 0}, If[i<1 || k==0, {0, 0}, Function[{f, g}, f + g + {0, g[[1]]}][b[n, i-1, k], If[i>n, {0, 0}, b[n-i, i, k-1]]]]]; T[n_, k_] := b[n, n, k][[2]]; Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, Dec 27 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Clark Kimberling, Mar 03 2012
STATUS
approved