OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..5382
MAPLE
revdigs:= proc(n) option remember;
local b;
if n < 10 then return n fi;
b:= n mod 10;
b*10^ilog10(n) + procname((n-b)/10);
end proc:
A:= {3, 5}:
B:= [0]:
for d from 2 to 20 do
if d::even then
B:= map(t -> (10*t+3, 10*t+5), B);
A:= A union select(isprime, {seq(revdigs(b)+10^(d/2)*b, b=B)});
else
A:= A union select(isprime, {seq(seq(
revdigs(b)+i*10^((d-1)/2)+10^((d+1)/2)*b, i = [3, 5]), b=B)});
fi
od:
sort(convert(A, list)); # Robert Israel, Dec 17 2015
PROG
(Python)
from itertools import product
from sympy import isprime
A138584_list = []
for l in range(17):
for d in product('35', repeat=l):
s = ''.join(d)
n = int(s+'3'+s[::-1])
if isprime(n):
A138584_list.append(n)
n += 2*10**l
if isprime(n):
A138584_list.append(n) # Chai Wah Wu, Dec 17 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paul Curtz, May 13 2008
EXTENSIONS
More terms from Arkadiusz Wesolowski, Dec 31 2011
STATUS
approved