Hubbry Logo
Repeating decimalRepeating decimalMain
Open search
Repeating decimal
Community hub
Repeating decimal
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Repeating decimal
Repeating decimal
from Wikipedia

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 is 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 1/3 becomes periodic just after the decimal point, repeating the single digit "3" forever, i.e. 0.333.... A more complicated example is 3227/555, 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 593/53, which becomes periodic after the decimal point, repeating the 13-digit pattern "1886792452830" forever, i.e. 11.18867924528301886792452830....

The infinitely repeated digit sequence 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.[1] Every terminating decimal representation can be written as a decimal fraction, a fraction whose denominator is a power of 10 (e.g. 1.585 = 1585/1000); it may also be written as a ratio of the form k/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 are 1.000... = 0.999... and 1.585000... = 1.584999.... (This type of repeating decimal can be obtained by long division if one uses a modified form of the usual division algorithm.[2])

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 § Every rational number is either a terminating or repeating decimal). Examples of such irrational numbers are 2 and π.[3]

Background

[edit]

Notation

[edit]

There are several notational conventions for representing repeating decimals. None of them are accepted universally.

Different notations with examples
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".

Decimal expansion and recurrence sequence

[edit]

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 5/74:

        0.0675
   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: 0.0675675675....

For any integer fraction A/B, 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

[edit]

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 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

[edit]

Each repeating decimal number satisfies a linear 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 described below.

Formal proof

[edit]

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 the i-th digit, and

Since ,[7]

Since is the sum of an integer () and a rational number (), is also rational.[8]

Fractions with prime denominators

[edit]

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 1/p 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 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.[9]

If the repetend length of 1/p for prime p is equal to p − 1 then the repetend, expressed as an integer, is called a cyclic number.

Cyclic numbers

[edit]

Examples of fractions belonging to this group are:

  • 1/7 = 0.142857, 6 repeating digits
  • 1/17 = 0.0588235294117647, 16 repeating digits
  • 1/19 = 0.052631578947368421, 18 repeating digits
  • 1/23 = 0.0434782608695652173913, 22 repeating digits
  • 1/29 = 0.0344827586206896551724137931, 28 repeating digits
  • 1/47 = 0.0212765957446808510638297872340425531914893617, 46 repeating digits
  • 1/59 = 0.0169491525423728813559322033898305084745762711864406779661, 58 repeating digits
  • 1/61 = 0.016393442622950819672131147540983606557377049180327868852459, 60 repeating digits
  • 1/97 = 0.010309278350515463917525773195876288659793814432989690721649484536082474226804123711340206185567, 96 repeating digits

The list can go on to include the fractions 1/109, 1/113, 1/131, 1/149, 1/167, 1/179, 1/181, 1/193, 1/223, 1/229, etc. (sequence A001913 in the OEIS).

Every proper multiple of a cyclic number (that is, a multiple having the same number of digits) is a rotation:

  • 1/7 = 1 × 0.142857 = 0.142857
  • 2/7 = 2 × 0.142857 = 0.285714
  • 3/7 = 3 × 0.142857 = 0.428571
  • 4/7 = 4 × 0.142857 = 0.571428
  • 5/7 = 5 × 0.142857 = 0.714285
  • 6/7 = 6 × 0.142857 = 0.857142

The reason for the cyclic behavior is apparent from an arithmetic exercise of long division of 1/7: the sequential remainders are the cyclic sequence {1, 3, 2, 6, 4, 5}. 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 1/7 starts '142' and is followed by '857' while 6/7 (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, p − 1/10 times). They are:[10]: 166 

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,... (sequence A073761 in the OEIS).

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 1/p 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... (sequence A000353 in the OEIS).

Other reciprocals of primes

[edit]

Some reciprocals of primes that do not generate cyclic numbers are:

  • 1/3 = 0.3, which has a period (repetend length) of 1.
  • 1/11 = 0.09, which has a period of two.
  • 1/13 = 0.076923, which has a period of six.
  • 1/31 = 0.032258064516129, which has a period of 15.
  • 1/37 = 0.027, which has a period of three.
  • 1/41 = 0.02439, which has a period of five.
  • 1/43 = 0.023255813953488372093, which has a period of 21.
  • 1/53 = 0.0188679245283, which has a period of 13.
  • 1/67 = 0.014925373134328358208955223880597, which has a period of 33.
  • 1/71 = 0.01408450704225352112676058338028169, which has a period of 35.
  • 1/73 = 0.01369863, which has a period of eight.
  • 1/79 = 0.0126582278481, which has a period of 13.
  • 1/83 = 0.01204819277108433734939759036144578313253, which has a period of 41.
  • 1/89 = 0.01123595505617977528089887640449438202247191, which has a period of 44.

(sequence A006559 in the OEIS)

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 of 1/p, 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 10p−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 of 1/13 can be divided into two sets, with different repetends. The first set is:

  • 1/13 = 0.076923
  • 10/13 = 0.769230
  • 9/13 = 0.692307
  • 12/13 = 0.923076
  • 3/13 = 0.230769
  • 4/13 = 0.307692

where the repetend of each fraction is a cyclic re-arrangement of 076923. The second set is:

  • 2/13 = 0.153846
  • 7/13 = 0.538461
  • 5/13 = 0.384615
  • 11/13 = 0.846153
  • 6/13 = 0.461538
  • 8/13 = 0.615384

where the repetend of each fraction is a cyclic re-arrangement of 153846.

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.

Totient rule

[edit]

For an arbitrary integer n, the length L(n) of the decimal repetend of 1/n divides φ(n), where φ is the totient function. 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. Such numbers p are called full repetend primes.

Reciprocals of composite integers coprime to 10

[edit]

If p is a prime other than 2 or 5, the decimal representation of the fraction 1/p2 repeats:

1/49 = 0.020408163265306122448979591836734693877551.

The period (repetend length) L(49) must be a factor of λ(49) = 42, where λ(n) is known as the Carmichael function. This follows from Carmichael's theorem which states that if n is a positive integer then λ(n) is the smallest integer m such that

for every integer a that is coprime to n.

The period of 1/p2 is usually pTp, where Tp is the period of 1/p. There are three known primes for which this is not true, and for those the period of 1/p2 is the same as the period of 1/p because p2 divides 10p−1−1. These three primes are 3, 487, and 56598313 (sequence A045616 in the OEIS).[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 example is 1/119:

119 = 7 × 17
λ(7 × 17) = LCM(λ(7), λ(17)) = LCM(6, 16) = 48,

where LCM denotes the least common multiple.

The period T of 1/pq is a factor of λ(pq) and it happens to be 48 in this case:

1/119 = 0.008403361344537815126050420168067226890756302521.

The period T of 1/pq is LCM(TpTq), where Tp is the period of 1/p and Tq is the period of 1/q.

If p, q, r, etc. are primes other than 2 or 5, and k, , m, etc. are positive integers, then

is a repeating decimal with a period of

where Tpk, Tq, Trm,... are respectively the period of the repeating decimals 1/pk, 1/q, 1/rm,... as defined above.

Reciprocals of integers not coprime to 10

[edit]

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:

where a and b are not both zero.

This fraction can also be expressed as:

if a > b, or as

if b > a, or as

if a = b.

The decimal has:

  • An initial transient of max(ab) digits after the decimal point. Some or all of the digits in the transient can be zeros.
  • A subsequent repetend which is the same as that for the fraction 1/pk q.

For example 1/28 = 0.03571428:

  • a = 2, b = 0, and the other factors pk q ⋯ = 7
  • there are 2 initial non-repeating digits, 03; and
  • there are 6 repeating digits, 571428, the same amount as 1/7 has.

Converting repeating decimals to fractions

[edit]

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)

