login
A033621
Numbers k such that k-1 is a palindrome in base 10, and k+1 is a palindrome in base 17.
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 89, 233, 374, 425, 596, 647, 869, 920, 3444, 4775, 23633, 45755, 62027, 180082, 231133, 310014, 487785, 566666, 645547, 724428, 803309, 1027202, 1064602, 1215122, 1252522, 1403042, 80399309, 111222112, 112060212, 146979642
OFFSET
1,2
LINKS
EXAMPLE
a(12) = 89 is a term because 89-1 = 88 is a palindrome in base 10, while 89+1 = 55_17 is a palindrome in base 17. - Robert Israel, Jan 14 2026
MAPLE
digrev:= proc(n, b) local L, i;
L:= convert(n, base, b);
add(L[-i]*b^(i-1), i=1..nops(L))
end proc:
b1:= 10: b2:= 17:
R:= $1..10, 12: count:= 12:
for d from 2 while count < 50 do
if d::even then
for x from b2^(d/2-1) to b2^(d/2)-1 while count < 50 do
m:= x*b2^(d/2)+digrev(x, b2);
if digrev(m-2, b1) = m-2 then
R:= R, m-1; count:= count+1;
fi
od
else
for x from b2^((d-3)/2) to b2^((d-1)/2)-1 while count < 50 do
for y from 0 to b2-1 do
m:= x*b2^((d+1)/2)+y*b2^((d-1)/2) + digrev(x, b2);
if digrev(m-2, b1) = m-2 then
R:= R, m-1; count:= count+1;
fi
od od
fi
od:
R; # Robert Israel, Jan 14 2026
PROG
(PARI) isok(m) = my(da=digits(m-1, 10), db=digits(m+1, 17)); da==Vecrev(da) && db==Vecrev(db); \\ Michel Marcus, Jul 09 2020
CROSSREFS
Sequence in context: A061729 A286126 A249157 * A332808 A108548 A333692
KEYWORD
nonn,base
EXTENSIONS
More terms from Michel ten Voorde
Corrected and extended by Sean A. Irvine, Jul 08 2020
STATUS
approved