login
A081939
a(1) = 2; a(n+1) is the smallest palindrome > a(n) that has a common factor with a(n).
4
2, 4, 6, 8, 22, 33, 44, 55, 66, 77, 88, 99, 111, 141, 171, 222, 232, 242, 252, 262, 272, 282, 292, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 585, 595, 616, 626, 636, 646, 656, 666, 676, 686, 696, 717, 747, 777, 828, 838, 848, 858, 868, 878, 888, 898
OFFSET
1,1
COMMENTS
Palindromes with an even number of digits are divisible by 11, so when a(n)=A002113(k) and A055642(a(n)) and A055642(A002113(k+1)) are even, a(n+1)=A002113(k+1). - Robert Israel, Jul 04 2018
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