Quotient and Remainder to Number Base/General Result

Theorem
Let $n \in \Z: n > 0$ be an integer.

Let $n$ be expressed in base $b$:
 * $\ds n = \sum_{j \mathop = 0}^m {r_j b^j}$

that is:
 * $n = \sqbrk {r_m r_{m - 1} \ldots r_2 r_1 r_0}_b$

Let $0 \le s \le m$.

Then:
 * $\floor {\dfrac n {b^s} } = \sqbrk {r_m r_{m - 1} \ldots r_{s + 1} r_s}_b$
 * $\ds n \mod {b^s} = \sum_{j \mathop = 0}^{s - 1} {r_j b^j} = \sqbrk {r_{s - 1} r_{s - 2} \ldots r_1 r_0}_b$

where:
 * $\floor {\, \cdot \,}$ denotes the floor function
 * $n \mod b$ denotes the modulo operation.