OFFSET
1,4
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{k=1..n} (-1)^(k-1)*A138135(k).
MAPLE
b:= proc(n, i) option remember; local f, g;
if n=0 or i=1 then [1, 0]
else f:= b(n, i-1); g:= `if`(i>n, [0, 0], b(n-i, i));
[f[1]+g[1], f[2]+g[2]+g[1]]
fi
end:
a:= proc(n) option remember;
(-1)^n*(b(n-1, n-1)[2]-b(n, n)[2])+`if`(n=1, 0, a(n-1))
end:
seq(a(n), n=1..60); # Alois P. Heinz, Apr 04 2012
MATHEMATICA
b[n_, i_] := b[n, i] = Module[{f, g}, If[n == 0 || i == 1, {1, 0}, f = b[n, i-1]; g = If[i>n, {0, 0}, b[n-i, i]]; {f[[1]] + g[[1]], f[[2]] + g[[2]] + g[[1]]}]]; a[n_] := a[n] = (-1)^n*(b[n-1, n-1][[2]] - b[n, n][[2]]) + If[n == 1, 0, a[n-1]]; Table [a[n], {n, 1, 60}] (* Jean-François Alcover, Nov 11 2015, after Alois P. Heinz *)
PROG
(PARI) vector(50, n, sum(k=1, n, (-1)^(k-1)*(numdiv(k)-1+sum(j=1, k-1, (numdiv(j)-1)*(numbpart(k-j)-numbpart(k-j-1)))))) \\ Altug Alkan, Nov 11 2015
CROSSREFS
KEYWORD
sign
AUTHOR
Omar E. Pol, Feb 01 2012
EXTENSIONS
More terms from Alois P. Heinz, Apr 04 2012
STATUS
approved