[Math] Repeatedly summing the digits of a number

elementary-number-theory

Take an arbitrary number – for the sake of an example, I'll use 392. If we add the digits, we get 3 + 9 + 2 = 14, and then add those digits to get 5 (keep adding the digits of each result until it reduces to a single-digit number).

Compare that to this method: let q and r be the quotient and remainder of the number with respect to 10. Take q+r, and repeat with that new result until it reduces to a single digit number. So, for 392, we do 39+2 = 41, and 4+1 = 5.

In this case, the two methods end up with the same result. I haven't been able to find any counter examples. Is this guaranteed to happen?

Best Answer

For both operations (add all digits or replace $10q+r$ with $q+r$), the result of the operation has the same remainder when dividing by $9$ as the original number (for the digit sum this is a well-known arithmetic "trick", for the othr operation note that $(10q+r)-(q+r)=9q$). Therefore, by starting with $n$ and repeating either of the operations until the result is single-digit (which is guaranteed to happen), we obtain a result $m$ with $m\equiv n\pmod{10}$ and $0\le m\le 9$. Note that neither of the two operations produces $0$ unless its input is $0$. Therefore, if $n>0$, we will in fact have $1\le m\le 9$, which then together with the modulo 9 condition determines $m$ uniquely.

Related Question