Repeating decimal

It can be shown that a number is rational if and only if its decimal representation is repeating or terminating.

The infinitely repeated digit sequence is called the repetend or reptend.

This is obtained by decreasing the final (rightmost) non-zero digit by one and appending a repetend of 9.

In English, there are various ways to read repeating decimals aloud.

Likewise, 11.1886792452830 may be read "eleven point repeating one double eight six seven nine two four five two eight three zero", "eleven point repeated one double eight six seven nine two four five two eight three zero", "eleven point recurring one double eight six seven nine two four five two eight three zero" "eleven point repetend one double eight six seven nine two four five two eight three zero" or "eleven point into infinity one double eight six seven nine two four five two eight three zero".

In order to convert a rational number represented as a fraction into decimal form, one may use long division.

When we arrive at 50 as the remainder, and bring down the "0", we find ourselves dividing 500 by 74, which is the same problem we began with.

[5] In base 10, a fraction has a repeating decimal if and only if in lowest terms, its denominator has any prime factors besides 2 or 5, or in other words, cannot be expressed as 2m 5n, where m and n are non-negative integers.

In the example above, α = 5.8144144144... satisfies the equation The process of how to find these integer coefficients is described below.

This result can be deduced from Fermat's little theorem, which states that 10p−1 ≡ 1 (mod p).

The base-10 digital root of the repetend of the reciprocal of any prime number greater than 5 is 9.

A fraction which is cyclic thus has a recurring decimal of even length that divides into two sequences in nines' complement form.

This, for cyclic fractions with long repetends, allows us to easily predict what the result of multiplying the fraction by any natural number n will be, as long as the repetend is known.

Those reciprocals of primes can be associated with several sequences of repeating decimals.

For example, the multiples of ⁠1/13⁠ can be divided into two sets, with different repetends.

In general, the set of proper multiples of reciprocals of a prime p consists of n subsets, each with repetend length k, where nk = p − 1.

The length is equal to φ(n) if and only if 10 is a primitive root modulo n.[11] In particular, it follows that L(p) = p − 1 if and only if p is a prime and 10 is a primitive root modulo p. Then, the decimal expansions of ⁠n/p⁠ for n = 1, 2, ..., p − 1, all have period p − 1 and differ only by a cyclic permutation.

[12] Similarly, the period of ⁠1/pk⁠ is usually pk–1Tp If p and q are primes other than 2 or 5, the decimal representation of the fraction ⁠1/pq⁠ repeats.

An integer that is not coprime to 10 but has a prime factor other than 2 or 5 has a reciprocal that is eventually periodic, but with a non-repeating sequence of digits that precede the repeating part.

For instance for n = 7: So this particular repeating decimal corresponds to the fraction ⁠1/10n − 1⁠, where the denominator is the number written as n 9s.

Knowing just that, a general repeating decimal can be expressed as a fraction without having to solve an equation.

For example, one could reason: or It is possible to get a general formula expressing a repeating decimal with an n-digit period (repetend length), beginning right after the decimal point, as a fraction: More explicitly, one gets the following cases: If the repeating decimal is between 0 and 1, and the repeating block is n digits long, first occurring right after the decimal point, then the fraction (not necessarily reduced) will be the integer number represented by the n-digit block divided by the one represented by n 9s.

will be represented by zero, which being to the left of the other digits, will not affect the final result, and may be omitted in the calculation of the generating function.

Because the absolute value of the common factor is less than 1, we can say that the geometric series converges and find the exact value in the form of a fraction by using the following formula where a is the first term of the series and r is the common factor.

Various properties of repetend lengths (periods) are given by Mitchell[13] and Dickson.

[15] Various features of repeating decimals extend to the representation of numbers in all other integer bases, not just base 10: For example, in duodecimal, ⁠1/2⁠ = 0.6, ⁠1/3⁠ = 0.4, ⁠1/4⁠ = 0.3 and ⁠1/6⁠ = 0.2 all terminate; ⁠1/5⁠ = 0.2497 repeats with period length 4, in contrast with the equivalent decimal expansion of 0.2; ⁠1/7⁠ = 0.186A35 has period 6 in duodecimal, just as it does in decimal.

For a rational 0 < ⁠p/q⁠ < 1 (and base b ∈ N>1) there is the following algorithm producing the repetend together with its length: The first highlighted line calculates the digit z.

The subsequent line calculates the new remainder p′ of the division modulo the denominator q.

[16] In these applications repeating decimals to base 2 are generally used which gives rise to binary sequences.

The maximum length binary sequence for ⁠1/p⁠ (when 2 is a primitive root of p) is given by:[17]

Formation rule