Congruence of Sum of Digits to Base Less 1

Theorem
Let $$x \in \mathbb{Z}$$, and $$b \in \mathbb{N}, b > 1$$.

Let $$x$$ be written in base $b$:

$$x = \left[{r_m r_{m-1} \ldots r_2 r_1 r_0}\right]_b$$.

Then $$\sum_{j=0}^m r_j \equiv x \left({\bmod\, b-1}\right)$$.

That is, the sum of the digits of any integer $$x$$ in base $b$ notation is congruent to $x$ modulo $b-1$.

Proof
Let $$x \in \mathbb{Z}, x > 0$$, and $$b \in \mathbb{N}, b > 1$$.

Then from the Basis Representation Theorem, $$x$$ can be expressed uniquely as:

$$x = \sum_{j = 0}^m r_j b^j, r_0, r_1, \ldots, r_m \in \left\{{0, 1, \ldots, b-1}\right\}$$.

Proof by induction:

For all $$n \in \mathbb{N}^*$$, let $$P \left({n}\right)$$ be the proposition $$\sum_{j = 0}^n r_j \equiv x \left({\bmod\, b-1}\right)$$.

Basis for the Induction

 * $$P(1)$$ is trivially true: $$\forall x: 0 \le x \le b: x \equiv x \left({\bmod\, b-1}\right)$$. This is our basis for the induction.

Induction Hypothesis

 * Now we need to show that, if $$P \left({k}\right)$$ is true, where $$k \ge 2$$, then it logically follows that $$P \left({k+1}\right)$$ is true.

So this is our induction hypothesis:

$$\sum_{j = 0}^k r_j \equiv \sum_{j = 0}^k r_j b^j \left({\bmod\, b-1}\right)$$.

Then we need to show:

$$\sum_{j = 0}^{k+1} r_j \equiv \sum_{j = 0}^{k+1} r_j b^j \left({\bmod\, b-1}\right)$$.

Induction Step
This is our induction step:

Let $$y$$ be expressed as $$y = \sum_{j = 0}^{k+1} {r_j b^j}, r_0, r_1, \ldots, r_{k+1} \in \left\{{0, 1, \ldots, b}\right\}$$.

Then $$y = \sum_{j = 0}^k r_j b^j + r_{k+1} b^{k+1}$$.

Now from Congruence of Powers, $$b \equiv 1 \left({\bmod\, b-1}\right) \Longrightarrow b^n \equiv 1^n \left({\bmod\, b-1}\right) \Longrightarrow b^n \equiv 1 \left({\bmod\, b-1}\right)$$.

So by Multiplication Modulo m: $$r_{k+1} b^{k+1} \equiv r_{k+1} \left({\bmod\, b-1}\right)$$.

From the induction hypothesis: $$\sum_{j = 0}^{k+1} r_j \equiv y \left({\bmod\, b-1}\right)$$

Thus by Addition Modulo m: $$\sum_{j = 0}^{k+1} r_j \equiv \sum_{j = 0}^k r_j + r_{k+1} \left({\bmod\, b-1}\right)$$.

Hence $$P \left({k}\right) \Longrightarrow P \left({k+1}\right)$$ and the result follows by the Principle of Mathematical Induction:

$$\sum_{j = 0}^n r_j \equiv \sum_{j = 0}^n r_j b^j \left({\bmod\, b-1}\right)$$.