|
EXAMPLE
|
a(1) = 3. Integers ending with 0, 1, 5 or 6 take 1 step to repeat the last digit. Integers ending with 4 or 9 require 2 steps and 2, 3, 7 or 8 require 3 steps to repeat their last digit. Thus, the distinct numbers of steps for n = 1 are {1, 2, 3} and a(1) = 3.
a(2) = 6 because the distinct steps are: {1, 2, 3, 4, 5, 6}.
a(3) = 9: {1, 2, 3, 4, 5, 6, 20, 21, 22}.
a(4) = 12: {1, 2, 3, 4, 5, 6, 20, 21, 22, 100, 101, 102}.
a(5) = 19: {1, 2, 3, 4, 5, 6, 7, 20, 21, 22, 23, 100, 101, 102, 103, 500, 501, 502, 503}.
a(6) = 28: [1, 2, 3, 4, 5, 6, 7, 8, 20, 21, 22, 23, 24, 100, 101, 102, 103, 104, 500, 501, 502, 503, 504, 2500, 2501, 2502, 2503, 2504}.
The paths of the last 1, 2, and 3 digits of integers resulted from iterating the map, m -> m*m, are shown in the Links.
|