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.

A095074 Primes in whose binary expansion the number of 0-bits is less than or equal to number of 1-bits.

This page as a plain text file.
%I A095074 #27 Aug 16 2025 04:49:52
%S A095074 2,3,5,7,11,13,19,23,29,31,37,41,43,47,53,59,61,71,79,83,89,101,103,
%T A095074 107,109,113,127,139,149,151,157,163,167,173,179,181,191,197,199,211,
%U A095074 223,227,229,233,239,241,251,271,283,307,311,313,317,331,347,349,359
%N A095074 Primes in whose binary expansion the number of 0-bits is less than or equal to number of 1-bits.
%H A095074 Indranil Ghosh, <a href="/A095074/b095074.txt">Table of n, a(n) for n = 1..25000</a>
%H A095074 A. Karttunen and J. Moyer, <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a>
%e A095074 From _Indranil Ghosh_, Feb 03 2017: (Start)
%e A095074 29 is in the sequence because 29_10 = 11101_2. '11101' has one 0 and three 1's.
%e A095074 37 is in the sequence because 37_10 = 100101_2. '100101' has three 1's and 3 0's. (End)
%t A095074 Select[Prime[Range[50]], DigitCount[#, 2, 0] <= DigitCount[#, 2, 1] &] (* _Alonso del Arte_, Jan 11 2011 *)
%o A095074 (PARI) forprime(p=2,359,v=binary(p);s=0;for(k=1,#v,s+=if(v[k]==0,+1,-1));if(s<=0,print1(p,", "))) \\ _Washington Bomfim_, Jan 13 2011
%o A095074 (Python)
%o A095074 from sympy import isprime
%o A095074 i=1
%o A095074 j=1
%o A095074 while j<=25000:
%o A095074     if isprime(i) and bin(i)[2:].count("0")<=bin(i)[2:].count("1"):
%o A095074         print(str(j)+" "+str(i))
%o A095074         j+=1
%o A095074     i+=1 # _Indranil Ghosh_, Feb 03 2017
%Y A095074 Complement of A095071 in A000040. Differs from A057447 first time at n=18, where a(n)=71, while A057447(18)=67. Cf. A095054.
%K A095074 nonn,base
%O A095074 1,1
%A A095074 _Antti Karttunen_, Jun 01 2004