A shortcut

[edit]

The procedure below can be applied in particular if the repetend has n digits, all of which are 0 except the final one which is 1. 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. For example,

  • 0.444444... = 4/9 since the repeating block is 4 (a 1-digit block),
  • 0.565656... = 56/99 since the repeating block is 56 (a 2-digit block),
  • 0.012012... = 12/999 since the repeating block is 012 (a 3-digit block); this further reduces to 4/333.
  • 0.999999... = 9/9 = 1, since the repeating block is 9 (also a 1-digit block)

If the repeating decimal is as above, except that there are k (extra) digits 0 between the decimal point and the repeating n-digit block, then one can simply add k digits 0 after the n digits 9 of the denominator (and, as before, the fraction may subsequently be simplified). For example,

  • 0.000444... = 4/9000 since the repeating block is 4 and this block is preceded by 3 zeros,
  • 0.005656... = 56/9900 since the repeating block is 56 and it is preceded by 2 zeros,
  • 0.00012012... = 12/99900 = 1/8325 since the repeating block is 012 and it is preceded by 2 zeros.

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,

  • 1.23444... = 1.23 + 0.00444... = 123/100 + 4/900 = 1107/900 + 4/900 = 1111/900
    • or alternatively 1.23444... = 0.79 + 0.44444... = 79/100 + 4/9 = 711/900 + 400/900 = 1111/900
  • 0.3789789... = 0.3 + 0.0789789... = 3/10 + 789/9990 = 2997/9990 + 789/9990 = 3786/9990 = 631/1665
    • or alternatively 0.3789789... = −0.6 + 0.9789789... = −6/10 + 978/999 = −5994/9990 + 9780/9990 = 3786/9990 = 631/1665

An even faster method is to ignore the decimal point completely and go like this

  • 1.23444... = 1234 − 123/900 = 1111/900 (denominator has one 9 and two 0s because one digit repeats and there are two non-repeating digits after the decimal point)
  • 0.3789789... = 3789 − 3/9990 = 3786/9990 (denominator has three 9s and one 0 because three digits repeat and there is one non-repeating digit after the decimal point)

It follows that any repeating decimal with period n, and k 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 fraction c/d will be (at most) the smallest number n such that 10n − 1 is divisible by d.

For example, the fraction 2/7 has d = 7, and the smallest k that makes 10k − 1 divisible by 7 is k = 6, because 999999 = 7 × 142857. The period of the fraction 2/7 is therefore 6.

In compressed form

[edit]

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.

Formation rule

In the generated fraction, the digit will be repeated times, and the digit will be repeated times.

Note that in the absence of an integer 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 the generating 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.

Repeating decimals as infinite series

[edit]

A repeating decimal can also be expressed as an infinite 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 a geometric series with the first term as 1/10 and the common factor 1/10. 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.

Similarly,

Multiplication and cyclic permutation

[edit]

The cyclic behavior of repeating decimals in multiplication also leads to the construction of integers which are cyclically permuted when multiplied by certain numbers. For example, 102564 × 4 = 410256. 102564 is the repetend of 4/39 and 410256 the repetend of 16/39.

Other properties of repetend lengths

[edit]

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

  • The period of 1/k for integer k is always ≤ k − 1.
  • If p is prime, the period of 1/p divides evenly into p − 1.
  • If k is composite, the period of 1/k is strictly less than k − 1.
  • The period of c/k, for c coprime to k, equals the period of 1/k.
  • If k = 2a·5bn where n > 1 and n is not divisible by 2 or 5, then the length of the transient of 1/k is max(ab), and the period equals r, where r is the multiplicative order of 10 mod n, that is the smallest integer such that 10r ≡ 1 (mod n).
  • If p, p′, p″,... are distinct primes, then the period of 1/p p′ p″ equals the lowest common multiple of the periods of 1/p, 1/p′, 1/p″,....
  • If k and k′ have no common prime factors other than 2 or 5, then the period of 1/k k′ equals the least common multiple of the periods of 1/k and 1/k′.
  • For prime p, if
for some m, but
then for c ≥ 0 we have
  • If p is a proper prime ending in a 1, that is, if the repetend of 1/p is a cyclic number of length p − 1 and p = 10h + 1 for some h, then each digit 0, 1, ..., 9 appears in the repetend exactly hp − 1/10 times.

For some other properties of repetends, see also.[15]

Extension to other bases

[edit]

Various features of repeating decimals extend to the representation of numbers in all other integer bases, not just base 10:

  • Every real number can be represented as an integer part followed by a radix point (the generalization of a decimal point to non-decimal systems) followed by a finite or infinite number of digits.
  • If the base is an integer, a terminating sequence obviously represents a rational number.
  • A rational number has a terminating sequence if all the prime factors of the denominator of the fully reduced fractional form are also factors of the base. These numbers make up a dense set in Q and R.
  • If the positional numeral system is a standard one, that is it has base
combined with a consecutive set of digits
with r := |b|, dr := d1 + r − 1 and 0 ∈ D, then a terminating sequence is obviously equivalent to the same sequence with non-terminating repeating part consisting of the digit 0. If the base is positive, then there exists an order homomorphism from the lexicographical order of the right-sided infinite strings over the alphabet D into some closed interval of the reals, which maps the strings 0.A1A2...Andb and 0.A1A2...(An+1)d1 with AiD and Andb to the same real number – and there are no other duplicate images. In the decimal system, for example, there is 0.9 = 1.0 = 1; in the balanced ternary system there is 0.1 = 1.T = 1/2.
  • A rational number has an indefinitely repeating sequence of finite length l, if the reduced fraction's denominator contains a prime factor that is not a factor of the base. If q is the maximal factor of the reduced denominator which is coprime to the base, l is the smallest exponent such that q divides b − 1. It is the multiplicative order ordq(b) of the residue class b mod q which is a divisor of the Carmichael function λ(q) which in turn is smaller than q. The repeating sequence is preceded by a transient of finite length if the reduced fraction also shares a prime factor with the base. A repeating sequence
represents the fraction
  • An irrational number has a representation of infinite length that is not, from any point, an indefinitely repeating sequence of finite length.

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.

If b is an integer base and k 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.

Algorithm for positive bases

[edit]

For a rational 0 < p/q < 1 (and base bN>1) there is the following algorithm producing the repetend together with its length:

function b_adic(b,p,q) // b ≥ 2; 0 < p < q
  digits = "0123..."; // up to the digit with value b–1
