72
$\begingroup$

I don't know if this is a well-known fact, but I have observed that every number, no matter how large, that is equally divided by $9$, will equal $9$ if you add all the numbers it is made from until there is $1$ digit.

A quick example of what I mean:

$9\times 99 = 891$

$8+9+1 = 18$

$1+8 = 9$

This works even with really long numbers like $4376331$

Why is that? What makes $9$ special in this divisibility tests? This doesn't work with any other number. Similarly for $11$ and alternating digits sums.

$\endgroup$
11
  • 8
    $\begingroup$ Here's something else to try: write a number $n$ such that the digits, read left to right, are increasing (e.g. 12345 or 13579). What is the sum of the digits of $9 \times n$? $\endgroup$ Commented Dec 31, 2010 at 20:32
  • 77
    $\begingroup$ I guess the gist is "10 makes 9 special" :-) $\endgroup$ Commented Jan 1, 2011 at 0:24
  • 1
    $\begingroup$ @Moron: Pretty much. $\endgroup$ Commented Jan 1, 2011 at 1:48
  • 2
    $\begingroup$ I'm assuming what @Moron is referring to is Base-10, or the "Decimal Number System". $\endgroup$ Commented Jan 1, 2011 at 3:05
  • 27
    $\begingroup$ 9 is dead. Because 7 8 9!! Ah ah ah ah. $\endgroup$ Commented Feb 9, 2011 at 23:07

8 Answers 8

124
$\begingroup$

Not quite right, since $9\times 0 = 0$ and the digits don't add up to $9$; but otherwise correct.

The reason it works is that we write numbers in base $10$, and when you divide $10$ by $9$, the remainder is $1$. Take a number, say, $184631$ (I just made it up). Remember what that really means: $$184631 = 1 + 3\times 10 + 6\times 10^2 + 4\times 10^3 + 8\times 10^4 + 1\times 10^5.$$ The remainder when you divide any power of $10$ by $9$ is again just $1$, so adding the digits gives you a number that has the same remainder when dividing by $9$ as the original number does. Keep doing it until you get down to a single digit and you get the remainder of the original number when you divide by $9$, except that you get $9$ instead of $0$ if the number is a nonzero multiple of $9$.

But since every multiple of $9$ is a multiple of $9$, you will always get $9$.

Note that you have a similar phenomenon with $3$ (a divisor of $9$), since adding the digits of a multiple of $3$ will always result in one of the one-digit multiples of $3$: $3$, $6$, or $9$.

If we wrote in base $8$, instead of base $10$, then $7$ would have the property: if you write a number in base $8$ and add the digits (in base 8) until you get down to a single digit between $1$ and $7$, then the multiples of $7$ will always end yielding $7$, for precisely the same reason. And if we wrote in base $16$, then $15$ (or rather, F) would have the property. In general, if you write in base $b$, then $b-1$ has the property.

This is a special case of casting out nines, which in turn is a special case of modular arithmetic. It is what is behind many divisibility tests (e.g., for $2$, $3$, $5$, $9$, and $11$).

Coda. This reminds me of an anecdote a professor of mine used to relate: a student once came to him telling him he had discovered a very easy way to test divisibility of any number $N$ by any number $b$: write $N$ in base $b$, and see if the last digit is $0$. I guess, equivalently, you could write $N$ in base $b+1$, and add the digits to see if you get $b$ at the end.

$\endgroup$
2
  • 5
    $\begingroup$ Yes. and another test is to write the number in base $b-1$ and check if the alternating sum adds up to zero. (mimicking the divisibility test for 11 in decimal system) $\endgroup$ Commented Dec 31, 2010 at 20:10
  • 1
    $\begingroup$ another badge to your name great answer :) $\endgroup$ Commented Feb 17, 2015 at 14:57
26
$\begingroup$

It's a special case of casting out nines, which is obvious when viewed via modular arithmetic:

