A repeating decimal or recurring decimal is a decimal representation of a number whose digits are eventually periodic (that is, after some place, the same sequence of digits is repeated forever); if this sequence consists only of zeros (that is if there are only a finite number of nonzero digits), 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.Courant, R. and Robbins, H. What Is Mathematics?: An Elementary Approach to Ideas and Methods, 2nd ed. Oxford, England: Oxford University Press, 1996: p. 67. Every terminating decimal representation can be written as a decimal fraction, a fraction whose denominator is a power of 10 (e.g. ); it may also be written as a ratio of the form (e.g. ). 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 (rightmost) non-zero digit by one and appending a repetend of 9. Two examples of this are and . (This type of repeating decimal can be obtained by long division if one uses a modified form of the usual division algorithm.)
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 (see ). Examples of such irrational numbers are and .
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. +Different notations with examplesFraction Vinculum Dots Parentheses Arc Ellipsis"r" notation 0. 0. 0.(1) 0. 0.111...0r1 = 0. 0. 0.(3) 0. 0.333...0r3 = 0. 0. 0.(6) 0. 0.666...0r6 = 0. 0. 0.(81) 0. 0.8181...0r81 = 0.58 0.58 0.58(3) 0.58 ...0.58r3 = 0. 0.4285 0.(142857) 0. ...0r142857 = 0. 0.1234567 0.(012345679) 0. ...0r012345679 = 3. 3.4285 3.(142857) 3. ...3r142857 = 11. 11.88679245283 11.(1886792452830) 11. ...11r1886792452830
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 (a vinculum) above the repetend.Conférence Intercantonale de l'Instruction Publique de la Suisse Romande et du Tessin (2011). Aide-mémoire. Mathématiques 9-10-11. LEP. pp. 20–21. 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 or multiplication. 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 (three periods, 0.333...), 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; , for example, can be represented as 3.14159.... "r" notation: In online settings or informal writing, where notating any of the above may be impossible, a simple way of writing repeated numbers is to place an r at the start of the repetition. For example, 1.2 can be written 1.2r34. In cases where the repetition starts at the decimal, the decimal point can be omitted, so 11. would be 11r1886792452830.
In English, there are various ways to read repeating decimals aloud. For example, 1.2 may be read "one point two repeating three four", "one point two repeated three four", "one point two recurring three four", "one point two repetend three four" or "one point two into infinity three four".
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 (modulo B).
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".For a base b and a divisor n, in terms of group theory this length divides
(with modular arithmetic ) which divides the Carmichael function
which again divides Euler's totient function φ(n).
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 (a prime denominator is considered as a prime factor of itself), 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 equation {| | nowrap="" |10000α − 10α | nowrap="" |= 58144.144144... − 58.144144... |- | align="right" |9990α || = 58086 |- | align="right" |Therefore, α || = = |} The 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 (i.e. coprime to 10) always produces a repeating decimal. The length of the repetend (period of the repeating decimal segment) 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
The list can go on to include the fractions , , , , , , , , , , etc. .
Every proper multiple of a cyclic number (that is, a multiple having the same number of digits) is a rotation:
= 1 × 0. = 0. = 2 × 0. = 0. = 3 × 0. = 0. = 4 × 0. = 0. = 5 × 0. = 0. = 6 × 0. = 0.
The reason for the cyclic behavior is apparent from an arithmetic exercise of long division of : the sequential remainders are the cyclic sequence . See also the article 142,857 for more properties of this cyclic number.
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 (by rotation) 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 (namely, times). They are:Dickson, L. E., History of the Theory of Numbers, Volume 1, Chelsea Publishing Co., 1952. 61, 131, 181, 461, 491, 541, 571, 701, 811, 821, 941, 971, 1021, 1051, 1091, 1171, 1181, 1291, 1301, 1349, 1381, 1531, 1571, 1621, 1741, 1811, 1829, 1861,... .
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 7, 23, 47, 59, 167, 179, 263, 383, 503, 863, 887, 983, 1019, 1367, 1487, 1619, 1823, 2063... .
Other reciprocals of primes Some reciprocals of primes that do not generate cyclic numbers are: = 0., which has a period (repetend length) 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. = 0., which has a period of 4. = 0., which has a period of 34.