OFFSET
1,1
LINKS
R. J. Mathar, Table of n, a(n) for n = 1..1000
MAPLE
read("transforms"):
A109308 := proc(n)
option remember;
local p, R ;
if n = 1 then
return 13 ;
else
p := nextprime(procname(n-1)) ;
while true do
R := digrev(p) ;
if R> p and isprime(R) then
return p;
end if;
p := nextprime(p) ;
end do:
end if;
end proc: # R. J. Mathar, Oct 12 2012
MATHEMATICA
dr[n_]:=FromDigits[Reverse[IntegerDigits[n]]]; Select[Prime[Range[1000]], PrimeQ[dr[ # ]]&&dr[ # ]>#&]
PROG
(PARI) isok(p) = if (isprime(p), my(q=fromdigits(Vecrev(digits(p)))); (p < q) && isprime(q)); \\ Michel Marcus, Sep 07 2021
(Python)
from sympy import isprime, primerange
def ok(p): revp = int(str(p)[::-1]); return p < revp and isprime(revp)
print(list(filter(ok, primerange(1, 1430)))) # Michael S. Branicky, Sep 07 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov, Jun 25 2005
STATUS
approved