0
$\begingroup$

Suppose N is any positive integer. Add the digits of N to obtain a smaller integer. Repeat this process of digit-addition till you get a single digit number n. Find the number of positive integers N ≤ 1000, such that the final single-digit number n is equal to 5.

$\endgroup$
2
$\begingroup$

Let $s(n)$ be the sum of digits function. Then $n\equiv s(n)\pmod{9}$, and by induction $$ n\equiv s(\cdots(s(n))\cdots)\pmod{9}. $$ Since the last obtained number is $5$ then it equivalent to find the number of positive integers which have remainder $5$ modulo $9$, i.e., $\lfloor 1000/9\rfloor=111$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ why "positive integers which have remainder 5 modulo 9 will be [1000/9]"? please explain. $\endgroup$ – mnulb Feb 1 '17 at 17:19
  • $\begingroup$ You just pick one integer every nine consecutive ones... $\endgroup$ – Paolo Leonetti Feb 1 '17 at 17:20
  • $\begingroup$ first will be 5 then 14 then 23.... last will be 999? $\endgroup$ – mnulb Feb 1 '17 at 17:21
  • $\begingroup$ $999$ has not remainder $5$ when it is divided by $9$; the last one is $995$.. $\endgroup$ – Paolo Leonetti Feb 1 '17 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.