This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
Arepeating decimal orrecurring decimal is adecimal representation of a number whosedigits are eventuallyperiodic (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 beterminating, and is not considered as repeating.
It can be shown that a number isrational if and only if its decimal representation is repeating or terminating. For example, the decimal representation of1/3 becomes periodic just after thedecimal point, repeating the single digit "3" forever, i.e. 0.333.... A more complicated example is3227/555, whose decimal becomes periodic at thesecond digit following the decimal point and then repeats the sequence "144" forever, i.e. 5.8144144144.... Another example of this is593/53, 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 therepetend orreptend. If the repetend is a zero, this decimal representation is called aterminating decimal rather than a repeating decimal, since the zeros can be omitted and the decimal terminates before these zeros.[1] Every terminating decimal representation can be written as adecimal fraction, a fraction whose denominator is apower of 10 (e.g.1.585 =1585/1000); it may also be written as aratio of the formk/2n·5m (e.g.1.585 =317/23·52). 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 are1.000... = 0.999... and1.585000... = 1.584999.... (This type of repeating decimal can be obtained by long division if one uses a modified form of the usualdivision algorithm.[2])
Any number that cannot be expressed as aratio of twointegers is said to beirrational. Their decimal representation neither terminates nor infinitely repeats, but extends forever without repetition (see§ Every rational number is either a terminating or repeating decimal). Examples of such irrational numbers are√2 andπ.[3]
This sectionneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources in this section. Unsourced material may be challenged and removed.(October 2024) (Learn how and when to remove this message) |
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.
| Fraction | Vinculum | Dots | Parentheses | Arc | Ellipsis | |
|---|---|---|---|---|---|---|
| 1/9 | 0.1 | 0..1 | 0.(1) | 0.1 | 0.111... | |
| 1/3 | =3/9 | 0.3 | 0..3 | 0.(3) | 0.3 | 0.333... |
| 2/3 | =6/9 | 0.6 | 0..6 | 0.(6) | 0.6 | 0.666... |
| 9/11 | =81/99 | 0.81 | 0..8.1 | 0.(81) | 0.81 | 0.8181... |
| 7/12 | =525/900 | 0.583 | 0.58.3 | 0.58(3) | 0.583 | 0.58333... |
| 1/7 | =142857/999999 | 0.142857 | 0..14285.7 | 0.(142857) | 0.142857 | 0.142857142857... |
| 1/81 | =12345679/999999999 | 0.012345679 | 0..01234567.9 | 0.(012345679) | 0.012345679 | 0.012345679012345679... |
| 22/7 | =3142854/999999 | 3.142857 | 3..14285.7 | 3.(142857) | 3.142857 | 3.142857142857... |
| 593/53 | =111886792452819/9999999999999 | 11.1886792452830 | 11..188679245283.0 | 11.(1886792452830) | 11.1886792452830 | 11.18867924528301886792452830... |
In English, there are various ways to read repeating decimals aloud. For example, 1.234 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". 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 arational number represented as a fraction into decimal form, one may uselong division. For example, consider the rational number5/74:
0.0675 74 ) 5.000004.44 560518 420370 500etc. 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:0.0675675675....
For any integer fractionA/B, the remainder at step k, for any positive integerk, isA × 10k (moduloB).
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".[5]
In base 10, a fraction has a repeating decimal if and only ifin 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, wherem andn are non-negative integers.
Each repeating decimal number satisfies alinear equation with integer coefficients, and its unique solution is a rational number. In the example above,α = 5.8144144144... satisfies the equation
| 10000α − 10α | = 58144.144144... − 58.144144... |
| 9990α | = 58086 |
| Therefore,α | =58086/9990 =3227/555 |
The process of how to find these integer coefficients is describedbelow.
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.[6] For with digits, let where is a terminating group of digits. Then,
where denotes thei-thdigit, and
Since,[7]
Since is the sum of an integer () and a rational number (), is also rational.[8]
A fractionin lowest terms with aprime 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) of1/p is equal to theorder of 10 modulop. If 10 is aprimitive root modulop, then the repetend length is equal top − 1; if not, then the repetend length is a factor ofp − 1. This result can be deduced fromFermat's little theorem, which states that10p−1 ≡ 1 (modp).
The base-10digital root of the repetend of the reciprocal of any prime number greater than 5 is 9.[9]
If the repetend length of1/p for primep is equal top − 1 then the repetend, expressed as an integer, is called acyclic number.
Examples of fractions belonging to this group are:
The list can go on to include the fractions1/109,1/113,1/131,1/149,1/167,1/179,1/181,1/193,1/223,1/229, etc. (sequenceA001913 in theOEIS).
Everyproper multiple of a cyclic number (that is, a multiple having the same number of digits) is a rotation:
The reason for the cyclic behavior is apparent from an arithmetic exercise of long division of1/7: the sequential remainders are the cyclic sequence{1, 3, 2, 6, 4, 5}. See also the article142,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 innines' complement form. For example1/7 starts '142' and is followed by '857' while6/7 (by rotation) starts '857' followed byits 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 anynatural number n will be, as long as the repetend is known.
Aproper prime is a primep which ends in the digit 1 in base 10 and whose reciprocal in base 10 has a repetend with lengthp − 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,p − 1/10 times). They are:[10]: 166
A prime is a proper prime if and only if it is afull reptend prime andcongruent to 1 mod 10.
If a primep is bothfull reptend prime andsafe prime, then1/p will produce a stream ofp − 1pseudo-random digits. Those primes are
Some reciprocals of primes that do not generate cyclic numbers are:
The reason is that 3 is a divisor of 9, 11 is a divisor of 99, 41 is a divisor of 99999, etc.To find the period of1/p, we can check whether the primep divides some number 999...999 in which the number of digits dividesp − 1. Since the period is never greater thanp − 1, we can obtain this by calculating10p−1 − 1/p. 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 of1/13 can be divided into two sets, with different repetends. The first set is:
where the repetend of each fraction is a cyclic re-arrangement of 076923. The second set is:
where the repetend of each fraction is a cyclic re-arrangement of 153846.
In general, the set of proper multiples of reciprocals of a primep consists ofn subsets, each with repetend length k, wherenk = p − 1.
For an arbitrary integern, the lengthL(n) of the decimal repetend of1/n dividesφ(n), whereφ is thetotient function. The length is equal toφ(n) if and only if 10 is aprimitive root modulon.[11]
In particular, it follows thatL(p) =p − 1if and only ifp is a prime and 10 is a primitive root modulop. Then, the decimal expansions ofn/p forn = 1, 2, ...,p − 1, all have periodp − 1 and differ only by a cyclic permutation. Such numbersp are calledfull repetend primes.
Ifp is a prime other than 2 or 5, the decimal representation of the fraction1/p2 repeats:
The period (repetend length)L(49) must be a factor ofλ(49) = 42, whereλ(n) is known as theCarmichael function. This follows fromCarmichael's theorem which states that ifn is a positive integer thenλ(n) is the smallest integerm such that
for every integera that iscoprime ton.
The period of1/p2 is usuallypTp, whereTp is the period of1/p. There are three known primes for which this is not true, and for those the period of1/p2 is the same as the period of1/p becausep2 divides 10p−1−1. These three primes are 3, 487, and 56598313 (sequenceA045616 in theOEIS).[12]
Similarly, the period of1/pk is usuallypk–1Tp
Ifp andq are primes other than 2 or 5, the decimal representation of the fraction1/pq repeats. An example is1/119:
where LCM denotes theleast common multiple.
The periodT of1/pq is a factor ofλ(pq) and it happens to be 48 in this case:
The periodT of1/pq is LCM(Tp, Tq), whereTp is the period of1/p andTq is the period of1/q.
Ifp,q,r, etc. are primes other than 2 or 5, andk,ℓ,m, etc. are positive integers, then
is a repeating decimal with a period of
whereTpk,Tqℓ,Trm,... are respectively the period of the repeating decimals1/pk,1/qℓ,1/rm,... as defined above.
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. The reciprocal can be expressed as:
wherea andb are not both zero.
This fraction can also be expressed as:
ifa >b, or as
ifb >a, or as
ifa =b.
The decimal has:
For example1/28 = 0.03571428:
Given a repeating decimal, it is possible to calculate the fraction that produces it. For example:
| (multiply each side of the above line by 10) | ||
| (subtract the 1st line from the 2nd) | ||
| (reduce to lowest terms) |
Another example:
| (move decimal to start of repetition = move by 1 place = multiply by 10) | ||
| (collate 2nd repetition here with 1st above = move by 2 places = multiply by 100) | ||
| (subtract to clear decimals) | ||
| (reduce to lowest terms) |
The procedure below can be applied in particular if the repetend hasn digits, all of which are 0 except the final one which is 1. For instance forn = 7:
So this particular repeating decimal corresponds to the fraction1/10n − 1, where the denominator is the number written asn 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 ann-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 isn digits long, first occurring right after the decimal point, then the fraction (not necessarily reduced) will be the integer number represented by then-digit block divided by the one represented byn 9s. For example,
If the repeating decimal is as above, except that there arek (extra) digits 0 between the decimal point and the repeatingn-digit block, then one can simply addk digits 0 after then digits 9 of the denominator (and, as before, the fraction may subsequently be simplified). For example,
Any repeating decimal not of the form described above can be written as a sum of a terminating decimal and a repeating decimal of one of the two above types (actually the first type suffices, but that could require the terminating decimal to be negative). For example,
An even faster method is to ignore the decimal point completely and go like this
It follows that any repeating decimal withperiodn, andk digits after the decimal point that do not belong to the repeating part, can be written as a (not necessarily reduced) fraction whose denominator is (10n − 1)10k.
Conversely the period of the repeating decimal of a fractionc/d will be (at most) the smallest numbern such that 10n − 1 is divisible byd.
For example, the fraction2/7 hasd = 7, and the smallestk that makes 10k − 1 divisible by 7 isk = 6, because 999999 = 7 × 142857. The period of the fraction2/7 is therefore 6.
The following picture suggests kind of compression of the above shortcut.Thereby represents the digits of the integer part of the decimal number (to the left of the decimal point), makes up the string of digits of the preperiod and its length, and being the string of repeated digits (the period) with length which is nonzero.

