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.
%I A095072 #34 Aug 29 2024 01:19:37 %S A095072 17,67,73,97,263,269,277,281,293,337,353,389,401,449,1039,1051,1063, %T A095072 1069,1109,1123,1129,1163,1171,1187,1193,1201,1249,1291,1301,1321, %U A095072 1361,1543,1549,1571,1609,1667,1669,1697,1801,4127,4157,4211,4217 %N A095072 Primes in whose binary expansion the number of 0-bits is one more than the number of 1-bits. %C A095072 A010051(a(n)) = 1 and A037861(a(n)) = 1. - _Reinhard Zumkeller_, Mar 31 2015 %H A095072 Indranil Ghosh, <a href="/A095072/b095072.txt">Table of n, a(n) for n = 1..20000</a> (terms 1..1000 from Reinhard Zumkeller) %H A095072 A. Karttunen and J. Moyer, <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a> %e A095072 97 is in the sequence because 97 is a prime and 97_10 = 1100001_2. The number of 0's in 1100001 is 4 and the number of 1's is 3. - _Indranil Ghosh_, Jan 31 2017 %t A095072 Select[Prime[Range[500]], Differences[DigitCount[#, 2]] == {1} &] %o A095072 (PARI) isA095072(n)=my(v=binary(n));#v==2*sum(i=1,#v,v[i])+1&&isprime(n) %o A095072 (PARI) forprime(p=2, 4250, v=binary(p); s=0; for(k=1, #v, s+=if(v[k]==0,+1,-1)); if(s==1,print1(p,", "))) %o A095072 (Haskell) %o A095072 a095072 n = a095072_list !! (n-1) %o A095072 a095072_list = filter ((== 1) . a010051' . fromIntegral) a031444_list %o A095072 -- _Reinhard Zumkeller_, Mar 31 2015 %o A095072 (Python) %o A095072 #Program to generate the b-file %o A095072 from sympy import isprime %o A095072 i=1 %o A095072 j=1 %o A095072 while j<=200: %o A095072 if isprime(i) and bin(i)[2:].count("0")-bin(i)[2:].count("1")==1: %o A095072 print(str(j)+" "+str(i)) %o A095072 j+=1 %o A095072 i+=1 # _Indranil Ghosh_, Jan 31 2017 %Y A095072 Intersection of A000040 and A031444. Subset of A095071. %Y A095072 Cf. A095052. %Y A095072 Cf. A010051, A037861. %K A095072 nonn,base,easy %O A095072 1,1 %A A095072 _Antti Karttunen_, Jun 01 2004