Divisibility by 9

Theorem
A number $$n=a_0+a_110+a_210^2+\ldots+a_n10^n$$ is divisible by 9 if and only if the sum $$a_0+a_1+\ldots+a_n$$ of its digits is divisible by 9.

Or, commonly stated, a number is divisible by 9 if and only if the sum of its digits is divisible by 9.

Direct Proof
If $$n$$ is divisible by 9, then

$$ $$ $$ $$

Alternative Proof
It can be seen that this is a special case of Congruence of Sum of Digits to Base Less 1.

Remark
This same argument holds for divisibility by 3. The proof is exactly the same as the proof above, replacing all instances of 9 by 3.