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.

A095070 One-bit dominant primes, i.e., primes whose binary expansion contains more 1's than 0's.

This page as a plain text file.
%I A095070 #35 Jul 25 2023 04:04:03
%S A095070 3,5,7,11,13,19,23,29,31,43,47,53,59,61,71,79,83,89,101,103,107,109,
%T A095070 113,127,151,157,167,173,179,181,191,199,211,223,227,229,233,239,241,
%U A095070 251,271,283,307,311,313,317,331,347,349,359,367,373,379,383
%N A095070 One-bit dominant primes, i.e., primes whose binary expansion contains more 1's than 0's.
%H A095070 Indranil Ghosh, <a href="/A095070/b095070.txt">Table of n, a(n) for n = 1..20000</a>
%H A095070 Antti Karttunen and John Moyer, <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a>.
%H A095070 MathOverflow, <a href="https://mathoverflow.net/questions/97288/primes-with-more-ones-than-zeroes-in-their-binary-expansion">Primes with more ones than zeroes in their Binary expansion</a>, 2012.
%e A095070 23 is in the sequence because 23 is a prime and 23_10 = 10111_2. '10111' has four 1's and one 0. - _Indranil Ghosh_, Jan 31 2017
%t A095070 Select[Prime[Range[70]], Plus@@IntegerDigits[#, 2] > Length[IntegerDigits[#, 2]]/2 &] (* _Alonso del Arte_, Jan 11 2011 *)
%t A095070 Select[Prime[Range[100]], Differences[DigitCount[#, 2]][[1]] < 0 &] (* _Amiram Eldar_, Jul 25 2023 *)
%o A095070 (PARI) B(x) = {nB = floor(log(x)/log(2)); b1 = 0; b0 = 0;
%o A095070 for(i = 0, nB, if(bittest(x,i), b1++;, b0++;); );
%o A095070 if(b1 > b0, return(1);, return(0););};
%o A095070 forprime(x = 3, 383, if(B(x), print1(x, ", "); ); ); \\ _Washington Bomfim_, Jan 11 2011
%o A095070 (PARI) has(n)=hammingweight(n)>#binary(n)/2
%o A095070 select(has, primes(500)) \\ _Charles R Greathouse IV_, May 02 2013
%o A095070 (Python)
%o A095070 # Program to generate the b-file
%o A095070 from sympy import isprime
%o A095070 i=1
%o A095070 j=1
%o A095070 while j<=200:
%o A095070     if isprime(i) and bin(i)[2:].count("1")>bin(i)[2:].count("0"):
%o A095070         print(str(j)+" "+str(i))
%o A095070         j+=1
%o A095070     i+=1 # _Indranil Ghosh_, Jan 31 2017
%Y A095070 Intersection of A000040 and A072600.
%Y A095070 Complement of A095075 in A000040.
%Y A095070 Subsequence: A095073.
%Y A095070 Cf. A095020.
%K A095070 nonn,easy,base
%O A095070 1,1
%A A095070 _Antti Karttunen_, Jun 01 2004