begin
  s = "";  // the string of digits
  pos = 0; // all places are right to the radix point
  while not defined(occurs[p]) do
    occurs[p] = pos; // the position of the place with remainder p
    bp = b*p;
    z = floor(bp/q); // index z of digit within: 0 ≤ z ≤ b-1
    p = b*p  z*q;   // 0 ≤ p < q
    if p = 0 then L = 0;
      if not z = 0 then
        s = s . substring(digits, z, 1) 
      end if
      return (s);
    end if
    s = s . substring(digits, z, 1); // append the character of the digit
    pos += 1;
  end while
  L = pos - occurs[p]; // the length of the repetend (being < q)
  // mark the digits of the repetend by a vinculum:
  for i from occurs[p] to pos-1 do
    substring(s, i, 1) = overline(substring(s, i, 1));
  end for
  return (s);
end function

The first highlighted line calculates the digit z.

The subsequent line calculates the new remainder p′ of the division modulo the denominator q. As a consequence of the floor function floor we have

thus

and

Because all these remainders p are non-negative integers less than q, there can be only a finite number of them with the consequence that they must recur in the while loop. Such a recurrence is detected by the associative array occurs. The new digit z is formed in the yellow line, where p is the only non-constant. The length L of the repetend equals the number of the remainders (see also section Every rational number is either a terminating or repeating decimal).

Table of values

[edit]
  • 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

Thereby fraction is the unit fraction 1/n and 10 is the length of the (decimal) repetend.

The lengths 10(n) of the decimal repetends of 1/n, n = 1, 2, 3, ..., are:

0, 0, 1, 0, 0, 1, 6, 0, 1, 0, 2, 1, 6, 6, 1, 0, 16, 1, 18, 0, 6, 2, 22, 1, 0, 6, 3, 6, 28, 1, 15, 0, 2, 16, 6, 1, 3, 18, 6, 0, 5, 6, 21, 2, 1, 22, 46, 1, 42, 0, 16, 6, 13, 3, 2, 6, 18, 28, 58, 1, 60, 15, 6, 0, 6, 2, 33, 16, 22, 6, 35, 1, 8, 3, 1, 18, 6, 6, 13, 0, 9, 5, 41, 6, 16, 21, 28, 2, 44, 1, 6, 22, 15, 46, 18, 1, 96, 42, 2, 0... (sequence A051626 in the OEIS).

For comparison, the lengths 2(n) of the binary repetends of the fractions 1/n, n = 1, 2, 3, ..., are:

0, 0, 2, 0, 4, 2, 3, 0, 6, 4, 10, 2, 12, 3, 4, 0, 8, 6, 18, 4, 6, 10, 11, 2, 20, 12, 18, 3, 28, 4, 5, 0, 10, 8, 12, 6, 36, 18, 12, 4, 20, 6, 14, 10, 12, 11, ... (=A007733[n], if n not a power of 2 else =0).

The decimal repetends of 1/n, n = 1, 2, 3, ..., are:

0, 0, 3, 0, 0, 6, 142857, 0, 1, 0, 09, 3, 076923, 714285, 6, 0, 0588235294117647, 5, 052631578947368421, 0, 047619, 45, 0434782608695652173913, 6, 0, 384615, 037, 571428, 0344827586206896551724137931, 3, 032258064516129, 0, 03, 2941176470588235, 285714... (sequence A036275 in the OEIS).

The decimal repetend lengths of 1/p, p = 2, 3, 5, ... (nth prime), are:

0, 1, 0, 6, 2, 6, 16, 18, 22, 28, 15, 3, 5, 21, 46, 13, 58, 60, 33, 35, 8, 13, 41, 44, 96, 4, 34, 53, 108, 112, 42, 130, 8, 46, 148, 75, 78, 81, 166, 43, 178, 180, 95, 192, 98, 99, 30, 222, 113, 228, 232, 7, 30, 50, 256, 262, 268, 5, 69, 28, 141, 146, 153, 155, 312, 79... (sequence A002371 in the OEIS).

The least primes p for which 1/p has decimal repetend length n, n = 1, 2, 3, ..., are:

3, 11, 37, 101, 41, 7, 239, 73, 333667, 9091, 21649, 9901, 53, 909091, 31, 17, 2071723, 19, 1111111111111111111, 3541, 43, 23, 11111111111111111111111, 99990001, 21401, 859, 757, 29, 3191, 211, 2791, 353, 67, 103, 71, 999999000001, 2028119, 909090909090909091, 900900900900990990990991, 1676321, 83, 127, 173... (sequence A007138 in the OEIS).

The least primes p for which k/p has n different cycles (1 ≤ kp−1), n = 1, 2, 3, ..., are:

7, 3, 103, 53, 11, 79, 211, 41, 73, 281, 353, 37, 2393, 449, 3061, 1889, 137, 2467, 16189, 641, 3109, 4973, 11087, 1321, 101, 7151, 7669, 757, 38629, 1231, 49663, 12289, 859, 239, 27581, 9613, 18131, 13757, 33931... (sequence A054471 in the OEIS).

See also

[edit]

Notes

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
A repeating decimal, also known as a recurring decimal, is a of a in which one or more digits after the decimal point repeat indefinitely in a periodic pattern. These patterns can be purely repeating, starting immediately after the decimal point (e.g., 13=0.3\frac{1}{3} = 0.\overline{3}), or eventually repeating, with a non-repeating prefix followed by the cycle (e.g., 16=0.16\frac{1}{6} = 0.1\overline{6}). The repeating sequence is termed the repetend, and the length of this sequence is called the period. Repeating decimals are intrinsically linked to rational numbers, as every fraction with a denominator whose prime factors include numbers other than 2 or 5 (in lowest terms) produces a non-terminating repeating decimal expansion. Conversely, a foundational result in real number theory states that a is rational if and only if its decimal expansion is either terminating (which can be viewed as repeating zeros) or eventually periodic. This periodicity arises from the algorithm for fractions, where remainders cycle after a finite number of steps, bounded by the denominator. For instance, the period of 17=0.142857\frac{1}{7} = 0.\overline{142857} is 6, reflecting the order of 10 modulo 7 in the multiplicative group. The concept of repeating decimals emerged with the development of decimal notation in the late 16th century, primarily through the work of Flemish mathematician , who in his 1585 treatise De Thiende (The Tenth) systematically introduced decimal fractions. Stevin's innovations facilitated practical applications in commerce and engineering, building on earlier fragmentary uses of decimals in and , but his efforts standardized their representation in . By the 18th century, the equivalence between repeating decimals and rationals was more rigorously established, confirming that irrational numbers have non-repeating decimal expansions. Today, repeating decimals underpin topics in , such as the study of decimal periods and their connections to cyclotomic polynomials.

Fundamentals

Notation

