OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
MAPLE
a:= proc(n) option remember; `if`(n<0, 0, ((s, t)-> s+
`if`(s<t, t, -t))(a(n-1), combinat[numbpart](n)))
end:
seq(a(n), n=0..70);
MATHEMATICA
a[n_] := a[n] = If[n<0, 0, With[{a1 = a[n-1], p = PartitionsP[n]}, If[p>a1, a1 + p, a1 - p]]];
a /@ Range[0, 70] (* Jean-François Alcover, Jan 05 2021 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(p = numbpart(n-1)); va[n] = va[n-1] - p; if (va[n] < 0, va[n] += 2*p); ); va; } \\ Michel Marcus, Jan 06 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Jan 11 2020
STATUS
approved