Given a positive integer n , let S ( n ) denote the digit sum of n . Consider the sequence of numbers given by
{ n 1 = S ( n ) n k = S ( n k − 1 ) k ≥ 2
For how many positive integers n ≤ 2 0 1 3 does the sequence { n k } contain the number 9 ?
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.
You have to be careful with your reasoning. The number 0 is a multiple of 9, but the sequence does not contain the number 9. Why must the number 9 eventually appear?
How would you fix your solution to account for this?
Log in to reply
I doubt if this is right: Maybe I must also indicate that n is given to be a positive integer, so that 0 can be excluded in consideration.
I am not convinced.
The above sequence is of the sum of digits of the previous number and the question was the sequence should contain the number 9 regardless where it appears. The term 19 also contains the number 9. So why the numbers having digit sum 19 have not been included.?
Log in to reply
Because the 9 in 19, in this sense, is a digit. I thought the problem asks for the number of positive integer n < 2 0 1 3 such that the sequence contains the number 9, that is, 9 is a term in the sequence, and in this case I got the answer.
In order to get the digit sum of 9, the sum must be wither 9, 18, or 27. Since we have maximum number in the given which is a four-digit number, the maximum digit is 28 and the minimum is 1.
The answer is simple. We can find such numbers which are simply divisible by 9. Hence, there are 223 numbers from 9 to 2007 inclusive.
How would you prove it? And why the sum can be either 9, 18 or 27?
First let's consider the general decimal representation of an n -digit positive integer...
i = 0 ∑ n a i + 1 1 0 i Digit sum: i = 0 ∑ n a i + 1
Since i = 0 ∑ n a i + 1 1 0 i ≡ i = 0 ∑ n a i + 1 ( m o d 9 )
So if i = 0 ∑ n a i + 1 ≡ 0 ( m o d 9 )
Then i = 0 ∑ n a i + 1 1 0 i ≡ 0 ( m o d 9 )
Thus, for the digit sum of a positive integer to be divisible by 9 , the number itself must be divisible by 9 . And thus we can also see that according to the recurrence relation given in the question, the digit sum of all the positive integers divisible by 9 will eventually become 9 .
Hence, the answer is simply...
⌊ 9 2 0 1 3 ⌋ = 2 3 3
On observing the sequence of numbers whose sum of digits give 9. we get the following numbers- 9,18,27,36,45..........so on. As these numbers are multiples of 9. Just divide 2013 by 9 and the quotient is the answer.
2013%9=6 2013-6=2007 2007/9=223
Problem Loading...
Note Loading...
Set Loading...
The recursive formula looks frustrating, but by deeply analyzing it, the point of the formula is that the next term of the sequence can be obtained by adding the digits of the previous term . For instance, let n = 6 3 8 5 9 Then n 1 = S ( n ) = 6 + 3 + 8 + 5 + 9 = 3 1 , n 2 = S ( n 1 ) = 3 + 1 = 4 and so on.
Now, for this problem, we are asked for the number of n whose one term in n k by the recursive formula is 9, that is, there is one time that the sum of the digits of the previous term is 9. Recall the divisibility rule of 9: A number is divisible by 9 if and only if the sum of its digits is also divisible by 9. Therefore, it follows that to get a 9 in the sequence, n must be divisible by 9, and the number of integers n divisible by 9 is
⌊ 9 2 0 1 3 ⌋ = 2 2 3 .