editing
approved
editing
approved
Select[Prime[Range[600]], DigitCount[#, 2, 1]<=DigitCount[#, 2, 0]-3&] (* Harvey P. Dale, Jul 04 2018 *)
approved
editing
editing
approved
(PARI)forprime(p=2, 4200, v=binary(p); s=0; for(k=1, #v, s+=if(v[k]==1, +1, -1)); if(s<=-3, print1(p, ", "))) [W. \\ _Washington Bomfim, _, Jan 12, 2011]
approved
editing
_Antti Karttunen (his-firstname.his-surname(AT)iki.fi), _, Jun 04 2004
reviewed
approved
proposed
reviewed
(PARI)forprime(p=2, 4200, v=binary(p); s=0; for(k=1, #v, s+=if(v[k]==1, +1, -1)); if(s<=-3, print1(p, ", "))) [W. Bomfim, Jan 12, 2011]
[W. Bomfim webonfim(AT)bol.com Jan 12, 2011]
(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-3), return(1); , return(0); ); };
(PARI)forprime(x p=2, 4200, v=binary(p); s=0; for(k=1, #v, s+= 11, 4153, if(B(xv[k]==1, +1, -1)), ; if(s<=-3, print1(x, p, ", "); ); );
(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-3), return(1); , return(0); ); };
forprime(x = 11, 4153, if(B(x), print1(x, ", "); ); );
[W. Bomfim webonfim(AT)bol.com Jan 12, 2011]
nonn,base,easy,new
approved
proposed