In the generated fraction, the digit will be repeated times, and the digit will be repeated times.
Note that in the absence of aninteger part in the decimal, 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 thegenerating function.
Examples:
The symbol in the examples above denotes the absence of digits of part in the decimal, and therefore and a corresponding absence in the generated fraction.
A repeating decimal can also be expressed as aninfinite series. That is, a repeating decimal can be regarded as the sum of an infinite number of rational numbers. To take the simplest example,
The above series is ageometric series with the first term as1/10 and the common factor1/10. Because the absolute value of the common factor is less than 1, we can say that the geometric seriesconverges and find the exact value in the form of a fraction by using the following formula wherea is the first term of the series andr is the common factor.
Similarly,
The cyclic behavior of repeating decimals in multiplication also leads to the construction of integers which arecyclically permuted when multiplied by certain numbers. For example,102564 × 4 = 410256. 102564 is the repetend of4/39 and 410256 the repetend of16/39.
Various properties of repetend lengths (periods) are given by Mitchell[13] and Dickson.[14]
For some other properties of repetends, see also.[15]
Various features of repeating decimals extend to the representation of numbers in all other integer bases, not just base 10:
For example, induodecimal,1/2 = 0.6,1/3 = 0.4,1/4 = 0.3 and1/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.
Ifb is an integer base andk is an integer, then
For example 1/7 in duodecimal:
which is 0.186A35base12. 10base12 is 12base10, 102base12 is 144base10, 21base12 is 25base10, A5base12 is 125base10.
For a rational0 <p/q < 1 (and baseb ∈N>1) there is the following algorithm producing the repetend together with its length:
functionb_adic(b,p,q)// b ≥ 2; 0 < p < qdigits="0123...";// up to the digit with value b–1begins="";// the string of digitspos=0;// all places are right to the radix pointwhilenotdefined(occurs[p])dooccurs[p]=pos;// the position of the place with remainder pbp=b*p;z=floor(bp/q);// index z of digit within: 0 ≤ z ≤ b-1p=b*p−z*q;// 0 ≤ p < qifp=0thenL=0;ifnotz=0thens=s.substring(digits,z,1)endifreturn(s);endifs=s.substring(digits,z,1);// append the character of the digitpos+=1;endwhileL=pos-occurs[p];// the length of the repetend (being < q)// mark the digits of the repetend by a vinculum:forifromoccurs[p]topos-1dosubstring(s,i,1)=overline(substring(s,i,1));endforreturn(s);endfunction
The first highlighted line calculates the digitz.
The subsequent line calculates the new remainderp′ of the divisionmodulo the denominatorq. As a consequence of thefloor functionfloor we have
thus
and
Because all these remaindersp are non-negative integers less thanq, there can be only a finite number of them with the consequence that they must recur in thewhile loop. Such a recurrence is detected by theassociative arrayoccurs. The new digitz is formed in the yellow line, wherep is the only non-constant. The lengthL of the repetend equals the number of the remainders (see also sectionEvery rational number is either a terminating or repeating decimal).
fraction | decimal expansion | ℓ10 | binary expansion | ℓ2 |
|---|---|---|---|---|
| 1/2 | 0.5 | 0 | 0.1 | 0 |
| 1/3 | 0.3 | 1 | 0.01 | 2 |
| 1/4 | 0.25 | 0 | 0.01 | 0 |
| 1/5 | 0.2 | 0 | 0.0011 | 4 |
| 1/6 | 0.16 | 1 | 0.001 | 2 |
| 1/7 | 0.142857 | 6 | 0.001 | 3 |
| 1/8 | 0.125 | 0 | 0.001 | 0 |
| 1/9 | 0.1 | 1 | 0.000111 | 6 |
| 1/10 | 0.1 | 0 | 0.00011 | 4 |
| 1/11 | 0.09 | 2 | 0.0001011101 | 10 |
| 1/12 | 0.083 | 1 | 0.0001 | 2 |
| 1/13 | 0.076923 | 6 | 0.000100111011 | 12 |
| 1/14 | 0.0714285 | 6 | 0.0001 | 3 |
| 1/15 | 0.06 | 1 | 0.0001 | 4 |
| 1/16 | 0.0625 | 0 | 0.0001 | 0 |
fraction | decimal expansion | ℓ10 |
|---|---|---|
| 1/17 | 0.0588235294117647 | 16 |
| 1/18 | 0.05 | 1 |
| 1/19 | 0.052631578947368421 | 18 |
| 1/20 | 0.05 | 0 |
| 1/21 | 0.047619 | 6 |
| 1/22 | 0.045 | 2 |
| 1/23 | 0.0434782608695652173913 | 22 |
| 1/24 | 0.0416 | 1 |
| 1/25 | 0.04 | 0 |
| 1/26 | 0.0384615 | 6 |
| 1/27 | 0.037 | 3 |
| 1/28 | 0.03571428 | 6 |
| 1/29 | 0.0344827586206896551724137931 | 28 |
| 1/30 | 0.03 | 1 |
| 1/31 | 0.032258064516129 | 15 |
fraction | decimal expansion | ℓ10 |
|---|---|---|
| 1/32 | 0.03125 | 0 |
| 1/33 | 0.03 | 2 |
| 1/34 | 0.02941176470588235 | 16 |
| 1/35 | 0.0285714 | 6 |
| 1/36 | 0.027 | 1 |
| 1/37 | 0.027 | 3 |
| 1/38 | 0.0263157894736842105 | 18 |
| 1/39 | 0.025641 | 6 |
| 1/40 | 0.025 | 0 |
| 1/41 | 0.02439 | 5 |
| 1/42 | 0.0238095 | 6 |
| 1/43 | 0.023255813953488372093 | 21 |
| 1/44 | 0.0227 | 2 |
| 1/45 | 0.02 | 1 |
| 1/46 | 0.02173913043478260869565 | 22 |
| 1/47 | 0.0212765957446808510638297872340425531914893617 | 46 |
| 1/48 | 0.02083 | 1 |
| 1/49 | 0.020408163265306122448979591836734693877551 | 42 |
| 1/50 | 0.02 | 0 |
| 1/51 | 0.0196078431372549 | 16 |
| 1/52 | 0.01923076 | 6 |
| 1/53 | 0.0188679245283 | 13 |
| 1/54 | 0.0185 | 3 |
| 1/55 | 0.018 | 2 |
| 1/56 | 0.017857142 | 6 |
| 1/57 | 0.017543859649122807 | 18 |
| 1/58 | 0.01724137931034482758620689655 | 28 |
| 1/59 | 0.0169491525423728813559322033898305084745762711864406779661 | 58 |
| 1/60 | 0.016 | 1 |
Therebyfraction is theunit fraction1/n andℓ10 is the length of the (decimal) repetend.
The lengthsℓ10(n) of the decimal repetends of1/n,n = 1, 2, 3, ..., are:
For comparison, the lengthsℓ2(n) of thebinary repetends of the fractions1/n,n = 1, 2, 3, ..., are:
The decimal repetends of1/n,n = 1, 2, 3, ..., are:
The decimal repetend lengths of1/p,p = 2, 3, 5, ... (nth prime), are:
The least primesp for which1/p has decimal repetend lengthn,n = 1, 2, 3, ..., are:
The least primesp for whichk/p hasn different cycles (1 ≤k ≤p−1),n = 1, 2, 3, ..., are:
For primes greater than 5, all the digital roots appear to have the same value, 9. We can confirm this if...