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
From Indranil Ghosh, Feb 03 2017 (Start):
29 is in the sequence because 29_10 = 11101_2. '11101' has one 0 and three 1's.
37 is in the sequence because 37_10 = 100101_2. '100101' has three 1's and 3 0's. (Stop)
MATHEMATICA
Select[Prime[Range[50]], DigitCount[#, 2, 0] <= DigitCount[#, 2, 1] &] (* Alonso del Arte, Jan 11 2011 *)
PROG
(PARI)forprime(p=2, 347, 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
(Python)
from sympy import isprime
i=1
j=1
while j<=25000:
if isprime(i) and bin(i)[2:].count("0")<=bin(i)[2:].count("1"):
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Feb 03 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 01 2004
STATUS
approved