A repeating decimal is a decimal representation in which a sequence of one or more digits repeats indefinitely after an optional initial non-repeating part. Repeating decimals are categorized as pure repeating, where the repeating sequence begins immediately after the decimal point (such as 0.3=0.3330.\overline{3} = 0.333\ldots), or mixed repeating (also called eventually repeating), which features a finite non-repeating prefix followed by the repeating portion (such as 0.16=0.16660.1\overline{6} = 0.1666\ldots). The conventional notation employs a vinculum, or overbar, placed above the repeating digits to indicate the repetend, the block that cycles. For instance, 0.12=0.1212120.\overline{12} = 0.121212\ldots denotes the sequence "12" repeating from the start, while the overbar in mixed cases applies only to the cycling part. Alternative conventions include dots positioned above the first and last digits of the repetend, as in 0.1˙2˙=0.1212120.\dot{1}\dot{2} = 0.121212\ldots for the two-digit repetend "12", or parentheses enclosing the sequence for clarity, such as 0.(3)=0.3330.(3) = 0.333\ldots. The vinculum notation traces its origins to 16th-century European mathematicians, with Simon Stevin employing horizontal lines over or under digit groups in decimal fractions in his 1585 treatise De Thiende to signify aggregation and structure in expansions. This practice evolved into the modern overbar for marking repetition in decimals by the .

Decimal Expansion and Recurrence

The decimal expansion of a pq\frac{p}{q}, where pp and qq are with q0q \neq 0, is generated by performing of pp by qq in base 10. This process begins after any integer part by multiplying the current by 10 and dividing by qq to produce successive decimal digits, along with a new between 0 and q1q-1. A repeating decimal arises when, during , a repeats a value encountered earlier in the process, causing the sequence of digits to cycle indefinitely from that point onward. Since there are only finitely many possible (at most qq), repetition is inevitable unless the reaches zero, which would terminate the expansion. The repeating cycle, or repetend, corresponds to the digits produced between the repeated . For instance, consider the expansion of 13\frac{1}{3}. Dividing 1 by 3 yields an initial of 0 and 1. Multiplying the remainder by 10 gives 10, which divides by 3 to produce digit 3 and 1 again. This loop generates 0.3330.333\ldots, or 0.30.\overline{3}, where the single digit 3 repeats due to the persistent . Repetition occurs in the expansion of pq\frac{p}{q} (in lowest terms) whenever qq has prime factors other than 2 and 5, as these additional factors prevent the remainders from resolving to zero and instead create a finite cycle of nonzero remainders. If qq factors solely into powers of 2 and/or 5 after simplifying, the expansion terminates. In cases with mixed factors, a non-repeating prefix precedes the cycle, with its length equal to the maximum of the exponents of 2 and 5 in the prime of qq. For example, in 16=12×3=0.16\frac{1}{6} = \frac{1}{2 \times 3} = 0.1\overline{6}, the exponent of 2 is 1 (higher than that of 5, which is 0), yielding a non-repeating digit "1" before the repeating "6".

Rationality and Proofs

Terminating and Repeating Decimals as

A fundamental result in is that every terminating decimal and every repeating decimal represents a , expressible as the ratio p/qp/q where pp and qq are with q0q \neq 0. Terminating decimals, which end after a finite number of digits, can be rewritten as fractions with a denominator that is a , such as 10k10^k for some positive kk. Since 10k=2k5k10^k = 2^k \cdot 5^k, this denominator factors only into primes 2 and 5, allowing reduction to a simple rational form. For example, 0.5=5/10=1/20.5 = 5/10 = 1/2, and 0.25=25/100=1/40.25 = 25/100 = 1/4. Repeating decimals, denoted with a bar over the repeating sequence (e.g., 0.30.\overline{3}), can be expressed as an infinite that sums to a . Consider 0.3=0.3+0.03+0.003+0.\overline{3} = 0.3 + 0.03 + 0.003 + \cdots, a with first term a=0.3a = 0.3 and common ratio r=0.1r = 0.1. The sum is a/(1r)=0.3/(10.1)=0.3/0.9=1/3a / (1 - r) = 0.3 / (1 - 0.1) = 0.3 / 0.9 = 1/3. Similarly, 0.27=0.27+0.0027+0.000027+=27/99=3/110.\overline{27} = 0.27 + 0.0027 + 0.000027 + \cdots = 27/99 = 3/11. In contrast, irrational numbers like π3.14159\pi \approx 3.14159\ldots have decimal expansions that are non-terminating and non-repeating, distinguishing them from .

Rationals as Terminating or Repeating Decimals

Every possesses a decimal expansion that is either terminating (finite) or eventually repeating (periodic). This fundamental property distinguishes from , whose expansions neither terminate nor repeat. Consider a rational number expressed as pq\frac{p}{q} in lowest terms, where pp and qq are integers with q>0q > 0 and gcd(p,q)=1\gcd(p, q) = 1. The decimal expansion terminates the prime factors of qq are solely 2 and/or 5. In such cases, qq divides some (since 10k=2k5k10^k = 2^k \cdot 5^k), allowing the fraction to be rewritten with a denominator that is a , resulting in a finite number of decimal places. Otherwise, if qq has any prime factor other than 2 or 5, the expansion is non-terminating but eventually repeating, with the length of the repeating cycle (repetend) dividing the multiplicative order of 10 the part of qq coprime to 10. This behavior arises naturally from the algorithm used to compute the decimal expansion. In dividing pp by qq, each step produces a digit and a rkr_k satisfying 0rk<q0 \leq r_k < q. If a remainder of zero occurs, the division terminates. Otherwise, the remainders form an infinite sequence taking values in the finite set {1, 2, \dots, q-1}. By the pigeonhole principle, after at most qq steps, at least two remainders must coincide, say rj=rkr_j = r_k with j<kj < k. The digits produced between these steps then repeat indefinitely, yielding a periodic expansion starting from the jj-th decimal place. For illustration, the fraction 12=0.5\frac{1}{2} = 0.5 terminates, as 2 is a factor of 10. In contrast, 13=0.3\frac{1}{3} = 0.\overline{3} repeats with period 1, since 3 is coprime to 10. A mixed case is 16=0.16\frac{1}{6} = 0.1\overline{6}, where the non-repeating prefix arises from the factor of 2 in 6, followed by repetition due to the factor of 3. Notably, certain rational numbers admit two distinct decimal representations. Terminating decimals can be expressed either with trailing zeros or with trailing nines. For example, 12=0.5000=0.4999\frac{1}{2} = 0.5000\dots = 0.4999\dots, where the equivalence holds because the infinite series 0.4999=0.4+0.09+0.009+=410+9100+91000+=410+990=120.4999\dots = 0.4 + 0.09 + 0.009 + \dots = \frac{4}{10} + \frac{9}{100} + \frac{9}{1000} + \dots = \frac{4}{10} + \frac{9}{90} = \frac{1}{2}. This non-uniqueness applies precisely to rationals that terminate in one representation.

Formal Proofs

