OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
C. Caldwell and H. Dubner (Eds), The top ten prime numbers: from the unpublished collections of R. Ondrejka (May 2001), p. 6.
MAPLE
filter:= proc(n) local L, LR;
L:= convert(n, base, 10);
if nops(L)::odd
then return false
fi;
L:= ListTools:-Reverse(L) - L;
not has(L, 0);
end;
Primes:= [seq(op(select(isprime, [$10^(2*n-1) ... 10^(2*n)-1])), n=1..3)]:
A241059:= select(filter, Primes); # Robert Israel, Apr 17 2014
PROG
(PARI) for(n=1, 1307, s=#Str(n); if(!bitand(s, 1)&&isprime(n), t=0; v=Vec(Str(n)); for(k=1, s/2, if(v[k]==v[s+1-k], break, t++)); if(t==s/2, print1(n, ", "))));
(Python)
from sympy import isprime
def ok(n):
s = str(n)
return not len(s)&1 and all(s[i] != s[-1-i] for i in range(len(s)//2)) and isprime(n)
print([k for k in range(2000) if ok(k)]) # Michael S. Branicky, Jun 17 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Arkadiusz Wesolowski, Apr 15 2014
STATUS
approved