A211373
Sum of median parts of all partitions of n into an odd number of parts.
Original entry on oeis.org
0, 1, 2, 4, 5, 9, 12, 18, 24, 37, 47, 68, 89, 123, 160, 218, 276, 370, 472, 615, 778, 1006, 1259, 1607, 2005, 2530, 3136, 3926, 4833, 6004, 7363, 9070, 11067, 13562, 16461, 20053, 24241, 29370, 35362, 42648, 51135, 61400, 73367, 87718, 104448, 124428, 147655
Offset: 0
a(6) = 12: partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6], sum of median parts is 1+2+2+1+6 = 12.
-
with(combinat):
a:= n-> add(`if`(nops(l)::odd, l[(nops(l)+1)/2], 0), l=partition(n)):
seq(a(n), n=0..40);
-
a[n_] := Sum[If[OddQ @ Length[l], l[[(Length[l]+1)/2]], 0], {l, IntegerPartitions[n]}];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Aug 20 2021, after Alois P. Heinz *)
A222044
Sum of smallest parts of all partitions of n into an odd number of parts.
Original entry on oeis.org
0, 1, 2, 4, 5, 8, 11, 15, 19, 28, 35, 47, 61, 80, 102, 136, 168, 218, 276, 350, 437, 556, 686, 860, 1063, 1321, 1620, 2005, 2443, 2998, 3649, 4445, 5377, 6531, 7863, 9496, 11398, 13694, 16373, 19603, 23347, 27834, 33058, 39259, 46467, 55020, 64914, 76599
Offset: 0
a(6) = 11: partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6], sum of smallest parts is 1+2+1+1+6 = 11.
-
b:= proc(n, i) option remember;
[`if`(n=i, n, 0), 0]+`if`(i<1, [0, 0], b(n, i-1)+
`if`(n [l[2], l[1]])(b(n-i, i))))
end:
a:= n-> b(n, n)[1]:
seq(a(n), n=0..60);
-
b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i<1, {0, 0}, b[n, i-1] + If[nJean-François Alcover, Feb 03 2017, translated from Maple *)
Table[Total[Min/@Select[IntegerPartitions[n],OddQ[Length[#]]&]],{n,0,50}] (* Harvey P. Dale, Jul 05 2019 *)
A222045
Sum of smallest parts of all partitions of n into an even number of parts.
Original entry on oeis.org
0, 0, 1, 1, 4, 4, 9, 10, 19, 21, 34, 40, 62, 72, 103, 124, 173, 207, 279, 337, 445, 538, 694, 842, 1077, 1299, 1634, 1977, 2464, 2969, 3669, 4411, 5410, 6488, 7896, 9447, 11442, 13640, 16421, 19536, 23411, 27761, 33124, 39174, 46554, 54915, 65008, 76485, 90258
Offset: 0
a(6) = 9: partitions of 6 into an even number of parts are [1,1,1,1,1,1], [2,2,1,1], [3,1,1,1], [3,3], [4,2], [5,1], sum of smallest parts is 1+1+1+3+2+1 = 9.
-
b:= proc(n, i) option remember;
[`if`(n=i, n, 0), 0]+`if`(i<1, [0, 0], b(n, i-1)+
`if`(n [l[2], l[1]])(b(n-i, i))))
end:
a:= n-> b(n, n)[2]:
seq(a(n), n=0..60);
-
b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i<1, {0, 0}, b[n, i-1] + If[nJean-François Alcover, Feb 03 2017, translated from Maple *)
A222047
Sum of largest parts of all partitions of n into an odd number of parts.
Original entry on oeis.org
0, 1, 2, 4, 6, 11, 17, 28, 41, 66, 93, 140, 195, 282, 384, 541, 722, 992, 1311, 1762, 2299, 3045, 3929, 5127, 6559, 8458, 10726, 13689, 17225, 21780, 27224, 34134, 42387, 52769, 65138, 80544, 98887, 121538, 148456, 181456, 220590, 268252, 324677, 392961
Offset: 0
a(6) = 17: partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6], sum of largest parts is 2+2+3+4+6 = 17.
-
b:= proc(n, i) option remember; [`if`(n=i, n, 0), 0]+
`if`(i>n, [0, 0], b(n, i+1)+(l-> [l[2], l[1]])(b(n-i, i)))
end:
a:= n-> b(n,1)[1]:
seq(a(n), n=0..50);
-
Table[Total[Max[#]&/@Select[IntegerPartitions[n],OddQ[Length[#]]&]],{n,0,50}] (* Harvey P. Dale, Apr 19 2014 *)
b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i>n, {0, 0}, b[n, i+1] + Reverse[b[n-i, i]]]; a[n_] := b[n, 1][[1]]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Aug 30 2016, after Alois P. Heinz *)
A222046
Difference between sums of smallest parts of all partitions of n into odd number of parts and into even number of parts.
Original entry on oeis.org
0, 1, 1, 3, 1, 4, 2, 5, 0, 7, 1, 7, -1, 8, -1, 12, -5, 11, -3, 13, -8, 18, -8, 18, -14, 22, -14, 28, -21, 29, -20, 34, -33, 43, -33, 49, -44, 54, -48, 67, -64, 73, -66, 85, -87, 105, -94, 114, -120, 132, -128, 156, -159, 174, -172, 203, -213, 234, -232, 263
Offset: 0
a(6) = 2 = (1+2+1+1+6) - (1+1+1+3+2+1) because the partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6] and the partitions of 6 into an even number of parts are [1,1,1,1,1,1], [2,2,1,1], [3,1,1,1], [3,3], [4,2], [5,1].
-
b:= proc(n, i) option remember;
[`if`(n=i, n, 0), 0]+`if`(i<1, [0, 0], b(n, i-1)+
`if`(n [l[2], l[1]])(b(n-i, i))))
end:
a:= n-> (l->l[1]-l[2])(b(n, n)):
seq(a(n), n=0..100);
-
b[n_, i_] := b[n, i] = {If[n == i, n, 0], 0} + If[i<1, {0, 0}, b[n, i-1] + If[nJean-François Alcover, Jan 23 2017, translated from Maple *)
A222049
Difference between sums of largest parts of all partitions of n into odd number of parts and into even number of parts.
Original entry on oeis.org
0, 1, 1, 2, 0, 2, -1, 2, -4, 4, -6, 5, -9, 8, -12, 14, -19, 19, -22, 26, -32, 38, -41, 48, -56, 65, -70, 84, -95, 107, -115, 133, -153, 172, -186, 212, -240, 264, -289, 325, -366, 400, -437, 485, -544, 597, -649, 714, -799, 869, -942, 1037, -1148, 1246, -1351
Offset: 0
a(6) = -1 = (2+2+3+4+6) - (1+2+3+3+4+5) because the partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6] and the partitions of 6 into an even number of parts are [1,1,1,1,1,1], [2,2,1,1], [3,1,1,1], [3,3], [4,2], [5,1].
-
b:= proc(n, i) option remember; [`if`(n=i, n, 0), 0]+
`if`(i>n, [0, 0], b(n, i+1)+(l-> [l[2], l[1]])(b(n-i, i)))
end:
a:= n-> (l->l[1]-l[2])(b(n, 1)):
seq(a(n), n=0..60);
-
b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i>n, {0, 0}, b[n, i+1] + Reverse @ b[n-i, i]]; a[n_] := b[n, 1][[1]]-b[n, 1][[2]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Feb 02 2017, translated from Maple *)
A211881
Difference between sum of largest parts and sum of smallest parts of all partitions of n into an even number of parts.
Original entry on oeis.org
0, 0, 0, 1, 2, 5, 9, 16, 26, 41, 65, 95, 142, 202, 293, 403, 568, 766, 1054, 1399, 1886, 2469, 3276, 4237, 5538, 7094, 9162, 11628, 14856, 18704, 23670, 29590, 37130, 46109, 57428, 70885, 87685, 107634, 132324, 161595, 197545, 240091, 291990, 353302, 427624
Offset: 0
a(6) = 9: partitions of 6 into an even number of parts are [1,1,1,1,1,1], [2,2,1,1], [3,1,1,1], [3,3], [4,2], [5,1], difference between sum of largest parts and sum of smallest parts is (1+2+3+3+4+5) - (1+1+1+3+2+1) = 18 - 9 = 9.
-
g:= proc(n, i) option remember; [`if`(n=i, n, 0), 0]+
`if`(i>n, [0, 0], g(n, i+1)+(l-> [l[2], l[1]])(g(n-i, i)))
end:
b:= proc(n, i) option remember;
[`if`(n=i, n, 0), 0]+`if`(i<1, [0, 0], b(n, i-1)+
`if`(n [l[2], l[1]])(b(n-i, i))))
end:
a:= n-> g(n, 1)[2] -b(n, n)[2]:
seq(a(n), n=0..50);
-
g[n_, i_] := g[n, i] = {If[n==i, n, 0], 0} + If[i>n, {0, 0}, g[n, i+1] + Reverse[g[n-i, i]]]; b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i<1, {0, 0}, b[n, i-1] + If[nJean-François Alcover, Feb 15 2017, translated from Maple *)
Showing 1-7 of 7 results.
Comments