OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 1091 is a term because it is an emirp (as 1091 and its reverse 1901 are distinct primes), the next emirp after 1091 is 1097, and 2*1097-1091 =1103 is also an emirp.
MAPLE
revdigs:= 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;
if not isprime(n) then return false fi;
r:= revdigs(n):
r <> n and isprime(r)
end proc:
E:= select(isemirp, [seq(seq(seq(i*10^d+j, j=1..10^d-1, 2), i=[1, 3, 7, 9]), d=1..5)]):
nE:= nops(E):
R:= NULL:
for n from 1 to nE-1 do
if isemirp(2*E[n+1]-E[n]) then R:= R, E[n] fi
od:
R;
MATHEMATICA
EmirpQ[n_]:=PrimeQ@IntegerReverse@n&&n!=IntegerReverse@n;
NextEmirp[p_]:=(k=NextPrime@p; While[!EmirpQ@k, k=NextPrime@k]; k);
Select[Prime@Range@10000, EmirpQ@#&&PrimeQ[s=2NextEmirp@#-#]&&EmirpQ@s&] (* Giorgos Kalogeropoulos, Jan 19 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jan 18 2022
STATUS
approved