2.5.3 · D3Number Theory (Intermediate)

Worked examples — Rational numbers — definition, decimal expansion (terminating - repeating)

2,285 words10 min readBack to topic

The scenario matrix

Before solving anything, let us lay out the full battlefield. Every rational-decimal problem you meet is one of these case classes:

# Case class What makes it special Covered by
A Terminating, denom division just stops Ex. 1
B Pure repeating, one prime remainder loops, decimal point right before the loop Ex. 2
C Mixed repeating (both a part and another prime) some digits settle, then a loop starts Ex. 3
D Negative numerator / sign handling where does the minus go? Ex. 4
E Denominator (integer / degenerate) "decimal" that is just a whole number Ex. 5
F Zero numerator (degenerate) for any Ex. 5
G Repeating decimal fraction (reverse direction) the "multiply and subtract" trick Ex. 6
H Limiting value: the famous edge case where a repeat equals a terminator Ex. 7
I Word problem (real-world units) translate, then classify Ex. 8
J Exam-style twist: "for which does terminate?" reasoning about the whole family at once Ex. 9

Two tools do all the work, so let us name them up front.

Figure — Rational numbers — definition, decimal expansion (terminating - repeating)

Look at the figure: the horizontal bar is the number line of possible remainders to . Long division walks along it, and because there are only finitely many slots, the walk must eventually step onto a slot it already stamped — that is the moment repetition is born (unless it lands on first, which is termination).


Case A — Terminating


Case B — Pure repeating


Case C — Mixed repeating


Case D — Negatives


Cases E & F — Degenerate inputs


Case G — Decimal back to fraction


Case H — The limiting edge case


Case I — Word problem


Case J — Exam-style twist (the whole family)


Recall Quick self-check

Does terminate? ::: Reduce first: . Yes — . Why must a long division of eventually repeat or stop? ::: Only possible remainders ( to ); by pigeonhole one must recur (or hit ). What number does equal? ::: Exactly . Does the length of the repetend of have to be ? ::: No — it divides ; it can be much shorter.