OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..6000
FORMULA
G.f.: Sum_{i>=0} i*x^i/Product_{j=1..i} (1 + x^j). - Ilya Gutkovskiy, Apr 13 2018
EXAMPLE
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].
MAPLE
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);
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Alois P. Heinz, Feb 06 2013
STATUS
approved