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!)
A059012 Numbers that have an even number of 0's and 1's in their binary expansion. 4
3, 9, 10, 12, 15, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 63, 129, 130, 132, 135, 136, 139, 141, 142, 144, 147, 149, 150, 153, 154, 156, 159, 160, 163, 165, 166, 169, 170, 172, 175, 177, 178, 180, 183, 184, 187, 189, 190, 192, 195, 197, 198 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Intersection of A001969 and A059010.
LINKS
EXAMPLE
36 is in the sequence because 36 = 100100_10. '100100' has two 1's and four 0's. - Indranil Ghosh, Feb 10 2017
MATHEMATICA
Select[Range[200], AllTrue[{DigitCount[#, 2, 0], DigitCount[#, 2, 1]}, EvenQ]&] (* Harvey P. Dale, Aug 16 2021 *)
PROG
(PARI) is(n)=hammingweight(n)%2==0 && hammingweight(bitneg(n, #binary(n)))%2==0 \\ Charles R Greathouse IV, Mar 26 2013
(Python)
i=0
j=1
while j<=300:
if bin(i)[2:].count("1")%2 == 0 == bin(i)[2:].count("0")%2:
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Feb 10 2017
CROSSREFS
Sequence in context: A119203 A115403 A282409 * A352317 A055063 A030354
KEYWORD
nonn,base,easy
AUTHOR
Patrick De Geest, Dec 15 2000
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 April 25 13:33 EDT 2024. Contains 371971 sequences. (Running on oeis4.)