|
|
A095070
|
|
One-bit dominant primes, i.e., primes whose binary expansion contains more 1's than 0's.
|
|
8
|
|
|
3, 5, 7, 11, 13, 19, 23, 29, 31, 43, 47, 53, 59, 61, 71, 79, 83, 89, 101, 103, 107, 109, 113, 127, 151, 157, 167, 173, 179, 181, 191, 199, 211, 223, 227, 229, 233, 239, 241, 251, 271, 283, 307, 311, 313, 317, 331, 347, 349, 359, 367, 373, 379, 383
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
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
|
|
MATHEMATICA
|
Select[Prime[Range[70]], Plus@@IntegerDigits[#, 2] > Length[IntegerDigits[#, 2]]/2 &] (* Alonso del Arte, Jan 11 2011 *)
Select[Prime[Range[100]], Differences[DigitCount[#, 2]][[1]] < 0 &] (* Amiram Eldar, Jul 25 2023 *)
|
|
PROG
|
(PARI) B(x) = {nB = floor(log(x)/log(2)); b1 = 0; b0 = 0;
for(i = 0, nB, if(bittest(x, i), b1++; , b0++; ); );
if(b1 > b0, return(1); , return(0); ); };
forprime(x = 3, 383, if(B(x), print1(x, ", "); ); ); \\ Washington Bomfim, Jan 11 2011
(PARI) has(n)=hammingweight(n)>#binary(n)/2
(Python)
# Program to generate the b-file
from sympy import isprime
i=1
j=1
while j<=200:
if isprime(i) and bin(i)[2:].count("1")>bin(i)[2:].count("0"):
print(str(j)+" "+str(i))
j+=1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|