login
A151758
G.f.: Theta^2-Theta, where Theta = Sum_{k>=0} x^(2^k).
5
0, -1, 0, 2, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0
OFFSET
0,4
COMMENTS
If we omit the "-x" term and divide by 2, we get the characteristic function of the numbers with binary weight 2 (A018900, A151774).
MATHEMATICA
w[n_] := IntegerDigits[n, 2] // Total;
a[n_] := If[n == 1, -1, 2 Boole[w[n] == 2]];
a /@ Range[0, 104] (* Jean-François Alcover, Mar 31 2021 *)
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Jun 22 2009
STATUS
approved