This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A095077 #28 Jul 20 2022 01:26:36 %S A095077 23,29,43,53,71,83,89,101,113,139,149,163,197,263,269,277,281,293,337, %T A095077 353,389,401,449,523,547,593,643,673,773,1031,1049,1061,1091,1093, %U A095077 1097,1217,1283,1289,1297,1409,1553,1601,2069,2083,2089,2129 %N A095077 Primes with four 1-bits in their binary expansion. %H A095077 T. D. Noe, <a href="/A095077/b095077.txt">Table of n, a(n) for n = 1..1000</a> %H A095077 A. Karttunen and J. Moyer, <a href="/A095062/a095062.c.txt">C-program for computing the initial terms of this sequence</a> %t A095077 Select[Prime[Range[320]], Plus@@IntegerDigits[#, 2] == 4 &] (* _Alonso del Arte_, Jan 11 2011 *) %t A095077 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 *) %o A095077 (PARI) bits1_4(x) = { nB = floor(log(x)/log(2)); z = 0; %o A095077 for(i=0,nB,if(bittest(x,i),z++;if(z>4,return(0);););); %o A095077 if(z == 4, return(1);, return(0););}; %o A095077 forprime(x=17,2129,if(bits1_4(x),print1(x, ", "););); %o A095077 \\ _Washington Bomfim_, Jan 11 2011 %o A095077 (PARI) is(n)=isprime(n) && hammingweight(n)==4 \\ _Charles R Greathouse IV_, Jul 30 2016 %o A095077 (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 %o A095077 (Python) %o A095077 from itertools import count, islice %o A095077 from sympy import isprime %o A095077 from sympy.utilities.iterables import multiset_permutations %o A095077 def A095077_gen(): # generator of terms %o A095077 return filter(isprime,map(lambda s:int('1'+''.join(s)+'1',2),(s for l in count(2) for s in multiset_permutations('0'*(l-2)+'11')))) %o A095077 A095077_list = list(islice(A095077_gen(),30)) # _Chai Wah Wu_, Jul 19 2022 %Y A095077 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. %Y A095077 Cf. A000215 (primes having two bits set), A081091 (three bits set). %Y A095077 Cf. A264908. %K A095077 nonn,easy,base %O A095077 1,1 %A A095077 _Antti Karttunen_, Jun 01 2004