Every fraction is either a terminating decimal or a repeating decimal, and its denominator alone decides which. This lesson proves the complete rule from unique prime factorization: when the decimal ends, how many digits come before the repeating block, how long the block is, and why a decimal that neither ends nor repeats cannot be a fraction.
Two kinds of decimal, and no third
The previous lessons proved two facts about the long division of a whole number a by a counting number b. By Theorem 1 of the lesson Repeating decimals, it either ends or repeats a block of digits forever. By Theorem 2 of the lesson Terminating decimals, it ends exactly when the denominator in lowest terms has no prime factor other than 2 and 5. Together:
Let ab be a fraction in lowest terms. If b is 1 or a product of 2s and 5s, its decimal terminates. Otherwise its decimal is a repeating decimal, whose digits never end. There is no third possibility.
By Theorem 2 of Terminating decimals, ab is a terminating decimal exactly when b is 1 or a product of 2s and 5s, and by Theorem 1 of that lesson its long division ends exactly then. Otherwise the division never ends, and by Theorem 1 of Repeating decimals it repeats one block of digits forever from some place on.
This is the standard statement: the decimal form of a fraction terminates in 0s or eventually repeats,[1] and every fraction can be written as a decimal that either stops or repeats.[2] The rest of the lesson describes the repeating case exactly: where the block starts and how long it is. Both are read from the prime factorization of the denominator, which is unique apart from the order of the factors.[3]
Which of 1364, 914, 2255 and 433 terminate?
- 1364: 64 is six 2s and 13 is odd, so it is in lowest terms: it terminates (six places, by the lesson Terminating decimals).
- 914: 14 = 2 × 7 and 9 = 3 × 3 share no prime: the 7 stays, so it repeats.
- 2255 = 25 (common factor 11): it terminates, 0.4.
- 433: 33 = 3 × 11 and 4 = 2 × 2 share no prime: it repeats.
Answer: 1364 and 2255 terminate; 914 and 433 repeat. Check: 1364 = 203,1251,000,000 = 0.203125, since 64 × 15,625 = 1,000,000.
Remainders and divisibility
To see where a repeating block starts, follow the remainders. Write r₀ for the remainder after the ones digit and r₁, r₂, … for the remainders after 1, 2, … places, as in the lesson Repeating decimals. Below, E stands for a 1 followed by zeros and N for a number written with nines only, such as 9, 99, 999.
rₖ is the remainder of a × (1 followed by k zeros) divided by b.
After k places the digits divided are those of a followed by k zeros, and the long division gives a × E = Q × b + rₖ with rₖ less than b, as in the proof of Theorem 1 of the lesson Fractions to decimals. By the uniqueness of the quotient and the remainder (Division with remainder), rₖ is the remainder of a × E by b.
Two whole numbers X ≤ Y leave the same remainder on division by b exactly when b divides Y − X.
Write X = q × b + r with r less than b. If Y = q′ × b + r with the same r, then Y − X = (q′ − q) × b. Conversely, if Y − X = n × b, then Y = (q + n) × b + r with r less than b, and by uniqueness r is the remainder of Y as well.
Let ab be in lowest terms and i less than j. Then rᵢ = rⱼ exactly when b divides E × N, where E is the 1 followed by i zeros and N is the number written with j − i nines.
The 1 followed by j zeros is E × (N + 1), since N + 1 is the 1 followed by j − i zeros (Multiplying and dividing by powers of ten). So, by the distributive property, a × E × (N + 1) − a × E = a × E × N. By Lemmas 1 and 2, rᵢ = rⱼ exactly when b divides a × E × N. Since a and b have no common factor but 1, Euclid’s lemma (Simplifying to lowest terms) says that b divides a × (E × N) exactly when b divides E × N.
A remainder that returns brings the same digits back (the Lemma of Repeating decimals). Conversely, the digits after place k are the digits of the long division of rₖ by b, so if the endless digits after place i and after place j are the same, they name the same fraction, and by Proposition 2 of that lesson rᵢb = rⱼb, so rᵢ = rⱼ. So the digits from place i + 1 on repeat those from place j + 1 on exactly when rᵢ = rⱼ.
Where the repeating block starts
Every counting number b can be written as b = (s factors 2) × (t factors 5) × c, where c has no factor 2 or 5: collect the 2s and the 5s of its prime factorization (Prime factorization), and c is the product of the other primes, or 1 if there are none. For example 300 = (2 × 2) × (5 × 5) × 3. Let m be the larger of s and t.
Let E be the 1 followed by i zeros and N a number written with nines only. Then b divides E × N exactly when s ≤ i, t ≤ i and c divides N.
N ends in 9, so it is odd and not a multiple of 5 (Divisibility rules and why they work): its prime factorization has no 2 and no 5. E is i factors 10, that is i factors 2 and i factors 5. So the prime factorization of E × N has exactly i factors 2 and i factors 5, and its other primes are those of N.
If b divides E × N, then by the Theorem of the section “Every divisor from the factorization” of the lesson Prime factorization is unique, each prime occurs in b at most as often as in E × N: so s ≤ i and t ≤ i, and every prime of c occurs in N at least as often as in c, so c divides N. Conversely, if s ≤ i and t ≤ i, then (s factors 2) × (t factors 5) divides E, and if c divides N, the product b divides the product E × N.
Let ab be in lowest terms, b = (s factors 2) × (t factors 5) × c with c greater than 1, and m the larger of s and t. Then exactly m digits come before the repeating block, and the block has p digits, where p is the smallest number of nines such that c divides 99…9 (p nines). In particular, when b has no factor 2 or 5, the decimal repeats from the first digit after the point.
By Theorem 1 of Repeating decimals some remainder returns, rᵢ = rⱼ, and by Proposition 1 and Lemma 3, c then divides the number written with j − i nines. So numbers of nines that c divides exist; let p be the smallest.
The block starts after m digits. Since c is more than 1, the division never ends (Theorem 1). By Lemma 3, b divides (1 followed by m zeros) × (p nines), so by Proposition 1, r₍m₎ = r₍m+p₎: from place m + 1 on, the digits repeat with a block of p digits. For i less than m, no rⱼ with j greater than i equals rᵢ, since by Proposition 1 and Lemma 3 that would need s ≤ i and t ≤ i, so m ≤ i. So the digits in places 1 to m never come back as part of the repetition: exactly m digits come before the block.
The block has p digits. A repeating block of q digits, starting after place m or after any later place k, would mean rₖ = r₍k+q₎ (the digits from place k + 1 on repeat those from place k + q + 1 on). By Proposition 1 and Lemma 3, c would then divide the number written with q nines, so q is at least p. So no repeating block is shorter than p digits.
The digits before the block form the nonperiodic part of the decimal,[4] and p, the number of digits in the shortest repeating block, is its period (Repeating decimals).[5] Theorem 2 is the classical description: the repetition begins after a number of digits set by the 2s and 5s of the denominator,[6] and the length of the block depends only on the part of the reduced denominator that is relatively prime to 10, here c.[7]
Predict the decimals of 914, 526, 775 and 433 from their denominators, then check.
- 14 = 2 × 7: m = 1, c = 7, and 7 divides 999,999 = 7 × 142,857 but none of 9, 99, 999, 9,999, 99,999: one digit, then a block of 6. Division: 0.6.
- 26 = 2 × 13: m = 1, c = 13, and 999,999 = 13 × 76,923 is the first row of nines that 13 divides: one digit, then a block of 6. Division: 50 = 1 × 26 + 24, 240 = 9 × 26 + 6, 60 = 2 × 26 + 8, 80 = 3 × 26 + 2, 20 = 0 × 26 + 20, 200 = 7 × 26 + 18, 180 = 6 × 26 + 24, and 24 returns: 0.1.
- 75 = 3 × 5 × 5: s = 0, t = 2, m = 2, c = 3, and 3 divides 9: two digits, then a block of 1. Division: 70 = 0 × 75 + 70, 700 = 9 × 75 + 25, 250 = 3 × 75 + 25: 0.09.
- 33 = 3 × 11 has no 2 or 5: m = 0. 33 does not divide 9, and 99 = 3 × 33: a block of 2 from the first digit. Division: 40 = 1 × 33 + 7, 70 = 2 × 33 + 4: 0..
Answer: each division agrees with the prediction.
Someone writes 730 = 0.. Check it with Theorem 2.
- 30 = 2 × 3 × 5: s = 1, t = 1, so m = 1 (the larger count, not s + t = 2), and c = 3, with p = 1 since 3 divides 9.
- So one digit comes before a block of one digit, not a block of two from the first digit.
- Division: 70 = 2 × 30 + 10; 100 = 3 × 30 + 10, and 10 returns.
Answer: 730 = 0.2. By Theorem 2 of Repeating decimals, 0. = 2399, a different fraction.
The length of the block
Theorem 2 shows that the length of the block depends only on c, not on the numerator: all fractions in lowest terms whose denominators have the same part c have blocks of the same length. For a prime denominator other than 2 and 5, all the cycles have the same length.[8] The block of 1c is found by asking which row of nines c divides.
Find the length of the block for the denominators 7, 13, 41 and 27.
- 7: 9, 99, 999, 9,999 and 99,999 leave the remainders 2, 1, 5, 3 and 4; 999,999 = 7 × 142,857. Block of 6, as in 17 = 0..
- 13: 999,999 = 13 × 76,923, and no shorter row works (9, 99, 999, 9,999, 99,999 leave 9, 8, 11, 2, 3). Block of 6.
- 41: 99,999 = 41 × 2,439 is the first. Block of 5: 141 = 0..
- 27: 9 and 99 are not multiples of 27, and 999 = 27 × 37. Block of 3, as for 827 = 0..
Answer: 6, 6, 5 and 3. Every fraction in lowest terms with denominator 7, such as 37 or 57, has a block of 6.
Predict the shape
- Round
- 1
- Score
- 0
- Streak
- 0
Without dividing: what does the decimal of 645 look like?
From a repeating decimal back to a fraction
Theorem 1 runs both ways: not only is every fraction terminating or repeating, every repeating decimal names a fraction. The lesson Repeating decimals proved it when the block starts right after the point; digits before the block are handled by moving the point.
Let B be a row of m digits and C a block of p digits, not all 9, and write BC for the row of their digits together. Then 0.B names the fraction BC − B99…900…0, with p nines and m zeros in the denominator.
Let E be the 1 followed by m zeros and N the number written with p nines. By Theorem 2 of Repeating decimals, 0. names CN. The cut-off of 0.B after m + j places is (B + t) ÷ E, where t is the cut-off of 0. after j places, because dividing by E moves the point m places to the left (Multiplying and dividing by powers of ten). Dividing t ≤ CN ≤ t + u by E, after adding B, shows that 0.B names (B + CN) ÷ E; its cut-offs after m places or fewer are those of B ÷ E, and the value lies in their pieces too. Finally, (B + CN) ÷ E = B × N + CN × E, and B × N + C = B × (N + 1) + C − B, where B × (N + 1) + C is the number BC (B followed by the p digits of C). So the fraction is BC − BN × E.
Write 0.58 and 0.2 as fractions in lowest terms.
- 0.58: B = 58, C = 3, one nine and two zeros: 583 − 58900 = 525900 = 712 (dividing by 75).
- The subtraction method gives the same: if x = 0.58333…, then 1,000x = 583.333… and 100x = 58.333…, so 900x = 525.
- 0.2: B = 2, C = 45, two nines and one zero: 245 − 2990 = 243990 = 27110 (dividing by 9).
- Check: 27 = 0 × 110 + 27; 270 = 2 × 110 + 50; 500 = 4 × 110 + 60; 600 = 5 × 110 + 50, and 50 returns: 0.2.
Answer: 712 and 27110. Both denominators agree with Theorem 2: 12 = 2 × 2 × 3 has m = 2, and 110 = 2 × 5 × 11 has m = 1.
Decimals that neither end nor repeat
An endless decimal can be written down whose digits follow a rule but never repeat: for example 0.101001000100001…, where the runs of 0s between the 1s grow longer by one each time. No block repeats, because any block would sooner or later meet a run of 0s longer than itself.
If an endless decimal names a fraction, its digits repeat from some place on (a tail of 0s or a tail of 9s counts as repeating). So an endless decimal whose digits never repeat names no fraction.
Let the decimal name the fraction x, and let tⱼ be its cut-off after j places, and sⱼ the cut-off of the long division of x. Both are whole numbers of units u of the j-th place, and sⱼ ≤ x < sⱼ + u (Proposition 1 of Repeating decimals) while tⱼ ≤ x ≤ tⱼ + u. So tⱼ < sⱼ + u, that is tⱼ ≤ sⱼ; and sⱼ ≤ tⱼ + u.
If tⱼ = sⱼ for every j, the decimal is the long division of x, which terminates or repeats by Theorem 1. Otherwise tⱼ = sⱼ − u for some j, and then x ≤ tⱼ + u = sⱼ ≤ x, so x = sⱼ is a terminating decimal. For every later place k, with v one unit of the k-th place, the cut-off tₖ still satisfies x ≤ tₖ + v, so tₖ ≥ x − v = tⱼ + u − v. But tₖ is tⱼ plus the digits in places j + 1 to k, and those digits are worth u − v when they are all 9s (as in Proposition 3 of Repeating decimals) and less as soon as one of them is smaller. So the digits after place j are all 9s: the decimal ends in 9s forever, as 0.24999… does for 0.25.
So 0.101001000100001… is not equal to any fraction. A decimal that does not stop and does not repeat cannot be written as a ratio of integers; such a number is called irrational.[9] The fractions, positive and negative, are called the rational numbers,[10] and numbers that are not rational are called irrational.[11]
Whether a decimal like 0.101001000100001… names a number at all is a question about the number line, not about fractions: the unit Real Numbers shows that it does, and that the line has many such points. Its lessons “Numbers that are not fractions” and “Why √2 is irrational” give the first examples. The number π is one: its decimal never ends or repeats.[12] The unit Rational Numbers, which comes next, treats all fractions, positive and negative, as one number system.
Exercises
Predict how many digits come before the block, and how long the block is, for 1148, 235 and 144. Then find the decimals.
▸ Show solution
- 1148: 48 = 2 × 2 × 2 × 2 × 3: m = 4, c = 3, block of 1. Four digits, then a block of 1: 0.2291 (110 = 2 × 48 + 14; 140 = 2 × 48 + 44; 440 = 9 × 48 + 8; 80 = 1 × 48 + 32; 320 = 6 × 48 + 32).
- 235: 35 = 5 × 7: m = 1, c = 7: one digit, then a block of 6: 0.0.
- 144: 44 = 2 × 2 × 11: m = 2, c = 11, block of 2: 0.02.
Without dividing, find the length of the block of every fraction in lowest terms with denominator 111, and where it starts.
▸ Show solution
Theorem 2 with c = 3 × 37 = 111. 9 and 99 are not multiples of 111, and 999 = 9 × 111. So every fraction in lowest terms with denominator 111 has a block of 3 digits, starting at the first digit (111 has no factor 2 or 5). For example 1111 = 0., since 9 × 111 = 999.
Write as fractions in lowest terms: 0.1, 0.04, 0.6.
▸ Show solution
- 0.1: 16 − 190 = 1590 = 16.
- 0.04: 43 − 4900 = 39900 = 13300.
- 0.6: 618 − 6990 = 612990 = 3455 (dividing by 18).
Find the smallest denominator b such that 1b has exactly three digits before a repeating block of one digit.
▸ Show solution
By Theorem 2, b = (s factors 2) × (t factors 5) × c with the larger of s and t equal to 3, and the block has one digit exactly when c divides 9, that is c = 3 or c = 9 (c = 1 would make the decimal terminate). The smallest choice takes c = 3, s = 3 and t = 0: b = 8 × 3 = 24. For example 124 = 0.041. Other choices, such as 125 × 3 = 375 or 8 × 5 × 3 = 120, are larger.
Without long division, describe the decimal of 13 + 17: does it terminate, where does its block start, and how long is it?
▸ Show solution
The sum is 13 + 17 = 1021 (Adding fractions with different denominators), in lowest terms since 10 = 2 × 5 and 21 = 3 × 7 share no prime. c = 21 and m = 0.
The block length is the smallest number of nines that 21 divides. 21 divides 999,999 = 21 × 47,619, and no shorter row (9, 99, 999, 9,999, 99,999 are not multiples of 7). So 1021 repeats from the first digit with a block of 6: 0..
An endless decimal has the digit 1 in the places 1, 4, 9, 16, 25, … (the square numbers n × n) and 0 in every other place: 0.1001000010000001…. Prove that it names no fraction.
▸ Show solution
Suppose the digits repeated from place K on with a block of p digits: then the digit in place k equals the digit in place k + p for every k ≥ K. Choose a whole number n with n × n ≥ K and 2 × n + 1 > p. The place n × n holds a 1, so the place n × n + p holds a 1 too. But n × n < n × n + p < n × n + 2 × n + 1 = (n + 1) × (n + 1), so n × n + p lies strictly between two consecutive square numbers and is not a square: its digit is 0. That is a contradiction. So the digits never repeat, and by Theorem 4 the decimal names no fraction.
Summary
- Every fraction is a terminating or a repeating decimal: it terminates exactly when its denominator in lowest terms has no prime factor other than 2 and 5.
- The remainder after k places is the remainder of a × (1 followed by k zeros) by b, and two remainders agree exactly when b divides their difference.
- Write the denominator in lowest terms as (s factors 2) × (t factors 5) × c. If c > 1, exactly max(s, t) digits come before the repeating block.
- The block has p digits, the smallest p such that c divides the number written with p nines; it does not depend on the numerator.
- Every repeating decimal names a fraction: 0.B followed by the repeating block C is (BC − B) over p nines and m zeros.
- An endless decimal whose digits never repeat names no fraction; such numbers are irrational and belong to the unit Real Numbers.
Sources
- 1.“The Number System, Grade 7”, Common Core State Standards Initiative (National Governors Association and Council of Chief State School Officers).Section “Apply and extend previous understandings of operations with fractions (CCSS.Math.Content.7.NS.A.2.d)”. thecorestandards.org/Math/Content/7/NS · open at the quoted passage.
“know that the decimal form of a rational number terminates in 0s or eventually repeats”
Used for: the decimal form of a fraction terminates in 0s or eventually repeats. - 2.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 7, “The Properties of Real Numbers”, section 7.1, “Rational and Irrational Numbers”, p. 541 (the whole topic: pp. 540–543).
“Every rational number can be written both as a ratio of integers and as a decimal that either stops or repeats.”
Used for: every fraction can be written as a decimal that either stops or repeats. - 3.David M. Burton, Elementary Number Theory (7th ed., McGraw-Hill, 2011).Chapter 3, “Primes and Their Distribution”, section 3.1, “The Fundamental Theorem of Arithmetic”, Theorem 3.2, p. 41 (the whole topic: pp. 39–42).
“Fundamental Theorem of Arithmetic. Every positive integer n > 1 is either a prime or a product of primes; this representation is unique, apart from the order in which the factors occur.”
Used for: the prime factorization of the denominator is unique apart from the order of the factors. - 4.Eric W. Weisstein, “Repeating Decimal”, MathWorld, a Wolfram Web Resource.Section “Repeating Decimal”. mathworld.wolfram.com/RepeatingDecimal.html · open at the quoted passage.
“has a nonperiodic part whose length is that of”
Used for: the digits before the repeating block form the nonperiodic part of the decimal (the page: for m relatively prime to 10 and 1/n terminating, 1/(mn) “has a nonperiodic part whose length is that of” 1/n “and a repeating part whose length is that of” 1/m). - 5.Eric W. Weisstein, “Repeating Decimal”, MathWorld, a Wolfram Web Resource.Section “Repeating Decimal”. mathworld.wolfram.com/RepeatingDecimal.html · open at the quoted passage.
“The minimum number of digits that repeats in such a number is known as the decimal period”
Used for: the number of digits in the shortest repeating block is the period of the decimal. - 6.Eric W. Weisstein, “Decimal Expansion”, MathWorld, a Wolfram Web Resource.Section “Decimal Expansion”. mathworld.wolfram.com/DecimalExpansion.html · open at the quoted passage.
“then the decimal period begins after”
Used for: the repetition begins after a number of digits set by the 2s and 5s of the denominator (the page: when the reduced denominator is n₀ times α factors 2 and β factors 5, with n₀ > 1 relatively prime to 10, “then the decimal period begins after” max(α, β) decimal digits). - 7.Eric W. Weisstein, “Decimal Expansion”, MathWorld, a Wolfram Web Resource.Section “Decimal Expansion”. mathworld.wolfram.com/DecimalExpansion.html · open at the quoted passage.
“The number of decimal digits in the repeating portion of the nonterminating decimal expansion of a rational number is the multiplicative order of 10 modulo the part of its reduced denominator that is relatively prime to 10.”
Used for: the length of the block depends only on c, the part of the reduced denominator relatively prime to 10. (The multiplicative order of 10 modulo c is the smallest p for which 1 followed by p zeros leaves remainder 1 on division by c, that is, for which c divides the number written with p nines.) - 8.John H. Conway and Richard K. Guy, The Book of Numbers (Copernicus (Springer), 1996).Chapter 6, “Further Fruitfulness of Fractions”, section “Fractions Cycle into Decimals”, p. 161 (the whole topic: pp. 157–162).
“For a prime denominator (other than 2 or 5), all the cycles have the same length.”
Used for: for a prime denominator other than 2 and 5, all the fractions have blocks of the same length. - 9.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 7, “The Properties of Real Numbers”, section 7.1, “Rational and Irrational Numbers”, p. 542 (the whole topic: pp. 540–543).
“A decimal that does not stop and does not repeat cannot be written as the ratio of integers. We call this kind of number an irrational number.”
Used for: a decimal that neither stops nor repeats is not a ratio of integers; such a number is called irrational. - 10.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 7, “The Properties of Real Numbers”, section 7.1, “Rational and Irrational Numbers”, p. 540 (the whole topic: pp. 540–543).
“All fractions, both positive and negative, are rational numbers.”
Used for: the fractions, positive and negative, are called rational numbers. - 11.“The Number System, Grade 8”, Common Core State Standards Initiative (National Governors Association and Council of Chief State School Officers).Section “Know that there are numbers that are not rational, and approximate them by rational numbers (CCSS.Math.Content.8.NS.A.1)”. thecorestandards.org/Math/Content/8/NS · open at the quoted passage.
“Know that numbers that are not rational are called irrational.”
Used for: numbers that are not rational are called irrational. - 12.Lynn Marecek, MaryAnne Anthony-Smith and Andrea Honeycutt Mathis, Prealgebra (2nd ed., OpenStax, Rice University, 2020).Chapter 5, “Decimals”, section 5.3, “Decimals and Fractions” (“Find the Circumference and Area of Circles”), p. 408 (the whole topic: pp. 407–410).
“cannot be calculated since the decimal never ends or repeats”
Used for: the decimal of π never ends or repeats.