A239292 (sum of all odd parts of all strict partitions of n) - (sum of all even parts of all strict partitions of n); for "strict", see Comments.
0, 1, -2, 2, 0, 3, -4, -1, 4, 4, 0, 0, 4, -2, 0, 1, 16, 6, 4, 2, 8, 8, 14, 4, 20, 18, 22, 32, 32, 32, 28, 32, 52, 56, 64, 83, 76, 92, 112, 130, 140, 168, 172, 198, 212, 256, 288, 318, 368, 416, 456, 527, 564, 640, 712, 806, 884, 985, 1116, 1224, 1344, 1496
Offset: 0
Examples
The strict partitions of 6 are 6, 51, 42, 321. The sum of all the odd parts is 10 and the sum of all the even parts is 14, so that a(6) = -4.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
Programs
-
Maple
b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0, `if`(n=0, [1, 0], b(n, i-1) +`if`(i>n, 0, (p->p+ [0, p[1]*`if`(irem(i, 2)=1, i, -i)])(b(n-i, i-1))))) end: a:= n-> b(n$2)[2]: seq(a(n), n=0..80); # Alois P. Heinz, Mar 15 2014
-
Mathematica
d[n_] := d[n] = Select[IntegerPartitions[n], DeleteDuplicates[#] == # &]; Map[Total[Select[#, OddQ]] - Total[Select[#, EvenQ]]&[Flatten[d[#]]] &, -1 + Range[55]] (* Peter J. C. Moses, Mar 14 2014 *) b[n_, i_] := b[n, i] = If[n > i (i + 1)/2, 0, If[n == 0, {1, 0}, b[n, i - 1] + If[i > n, 0, Function[p, p + {0, p[[1]]*If[Mod[i, 2] == 1, i, -i]}][b[n - i, i - 1]]]]]; a[n_] := b[n, n][[2]]; a /@ Range[0, 80] (* Jean-François Alcover, May 31 2021, after Alois P. Heinz *)
Comments