OFFSET
0,2
COMMENTS
Apart from 0, the terms listed so far are all of period 2 or 3. Are there longer periods?
EXAMPLE
f(84290) = 126119 since 8+4 = 12, 4+2 = 6, 2+9 = 11, 9+0 = 9.
PROG
(Python)
def f(n):
if 0 <= n <= 9: return 0
d = str(n)
return int("".join(str(int(di)+int(dj)) for di, dj in zip(d[:-1], d[1:])))
def aupto(limit):
n, DIVERGENCELIMIT = 0, 10**100
while n <= limit:
m, orbit = n, []
while m <= DIVERGENCELIMIT and m not in orbit: orbit.append(m); m = f(m)
if m in orbit and m == orbit[0]: print(n, end=", ")
n += 1
aupto(130000) # Michael S. Branicky, Mar 24 2021
CROSSREFS
KEYWORD
nonn,base,nice,more
AUTHOR
Erich Friedman, Jan 07 2000
EXTENSIONS
More terms from Naohiro Nomoto, Apr 06 2001
0 added by N. J. A. Sloane, Nov 01 2019
STATUS
approved