OFFSET
1,1
COMMENTS
The trajectories of the given terms do not reach a palindrome in 10000 (10^4) or fewer steps. The trajectory of 49 does not reach a palindrome in 100000 (10^5) or fewer steps.
PROG
(PARI) eva(n) = subst(Pol(n), x, 10)
rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
a345112(n, bound) = my(x=n, i=0); while(1, x=x+eva(rot(digits(x))); i++; if(digits(x)==Vecrev(digits(x)), break); if(i > bound, return(-1))); i
is(n) = a345112(n, 10000)==-1
(Python)
def pal(s): return s == s[::-1]
def rotl(s): return s[1:] + s[0]
def A345111(n): return n + int(rotl(str(n)))
def A345112_bd(n, bd=10000):
i, iter, seen = 0, n, set()
while not (iter > n and pal(str(iter))) and iter not in seen and i < bd:
seen.add(iter)
i, iter = i+1, A345111(iter)
return i if iter > n and pal(str(iter)) else 0
def aupto(lim, bd=10000):
return [n for n in range(1, lim+1) if A345112_bd(n, bd=bd) == 0]
print(aupto(168, bd=100)) # Michael S. Branicky, Jun 09 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Jun 09 2021
STATUS
approved