I am trying to show using the pigeonhole principle that the decimal expansion of a rational must become repeating. I started out by trying to construct the decimal expansion of $\frac{a}{b}$ where $a,b \in \mathbb{Z}$ and $b \neq 0.$ I then was suggested this algorithm to construct this expansion: \
Let $e_0 = a$, and for all $k \geq 1,$ Let $$10 \times e_{k-1} = ba_k + r_k$$, where $0 \leq r_k < b$ (thus is a remainder from the division of $b$) and $a_k$ is the $k$th digit of the decimal expansion of $\frac{a}{b}$ I can kind of see how this recursive construction relates to how long division works, but It is not clear to me how to apply Pigeonhole Principle from then. I may want to use some form of modulus in this problem, But for whether it deals with the equivalence classes surrounding $a_k$ or $r_k$, I am not completely sure. My friend also suggested that there may be a ring-theoretic way of going about this problem that is simpler and easier to construct. Any suggestions would be greatly appreciated.
The pigeonhole principle tells you that eventually you will have two $r_k$s that are the same. This will happen after $b-1$ divisions at the latest, because you can't have one of the $r$'s be zero or the decimal would terminate. Now argue that the set of decimals between these two matching ones will repeat because you are doing all the same divisions.