OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
A. Karttunen and J. Moyer: C-program for computing the initial terms of this sequence
MAPLE
f:= proc(n) local L, d, s;
if not isprime(n) then return false fi;
L:= convert(n, base, 2);
convert(L, `+`) > nops(L)/2+1
end proc:
select(f, [seq(i, i=3..1000, 2)]); # Robert Israel, Oct 26 2023
MATHEMATICA
n1Q[p_]:=Module[{be=IntegerDigits[p, 2]}, Total[be]>2+Count[be, 0]]; Select[ Prime[ Range[150]], n1Q] (* Harvey P. Dale, Oct 26 2022 *)
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 > (2+b0), return(1); , return(0); ); };
forprime(x = 2, 859, if(B(x), print1(x, ", "); ); );
\\ Washington Bomfim, Jan 12 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 04 2004
STATUS
approved