To prove that every repeating decimal represents a rational number, consider a general repeating decimal r=q.d1d2dkdk+1dnr = q.d_1 d_2 \dots d_k \overline{d_{k+1} \dots d_n}, where qq is the integer part, the first kk digits after the decimal are non-repeating, and the block dk+1dnd_{k+1} \dots d_n repeats with period nkn - k. Multiplying by 10k10^k shifts the decimal point past the non-repeating part:
10kr=(10kq+d110k1++dk).dk+1dn.10^k r = (10^k q + d_1 10^{k-1} + \dots + d_k) . \overline{d_{k+1} \dots d_n}.
Multiplying by 10n10^n shifts past the non-repeating part and one full period:
10nr=(10nq+d110n1++dn).dk+1dn.10^n r = (10^n q + d_1 10^{n-1} + \dots + d_n) . \overline{d_{k+1} \dots d_n}.
Subtracting these equations aligns the repeating parts:
10nr10kr=(10nq+d110n1++dn)(10kq+d110k1++dk),10^n r - 10^k r = (10^n q + d_1 10^{n-1} + \dots + d_n) - (10^k q + d_1 10^{k-1} + \dots + d_k),
where the right side is an integer, say mm. Thus,
r(10n10k)=m,r (10^n - 10^k) = m,
so
r=m10n10k=m10k(10nk1),r = \frac{m}{10^n - 10^k} = \frac{m}{10^k (10^{n-k} - 1)},
which is a ratio of integers, proving rr is rational.
For a pure repeating decimal with no non-repeating part (k=0k = 0), such as r=0.d1dkr = 0.\overline{d_1 \dots d_k}, the formula simplifies. Let ss be the integer formed by the digits d1dkd_1 \dots d_k. Then
r=s10k1,r = \frac{s}{10^k - 1},
as derived by multiplying rr by 10k10^k and subtracting:
10krr=s,10^k r - r = s,
yielding r(10k1)=sr (10^k - 1) = s. This expresses rr as a rational with denominator 9999999\dots 9 (kk nines).
Conversely, every rational number has a decimal expansion that is either terminating or eventually repeating. Consider a rational ab\frac{a}{b} in lowest terms, with a,ba, b integers and b>0b > 0. Performing of aa by bb generates a sequence of remainders r1,r2,r_1, r_2, \dots, each satisfying 0ri<b0 \leq r_i < b. Since there are only bb possible remainders (0 through b1b-1), by the pigeonhole principle, either some remainder is 0 (causing termination) or two remainders repeat, say ri=rjr_i = r_j with i<ji < j. In the latter case, the digits from position ii onward repeat with period jij - i, making the expansion eventually periodic. For mixed repeating decimals, the length of the non-repeating part equals the maximum of the exponents of 2 and 5 in the prime factorization of bb. Write b=2m5nqb = 2^m 5^n q, where q>1q > 1 is coprime to 10 (i.e., has no factors of 2 or 5). The decimal terminates if q=1q = 1 (after max(m,n)\max(m, n) digits); otherwise, it has a non-repeating prefix of length max(m,n)\max(m, n) followed by a repeating part determined by qq. To see this, multiply numerator and denominator by 5max(m,n)m2max(m,n)n5^{\max(m,n) - m} 2^{\max(m,n) - n} to make the denominator 10max(m,n)q10^{\max(m,n)} q, yielding a terminating part from the powers of 10 and a repeating part from dividing by qq (which, by the pigeonhole argument, cycles after at most q1q-1 steps). Terminating decimals admit a : one ending in infinite 0s and an equivalent one ending in infinite 9s. For example, consider 1=1.000=0.9991 = 1.000\dots = 0.999\dots. To prove 0.999=10.999\dots = 1, let x=0.999x = 0.999\dots. Then 10x=9.99910x = 9.999\dots, so 10xx=9.9990.999=910x - x = 9.999\dots - 0.999\dots = 9, yielding 9x=99x = 9 and x=1x = 1. Alternatively, as an infinite , 0.999=k=1910k=91011101=91/109/10=10.999\dots = \sum_{k=1}^\infty 9 \cdot 10^{-k} = 9 \cdot \frac{10^{-1}}{1 - 10^{-1}} = 9 \cdot \frac{1/10}{9/10} = 1. This duality arises because the series converges to the same limit, and in the real numbers, these representations are identical.

Common Examples

Table of Values

The following table summarizes the decimal expansions of fractions 1/n1/n for n=1n = 1 to 2020, showcasing terminating decimals, purely repeating decimals, and eventually repeating (mixed) forms. These expansions are standard representations derived from processes.
nnDecimal Expansion of 1/n1/n
11.01.0
20.50.5
30.30.\overline{3}
40.250.25
50.20.2
60.160.1\overline{6}
70.1428570.\overline{142857}
80.1250.125
90.10.\overline{1}
100.10.1
110.090.\overline{09}
120.0830.08\overline{3}
130.0769230.\overline{076923}
140.07142850.0\overline{714285}
150.060.0\overline{6}
160.06250.0625
170.05882352941176470.\overline{0588235294117647}
180.050.0\overline{5}
190.0526315789473684210.\overline{052631578947368421}
200.050.05
This table illustrates key patterns in repeating decimals, including short periods for small prime denominators like period 1 for 1/31/3 and 1/91/9, and longer periods for larger primes such as the full 6-digit cycle in 1/71/7. Terminating expansions appear when the denominator factors into powers of 2 and/or 5, as seen in entries for n=2,4,5,8,10,16,20n=2,4,5,8,10,16,20. The examples in this table exemplify the earlier theorems on rational numbers, confirming that every yields either a terminating or a repeating decimal expansion in base 10.

Reciprocals of Primes

For prime numbers p>5p > 5, the reciprocal 1/p1/p produces a pure expansion in base 10, meaning the repetition begins immediately after the decimal point with no non-repeating digits. The length of this repeating block, known as the repetend or period, is given by the multiplicative order of 10 pp, denoted ordp(10)\operatorname{ord}_p(10), which is the smallest positive kk such that 10k1(modp)10^k \equiv 1 \pmod{p}. This order exists because pp is coprime to 10, ensuring 10 is invertible pp. By , since gcd(10,p)=1\gcd(10, p) = 1, the order ordp(10)\operatorname{ord}_p(10) divides ϕ(p)=p1\phi(p) = p-1, where ϕ\phi is . Thus, the period of 1/p1/p is a of p1p-1. When the order equals p1p-1, the period achieves its maximum length, and pp is called a ; in such cases, the repetend forms a , an integer whose digits, when multiplied by integers from 1 to p1p-1, yield cyclic permutations of the original digits. A classic example is p=7p = 7, where ord7(10)=6=71\operatorname{ord}_7(10) = 6 = 7-1, so 1/7=0.1428571/7 = 0.\overline{142857}. The repetend 142857 is a : multiplying by 2 gives 2/7=0.2857142/7 = 0.\overline{285714}, by 3 gives 3/7=0.4285713/7 = 0.\overline{428571}, and so on up to 6/7=0.8571426/7 = 0.\overline{857142}, each a of the same digits. For primes with shorter periods, such as p=11p = 11 where ord11(10)=2\operatorname{ord}_{11}(10) = 2 (dividing 10), 1/11=0.091/11 = 0.\overline{09}. Similarly, for p=13p = 13 with ord13(10)=6\operatorname{ord}_{13}(10) = 6 (dividing 12), 1/13=0.0769231/13 = 0.\overline{076923}. These properties highlight the connection between decimal expansions and the structure of the multiplicative group modulo pp.

