OFFSET
1,1
COMMENTS
All terms start with digit 1 or 3.
It appears that the only term that does not end with digit 7 or 9 is 13.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 107 is a term because it is prime, its reversal 701 is prime, and 701 mod 107 = 59 is prime.
MAPLE
rev:= proc(n) local K, i;
K:= convert(n, base, 10);
add(K[-i]*10^(i-1), i=1..nops(K))
end proc:
filter:= proc(p) local q;
if not isprime(p) then return false fi;
q:= rev(p);
q > p and isprime(q) and isprime(q mod p)
end proc:
select(filter, [seq(i, i=3..10^5, 2)]);
MATHEMATICA
q[p_] := Module[{r = IntegerReverse[p]}, r > p && PrimeQ[r] && PrimeQ[Mod[r, p]]]; Select[Prime[Range[3500]], q] (* Amiram Eldar, Sep 18 2022 *)
PROG
(Python)
from sympy import isprime
def ok(n):
r = int(str(n)[::-1])
return r > n and isprime(n) and isprime(r) and isprime(r%n)
print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Sep 18 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Sep 18 2022
STATUS
approved