login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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