OFFSET
0,3
COMMENTS
A strict partition is one having distinct parts. a(n) < 0 if and only if n is one of these: 2,6,7,13.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
EXAMPLE
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.
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 *)
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Clark Kimberling, Mar 14 2014
STATUS
approved