OFFSET
1,1
MAPLE
negative_terms(A059876); negative_terms := proc(b) local a, i; a := []; for i from 1 to nops(b) do if(b[i] < 0) then a := [op(a), i]; fi; od; RETURN(a); end;
MATHEMATICA
a[n_] := With[{s = Floor[Log[2, n]]}, (-1)^(n+1) + Sum[(-1)^(Floor[n/2^i] + 1)*Prime[i], {i, 1, s}] + If[1 == n, 1, Mod[s + 1, 2]*Prime[s]]];
A059880 = Position[Array[a, 500], _?Negative] // Flatten (* Jean-François Alcover, Mar 07 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 05 2001
STATUS
approved