OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..2000
EXAMPLE
a(3) = 18413 = p is a term because it is an emirp (18413 and 31481 being distinct primes), the next emirp is q = 18427, and (p*q) mod (p+q) = 36791 and floor((p*q)/(p+q)) = 9209 are emirps.
MAPLE
rev:= 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:= rev(n);
r <> n and isprime(r)
end proc:
R:= NULL: count:= 0:
p:= 0:
for d from 1 while count < 40 do
for i in [1, 3, 7, 9] do
for j from 1 to 10^d-1 by 2 while count < 40 do
q:= i*10^d+j;
if isemirp(q) then
s:= p+q;
t:= p*q;
if isemirp(t mod s) and isemirp(floor(t/s)) then
count:= count+1; R:= R, p;
fi;
p:= q;
fi;
od od od;
R;
MATHEMATICA
emirpQ[p_] := (q = IntegerReverse[p]) != p && And @@ PrimeQ[{p, q}]; nextEmirp[p_] := Module[{k = NextPrime[p]}, While[(q = IntegerReverse[k]) == k || ! PrimeQ[q], k = NextPrime[k]]; k]; seqQ[p_] := emirpQ[p] && Module[{q = nextEmirp[p]}, And @@ emirpQ /@ {Mod[p*q, p + q], Floor[p*q/(p + q)]}]; Select[Range[2*10^6], seqQ] (* Amiram Eldar, Jan 21 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Jan 20 2022
STATUS
approved