OFFSET
1,1
COMMENTS
EXAMPLE
a(3) = 46831 is a term because it is prime, the next prime is 46853, and 46831, 46853 and 46831 + 46853 = 93684 have distinct digits but 46853 - 46831 = 22 does not.
MAPLE
isdd:= proc(n) local L;
L:= convert(n, base, 10);
nops(L) = nops(convert(L, set))
end proc:
Res:= NULL:
for d from 1 to 9 do
for t in combinat:-permute([$0..9], d) do
if t[1] = 0 then next fi;
p:= add(t[i]*10^(d-i), i=1..d);
if isprime(p) then
q:= nextprime(p);
if not(isdd(q-p)) and isdd(q) and isdd(p+q) then
Res:= Res, p;
fi
fi
od od:
Res;
CROSSREFS
KEYWORD
nonn,fini,full,base
AUTHOR
Zak Seidov and Robert Israel, Mar 19 2024
STATUS
approved