OFFSET
1,1
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..25000
A. Karttunen and J. Moyer: C-program for computing the initial terms of this sequence
EXAMPLE
13 is in the sequence because 13 is prime and 13 = 1101_2. '1101' has three 1's and one 0. 3 > 1 + 1. - Indranil Ghosh, Feb 07 2017
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+1), return(1); , return(0); ); };
forprime(x = 3, 499, if(B(x), print1(x, ", "); ); );
\\ Washington Bomfim, Jan 11 2011
(Python)
from sympy import isprime
i = 1
j = 1
while j <= 2000:
bi = bin(i)[2:]
if isprime(i) and bi.count("1") > 1 + bi.count("0"):
print(str(j) + " " + str(i))
j += 1
i += 1 # Indranil Ghosh, Feb 07 2017
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Antti Karttunen, Jun 04 2004
STATUS
approved