login

Revision History for A095321

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Primes in whose binary expansion the number of 1-bits is <= number of 0-bits minus 3.
(history; published version)
#14 by Harvey P. Dale at Wed Jul 04 20:13:01 EDT 2018
STATUS

editing

approved

#13 by Harvey P. Dale at Wed Jul 04 20:12:58 EDT 2018
MATHEMATICA

Select[Prime[Range[600]], DigitCount[#, 2, 1]<=DigitCount[#, 2, 0]-3&] (* Harvey P. Dale, Jul 04 2018 *)

STATUS

approved

editing

#12 by Jon E. Schoenfield at Mon Mar 02 02:34:36 EST 2015
STATUS

editing

approved

#11 by Jon E. Schoenfield at Mon Mar 02 02:34:34 EST 2015
PROG

(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]

STATUS

approved

editing

#10 by Russ Cox at Sat Mar 31 14:02:23 EDT 2012
AUTHOR

_Antti Karttunen (his-firstname.his-surname(AT)iki.fi), _, Jun 04 2004

Discussion
Sat Mar 31
14:02
OEIS Server: https://oeis.org/edit/global/912
#9 by T. D. Noe at Fri Jan 14 00:01:32 EST 2011
STATUS

reviewed

approved

#8 by Michael B. Porter at Thu Jan 13 21:18:23 EST 2011
STATUS

proposed

reviewed

#7 by T. D. Noe at Thu Jan 13 21:08:21 EST 2011
PROG

(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]

#6 by Washington Bomfim at Thu Jan 13 20:00:05 EST 2011
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-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, ", "); ); );

#5 by Washington Bomfim at Wed Jan 12 02:11:29 EST 2011
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-3), return(1); , return(0); ); };

forprime(x = 11, 4153, if(B(x), print1(x, ", "); ); );

[W. Bomfim webonfim(AT)bol.com Jan 12, 2011]

KEYWORD

nonn,base,easy,new

STATUS

approved

proposed

Discussion
Thu Jan 13
18:25
T. D. Noe: It seems that a much shorter program is possible.