login
A389673
a(n) is the length of the sequence obtained by repeated iteration of the "rebase-and-read" operation (A389674), starting at n until one reaches a number already in the sequence.
1
1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 9, 9, 5, 6, 8, 10, 5, 11, 1, 10, 4, 9, 7, 5, 3, 10, 10, 1, 11, 9, 4, 9, 11, 2, 7, 5, 1, 8, 12, 4, 10, 9, 6, 10, 10, 1, 7, 5, 5, 9, 12, 5, 10, 9, 1, 13, 6, 2, 7, 8, 5, 7, 5, 1, 9, 14, 6, 6, 6, 4, 7, 9, 1, 7, 6, 6, 7, 11, 2, 8, 2, 1, 7
OFFSET
1,2
COMMENTS
See A389674 for the "rebase-and-read" operation.
Fixed points occur when A007953(n) = 10, that is elements of A052224.
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
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]]];
A389673[n_] := Length[NestWhileList[A389674, n, UnsameQ, All]] - 1;
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