[go: up one dir, main page]

login
A015979
Three iterations of Reverse and Add are needed to reach a palindrome.
2
59, 68, 77, 86, 95, 155, 156, 157, 158, 164, 165, 168, 178, 180, 184, 185, 186, 194, 199, 249, 254, 255, 256, 257, 263, 264, 267, 277, 283, 284, 285, 293, 298, 299, 348, 349, 353, 354, 355, 356, 362, 363, 366, 376, 382, 383, 384, 389, 392, 397
OFFSET
1,1
COMMENTS
The number of iterations starts at 1, so palindromes (cf. A002113) are not excluded. The corresponding sequence excluding palindromes is A065208.
MAPLE
filter:= proc(n, t) local x, d, m, L, i;
x:= n;
L:= convert(x, base, 10);
for i from 1 to t do
d:= nops(L);
x:= add(L[i]*(10^(i-1) + 10^(d-i)), i=1..d);
L:= convert(x, base, 10);
if L = ListTools:-Reverse(L) then return (i=t) fi;
od;
false
end proc:
select(filter, [$1..1000], 3); # Robert Israel, Aug 26 2024
CROSSREFS
Sequence in context: A096339 A216872 A235225 * A065208 A061759 A061764
KEYWORD
nonn,base
EXTENSIONS
Offset corrected by Robert Israel, Aug 26 2024
STATUS
approved