Reciprocals of Composites Coprime to 10

When the denominator nn of the reciprocal 1/n1/n is a composite integer coprime to 10, the length of the repeating decimal period, known as the repetend length, is the multiplicative order of 10 modulo nn, which is the smallest positive integer kk such that 10k1(modn)10^k \equiv 1 \pmod{n}. This order equals the least common multiple (LCM) of the orders of 10 modulo each prime power pkp^k in the prime factorization of nn, due to the Chinese Remainder Theorem decomposing the multiplicative group modulo nn into a direct product of groups modulo the prime powers. For odd primes p5p \neq 5, the order modulo pkp^k is a multiple of the order modulo pp, and equals it in some cases but can be larger in others, so the period of 1/n1/n is the LCM of the orders modulo its prime power factors. Building on the periods for prime denominators, compositeness allows the overall period to be computed via LCM, which can either shorten the effective period relative to the size of nn (if factors share common period divisors) or extend it beyond individual prime periods (if the prime periods are whose LCM is their product). For instance, the period of 1/9=1/32=0.11/9 = 1/3^2 = 0.\overline{1} is 1, matching the period of 1/31/3. Another example is 1/21=1/(3×7)=0.0476191/21 = 1/(3 \times 7) = 0.\overline{047619}, where the period is LCM(1,6)=6\operatorname{LCM}(1, 6) = 6, combining the period of 1 (from 1/31/3) and 6 (from 1/71/7). Similarly, for 1/77=1/(7×11)=0.0129871/77 = 1/(7 \times 11) = 0.\overline{012987}, the period is LCM(6,2)=6\operatorname{LCM}(6, 2) = 6, using the periods from 1/71/7 and 1/11=0.091/11 = 0.\overline{09}. In some cases, the repeating block may include leading zeros within the repetend, giving the appearance of a non-full period, though the decimal is purely periodic since gcd(n,10)=1\gcd(n, 10) = 1. For example, 1/33=1/(3×11)=0.031/33 = 1/(3 \times 11) = 0.\overline{03}, with period LCM(1,2)=2\operatorname{LCM}(1, 2) = 2, but the block "03" starts with a zero after the decimal point. This compositeness effect highlights how the LCM mechanism can produce periods that are multiples of prime factors' periods, often resulting in longer cycles for products of primes with distinct period lengths compared to the primes alone, while keeping the maximum possible period bounded by the Carmichael function λ(n)\lambda(n).

Conversion Techniques

Repeating Decimals to Fractions

One common algebraic technique to convert a repeating decimal to its exact fractional equivalent involves setting up an with a variable representing the decimal and using by powers of 10 to align the repeating portions for . For a purely repeating decimal of the form x=0.a1a2akx = 0.\overline{a_1 a_2 \dots a_k}, where the block a1a2aka_1 a_2 \dots a_k of length kk repeats indefinitely, multiply xx by 10k10^k to shift the decimal point by kk places. This yields 10kx=a1a2ak.a1a2ak10^k x = a_1 a_2 \dots a_k . \overline{a_1 a_2 \dots a_k}. Subtract the original equation: 10kxx=a1a2ak.a1a2ak0.a1a2ak10^k x - x = a_1 a_2 \dots a_k . \overline{a_1 a_2 \dots a_k} - 0.\overline{a_1 a_2 \dots a_k}, simplifying to (10k1)x=a1a2ak(10^k - 1) x = a_1 a_2 \dots a_k, where the right side is the integer formed by the repeating block. Solving for xx gives x=a1a2ak10k1x = \frac{a_1 a_2 \dots a_k}{10^k - 1}, or equivalently, the repeating block as the numerator over a denominator of kk (999...9). For example, consider x=0.3x = 0.\overline{3}, where k=1k = 1 and the block is 3. Then 10x=3.310x = 3.\overline{3}, so 10xx=3.30.310x - x = 3.\overline{3} - 0.\overline{3}, yielding 9x=39x = 3 and x=39=13x = \frac{3}{9} = \frac{1}{3}. Using the shortcut, this is directly 39\frac{3}{9}. For a mixed repeating decimal x=0.b1b2bma1a2akx = 0.b_1 b_2 \dots b_m \overline{a_1 a_2 \dots a_k}, with mm non-repeating digits followed by a repeating block of length kk, first multiply by 10m10^m to shift past the non-repeating part: 10mx=b1bm.a1a2ak10^m x = b_1 \dots b_m . \overline{a_1 a_2 \dots a_k}. Then multiply by 10m+k10^{m+k} to also shift the repeating block: 10m+kx=b1bma1ak.a1a2ak10^{m+k} x = b_1 \dots b_m a_1 \dots a_k . \overline{a_1 a_2 \dots a_k}. Subtract the first shifted equation from this: 10m+kx10mx=(b1bma1ak.a1a2ak)(b1bm.a1a2ak)10^{m+k} x - 10^m x = (b_1 \dots b_m a_1 \dots a_k . \overline{a_1 a_2 \dots a_k}) - (b_1 \dots b_m . \overline{a_1 a_2 \dots a_k}), which simplifies to (10m+k10m)x=b1bma1akb1bm(10^{m+k} - 10^m) x = b_1 \dots b_m a_1 \dots a_k - b_1 \dots b_m, an on the right. Solving for xx provides the , which should then be simplified. As an illustration, take x=0.16x = 0.1\overline{6}, with m=1m=1 (digit 1) and k=1k=1 (repeating 6). Then 10x=1.610x = 1.\overline{6} and 100x=16.6100x = 16.\overline{6}, so 100x10x=16.61.6100x - 10x = 16.\overline{6} - 1.\overline{6}, giving 90x=1590x = 15 and x=1590=16x = \frac{15}{90} = \frac{1}{6}. A shortcut for pure repeats treats the entire repeating block as a single numerator unit over the corresponding string of nines; for instance, 0.abc0.\overline{abc} (block abc of length 3) equals abc999\frac{abc}{999}, where abc is the three-digit . This approach leverages the fact that 1999=0.001\frac{1}{999} = 0.\overline{001}, scaling the numerator accordingly for longer or varied blocks.

Infinite Series Representation

