In the textbook "Elementary Number Theory" by Kenneth H. Rosen,
Theorem 12.3. (page 472) The real number $\alpha$, $0 \leq \alpha \lt 1$, has a terminating base $b$ expansion if and only if $\alpha$ is rational and can be written as $\alpha = \dfrac{a}{s}$, where $0 \leq r < s$, and every prime factor of $s$ also divides $b$.
Proof
First suppose that $\alpha$ has a terminating base $b$ expansion, $\alpha = (.c_1c_2 \ldots c_n)_b$ Then $\alpha = \dfrac{c_1}{b} + \dfrac{c_2}{b^2} + \ldots + \dfrac{c_n}{b^n} = \dfrac{c_1b^{n-1} + c_2b^{n-2} + \ldots + c_n}{b^n}$ so that $\alpha$ is rational, can be written with a denominator divisible only by primes dividing b.
Conversly, suppose that $0 \leq \alpha < 1$, and $\alpha = \dfrac{r}{s}$ where each prime dividing $s$ also divides $b$. Hence, there is a power of $b$, say, $b^{N}$, that is divisible by $s$. Then $b^N\alpha = b^N\dfrac{r}{s} = ar,$ where $sa = b^N$, and $a$ is a positive integer because $s|b^N$. Now let $(a_ma_{m-1}\ldots a_1a_0)_b$ be the base $b$ expansion of $ar$. Then $\alpha = \dfrac{ar}{b^N} = \dfrac{a_mb^m + a_{m-1}b^{m-1} + \ldots + a_1b + a_0}{b^N}$ $= a_mb^{m-N} + a_{m-1}b^{m-1-N} + \ldots + a_1b^{1-N} + a_0b^{-N}$ $= (.00\ldots a_ma_{m-1} \ldots a_1a_0)_b$ Hence $\alpha$ has a terminating base $b$ expansion. $\square$
For the only if proof I got it straight, but for the if I don't understand how the author goes from: $= a_mb^{m-N} + a_{m-1}b^{m-1-N} + \ldots + a_1b^{1-N} + a_0b^{-N}$ to $= (.00\ldots a_ma_{m-1} \ldots a_1a_0)_b$
Where did $.00$ come from? Besides, "....Now let $(a_ma_{m-1}\ldots a_1a_0)_b$ be the base $b$ expansion of $ar$" From here, did the author assume that the expansion of $ar$ is terminating? I was confused here because the way it was written. If it's not terminating, or periodic, should I write it as $(a_0a_1 \ldots)_b$?
Thank you,