Repeating decimal
A repeating decimal or recurring decimal is a decimal representation of a number whose digits are eventually periodic ; if this sequence consists only of zeros, the decimal is said to be terminating, and is not considered as repeating.
It can be shown that a number is rational if and only if its decimal representation is repeating or terminating. For example, the decimal representation of becomes periodic just after the decimal point, repeating the single digit "3" forever, i.e. 0.333.... A more complicated example is, whose decimal becomes periodic at the second digit following the decimal point and then repeats the sequence "144" forever, i.e. 5.8144144144.... Another example of this is, which becomes periodic after the decimal point, repeating the 13-digit pattern "1886792452830" forever, i.e. 11.18867924528301886792452830....
The finite digit sequence that is repeated infinitely is called the repetend or reptend. If the repetend is a zero, this decimal representation is called a terminating decimal rather than a repeating decimal, since the zeros can be omitted and the decimal terminates before these zeros. Every terminating decimal representation can be written as a decimal fraction, a fraction whose denominator is a power of 10 ; it may also be written as a ratio of the form . However, every number with a terminating decimal representation also trivially has a second, alternative representation as a repeating decimal whose repetend is the digit "9". This is obtained by decreasing the final non-zero digit by one and appending a repetend of 9. Two examples of this are 0.999...| and.
Any number that cannot be expressed as a ratio of two integers is said to be irrational. Their decimal representation neither terminates nor infinitely repeats, but extends forever without repetition. Examples of such irrational numbers are square root of 2| and pi|.
Background
Notation
Any textual representation is necessarily finite, which is why special non-decimal notation is required to represent repeating decimals. Below are several notational conventions. None of them are accepted universally.- Vinculum: In the United States, Canada, India, France, Germany, Denmark, the Netherlands, Italy, Switzerland, the Czech Republic, Slovakia, Slovenia, Chile, Taiwan, and Turkey, the convention is to draw a horizontal line above the repetend.
- Dots: In some Islamic countries, such as Bangladesh, Malaysia, Morocco, Pakistan, Tunisia, Iran, Algeria and Egypt, as well as the United Kingdom, New Zealand, Australia, South Africa, Japan, Thailand, India, South Korea, Singapore, and the People's Republic of China, the convention is to place dots above the outermost numerals of the repetend.
- Parentheses: In parts of Europe, incl. Austria, Finland, Norway, Poland, Russia and Ukraine, as well as Vietnam and Israel, the convention is to enclose the repetend in parentheses. This can cause confusion with the notation for standard uncertainty.
- Arc: In Spain and some Latin American countries, such as Argentina, Brazil, and Mexico, the arc notation over the repetend is also used as an alternative to the vinculum and the dots notation.
- Ellipsis: Informally, repeating decimals are often represented by an ellipsis, especially when the previous notational conventions are first taught in school. This notation introduces uncertainty as to which digits should be repeated and even whether repetition is occurring at all, since such ellipses are also employed for irrational numbers; pi|, for example, can be represented as 3.14159....
Decimal expansion and recurrence sequence
In order to convert a rational number represented as a fraction into decimal form, one may use long division. For example, consider the rational number :0.0
74 ) 5.00000
4.44
560
518
420
370
500
etc. Observe that at each step we have a remainder; the successive remainders displayed above are 56, 42, 50. 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. Therefore, the decimal repeats:....
For any integer fraction, the remainder at step k, for any positive integer k, is A × 10k.
Every rational number is either a terminating or repeating decimal
For any given divisor, only finitely many different remainders can occur. In the example above, the 74 possible remainders are 0, 1, 2, ..., 73. If at any point in the division the remainder is 0, the expansion terminates at that point. Then the length of the repetend, also called "period", is defined to be 0.If 0 never occurs as a remainder, then the division process continues forever, and eventually, a remainder must occur that has occurred before. The next step in the division will yield the same new digit in the quotient, and the same new remainder, as the previous time the remainder was the same. Therefore, the following division will repeat the same results. The repeating sequence of digits is called "repetend" which has a certain length greater than 0, also called "period".
In base 10, a fraction has a repeating decimal if and only if in lowest terms, its denominator has at least a prime factor different from 2 and 5, or in other words, the denominator cannot be expressed as 2m5n, where m and n are non-negative integers.
Every repeating or terminating decimal is a rational number
Each repeating decimal number satisfies a linear equation with integer coefficients, and its unique solution is a rational number. In the example above, satisfies the equationThe process of how to find these integer coefficients is described [|below].
Formal proof
Given a repeating decimal where,, and are groups of digits, let, the number of digits of. Multiplying by separates the repeating and terminating groups:If the decimals terminate, the proof is complete. For with digits, let where is a terminating group of digits. Then,
where denotes the i-th digit, and
Since,
Since is the sum of an integer and a rational number, is also rational.
Fractions with prime denominators
A fraction in lowest terms with a prime denominator other than 2 or 5 always produces a repeating decimal. The length of the repetend of is equal to the order of 10 modulo p. If 10 is a primitive root modulo p, then the repetend length is equal to p − 1; if not, then the repetend length is a factor of p − 1. This result can be deduced from Fermat's little theorem, which states that.The base-10 digital root of the repetend of the reciprocal of any prime number greater than 5 is 9.
If the repetend length of for prime p is equal to p − 1 then the repetend, expressed as an integer, is called a cyclic number.
Cyclic numbers
Examples of fractions belonging to this group are:- = 0., 6 repeating digits
- = 0., 16 repeating digits
- = 0., 18 repeating digits
- = 0., 22 repeating digits
- = 0., 28 repeating digits
- = 0., 46 repeating digits
- = 0., 58 repeating digits
- = 0., 60 repeating digits
- = 0., 96 repeating digits
Every proper multiple of a cyclic number is a rotation:
- = 1 × 0. = 0.
- = 2 × 0. = 0.
- = 3 × 0. = 0.
- = 4 × 0. = 0.
- = 5 × 0. = 0.
- = 6 × 0. = 0.
A fraction which is cyclic thus has a recurring decimal of even length that divides into two sequences in nines' complement form. For example starts '142' and is followed by '857' while starts '857' followed by its nines' complement '142'.
The rotation of the repetend of a cyclic number always happens in such a way that each successive repetend is a bigger number than the previous one. In the succession above, for instance, we see that 0.142857... < 0.285714... < 0.428571... < 0.571428... < 0.714285... < 0.857142.... 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.
A proper prime is a prime p which ends in the digit 1 in base 10 and whose reciprocal in base 10 has a repetend with length p − 1. In such primes, each digit 0, 1,..., 9 appears in the repeating sequence the same number of times as does each other digit. They are:
A prime is a proper prime if and only if it is a full reptend prime and congruent to 1 mod 10.
If a prime p is both full reptend prime and safe prime, then will produce a stream of p − 1 pseudo-random digits. Those primes are
Other reciprocals of primes
Some reciprocals of primes that do not generate cyclic numbers are:- = 0., which has a period of 1.
- = 0., which has a period of two.
- = 0., which has a period of six.
- = 0., which has a period of 15.
- = 0., which has a period of three.
- = 0., which has a period of five.
- = 0., which has a period of 21.
- = 0., which has a period of 13.
- = 0., which has a period of 33.
- = 0., which has a period of 35.
- = 0., which has a period of eight.
- = 0., which has a period of 13.
- = 0., which has a period of 41.
- = 0., which has a period of 44.
To find the period of, we can check whether the prime p divides some number 999...999 in which the number of digits divides p − 1. Since the period is never greater than p − 1, we can obtain this by calculating. For example, for 11 we get
and then by inspection find the repetend 09 and period of 2.
Those reciprocals of primes can be associated with several sequences of repeating decimals. For example, the multiples of can be divided into two sets, with different repetends. The first set is:
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
- = 0.
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.