A repeating decimal with a single-digit repetend, such as 0.d0.\overline{d} where dd is a digit from 1 to 9, can be expressed as the infinite n=1d10n\sum_{n=1}^{\infty} \frac{d}{10^n}. This series has first term a=d10a = \frac{d}{10} and common ratio r=110r = \frac{1}{10}, so its sum is d/1011/10=d9\frac{d/10}{1 - 1/10} = \frac{d}{9}. For a pure repeating decimal with repetend period k1k \geq 1, denoted 0.a1a2ak0.\overline{a_1 a_2 \dots a_k}, let NN be the kk-digit integer formed by a1a2aka_1 a_2 \dots a_k. This decimal equals Nn=1110kn=N1/10k11/10k=N10k1N \sum_{n=1}^{\infty} \frac{1}{10^{kn}} = N \cdot \frac{1/10^k}{1 - 1/10^k} = \frac{N}{10^k - 1}. For example, 0.142=142n=111000n=1429990.\overline{142} = 142 \sum_{n=1}^{\infty} \frac{1}{1000^n} = \frac{142}{999}. A mixed repeating decimal, such as 0.b1b2bma1a2ak0.b_1 b_2 \dots b_m \overline{a_1 a_2 \dots a_k} with m1m \geq 1 non-repeating digits, consists of a finite sum for the non-repeating part plus a geometric series for the repeating part shifted by mm places. The non-repeating portion sums to i=1mbi10i\sum_{i=1}^{m} \frac{b_i}{10^i}, and the repeating portion is (j=1kaj10m+j)n=0110kn=r111/10k\left( \sum_{j=1}^{k} \frac{a_j}{10^{m+j}} \right) \sum_{n=0}^{\infty} \frac{1}{10^{kn}} = r \cdot \frac{1}{1 - 1/10^k}, where r=j=1kaj10m+jr = \sum_{j=1}^{k} \frac{a_j}{10^{m+j}} is the value of the repeating block starting after the non-repeating digits. For instance, 0.16=0.1+0.06=110+690=160.1\overline{6} = 0.1 + 0.0\overline{6} = \frac{1}{10} + \frac{6}{90} = \frac{1}{6}. In base 10, these series converge because the common ratio satisfies r=10k<1|r| = 10^{-k} < 1 for any finite k1k \geq 1, ensuring the partial sums approach a finite limit.

Advanced Properties

Repetend Lengths and Cyclic Numbers

The repetend length, or period, of the decimal expansion of a fraction 1/n1/n in lowest terms is the smallest positive integer kk such that the sequence of digits repeats every kk places after any initial non-repeating digits. To determine this length, first factor n=2a5bmn = 2^a 5^b m where mm is coprime to 10; the non-repeating part has length max(a,b)\max(a, b), and the repetend length is the multiplicative order of 10 modulo mm, defined as the minimal k>0k > 0 satisfying 10k1(modm)10^k \equiv 1 \pmod{m}. This period kk always divides Euler's totient function ϕ(m)\phi(m), providing an upper bound on possible lengths, though the actual value is the smallest such divisor where the congruence holds. For prime denominators pp coprime to 10, the period divides p1p-1, and maximal periods occur when k=p1k = p-1, corresponding to primes where 10 is a primitive root modulo pp. These are known as full reptend primes, with examples including 7 (period 6), 17 (period 16), and 19 (period 18). Cyclic numbers arise in the context of full reptend primes, where the repetend of 1/p1/p forms an (p1)(p-1)-digit whose multiples by 1 through p1p-1 yield cyclic permutations of its digits. The most famous example is the repetend 142857 from 1/7=0.1428571/7 = 0.\overline{142857}, where 142857×1=142857142857 \times 1 = 142857, 142857×2=285714142857 \times 2 = 285714, 142857×3=428571142857 \times 3 = 428571, 142857×4=571428142857 \times 4 = 571428, 142857×5=714285142857 \times 5 = 714285, and 142857×6=857142142857 \times 6 = 857142, each a of the original digits. Such numbers are generated solely by full reptend primes and exhibit this rotational property due to the maximal order of 10 modulo pp.

Multiplication and Cyclic Permutations

One prominent illustration of cyclic permutations in repeating decimals arises with the fraction 17=0.142857\frac{1}{7} = 0.\overline{142857}, where the six-digit repetend cycles through permutations upon multiplication by integers from 1 to 6. Specifically, 27=0.285714\frac{2}{7} = 0.\overline{285714}, 37=0.428571\frac{3}{7} = 0.\overline{428571}, 47=0.571428\frac{4}{7} = 0.\overline{571428}, 57=0.714285\frac{5}{7} = 0.\overline{714285}, and 67=0.857142\frac{6}{7} = 0.\overline{857142}, each representing a rotation of the original sequence. In full-period fractions 1p\frac{1}{p}, where pp is a prime and the repetend length equals p1p-1 (indicating that 10 is a primitive root modulo pp), multiplication by an integer mm with 1m<p1 \leq m < p yields a decimal expansion that is a cyclic shift of the original repetend. The shift position is determined by the discrete logarithm of mm base 10 modulo pp, reflecting the multiplicative order in the cyclic group generated by 10 modulo pp. A longer example is 117=0.0588235294117647\frac{1}{17} = 0.\overline{0588235294117647}, featuring a 16-digit repetend that rotates under multiplication by 1 through 16. For instance, 217=0.1176470588235294\frac{2}{17} = 0.\overline{1176470588235294} and 1617=0.9411764705882352\frac{16}{17} = 0.\overline{9411764705882352}, both preserving the digit sequence through cyclic permutation. This cyclic behavior enables efficient verification of expansions for such multiples, as one can confirm correctness by checking the rotation against the base repetend rather than recomputing via long division, and it aids in generating fractions' decimals for educational or computational purposes.

Reciprocals Not Coprime to 10

When the denominator nn of a reciprocal 1/n1/n shares prime factors with 10 (i.e., gcd(n,10)>1\gcd(n, 10) > 1), the decimal expansion either terminates or consists of a non-repeating prefix followed by a repeating sequence, depending on whether nn has prime factors other than 2 and 5. If nn is of the form 2a5b2^a 5^b with a,b0a, b \geq 0, the expansion terminates after max(a,b)\max(a, b) decimal places, as the denominator divides some power of 10. For instance, 1/4=1/22=0.251/4 = 1/2^2 = 0.25 (two places), and 1/5=0.21/5 = 0.2 (one place). If n=2a5bmn = 2^a 5^b m where m>1m > 1 is coprime to 10, the expansion has a non-repeating prefix of max(a,b)\max(a, b), followed by a repeating part determined by the factors in mm. The prefix arises because multiplying the numerator by 10max(a,b)10^{\max(a,b)} clears the factors of 2 and 5, leaving division by mm to produce the repeating after that point. For example, 1/12=1/(223)=0.0831/12 = 1/(2^2 \cdot 3) = 0.08\overline{3} (prefix "08" of 2), 1/15=1/(35)=0.061/15 = 1/(3 \cdot 5) = 0.0\overline{6} (prefix "0" of 1), and 1/20=1/(225)=0.051/20 = 1/(2^2 \cdot 5) = 0.05 (terminating after 2 places). To compute such expansions, first factor out the powers of 2 and 5 from nn to isolate the coprime remainder mm, then determine the repeating decimal for 1/m1/m (which is purely repeating, unlike the mixed form here) and scale it by the appropriate power of 1/101/10 corresponding to max(a,b)\max(a, b).

Generalizations

Properties in Other Bases

