login
A380435
Erase digit 0 from decimal expansion of n. Then repeatedly apply the number of divisor function (A000005) onto each digit until a stationary value is reached. a(n) is the final stationary value (if it is reached for all digits).
0
1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 11, 12, 12, 12, 12, 12, 12, 12, 12, 2, 21, 22, 22, 22, 22, 22, 22, 22, 22, 2, 21, 22, 22, 22, 22, 22, 22, 22, 22, 2, 21, 22, 22, 22, 22, 22, 22, 22, 22, 2, 21, 22, 22, 22, 22, 22, 22, 22, 22, 2, 21, 22, 22, 22, 22, 22, 22, 22, 22, 2, 21, 22, 22, 22, 22, 22
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
a(A007931(n)) = A007931(n).
For r = 1, k >= 0:
a(10^k) = 1
a((10^k - 1)/9) = (10^k - 1)/9.
For r from [2, 9], k >= 0:
a(r*10^k) = 2.
a(r*(10^k - 1)/9) = 2*(10^k - 1)/9.
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