OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 1201 is a term because it is an emirp, i.e., 1201 and its reverse 1021 are distinct primes, and 2*1201 - 1021 = 1381 is also an emirp.
MAPLE
rev:= proc(n) local L, t;
L:= convert(n, base, 10);
add(L[-t]*10^(t-1), t=1..nops(L));
end proc:
filter:= proc(n) local r, s, t;
if not isprime(n) then return false fi;
r:= rev(n);
if r = n or not isprime(r) then return false fi;
s:= 2*n-r;
if not isprime(s) then return false fi;
t:= rev(s);
t <> s and isprime(t)
end proc:
select(filter, [seq(i, i=3..100000, 2)]);
MATHEMATICA
emirpQ[n_] := ! PalindromeQ[n] && AllTrue[{n, IntegerReverse[n]}, PrimeQ]; q[n_] := emirpQ[n] && (d = 2*n - IntegerReverse[n]) > 0 && AllTrue[{d, IntegerReverse[d]}, emirpQ]; Select[Range[80000], q] (* Amiram Eldar, Dec 08 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Dec 08 2022
STATUS
approved