login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A151774 Characteristic function of numbers with binary weight 2 (A018900). 5
0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
a(A018900(n)) = 1; a(A161989(n)) = 0. - Reinhard Zumkeller, Jun 24 2009
LINKS
FORMULA
Let Theta = Sum_{k >= 0} x^(2^k). G.f. is (x + Theta^2 - Theta)/2 (cf. A151758).
MATHEMATICA
w[n_] := IntegerDigits[n, 2] // Total;
a[n_] := Boole[w[n] == 2];
a /@ Range[0, 105] (* Jean-François Alcover, Mar 31 2021 *)
PROG
(PARI) a(n)=hammingweight(n)==2 \\ Charles R Greathouse IV, Sep 26 2015
CROSSREFS
Sequence in context: A341612 A252742 A066247 * A095792 A288381 A169675
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 23 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 15 02:36 EDT 2024. Contains 374323 sequences. (Running on oeis4.)