A172467 T(n,k) = number of summands in the partitions of n into k parts; a triangular array.
1, 1, 2, 1, 2, 3, 1, 4, 3, 4, 1, 4, 6, 4, 5, 1, 6, 9, 8, 5, 6, 1, 6, 12, 12, 10, 6, 7, 1, 8, 15, 20, 15, 12, 7, 8, 1, 8, 21, 24, 25, 18, 14, 8, 9, 1, 10, 24, 36, 35, 30, 21, 16, 9, 10, 1, 10, 30, 44, 50, 42, 35, 24, 18, 10, 11, 1, 12, 36, 60, 65, 66, 49, 40, 27, 20, 11, 12, 1
Offset: 1
Examples
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
Links
- Alois P. Heinz, Rows n = 1..141, flattened
Programs
-
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 *)
Comments