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 A082554 #30 Feb 16 2025 08:32:49 %S A082554 5,11,13,17,19,23,29,47,59,61,67,71,79,97,103,113,131,191,193,199,223, %T A082554 227,239,241,251,257,263,271,383,449,463,479,487,499,503,509,769,911, %U A082554 967,991,1009,1019,1021,1031,1039,1087,1151,1279,1543,1567,1663,1823 %N A082554 Primes whose base-2 representation is a block of 1's, followed by a block of 0's, followed by a block of 1's. %C A082554 The n-th prime is a term iff A100714(n) = 3. - Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004 %C A082554 A019434 \{3} is a subsequence, since the base-2 representation of a Fermat prime 2^(2^k)+1 > 3 is a single 1, followed by a block of 2^k-1 0's, followed by a last single 1. - _Bernard Schott_, Mar 07 2023 %H A082554 Michael S. Branicky, <a href="/A082554/b082554.txt">Table of n, a(n) for n = 1..10000</a> %H A082554 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Run-LengthEncoding.html">Run-Length Encoding</a>. %e A082554 1987 = 11111000011_2, which is a block of 5 1's, followed by a block of 4 0's, followed by a block of 2 1's, so 1987 is a term. %e A082554 a(3)=17 is a term because it is the 3rd prime whose binary representation splits into exactly three runs: 17_10 = 10001_2 splits into {{1}, {0,0,0}, {1}}. %t A082554 Select[Table[Prime[k], {k, 1, 500}], Length[Split[IntegerDigits[ #, 2]]] == 3 &] %o A082554 (PARI) decomp(s)=if(s%2==0,return(1),); k=1; while(k==1,k=s%2; s=floor(s/2)); if(s==0,return(1),); while(k==0,k=s%2; s=floor(s/2)); while(k==1,k=s%2; s=floor(s/2)); return(s) %o A082554 forprime(i=1,2000,if(decomp(i)==0,print1(i,", "))) %o A082554 (Python) %o A082554 from sympy import isprime %o A082554 from itertools import count, islice %o A082554 def agen(): yield from filter(isprime, ((1<<k)-(1<<j)+(1<<i)-1 for k in count(1) for j in range(k-1, 1, -1) for i in range(1, j))) %o A082554 print(list(islice(agen(), 52))) # _Michael S. Branicky_, Feb 25 2023 %Y A082554 Cf. A100714, A000040. Primes in A043570. %Y A082554 Cf. A019434. %K A082554 nonn,base %O A082554 1,1 %A A082554 _Randy L. Ekl_, May 03 2003