Problem 46571. Characterize the final state of the digit inventory sequence
Cody Problem 46122 involved a counting sequence that I called the digit inventory sequence, in which each term provides an inventory of the digits of the previous term. If the initial number of the sequence is 24, then the sequence is
For example, the third term provides an inventory of the second: two 1's, one 2, one 4. Notice that starting with 24 leads to a steady state after 7 terms because all subsequent terms are equal to the seventh (i.e., 31123314).
However, the final state is not necessarily a steady state. If the starting number is 210, then the sequence is
The tenth and eleventh terms repeat indefinitely. In other words, the repeated terms start at term 10, and they have a period of 2.
Write a function to determine the number of the term at which the final state begins and the period of the repeated terms.
Solution CommentsShow comments
Problem Recent Solvers11