Elementary Number Theory – How to Prove All Rational Numbers Are Either Terminating or Repeating Decimals

decimal-expansionelementary-number-theoryfaqrational numbers

I am trying to figure out how to prove that all rational numbers are either terminating decimal or repeating decimal numerals, but I am having a great difficulty in doing so. Any help will be greatly appreciated.

Best Answer

Hint$\ $ Consider what it means for a real $\rm\ 0 < \alpha < 1\ $ to have a periodic decimal expansion:

$$\begin{array}{rrl} &\alpha\!\!\! &\rm =\,\ 0\:.\overbrace{a_1a_2\cdots a_n^{\phantom{l}}}^{\textstyle a}\ \overbrace{\overline{c_1c_2\cdots c_k}}^{\textstyle \overline c}\ \ \text{ in radix } 10\\[.2em] \iff& \beta \!\!&\!:= \rm 10^n\, \alpha\! -\! a = 0\:.\overline{c_1c_2\cdots c_k}\\[.2em] \iff& 10^k\: \beta \!\!&=\ \rm c + \beta\\[.2em] \iff& (10^k-1)\ \beta \!\!&=\ \rm c\\[.2em] \iff&\!\!\!\! \rm (10^k-1)\ 10^n\: \alpha \!\!&\in\ \Bbb Z \end{array}\qquad$$

Thus to show that a rational $\rm\,\alpha\,$ has such a periodic expansion, it suffices to find $\rm\,k,n\,$ as above, i.e. so that $\rm\,(10^k-1)\,10^n\,$ serves as a denominator for $\rm\,\alpha.\,$ Put $\rm\,\alpha\, = a/b,\,$ and $\rm\, b = 2^i\,5^j\,d,\,$ where $\rm\,2,5\,\nmid d\,.\,$ Choosing $\rm\,n\, >\, i,\,j\,$ ensures that $\rm\,10^n\,\alpha\,$ has no factors of $\rm\,2\,$ or $\rm\,5\,$ in its denominator. Hence it remains to find some $\rm\,k\,$ such that $\rm\,10^k-1\,$ will cancel the remaining factor of $\rm\,d\,$ in the denominator, i.e. such that $\rm\,d\,|\,10^k-1\,,\,$ or $\rm\,10^k\equiv 1\pmod{d}\,.\,$ Since $\rm\,10\,$ is coprime to $\rm\,d,\,$ by the Euler-Fermat theorem we may choose $\rm\,k = \phi(d),\,$ which completes the proof sketch. For the converse, see this answer.