OFFSET
1,1
COMMENTS
The first two terms that are not in A085306 are a(8) = 307 and a(55) = 30001253.
The first two terms p such that the square root of the reversal of p^2 is neither p nor the reversal of p are a(69) = 110092211 and a(81) = 112191011 (whose squares are each other's reversals).
For n>1, the first decimal digit of a(n)^2 is either 1 or 9. - Chai Wah Wu, Apr 07 2026
EXAMPLE
a(5) = 31 is a term because 31^2 = 961 whose reversal 169 = 13^2, and 13 is prime.
MAPLE
filter:= proc(p) local r;
if not isprime(p) then return false fi;
r:= rev(p^2);
issqr(r) and isprime(sqrt(r))
end proc:
select(filter, [2, seq(i, i=3..2*10^6, 2)]);
MATHEMATICA
Select[Prime[Range[10^5]], PrimeQ[Sqrt[IntegerReverse[#^2]]] &] (* Stefano Spezia, Apr 05 2026 *)
PROG
(PARI) isok(p) = if (isprime(p), my(r = fromdigits(Vecrev(digits(p^2)))); issquare(r) && isprime(sqrtint(r))); \\ Michel Marcus, Apr 05 2026
(Python)
from itertools import count, islice
from math import isqrt
from sympy import primerange, integer_nthroot, isprime
def A393520_gen(): # generator of terms
yield 2
for l in count(0):
for p in primerange(isqrt(m:=10**l)+1, isqrt((m<<1)-1)+1):
q, r = integer_nthroot(int(str(p**2)[::-1]), 2)
if r and isprime(q):
yield p
for p in primerange(isqrt(9*m), isqrt(10*m-1)+1):
q, r = integer_nthroot(int(str(p**2)[::-1]), 2)
if r and isprime(q):
yield p
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Apr 05 2026
STATUS
approved
