Maths WorkshopMaths problems with full solutions
Exercise 71Number theory › IrrationalityHigh schoolAdded 3 Nov 2026

Decimal expansions and rationality

#decimal expansion#rational#periodic

Statement

Show that a real number is rational iff its decimal expansion is eventually periodic.

Hint

Forward: long division produces periodic remainders. Converse: compute 0.a1⋯ak‾0.\overline{a_1\cdots a_k} as a geometric series.

Show solutionHide solution

Solution

Forward. For x=p/qx=p/q, long division: remainders mod qq are among 0,…,q−10,\ldots,q-1, so by pigeonhole some remainder repeats within qq steps. From that point the decimal is periodic. (If the remainder 00 is hit, the decimal is finite, considered periodic with period 00.)

Converse. Up to adding an integer to xx, we can assume x=0.a1⋯ak‾x=0.\overline{a_1\cdots a_k}. Multiplying xx by 10k10^k and subtracting xx gives x(10k−1)=a1⋯ak‾∈Nx(10^k-1)=\overline{a_1\cdots a_k} \in \mathbb{N}, so x=a1⋯ak‾10k−1∈Qx=\frac{\overline{a_1\cdots a_k}}{10^k-1}\in\mathbb{Q}.

Conclusion. Rationals are exactly the eventually periodic decimals.