A095321 Primes in whose binary expansion the number of 1-bits is <= number of 0-bits minus 3.
257, 521, 577, 641, 769, 1031, 1033, 1049, 1061, 1091, 1093, 1097, 1153, 1217, 1283, 1289, 1297, 1409, 1553, 1601, 2053, 2069, 2081, 2083, 2089, 2113, 2129, 2179, 2309, 2593, 2689, 3089, 3137, 3329, 4099, 4111, 4129, 4133, 4139, 4153
Offset: 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
Programs
-
Maple
filter:= proc(p) local L; L:= convert(p,base,2); 2*convert(L,`+`) <= nops(L)-3 end proc; select(filter, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Apr 27 2025
-
Mathematica
Select[Prime[Range[600]],DigitCount[#,2,1]<=DigitCount[#,2,0]-3&] (* Harvey P. Dale, Jul 04 2018 *)
-
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,", "))) \\ Washington Bomfim, Jan 12 2011