$\rm\ \bmod 9\!:\, \ \color{#c00}{10\equiv 1}\ \Rightarrow\ P(\color{#c00}{10})\equiv P(\color{#c00}1)\ \, $ for all $\rm\color{#0a0}{polynomials}$ $\rm\,P(x)\,$ with integer coefficients

by $\rm\color{#0a0}{Polynomial}$ Congruence Rule. But radix notation has $\rm\color{#0a0}{polynomial}$ form $\rm\:\!N = P(10),\,$ so

$\rm\ \bmod 9\!:\,\ \ \rm N\:\! =\:\! P(\color{#c00}{10})\:\!\equiv\:\! P(\color{#c00}1) = $ sum $\rm\:\!S_N\:\!$ of the decimal digits of $\rm\:\!N,\,$ e.g.

$\!\begin{align} \rm\ \bmod 9\!:\ 567 = &\rm \ P(\color{#c00}{10})=5\cdot \color{#c00}{10}^2+6\cdot \color{#c00}{10}+7\\[.2em] \equiv &\ \rm P(\color{#c00}{1})\, \ =\:\! 5\ \cdot\ \color{#c00}1^2 + \:\! 6\ \cdot\ \color{#c00}1\:\!+7\:\!\equiv\:\! \color{#0af}{18} = digit\ sum\:\!\ S_{\:\!567} \end{align}$

Repeating: $\:\!\color{#0af}{18}\equiv 1\!+\!8\equiv\color{darkorange}9,\,$ so $\,567\equiv\color{#0af}{18}\equiv \color{darkorange}9\equiv 0,\,$ so $\,9\mid 567,\,$ i.e. $\:\!9\:\!$ divides $\:\!567$.

OP is special case $\rm\:\! N\equiv 0\pmod{\! 9}\:\! $ so by above it remains $\equiv 0\ $ if we map $\:\!\rm N\:\!$ to its digit sum $\rm\:\!S_N.\:\!$ This map is strictly decreasing for all $\rm\:N > 9,\, $ thus iterating it eventually reaches some $\rm\: N' \le 9.\ $ But $\rm\ N'\equiv 0\pmod{\!9}\, $ so $\rm\: N' = 9\,$ $\rm (N'\!\neq0\,$ by $\rm\,N>0\,$ has a digit $\neq 0\,$ so its digit sum $\rm\,S_N>0)$.

[If modular arithmetic is unfamiliar we could instead use divisibility rules or proceed as follows:

$\ \ $ Factor Theorem $\rm\,\Rightarrow\, X\!-\!1\mid P(X)\!-\!P(1)\ $ at $\rm\ X \!=\! 10\ \Rightarrow\ 9\mid P(10)\!-\!P(1)\ $ i.e. $\rm\; 9\mid N\! -\! S_N$]

The analogous result holds true for any radix $\rm\:b,\,$ i.e. we can cast $\rm\:b\!-\!1$'s in the same way, by

$\rm\quad \bmod\, \color{}{b\!-\!1\!}:\,\ \color{#c00}{b\equiv 1}\,\Rightarrow\, N=P(\color{#c00}b) \equiv P(\color{#c00}1)= \text{sum of radix $\rm\,b\,$ digits of }\, N$

Hence $\,\rm \bbox[5px,border:1px solid #c00]{\text{the divisor $\,9\,$ is 'special' in radix $\,10\,$ because }\, \color{#c00}{10\,\equiv\, 1}\,\pmod{\! 9}}$

Similar: $ $ we cast out $11$'s by $\!\rm\bmod 11\!:\ \color{#c00}{10\equiv -1}\,\Rightarrow\, P(\color{#c00}{10})\equiv P(\color{#c00}{-1})\equiv p_0 \!\color{#0af}{-\!p_1}\! +\! p_2\! \color{#0af}{-\!p_3}\! +\cdots $

Hence $\,\rm \bbox[5px,border:1px solid #c00]{\text{the divisor $11$ is 'special' in radix $\,10\,$ because } \color{#c00}{10\equiv -1}\pmod{\!\! 11}}$

Similarly we may cast out $\,1001 = 7\cdot 11\cdot 13\,$ by taking the $\rm\color{#0af}{alternating}$ digit sum in radix $10^3,\,$ yielding a combined divisibility test for $\,7,11,13\,$ (which can be viewed as a special case of the method of simpler multiples). We get countless divisibility tests via such modular reduction, e.g. see here for casting out $\,91$'s.

Remark $ $ It deserves to be better known that we may also cast out $9$s to check rational arithmetic - as long as the fractions have denominator coprime to $3$, e.g. see Hilton; Pedersen, $1981,\,$ Casting out nines revisited (these results are very old). Analogous remarks hold true for any ring that has $\ \mathbb Z/9\ $ as an image - just as one can apply parity arguments in any ring that has $\ \mathbb Z/2\ $ as an image, e.g. the ring of rationals with odd denominator where we have $\,\frac{a}{1+2b}\equiv a\pmod{\!2},\,$ or the ring of Gaussian integers $\,\mathbb Z[i],\,$ where the image $\, \mathbb Z[i]/(2,i\!-\!1) \cong \mathbb Z/2\ $ yields the parity definition: $\, a+b\:i\ $ is even $\!\iff\! a\equiv b\pmod{\! 2},\,$ i.e. if $\, a+b\:i\ $ maps to $\:0\:$ via the above isomorphism, which maps $\, 2\to 0,\ i\to 1\:$. See here for further discussion of parity in rings of algebraic integers, including examples of number rings with no parity structure, and with more than one parity structure. See also this post for "casting out orders" in cyclic groups, and see this thread for an in-depth comparison of various elementary inductive proofs of casting nines.

These are elementary prototypical examples of problem-solving by way of modular reduction - one of the keystones of abstract algebra. As such one should be sure to understand these simple instances before moving on to more advanced manifestations of modular reduction.

Beware $ $ Such casting-out rules are often advocated for use in checking arithmetic. But keep in mind that such checks won't reveal all arithmetical errors, i.e. there can be many "false positives", since the check only verifies that expressions agree modulo some small number, e.g. integers agreeing mod $10$ means only that they have the same final digits. To remedy this we can perform checks modulo sufficiently many coprime moduli (see CRT = Chinese Remainder Theorem). This is one example of various "lifting" techniques employed in modular computation methods - which you can read about in most textbooks on computer algebra, e.g. Knuth, TAOCP, vol. 2, Seminumerical Algorithms, or von zur Gathen: Modern Computer Algebra.

$\endgroup$
1
  • $\begingroup$ I was going to mention 'casting out nines' if no one else did, so I up-voted this answer. $\endgroup$ Commented Jun 25, 2011 at 21:38
20
$\begingroup$

Many ways to say this I suppose - what made sense to me when I first was confronted with this fact is that the number "$abcd$" is $1000a+100b+10c+d=(999a+99b+9c)+a+b+c+d$. The first term is clearly divisible by $9$ so if the digit sum is then "$abcd$" is as well...

$\endgroup$
7
$\begingroup$

This follows from the divisibility test for $9$ and from the fact that the sum of the digits of a natural number with more than one digit is strictly less than the number itself i.e. if $n$ is a natural number with more than one digit and if $s(n)$ denotes the sum of the digits of the natural number then $s(n)<n$. Your observation can be strengthened to note that if we keep repeatedly adding the digits, the final number we are left with is the remainder when divided by $9$.

$\endgroup$
5
$\begingroup$

This property is based on the fact that $9$ is one minus $10$ which is the base of the number system you are working with because of this any power of $10$ will equal $1$ modulo $9$.

$\endgroup$
2
  • 1
    $\begingroup$ "9 is one minus 10" is certainly not correct. $\endgroup$ Commented Sep 6 at 19:37
  • $\begingroup$ Maybe instead: nine is one less than ten, the base of the number system … $\endgroup$ Commented Sep 7 at 1:46
3
$\begingroup$

$9$ is also special for accounts in finding book keeper errors of transposed digits.

$124+256+345=725$

$124+265+345=734$

$734-725=9$

$\endgroup$
1
  • $\begingroup$ Seems only for single digit errors. Request explanation why works for such errors alone. $\endgroup$ Commented Nov 19, 2021 at 9:10
3
$\begingroup$

The "specialness'' of $9$ stems from the fact that $10 \equiv 1 \pmod{9}$.

So, in our base-10 numeral system in which an integer can be expressed as

$$ d_{k}d_{k-1} \ldots d_{1}d_{0} = d_{k}10^{k} + d_{k-1}10^{k-1} + \ldots + d_{1}10 + d_{0}$$

$$ \equiv d_{k}(1) + d_{k-1}(1) + \ldots + d_{1}(1) + d_{0} \pmod{9},$$

all we need to do is to evaluate the sum $d_{k} + d_{k-1} + \ldots + d_{1} + d_{0}$ and check to see if it is divisible by $9$ in order to determine if the given integer is divisible by $9$.

Finally, note that a similar test with analogous justification also exists for determining if a given integer is divisible by $3$, as $10 \equiv 1 \pmod{3}$.

$\endgroup$
0
$\begingroup$

A formal proof is all very nice, but sometimes I feel for a novice seeing this the first time that a simple intuitive explanation would be more satisfying.

Adding $9$ is the same thing as adding $10$ and then subtracting $1$. In general add $10$ increases the tens digit by one, and subtracting $1$ decreases the ones digit by $1$. So in general adding $9$ will leave the sum of the digits exactly the same (the tens has be increased while the ones has been decreased). So if this fact is true for one multiple of $9$ it will (in general) be true for the next multiple of $9$ which is nine more.

We can visualize this. If $abcdefg$ is a multiple of $9$ with the property that $a+b+c+d+e+f+g$ ultimately reduces down to $9$ then, the next multiple $9$ is $abcdefg + 9 = abcdefg + (10 -1) = abcde(f+1)(g-1)$ and the sum of the digits being $a+b+c+d+e+(f+1) + (g-1)$ which is the same sum so ultimately reduces down to $9$.

There are two exceptions though. If the last digit is $0$. $abcdef0 + 9 = abcdef9$. But this is okay. $a+b+c+d+e+f+0=a+b+c+d+e+f=K$ is a multiple of nine that reduces down so $a+b+k+c+d+e+f+9 = K + 9$ and that is a multiple of nine and reduces down.

(This is a bootstrapping induction argument. We are assume it is true for all multiples of $9$ that we've tested. Then we show it is true for the next multiple of $9$. If we have this exception thats okay because it bootstraps down to an argument for $K+9$ which is a smaller multiple of $9$. As it is a smaller multiple of nine, we have presumably already tested it.)

The other exception if is if the tens digit is a $9$. $abcde9a$ then $abcde9g + 9 = abcde9g +(10-1) = abcd(e+1)0(g-1)$. Here the ones digit decreasing is countered by the hundreds digit increasing. And the tens digits goes from $9$ to $0$. That makes the sum of digits decrease by $9$. So it is still a smaller multiple of $9$ and reduces down to $9$.

(The same holds for many digits being $9$. If $ab9999g$ is a multiple of $9$ with $a+b+9+9+9+9+g=K$ reducing down to $9$ then $ab9999g + 9 = a(b+1)0000(g-1)$ and the sum of the digits is $a + (b+1) + 0 + 0 + 0 + 0 +(g-1) = K -9-9-9-9$ and that's a smaller multiple of $9$ that reduces down to $9$.)

That's the argument I came up when I first encountered this. I had a bit of trouble with the hand waving exceptions bootstraping down but I did see that it only resulted is cases that were smaller than the one I was considering and that if I lined up the exceptions that were smallest there had to be a bottom first exception.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.