In an integer base b2b \geq 2, the positional expansion of a rational number r/sr/s in lowest terms, where 0<r<s0 < r < s, is terminating if and only if every prime factor of ss divides bb, meaning ss divides some power bkb^k. Otherwise, the expansion is eventually periodic, with a non-repeating prefix whose length equals the maximum exponent of primes dividing bb in the factorization of ss, followed by a repeating cycle whose minimal period is the multiplicative order of bb modulo ss', where ss' is the largest divisor of ss coprime to bb. If gcd(b,s)=1\gcd(b, s) = 1, then s=ss' = s and the expansion is purely periodic from the first fractional digit, with period equal to the order of bb modulo ss. For example, in base b=2b = 2, the fraction 1/31/3 has gcd(2,3)=1\gcd(2, 3) = 1, so its expansion is purely periodic with period equal to the order of 2 modulo 3, which is 2 since 212(mod3)2^1 \equiv 2 \pmod{3} and 221(mod3)2^2 \equiv 1 \pmod{3}; thus, 1/3=0.0121/3 = 0.\overline{01}_2. In base b=3b = 3, the fraction 1/21/2 also satisfies gcd(3,2)=1\gcd(3, 2) = 1, yielding a purely periodic expansion with period equal to the order of 3 modulo 2, which is 1 since 31(mod2)3 \equiv 1 \pmod{2}; hence, 1/2=0.131/2 = 0.\overline{1}_3. For a mixed case, consider 1/61/6 in base b=10b = 10: here s=6=23s = 6 = 2 \cdot 3, s=3s' = 3, and the order of 10 modulo 3 is 1 (since 101(mod3)10 \equiv 1 \pmod{3}), producing a non-repeating prefix of length 1 (from the factor of 2) followed by a repeating digit: 1/6=0.16101/6 = 0.1\overline{6}_{10}. The cyclic properties observed in base-10 repeating decimals extend to other bases. For a prime denominator pp coprime to bb, the expansion of 1/p1/p is purely periodic with period dividing p1p-1, and it achieves a full reptend of length exactly p1p-1 if the order of bb modulo pp equals p1p-1, meaning bb is a primitive root modulo pp. Such full reptends generate cyclic numbers analogous to 142857 for 1/71/7 in base 10, but now in bases coprime to pp. A key difference from base-10 expansions arises in the criteria for terminating representations: in base bb, termination depends solely on whether the denominator's primes divide bb, without the specific asymmetry between 2 and 5 that occurs because 10 factors as 2×52 \times 5. For instance, in base b=6=2×3b = 6 = 2 \times 3, fractions with denominators powers of 2 or 3 terminate, while those involving other primes repeat, unifying the treatment of base factors.

Algorithm for Arbitrary Bases

The algorithm for computing the repeating expansion of a fraction pq\frac{p}{q} (with 0<p<q0 < p < q and gcd(p,q)=1\gcd(p, q) = 1) in an arbitrary base b>1b > 1 adapts the classical long division process to generate digits sequentially. Begin with the initial remainder r0=pr_0 = p. For each subsequent digit position k=1,2,k = 1, 2, \dots, compute rk1×b=dk×q+rkr_{k-1} \times b = d_k \times q + r_k, where dkd_k (the kk-th digit) is the unique integer satisfying 0dk<b0 \leq d_k < b and 0rk<q0 \leq r_k < q. The digit dk=rk1×bqd_k = \left\lfloor \frac{r_{k-1} \times b}{q} \right\rfloor, and the new remainder is rk=(rk1×b)modqr_k = (r_{k-1} \times b) \mod q. This process continues indefinitely unless rk=0r_k = 0, in which case the expansion terminates. To detect repeating cycles, maintain a record of all seen remainders and their corresponding starting positions. A repetition occurs when a remainder rkr_k matches a previous remainder rjr_j (with j<kj < k); the cycle then begins at position j+1j+1 and has length kjk - j. If the denominator qq shares prime factors with bb, the expansion may have a non-repeating prefix (preperiod) followed by a repeating part. The preperiod length is the maximum exponent of the primes dividing bb that also divide qq, after which the remainders enter the coprime portion and begin cycling. The following pseudocode outlines the process for the fractional expansion of 1q\frac{1}{q} in base bb, assuming gcd(1,q)=1\gcd(1, q) = 1:

function repeating_expansion(b, q): remainders = {} # map remainder to position digits = [] remainder = 1 position = 0 while remainder != 0 and remainder not in remainders: remainders[remainder] = position remainder *= b digit = remainder // q digits.append(digit) remainder %= q position += 1 if remainder == 0: return "0." + "".join(map(str, digits)) + " (terminating)" else: start = remainders[remainder] non_repeating = "".join(map(str, digits[:start])) repeating = "".join(map(str, digits[start:])) return "0." + non_repeating + "\overline{" + repeating + "}_" + str(b)

function repeating_expansion(b, q): remainders = {} # map remainder to position digits = [] remainder = 1 position = 0 while remainder != 0 and remainder not in remainders: remainders[remainder] = position remainder *= b digit = remainder // q digits.append(digit) remainder %= q position += 1 if remainder == 0: return "0." + "".join(map(str, digits)) + " (terminating)" else: start = remainders[remainder] non_repeating = "".join(map(str, digits[:start])) repeating = "".join(map(str, digits[start:])) return "0." + non_repeating + "\overline{" + repeating + "}_" + str(b)

This implementation handles both terminating and repeating cases, with subscripts indicating the base for digits greater than 9 (though examples below use small bases). For a terminating example, consider 12\frac{1}{2} in base 4 (where 2 divides 4). Starting with remainder 1: 1×4=41 \times 4 = 4, 4/2=24 / 2 = 2 (digit 2), remainder 4mod2=04 \mod 2 = 0. The expansion is 0.240.2_4, which equals 2/4=1/22/4 = 1/2 in . For a purely repeating example, 12\frac{1}{2} in base 3 (coprime): remainder 1, 1×3=31 \times 3 = 3, 3/2=13 / 2 = 1 (digit 1), remainder 1. The remainder repeats immediately, yielding 0.13=131=120.\overline{1}_3 = \frac{1}{3-1} = \frac{1}{2}. For a mixed case, consider 110\frac{1}{10} in base 6 (10 = 2 × 5, sharing factor 2 with 6 = 2 × 3). Remainder 1, 1×6=61 \times 6 = 6, 6/10=06 / 10 = 0 (digit 0), remainder 6. Next, 6×6=366 \times 6 = 36, 36/10=336 / 10 = 3 (digit 3), remainder 6. The remainder repeats, so the expansion is 0.0360.0\overline{3}_6, with preperiod "0" and cycle "3". This equals 0/6+3/62/(11/6)=3/36×6/5=1/100/6 + 3/6^2 / (1 - 1/6) = 3/36 \times 6/5 = 1/10. A longer repeating example is 17\frac{1}{7} in base 3 (coprime). The remainders cycle through 1 → 3 → 2 → 6 → 4 → 5 → 1 after six steps, producing digits 0,1,0,2,1,2. Thus, 0.0102123=035+134+033+232+13+2361=1041072810=170.\overline{010212}_3 = \frac{0 \cdot 3^5 + 1 \cdot 3^4 + 0 \cdot 3^3 + 2 \cdot 3^2 + 1 \cdot 3 + 2}{3^6 - 1} = \frac{104_{10}}{728_{10}} = \frac{1}{7}.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.