OFFSET
1,1
COMMENTS
There are large gaps in this sequence because all terms need to begin with 1, 3, 7, or 9 otherwise the reversal is composite.
EXAMPLE
a(1) = 97 because of the three consecutive primes 89, 97, 101 only 97 is an emirp and this is the first such occurrence.
MATHEMATICA
emirpQ[p_] := (r = IntegerReverse[p]) != p && PrimeQ[r]; p = Select[Range[3400], PrimeQ]; p[[1 + Position[Partition[emirpQ /@ p, 3, 1], {False, True, False}] // Flatten]] (* Amiram Eldar, Jul 14 2021 *)
PROG
(Python)
from sympy import isprime, nextprime
def isemirp(p): s = str(p); return s != s[::-1] and isprime(int(s[::-1]))
def aupto(limit):
alst, pvec, evec, p = [], [2, 3, 5], [0, 0, 0], 7
while pvec[1] <= limit:
if evec == [0, 1, 0]: alst.append(pvec[1])
pvec = pvec[1:] + [p]; evec = evec[1:] + [isemirp(p)]; p = nextprime(p)
return alst
print(aupto(3319)) # Michael S. Branicky, Jul 14 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Lars Blomberg, Jul 14 2021
STATUS
approved