OFFSET
1,1
COMMENTS
All terms == 1 (mod 6). - Robert Israel, Sep 13 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
271 belongs to this sequence as 271 squared is 73441 and 271 reversed is 172 and the sum of 73441 and 172 is 73613, which is prime.
MAPLE
revdigs:= proc(n) local L, i;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L));
end proc:
filter:= t -> isprime(t) and isprime(t^2+revdigs(t)):
select(filter, [seq(t, t=1..10^4, 6)]); # Robert Israel, Sep 13 2018
MATHEMATICA
Select[Prime@Range@1120, PrimeQ[#^2 + FromDigits[Reverse@IntegerDigits@#]] &] (* Vincenzo Librandi, Sep 14 2018 *)
PROG
(Python)
nmax=10000
def is_prime(num):
if num == 0 or num == 1: return(0)
for k in range(2, num):
if (num % k) == 0:
return(0)
return(1)
ris = ""
for i in range(nmax):
if is_prime(i):
r=int((str(i)[::-1]))
t=pow(i, 2)+r
if is_prime(t):
ris = ris+str(i)+", "
print(ris)
(PARI) forprime(p=1, 9000, if(ispseudoprime(p^2 + eval(concat(Vecrev(Str(p))))), print1(p, ", "))) \\ Felix Fröhlich, Sep 12 2018
CROSSREFS
KEYWORD
AUTHOR
Pierandrea Formusa, Sep 11 2018
STATUS
approved