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 A346022 #14 Jul 04 2021 12:04:54 %S A346022 13,31,337,701,761,937,983,1151,1279,1831,1933,3191,3803,3851,3911, %T A346022 7043,7219,7457,7523,7643,9127,9161,9241,9437,9521,9547,9601,9871, %U A346022 9931,10007,10151,10247,10487,10639,10853,10889,11071,11657,11833,12071,12547,12689 %N A346022 Primes that are the first in a run of exactly 2 emirps. %C A346022 There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite. %e A346022 a(2) = 31 because of the four consecutive primes 29, 31, 37, 41 only 31, 37 are emirps. %o A346022 (Python) %o A346022 from sympy import isprime, nextprime %o A346022 def isemirp(p): s = str(p); return s != s[::-1] and isprime(int(s[::-1])) %o A346022 def aupto(limit): %o A346022 alst, pvec, evec, p = [], [2, 3, 5, 7], [0, 0, 0, 0], 11 %o A346022 while pvec[1] <= limit: %o A346022 if evec == [0, 1, 1, 0]: alst.append(pvec[1]) %o A346022 pvec = pvec[1:] + [p]; evec = evec[1:] + [isemirp(p)]; p = nextprime(p) %o A346022 return alst %o A346022 print(aupto(12689)) # _Michael S. Branicky_, Jul 04 2021 %Y A346022 Subsequence of A006567 (emirps). %Y A346022 Cf. A003684, A048052, A048054, A071612. %K A346022 nonn,base %O A346022 1,1 %A A346022 _Lars Blomberg_, Jul 01 2021