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!)
A059014 Numbers that have an even number of 0's and an odd number of 1's in binary expansion. 6
1, 4, 7, 16, 19, 21, 22, 25, 26, 28, 31, 64, 67, 69, 70, 73, 74, 76, 79, 81, 82, 84, 87, 88, 91, 93, 94, 97, 98, 100, 103, 104, 107, 109, 110, 112, 115, 117, 118, 121, 122, 124, 127, 256, 259, 261, 262, 265, 266, 268, 271, 273, 274, 276, 279, 280, 283, 285, 286 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..50000 (terms 1..1000 from Harvey P. Dale)
EXAMPLE
21 is in the sequence because 21 = 10101_2. '10101' has two 0's and three 1's. - Indranil Ghosh, Feb 06 2017
MATHEMATICA
en0on1Q[n_]:=Module[{idn2=IntegerDigits[n, 2]}, EvenQ[Count[idn2, 0]] && OddQ[Count[idn2, 1]]]; Select[Range[300], en0on1Q] (* Harvey P. Dale, Nov 08 2013 *)
PROG
(PARI) is(n)=hammingweight(n)%2 && hammingweight(bitneg(n, #binary(n)))%2==0 \\ Charles R Greathouse IV, Mar 26 2013
(Python)
i=1
j=1
while j<=100:
if not bin(i)[2:].count("0")%2 and bin(i)[2:].count("1")%2:
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Feb 06 2017
CROSSREFS
Sequence in context: A037373 A310928 A018887 * A360800 A255650 A350961
KEYWORD
nonn,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 20 09:04 EDT 2024. Contains 371799 sequences. (Running on oeis4.)