Divisibility by 9 via Digit Sum

#hsc-maths#extension-2#proofs#number-theory#medium

The classic divisibility test for 9 is one of the most elegant results in elementary number theory — and it makes a perfect playground for practising biconditional proofs in the HSC Extension 2 course. By working through this proof, you’ll see how a simple algebraic rearrangement can uncover a deep modular relationship between a number and its digit sum, and how that one relationship makes both directions of the “if and only if” argument almost trivial.

Problem Statement

Prove that a three-digit number is divisible by 99 if and only if the sum of its digits is divisible by 99.


Hints

  • Let N=100a+10b+cN = 100a + 10b + c where a,b,ca, b, c are the digits.
  • Rewrite this as N=9(11a+b)+(a+b+c)N = 9(11a + b) + (a + b + c) to establish the relationship between NN and the digit sum.
  • Then prove both directions of the biconditional using this relationship.

Solutions

We begin by giving the three-digit number a name and expressing it in terms of its digits. Let’s write

  • Let N=100a+10b+cN = 100a + 10b + c be a three-digit number with digits a,b,ca, b, c.
  • Let S=a+b+cS = a + b + c be the sum of digits.

The heart of the proof is to connect NN and SS in a way that reveals a multiple of 99. By splitting the 100a100a and 10b10b terms into 99a+a99a + a and 9b+b9b + b, we can factor out 99 from most of the expression, leaving the digit sum behind:

  • Key Relationship: Rewrite NN:

    N=100a+10b+c=(99a+a)+(9b+b)+c=9(11a+b)+(a+b+c)=9(11a+b)+S\begin{aligned} N &= 100a + 10b + c \\ &= (99a + a) + (9b + b) + c \\ &= 9(11a + b) + (a + b + c) \\ &= 9(11a + b) + S \end{aligned}

This rearrangement tells us that NN and SS differ by a multiple of 99 — specifically, 9(11a+b)9(11a+b). In the language of modular arithmetic, that means

  • Therefore: NS=9(11a+b)N - S = 9(11a + b), which means NS(mod9)N \equiv S \pmod{9}.

Now we have a single, clean congruence that instantly handles both directions of the biconditional.

For the forward direction (\Rightarrow), assume 99 divides NN — that is, N0(mod9)N \equiv 0 \pmod{9}. Because NN and SS are congruent modulo 99, SS must also be congruent to 00, so 99 divides SS:

  • Direction 1 (\Rightarrow): If 9N9|N, then 9S9|S. If N0(mod9)N \equiv 0 \pmod{9}, then from NS(mod9)N \equiv S \pmod{9}, we get S0(mod9)S \equiv 0 \pmod{9}. Thus 9S9|S.

The reverse direction (\Leftarrow) is just the mirror image. If we start with 99 dividing SS (S0(mod9)S \equiv 0 \pmod{9}), then the congruence NS(mod9)N \equiv S \pmod{9} forces N0(mod9)N \equiv 0 \pmod{9}, so 99 must also divide NN:

  • Direction 2 (\Leftarrow): If 9S9|S, then 9N9|N. If S0(mod9)S \equiv 0 \pmod{9}, then from NS(mod9)N \equiv S \pmod{9}, we get N0(mod9)N \equiv 0 \pmod{9}. Thus 9N9|N.

With both implications established, the biconditional is proved.

  • Both directions proven, so the biconditional holds.
  • Note: This proof generalizes to all positive integers and divisibility by 9. The key is the modular relationship NS(mod9)N \equiv S \pmod{9}.

Takeaways

  • The algebraic manipulation 100a+10b+c=9(11a+b)+(a+b+c)100a+10b+c = 9(11a+b) + (a+b+c) is the core trick — it shows that any number differs from its digit sum by a multiple of 99, so divisibility by 99 depends purely on the digit sum.
  • Once you have the congruence NS(mod9)N \equiv S \pmod{9}, both directions of the “if and only if” become one-step deductions from the definition of modular equivalence.
  • The same technique works for any number of digits, because every power of 1010 is congruent to 11 modulo 99 — a fact that underpins the general divisibility rule for 99.

Further Readings

If you found this proof interesting, be sure to check out these relevant HSC booklets to sharpen your reasoning skills:

Written by Vu Hung Nguyen

Mathematics Educator · LinkedIn · About