login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A059695
Primes p such that p^2 reversed is also prime.
4
19, 37, 41, 89, 97, 139, 193, 271, 277, 281, 313, 331, 353, 373, 383, 397, 401, 421, 439, 443, 557, 587, 853, 971, 991, 1039, 1063, 1109, 1129, 1153, 1171, 1181, 1249, 1277, 1289, 1297, 1303, 1307, 1319, 1399, 1409, 1753, 1789, 1823, 1847, 1973
OFFSET
1,1
MATHEMATICA
Select[ Range[ 2500 ], PrimeQ[ # ] && PrimeQ[ ToExpression[ StringReverse[ ToString[ #^2 ] ] ] ] & ]
PROG
(Magma) [p: p in PrimesUpTo(2000) | IsPrime(Seqint(Reverse(Intseq(p^2))))]; // Vincenzo Librandi, Apr 12 2013
(Python)
from sympy import isprime, primerange
def ok(p): return isprime(int(str(p**2)[::-1]))
print([p for p in primerange(1, 2000) if ok(p)]) # Michael S. Branicky, Dec 27 2021
(PARI) select(p->isprime(fromdigits(Vecrev(digits(p^2)))), primes(1000)) \\ Mohammed Yaseen, Dec 31 2021
CROSSREFS
Cf. A059007.
Primes p such that p^k reversed is also prime: A059696 (k=3), ..., A059705 (k=12).
Sequence in context: A368833 A352885 A354431 * A134196 A217045 A139313
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Feb 06 2001
STATUS
approved