login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A059695 Primes p such that p^2 reversed is also prime. 4

%I #24 Sep 08 2022 08:45:03

%S 19,37,41,89,97,139,193,271,277,281,313,331,353,373,383,397,401,421,

%T 439,443,557,587,853,971,991,1039,1063,1109,1129,1153,1171,1181,1249,

%U 1277,1289,1297,1303,1307,1319,1399,1409,1753,1789,1823,1847,1973

%N Primes p such that p^2 reversed is also prime.

%H T. D. Noe, <a href="/A059695/b059695.txt">Table of n, a(n) for n = 1..1000</a>

%t Select[ Range[ 2500 ], PrimeQ[ # ] && PrimeQ[ ToExpression[ StringReverse[ ToString[ #^2 ] ] ] ] & ]

%o (Magma) [p: p in PrimesUpTo(2000) | IsPrime(Seqint(Reverse(Intseq(p^2))))]; // _Vincenzo Librandi_, Apr 12 2013

%o (Python)

%o from sympy import isprime, primerange

%o def ok(p): return isprime(int(str(p**2)[::-1]))

%o print([p for p in primerange(1, 2000) if ok(p)]) # _Michael S. Branicky_, Dec 27 2021

%o (PARI) select(p->isprime(fromdigits(Vecrev(digits(p^2)))), primes(1000)) \\ _Mohammed Yaseen_, Dec 31 2021

%Y Cf. A059007.

%Y Primes p such that p^k reversed is also prime: A059696 (k=3), ..., A059705 (k=12).

%K nonn,base

%O 1,1

%A _Robert G. Wilson v_, Feb 06 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 10:22 EDT 2024. Contains 371268 sequences. (Running on oeis4.)