OFFSET
1,1
COMMENTS
LINKS
MAPLE
dmax:= 5: # to get all terms with at most dmax digits
revdigs:= proc(n)
local L, Ln, i;
L:= convert(n, base, 10);
Ln:= nops(L);
add(L[i]*10^(Ln-i), i=1..Ln);
end proc:
P:= $0..9:
for d from 2 to dmax do
if d::even then
P:= P, seq(10^(d/2)*x + revdigs(x), x=10^(d/2-1)..10^(d/2)-1)
else
m:= (d-1)/2;
P:= P, seq(seq(10^(m+1)*x + 10^m*j+revdigs(x), j=0..9), x=10^(m-1)..10^m-1);
fi
od:
P:= [P]:
r:= P[3]: Res:= r: count:= 1:
for i from 4 to nops(P) do
if igcd(P[i], r) > 1 then
count:= count+1; r:= P[i]; Res:= Res, r;
fi
od:
Res; # Robert Israel, Jul 04 2018
PROG
(PARI) ispal(n) = my(d=digits(n)); d == Vecrev(d);
lista(nn) = {print1(last = 2, ", "); for (n=3, nn, if (ispal(n) && (gcd(n, last) != 1), print1(n, ", "); last = n; ); ); } \\ Michel Marcus, Aug 12 2015
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Apr 02 2003
EXTENSIONS
More terms from David Wasserman, Jun 29 2004
STATUS
approved