It's common that, given a positive integer , to find the sum of its digits. For example, 2016 has digit sum 9, and 9686 has digit sum 29. This process can be iterated until we get a digit sum that has only a single digit. For example, 2016 arrives to the single-digit 9 in a single step, but 9686 takes three steps, going to 29, 11, before arriving at 2.
Let be the number of digit-sum iterations needed from to arrive to a single-digit result. For example, and .
Let be the smallest positive integer such that . For example, and .
Find .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We have X(2) = 19 because all number less than 19 has Z = 1 Let's A = X(3). We could easily see that S(A) = X(2) = 19, because if S(A) >19, we can reduce some of digit of A and make A' so that S(A') = 19, and A'<A, and Z(A') = 3 so A, by definition, could not be X(3).
In general, we can see that S(X(n+1)) = X(n).
Lets call X(n+1) = a 1 a 2 . . . a k . In order to get the smallest, we will need a 2 = a 3 = . . = a k = 9 and a 1 = S ( X ( n + 1 ) ) − 9 ∗ k = X ( n ) − 9 ∗ k
But we have X(2) = 19 = 9*2+1, so for X(3) we have a 1 = 1 and k = 3 , that means X ( 3 ) = 1 9 9 = 9 9 ∗ 2 + 1 = 9 ∗ 2 2 + 1
Using recursion, we can see X(n) will always have a form 1 9 . . 9 with N > 1, so X(4562) mod 6 = 1