OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
13 is in the sequence because the next emirp (17) is also the next prime.
71 is in the sequence because the next emirp (73) is also the next prime.
MAPLE
digrev:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
isemirp:= proc(n) local r;
r:= digrev(n);
r <> n and isprime(r)
end proc:
R:= NULL: count:= 0:
p:= 2: ep:= false:
while count < 100 do
q:= p; eq:= ep;
p:= nextprime(p);
ep:= isemirp(p);
if ep and eq then
R:= R, q; count:= count+1;
fi
od:
R; # Robert Israel, Jun 20 2021
MATHEMATICA
emirpQ[n_] := PrimeQ[n] && Block[{r=FromDigits@Reverse@IntegerDigits@n},
r != n && PrimeQ[r]]; nextEmirp[n_] := Block[{e=NextPrime[n]}, While[! emirpQ[e], e = NextPrime[e]]; e]; Select[Prime@Range@1000, emirpQ[#] && NextPrime[#] == nextEmirp[#] &] (* Giovanni Resta, Oct 28 2012 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jonathan Vos Post, Oct 08 2012
EXTENSIONS
More terms from Giovanni Resta, Oct 28 2012
STATUS
approved