OFFSET
1,2
COMMENTS
See A389674 for the "rebase-and-read" operation.
It is not known if a(n) is finite for all n. Empirically, a(n) appears to be always finite and grows without bound, albeit slowly, as n grows.
The only cycle known with length greater than one has length four, arising from 115 --> 223 --> 436 --> 277.
No further cycles for n <= 10^10. - Michael S. Branicky, Oct 12 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 13, we successively apply A389674 obtaining the sequence 13 --> 31 --> 133 --> 250 --> 505 --> 505. Since we hit a repeated number on the 5th iteration, a(13) = 5.
a(15) = 8 and is the earliest point at which we encounter a repeating cycle: 15 --> 23 --> 43 --> 61 --> 115 --> 223 --> 436 --> 277 --> 115.
MATHEMATICA
A389674[n_] := If[# == 1, n, FromDigits[IntegerDigits[n, #]]] & [Total[IntegerDigits[n]]];
Array[A389673, 100] (* Paolo Xausa, Oct 17 2025 *)
PROG
(Python)
from sympy.ntheory import digits
def F(n): return n if (b:=sum(d:=list(map(int, str(n)))))<2 else sum(di*10**i for i, di in enumerate(digits(n, b)[:0:-1]))
def a(n):
c, seen = 0, set()
while n not in seen: n, c, seen = F(n), c+1, seen | {n}
return c
print([a(n) for n in range(1, 84)]) # Michael S. Branicky, Oct 10 2025
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Daniel Baldwin, Oct 10 2025
STATUS
approved
