OFFSET
1,2
COMMENTS
The number of iterations is 0, 1, 2, 3 for numbers containing the highest digits (1, 2), (3,5,7), (4, 9), (6, 8). n >= a(n) >= 1.
FORMULA
EXAMPLE
For n = 21 a(21) = 21.
For n = 408 we iterate 48 --> 34 --> 23 --> 22, thus, after 3 iterations, a(408) = 22.
MATHEMATICA
a[n_] := FromDigits[IntegerDigits[n] /. {0 -> Nothing, _?(# > 1 &) -> 2}]; Array[a, 100] (* Amiram Eldar, Jan 24 2025 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Jan 24 2025
STATUS
approved