A066183
Total sum of squares of parts in all partitions of n.
Original entry on oeis.org
1, 6, 17, 44, 87, 180, 311, 558, 910, 1494, 2302, 3608, 5343, 7986, 11554, 16714, 23549, 33270, 45942, 63506, 86338, 117156, 156899, 209926, 277520, 366260, 479012, 624956, 808935, 1044994, 1340364, 1715572, 2182935, 2770942, 3499379
Offset: 1
a(3) = 17 because the squares of all partitions of 3 are {9}, {4,1} and {1,1,1}, summing to 17.
-
b:= proc(n, i) option remember; local g, h;
if n=0 then [1, 0]
elif i<1 then [0, 0]
elif i>n then b(n, i-1)
else g:= b(n, i-1); h:= b(n-i, i);
[g[1]+h[1], g[2]+h[2] +h[1]*i^2]
fi
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=1..40); # Alois P. Heinz, Feb 23 2012
# second Maple program:
g := (sum(k^2*x^k/(1-x^k), k = 1..100))/(product(1-x^k, k = 1..100)): gser := series(g, x = 0, 45): seq(coeff(gser, x, m), m = 1 .. 40); # Emeric Deutsch, Dec 06 2015
-
Table[Apply[Plus, IntegerPartitions[n]^2, {0, 2}], {n, 30}]
(* Second program: *)
b[n_, i_] := b[n, i] = Module[{g, h}, Which[n==0, {1, 0}, i<1, {0, 0}, i>n, b[n, i-1], True, g = b[n, i-1]; h = b[n-i, i]; {g[[1]] + h[[1]], g[[2]] + h[[2]] + h[[1]]*i^2}]]; a[n_] := b[n, n][[2]]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Aug 31 2015, after Alois P. Heinz *)
-
a(n)=my(s); forpart(v=n,s+=sum(i=1,#v,v[i]^2));s \\ Charles R Greathouse IV, Aug 31 2015
-
a(n)=sum(k=1,n,sigma(k,2)*numbpart(n-k)) \\ Charles R Greathouse IV, Aug 31 2015
A206561
Triangle read by rows: T(n,k) = total sum of parts >= k in all partitions of n.
Original entry on oeis.org
1, 4, 2, 9, 5, 3, 20, 13, 7, 4, 35, 23, 15, 9, 5, 66, 47, 31, 19, 11, 6, 105, 75, 53, 35, 23, 13, 7, 176, 131, 93, 66, 42, 27, 15, 8, 270, 203, 151, 106, 74, 49, 31, 17, 9, 420, 323, 241, 178, 126, 86, 56, 35, 19, 10, 616, 477, 365, 272, 200, 140, 98, 63, 39, 21, 11
Offset: 1
Triangle begins:
1;
4, 2;
9, 5, 3;
20, 13, 7, 4;
35, 23, 15, 9, 5;
66, 47, 31, 19, 11, 6;
105, 75, 53, 35, 23, 13, 7;
...
-
Table[With[{s = IntegerPartitions[n]}, Table[Total@ Flatten@ Map[Select[#, # >= k &] &, s], {k, n}]], {n, 11}] // Flatten (* Michael De Vlieger, Mar 19 2018 *)
A180681
T(n,k) is the sum of the hook lengths over the partitions of n with exactly k parts.
Original entry on oeis.org
1, 3, 3, 6, 5, 6, 10, 16, 8, 10, 15, 23, 22, 12, 15, 21, 47, 44, 30, 17, 21, 28, 62, 74, 56, 40, 23, 28, 36, 104, 115, 114, 71, 52, 30, 36, 45, 130, 196, 162, 139, 89, 66, 38, 45, 55, 195, 268, 286, 227, 169, 110, 82, 47, 55, 66, 235, 395, 407, 369, 269, 204, 134, 100, 57, 66
Offset: 1
T(5,3) = 22 since the partitions of 5 in 3 parts are 221 and 311, with hook lengths {{2,4}, {1,3}, {1}} and {{1,2,5}, {2}, {1}} summing to 22.
Triangle T(n,k) begins:
1;
3, 3;
6, 5, 6;
10, 16, 8, 10;
15, 23, 22, 12, 15;
21, 47, 44, 30, 17, 21;
28, 62, 74, 56, 40, 23, 28;
36, 104, 115, 114, 71, 52, 30, 36;
45, 130, 196, 162, 139, 89, 66, 38, 45;
55, 195, 268, 286, 227, 169, 110, 82, 47, 55;
-
f:= n-> (n-1)*n/2:
b:= proc(n, i) option remember; `if`(n=0 or i=1, [1, n+f(n)],
b(n, i-1)+(p-> p+[0, p[1]*(n+f(i))])(b(n-i, min(n-i, i))))
end:
T:= (n, k)-> (p-> p[1]*(n+f(k))+p[2])(b(n-k, min(n-k, k))):
seq(seq(T(n, k), k=1..n), n=1..14); # Alois P. Heinz, Mar 20 2018
-
(*Needs["DiscreteMath`Combinatorica`"]; hooklength[(p_)?PartitionQ] := Block[{ferr = (PadLeft[1 + 0*Range[ #1], Max[p]] & ) /@ p}, DeleteCases[(Rest[FoldList[Plus, 0, #1]] & ) /@ ferr + Reverse /@ Reverse[Transpose[(Rest[FoldList[Plus, 0, #1]] & ) /@ Reverse[Reverse /@ Transpose[ferr]]]], 0, {2}] - 1]; partitionexact[n_, m_] := TransposePartition /@ (Prepend[ #1, m] & ) /@ Partitions[n - m, m] *); Table[Tr[ Tr[ Flatten[hooklength[ # ]]] &/@ partitionexact[n,k] ] ,{n,16},{k,n}]
(* Second program: *)
Table[p = IntegerPartitions[n, {k}]; Total@Table[y = Table[Boole[p[[l]][[i]] >= j], {i, k}, {j, n}]; Total[Table[Total[{y[[i, j ;; n]], y[[i + 1 ;; k, j]]}, 2], {i, k}, {j, n}], 2], {l, Length[p]}], {n, 11}, {k, n}] // Flatten (* Robert Price, Jun 19 2020 *)
f[n_] := n(n-1)/2;
b[n_, i_] := b[n, i] = If[n == 0 || i == 1, {1, n + f[n]}, b[n, i - 1] + Function[p, p + {0, p[[1]] (n + f[i])}][b[n - i, Min[n - i, i]]]];
T[n_, k_] := Function[p, p[[1]] (n + f[k]) + p[[2]]][b[n-k, Min[n-k, k]]];
Table[Table[T[n, k], {k, 1, n}], {n, 1, 14}] // Flatten (* Jean-François Alcover, Dec 12 2020, after Alois P. Heinz *)
A299769
Triangle read by rows: T(n,k) is the sum of all squares of the parts k in the last section of the set of partitions of n, with n >= 1, 1 <= k <= n.
Original entry on oeis.org
1, 1, 4, 2, 0, 9, 3, 8, 0, 16, 5, 4, 9, 0, 25, 7, 16, 18, 16, 0, 36, 11, 12, 18, 16, 25, 0, 49, 15, 32, 27, 48, 25, 36, 0, 64, 22, 28, 54, 32, 50, 36, 49, 0, 81, 30, 60, 54, 80, 75, 72, 49, 64, 0, 100, 42, 60, 90, 80, 100, 72, 98, 64, 81, 0, 121, 56, 108, 126, 160, 125, 180, 98, 128, 81, 100, 0, 144
Offset: 1
Triangle begins:
1;
1, 4;
2, 0, 9;
3, 8, 0, 16;
5, 4, 9, 0, 25;
7, 16, 18, 16, 0, 36;
11, 12, 18, 16, 25, 0, 49;
15, 32, 27, 48, 25, 36, 0, 64;
22, 28, 54, 32, 50, 36, 49, 0, 81;
30, 60, 54, 80, 75, 72, 49, 64, 0, 100;
42, 60, 90, 80, 100, 72, 98, 64, 81, 0, 121;
56, 108, 126, 160, 125, 180, 98, 128, 81, 100, 0, 144;
...
Illustration for the 4th row of triangle:
.
. Last section of the set
. Partitions of 4. of the partitions of 4.
. _ _ _ _ _
. |_| | | | [1,1,1,1] | | [1]
. |_ _| | | [2,1,1] | | [1]
. |_ _ _| | [3,1] _ _ _| | [1]
. |_ _| | [2,2] |_ _| | [2,2]
. |_ _ _ _| [4] |_ _ _ _| [4]
.
For n = 4 the last section of the set of partitions of 4 is [4], [2, 2], [1], [1], [1], so the squares of the parts are respectively [16], [4, 4], [1], [1], [1]. The sum of the squares of the parts 1 is 1 + 1 + 1 = 3. The sum of the squares of the parts 2 is 4 + 4 = 8. The sum of the squares of the parts 3 is 0 because there are no parts 3. The sum of the squares of the parts 4 is 16. So the fourth row of triangle is [3, 8, 0, 16].
Leading diagonal gives
A000290, n >= 1.
-
b:= proc(n, i) option remember; `if`(n=0 or i=1, 1+n*x, b(n, i-1)+
(p-> p+(coeff(p, x, 0)*i^2)*x^i)(b(n-i, min(n-i, i))))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n$2)-b(n-1$2)):
seq(T(n), n=1..14); # Alois P. Heinz, Jul 23 2018
-
b[n_, i_] := b[n, i] = If[n==0 || i==1, 1 + n*x, b[n, i-1] + Function[p, p + (Coefficient[p, x, 0]*i^2)*x^i][b[n-i, Min[n-i, i]]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, n}]][b[n, n] - b[n-1, n-1]];
T /@ Range[14] // Flatten (* Jean-François Alcover, Dec 10 2019, after Alois P.heinz *)
Showing 1-4 of 4 results.
Comments