\begin{definition}[Definition:Digit Sum]
Let $n \in \Z: n \ge 0$.
The '''digit sum of $n$ to base $b$''' is the sum of all the digits of $n$ when expressed in base $b$.
That is, if:
:$\ds n = \sum_{k \mathop \ge 0} r_k b^k$
where $0 \le r_k < b$, then:
:$\ds \map {s_b} n = \sum_{k \mathop \ge 0} r_k$
\end{definition}