login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A095077 Primes with four 1-bits in their binary expansion. 5
23, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 263, 269, 277, 281, 293, 337, 353, 389, 401, 449, 523, 547, 593, 643, 673, 773, 1031, 1049, 1061, 1091, 1093, 1097, 1217, 1283, 1289, 1297, 1409, 1553, 1601, 2069, 2083, 2089, 2129 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

T. D. Noe, Table of n, a(n) for n = 1..1000

A. Karttunen and J. Moyer, C-program for computing the initial terms of this sequence

MATHEMATICA

Select[Prime[Range[320]], Plus@@IntegerDigits[#, 2] == 4 &] (* Alonso del Arte, Jan 11 2011 *)

Select[ Flatten[ Table[2^i + 2^j + 2^k + 1, {i, 3, 11}, {j, 2, i - 1}, {k, j - 1}]], PrimeQ] (* Robert G. Wilson v, Jul 30 2016 *)

PROG

(PARI) bits1_4(x) = { nB = floor(log(x)/log(2)); z = 0;

for(i=0, nB, if(bittest(x, i), z++; if(z>4, return(0); ); ); );

if(z == 4, return(1); , return(0); ); };

forprime(x=17, 2129, if(bits1_4(x), print1(x, ", "); ); );

\\ Washington Bomfim, Jan 11 2011

(PARI) is(n)=isprime(n) && hammingweight(n)==4 \\ Charles R Greathouse IV, Jul 30 2016

(PARI) list(lim)=my(v=List(), t); for(a=3, logint(lim\=1, 2), for(b=2, a-1, for(c=1, b-1, t=1<<a + 1<<b + 1<<c + 1; if(t>lim, return(Vec(v))); if(isprime(t), listput(v, t))))); Vec(v) \\ Charles R Greathouse IV, Jul 30 2016

CROSSREFS

Subsequence of A027699. First differs from A085448 at n = 19, where a(n)=337, while A085448 continues from there with 311, whose binary expansion has six 1-bits, not four. Cf. A095057.

Cf. A000215 (primes having two bits set), A081091 (three bits set).

Cf. A264908.

Sequence in context: A007637 A161723 A085448 * A106989 A106988 A127834

Adjacent sequences:  A095074 A095075 A095076 * A095078 A095079 A095080

KEYWORD

nonn,easy,base

AUTHOR

Antti Karttunen, Jun 01 2004

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 10 18:17 EDT 2021. Contains 342853 sequences. (Running on oeis4.)