MathLabs
TheoremProved

Digit-sum test for divisibility by 9 (and 3)

Statement

Let nn have digits so that n=∑i=0kdi 10in = \sum_{i=0}^{k} d_i\,10^i. Then 9∣n9 \mid n if and only if 99 divides the digit sum ∑idi\sum_i d_i; the same statement holds with 33 in place of 99.

Why is it true?

Every power of 1010 leaves remainder 11 when divided by 99 (since 10=9+110=9+1), so shifting a digit to a higher place value never changes its contribution modulo 99 — the whole number is congruent to the plain sum of its digits.

Proof sketch

Step 1. Show by induction that 10i≡1(mod9)10^i \equiv 1 \pmod 9 for every i≥0i\ge0. Base case i=0i=0: 100=1≡1(mod9)10^0=1\equiv1\pmod9. Inductive step: if 10i≡1(mod9)10^i\equiv1\pmod9, then 10i+1=10⋅10i≡10⋅1=10≡1(mod9)10^{i+1}=10\cdot10^i\equiv10\cdot1=10\equiv1\pmod9 (using 10≡1(mod9)10 \equiv 1 \pmod 9). So 10i≡1(mod9)10^i\equiv1\pmod9 for all ii.

Step 2. Substitute into the place-value expansion: n=∑idi10i≡∑idi⋅1=∑idi(mod9)n=\sum_i d_i 10^i \equiv \sum_i d_i\cdot1 = \sum_i d_i \pmod9. So nn and its digit sum always leave the same remainder upon division by 99.

Step 3. Conclude: 9∣n9\mid n exactly when n≡0(mod9)n\equiv0\pmod9, which by Step 2 happens exactly when ∑idi≡0(mod9)\sum_i d_i\equiv0\pmod9, i.e. exactly when 99 divides the digit sum. Since 9=3×39=3\times3 and the same congruence 10≡1(mod3)10\equiv1\pmod3 also holds, the identical argument with 33 in place of 99 throughout proves the divisibility-by-33 version.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. David M. Burton (2010). Elementary Number Theory
  2. John H. Conway, Richard K. Guy (1996). The Book of Numbers · DOI:10.1007/978-1-4612-4072-3