cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059012 Numbers that have an even number of 0's and 1's in their binary expansion.

This page as a plain text file.
%I A059012 #23 Aug 16 2021 13:43:28
%S A059012 3,9,10,12,15,33,34,36,39,40,43,45,46,48,51,53,54,57,58,60,63,129,130,
%T A059012 132,135,136,139,141,142,144,147,149,150,153,154,156,159,160,163,165,
%U A059012 166,169,170,172,175,177,178,180,183,184,187,189,190,192,195,197,198
%N A059012 Numbers that have an even number of 0's and 1's in their binary expansion.
%C A059012 Intersection of A001969 and A059010.
%H A059012 Indranil Ghosh, <a href="/A059012/b059012.txt">Table of n, a(n) for n = 1..32768</a>
%e A059012 36 is in the sequence because 36 = 100100_10. '100100' has two 1's and four 0's. - _Indranil Ghosh_, Feb 10 2017
%t A059012 Select[Range[200],AllTrue[{DigitCount[#,2,0],DigitCount[#,2,1]},EvenQ]&] (* _Harvey P. Dale_, Aug 16 2021 *)
%o A059012 (PARI) is(n)=hammingweight(n)%2==0 && hammingweight(bitneg(n, #binary(n)))%2==0 \\ _Charles R Greathouse IV_, Mar 26 2013
%o A059012 (Python)
%o A059012 i=0
%o A059012 j=1
%o A059012 while j<=300:
%o A059012     if bin(i)[2:].count("1")%2 == 0 == bin(i)[2:].count("0")%2:
%o A059012         print(str(j)+" "+str(i))
%o A059012         j+=1
%o A059012     i+=1 # _Indranil Ghosh_, Feb 10 2017
%Y A059012 Cf. A000069, A001969, A059009-A059014.
%K A059012 nonn,base,easy
%O A059012 1,1
%A A059012 _Patrick De Geest_, Dec 15 2000