Repeating decimal

From testwiki
Jump to navigation Jump to search

Template:Short description Template:Redirect-distinguish Template:Multiple issues 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 Template:Sfrac becomes periodic just after the decimal point, repeating the single digit "3" forever, i.e. 0.333.... A more complicated example is Template:Sfrac, 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 Template:Sfrac, which becomes periodic after the decimal point, repeating the 13-digit pattern "1886792452830" forever, i.e. 11.18867924528301886792452830....

Template:Anchor 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. Template:Nowrap); it may also be written as a ratio of the form Template:Sfrac (e.g. Template:Nowrap). 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 [[0.999...|Template:Nowrap]] and Template:Nowrap. (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 Template:Slink). Examples of such irrational numbers are [[square root of 2|Template:Math]] and [[pi|Template:Pi]].[3]

Background

Notation

Template:More citations needed section 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
Template:Sfrac 0.Template:Overline 0.Template:Overset 0.(1) 0.Template:Overarc 0.111...
Template:Sfrac = Template:Sfrac 0.Template:Overline 0.Template:Overset 0.(3) 0.Template:Overarc 0.333...
Template:Sfrac = Template:Sfrac 0.Template:Overline 0.Template:Overset 0.(6) 0.Template:Overarc 0.666...
Template:Sfrac = Template:Sfrac 0.Template:Overline 0.Template:OversetTemplate:Overset 0.(81) 0.Template:Overarc 0.8181...
Template:Sfrac = Template:Sfrac 0.58Template:Overline 0.58Template:Overset 0.58(3) 0.58Template:Overarc Template:Gaps...
Template:Sfrac = Template:Sfrac 0.Template:Overline 0.Template:Overset4285Template:Overset 0.(142857) 0.Template:Overarc Template:Gaps...
Template:Sfrac = Template:Sfrac 0.Template:Overline 0.Template:Overset1234567Template:Overset 0.(012345679) 0.Template:Overarc Template:Gaps...
Template:Sfrac = Template:Sfrac 3.Template:Overline 3.Template:Overset4285Template:Overset 3.(142857) 3.Template:Overarc Template:Gaps...
Template:Sfrac = Template:Sfrac 11.Template:Overline 11.Template:Overset88679245283Template:Overset 11.(1886792452830) 11.Template:Overarc Template:Gaps...

In English, there are various ways to read repeating decimals aloud. For example, 1.2Template:Overline 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.Template:Overline 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

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 Template:Sfrac:

        0.0Template:Overline
   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: Template:Gaps....

For any integer fraction Template:Sfrac, 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".[5]

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

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, Template:Nowrap satisfies the equation

10000α − 10α = 58144.144144... − 58.144144...
9990α = 58086
Therefore, α = Template:Sfrac = Template:Sfrac

The process of how to find these integer coefficients is described below.

Formal proof

Given a repeating decimal x=a.bc where a, b, and c are groups of digits, let n=log10b, the number of digits of b. Multiplying by 10n separates the repeating and terminating groups:

10nx=ab.c¯.

If the decimals terminate (c=0), the proof is complete.[6] For c0 with k digits, let x=y.c¯ where y is a terminating group of digits. Then,

c=d1d2...dk

where di denotes the i-th digit, and

x=y+n=1c(10k)n=y+(cn=01(10k)n)c.

Since n=01(10k)n=1110k,[7]

x=yc+10kc10k1.

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

Table of values

Thereby fraction is the unit fraction Template:Sfrac and 10 is the length of the (decimal) repetend.

The lengths 10(n) of the decimal repetends of Template:Sfrac, 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... Template:OEIS.

For comparison, the lengths 2(n) of the binary repetends of the fractions Template:Sfrac, 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, ... (=Template:OEIS link[n], if n not a power of 2 else =0).

The decimal repetends of Template:Sfrac, 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... Template:OEIS.

The decimal repetend lengths of Template:Sfrac, 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... Template:OEIS.

The least primes p for which Template:Sfrac 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... Template:OEIS.

The least primes p for which Template:Sfrac has n different cycles (Template:Nowrap), 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... Template:OEIS.

Fractions with prime denominators

Template:Main 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 Template:Sfrac 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 Template:Nowrap.

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 Template:Sfrac for prime p is equal to p − 1 then the repetend, expressed as an integer, is called a cyclic number.

Cyclic numbers

Template:Main

Examples of fractions belonging to this group are:

The list can go on to include the fractions Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, Template:Sfrac, etc. Template:OEIS.

Every proper 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 of Template:Sfrac: the sequential remainders are the cyclic sequence Template:Nowrap. 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 Template:Sfrac starts '142' and is followed by '857' while Template:Sfrac (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, Template:Sfrac times). They are:[10]Template:Rp

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,... Template: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 Template:Sfrac 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... Template:OEIS.

Other reciprocals of primes

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

Template: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 Template:Sfrac, 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 Template:Sfrac. For example, for 11 we get

10111111=909090909

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 Template:Sfrac 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 prime p consists of n subsets, each with repetend length k, where nk = p − 1.

Totient rule

For an arbitrary integer n, the length L(n) of the decimal repetend of Template:Sfrac divides φ(n), where φ is the totient function. The length is equal to Template:Nowrap if and only if 10 is a primitive root modulo n.[11]

In particular, it follows that Template:Nowrap if and only if p is a prime and 10 is a primitive root modulo p. Then, the decimal expansions of Template:Sfrac 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

If p is a prime other than 2 or 5, the decimal representation of the fraction Template:Sfrac repeats:

Template:Sfrac = 0.Template:Overline.

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

am1(modn)

for every integer a that is coprime to n.

The period of Template:Sfrac is usually pTp, where Tp is the period of Template:Sfrac. There are three known primes for which this is not true, and for those the period of Template:Sfrac is the same as the period of Template:Sfrac because p2 divides 10p−1−1. These three primes are 3, 487, and 56598313 Template:OEIS.[12]

Similarly, the period of Template:Sfrac is usually pk–1Tp

If p and q are primes other than 2 or 5, the decimal representation of the fraction Template:Sfrac repeats. An example is Template:Sfrac:

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

where LCM denotes the least common multiple.

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

Template:Sfrac = 0.Template:Overline.

The period T of Template:Sfrac is LCM(TpTq), where Tp is the period of Template:Sfrac and Tq is the period of Template:Sfrac.

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

1pkqrm

is a repeating decimal with a period of

LCM(Tpk,Tq,Trm,)

where Tpk, Tq, Trm,... are respectively the period of the repeating decimals Template:Sfrac, Template:Sfrac, Template:Sfrac,... as defined above.

Reciprocals of integers not coprime to 10

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:

12a5bpkq,

where a and b are not both zero.

This fraction can also be expressed as:

5ab10apkq,

if a > b, or as

2ba10bpkq,

if b > a, or as

110apkq,

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 Template:Sfrac.

For example Template:Sfrac = 0.03Template:Overline:

  • a = 2, b = 0, and the other factors Template:Nowrap
  • there are 2 initial non-repeating digits, 03; and
  • there are 6 repeating digits, 571428, the same amount as Template:Sfrac has.

Converting repeating decimals to fractions

Given a repeating decimal, it is possible to calculate the fraction that produces it. For example:

x =0.333333
10x =3.333333 (multiply each side of the above line by 10)
9x =3 (subtract the 1st line from the 2nd)
x =39=13 (reduce to lowest terms)

Another example:

x =    0.836363636
10x =    8.36363636 (move decimal to start of repetition = move by 1 place = multiply by 10)
1000x =836.36363636 (collate 2nd repetition here with 1st above = move by 2 places = multiply by 100)
990x =828 (subtract to clear decimals)
x =828990=18461855=4655 (reduce to lowest terms)

A shortcut

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:

x=0.000000100000010000001107x=1.000000100000010000001(1071)x=9999999x=1x=11071=19999999

So this particular repeating decimal corresponds to the fraction Template:Sfrac, 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:

7.48181818=7.3+0.18181818=7310+1899=7310+92911=7310+211=1173+1021011=823110

or

11.18867924528301886792452830=11+0.18867924528301886792452830=11+1053=1153+1053=59353

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:

x=0.a1a2an10nx=a1a2an.a1a2an(10n1)x=9999x=a1a2anx=a1a2an10n1=a1a2an9999

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... = Template:Sfrac since the repeating block is 4 (a 1-digit block),
  • 0.565656... = Template:Sfrac since the repeating block is 56 (a 2-digit block),
  • 0.012012... = Template:Sfrac since the repeating block is 012 (a 3-digit block); this further reduces to Template:Sfrac.
  • 0.999999... = Template:Sfrac = 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... = Template:Sfrac since the repeating block is 4 and this block is preceded by 3 zeros,
  • 0.005656... = Template:Sfrac since the repeating block is 56 and it is preceded by 2 zeros,
  • 0.00012012... = Template:Sfrac = Template:Sfrac 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,

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

  • 1.23444... = Template:Sfrac = Template:Sfrac (denominator has one 9 and two 0s because one digit repeats and there are two non-repeating digits after the decimal point)
  • 0.3789789... = Template:Sfrac = Template:Sfrac (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 Template:Sfrac will be (at most) the smallest number n such that 10n − 1 is divisible by d.

For example, the fraction Template:Sfrac 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 Template:Sfrac is therefore 6.

In compressed form

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 9 will be repeated #𝐏 times, and the digit 0 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:

3.254444=3.254={𝐈=3𝐀=25𝐏=4#𝐀=2#𝐏=1}=3254325900=29299000.512512=0.512={𝐈=0𝐀=𝐏=512#𝐀=0#𝐏=3}=5120999=5129991.09191=1.091={𝐈=1𝐀=0𝐏=91#𝐀=1#𝐏=2}=109110990=10819901.333=1.3={𝐈=1𝐀=𝐏=3#𝐀=0#𝐏=1}=1319=129=430.3789789=0.3789={𝐈=0𝐀=3𝐏=789#𝐀=1#𝐏=3}=378939990=37869990=6311665

The symbol in the examples above denotes the absence of digits of part 𝐀 in the decimal, and therefore #𝐀=0 and a corresponding absence in the generated fraction.

Repeating decimals as infinite series

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,

0.1=110+1100+11000+=n=1110n

The above series is a geometric series with the first term as Template:Sfrac and the common factor Template:Sfrac. 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.

a1r=1101110=1101=19

Similarly,

0.142857=142857106+1428571012+1428571018+=n=1142857106n[6px]a1r=14285710611106=1428571061=142857999999=17

Multiplication and cyclic permutation

Template:Main

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, Template:Nowrap. 102564 is the repetend of Template:Sfrac and 410256 the repetend of Template:Sfrac.

Other properties of repetend lengths

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

period(1p)=period(1p2)==period(1pm)
for some m, but
period(1pm)period(1pm+1),
then for c ≥ 0 we have
period(1pm+c)=pcperiod(1p).
  • If p is a proper prime ending in a 1, that is, if the repetend of Template:Sfrac 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 hTemplate:Sfrac times.

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

Extension to other bases

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 Template:Math and Template:Math.
  • Template:AnchorIf the positional numeral system is a standard one, that is it has base
b{1,0,1}
combined with a consecutive set of digits
D:={d1,d1+1,,dr}
with Template:Math, Template:Math and Template:Math, 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 Template:Math into some closed interval of the reals, which maps the strings Template:Math and Template:Math with Template:Math and Template:Math to the same real number – and there are no other duplicate images. In the decimal system, for example, there is 0.Template:Overline = 1.Template:Overline = 1; in the balanced ternary system there is 0.Template:Overline = 1.Template:Overline = Template:Sfrac.
(0.A1A2A)b
represents the fraction
(A1A2A)bb1.
  • 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, Template:Sfrac = 0.6, Template:Sfrac = 0.4, Template:Sfrac = 0.3 and Template:Sfrac = 0.2 all terminate; Template:Sfrac = 0.Template:Overline repeats with period length 4, in contrast with the equivalent decimal expansion of 0.2; Template:Sfrac = 0.Template:Overline has period 6 in duodecimal, just as it does in decimal.

If Template:Mvar is an integer base and Template:Mvar is an integer, then

1k=1b+(bk)1b2+(bk)2b3+(bk)3b4++(bk)N1bN+=1b11bkb.

For example 1/7 in duodecimal: 17=(1101+5102+21103+A5104+441105+1985106+)base 12

which is 0.Template:Overlinebase12. 10base12 is 12base10, 102base12 is 144base10, 21base12 is 25base10, A5base12 is 125base10.

Algorithm for positive bases

For a rational Template:Math (and base Template:Math) 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 Template:Mvar.

The subsequent line calculates the new remainder Template:Mvar of the division modulo the denominator Template:Mvar. As a consequence of the floor function floor we have

bpq1<z=bpqbpq,

thus

bpq<zqp:=bpzq<q

and

zqbp0bpzq=:p.

Because all these remainders Template:Mvar are non-negative integers less than Template:Mvar, 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 Template:Mvar is formed in the yellow line, where Template:Mvar is the only non-constant. The length Template:Mvar of the repetend equals the number of the remainders (see also section Every rational number is either a terminating or repeating decimal).

Applications to cryptography

Repeating decimals (also called decimal sequences) have found cryptographic and error-correction coding applications.[16] In these applications repeating decimals to base 2 are generally used which gives rise to binary sequences. The maximum length binary sequence for Template:Sfrac (when 2 is a primitive root of p) is given by:[17]

a(i)=2imodpmod2

See also

Notes

Template:Reflist

de:Rationale Zahl#Dezimalbruchentwicklung

  1. 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.
  2. Template:Citation
  3. Template:Cite web
  4. 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.
  5. For a base b and a divisor n, in terms of group theory this length divides
    ordn(b):=min{LbL1modn}
    (with modular arithmetic Template:Nowrap) which divides the Carmichael function
    λ(n):=max{ordn(b)gcd(b,n)=1}
    which again divides Euler's totient function φ(n).
  6. Template:Cite web
  7. Template:Cite web
  8. Template:Cite web
  9. Template:Cite journal
  10. Dickson, L. E., History of the Theory of Numbers, Volume 1, Chelsea Publishing Co., 1952.
  11. William E. Heal. Some Properties of Repetends. Annals of Mathematics, Vol. 3, No. 4 (Aug., 1887), pp. 97–103
  12. Albert H. Beiler, Recreations in the Theory of Numbers, p. 79
  13. Mitchell, Douglas W., "A nonlinear random number generator with known, long cycle length", Cryptologia 17, January 1993, pp. 55–62.
  14. Dickson, Leonard E., History of the Theory of Numbers, Vol. I, Chelsea Publ. Co., 1952 (orig. 1918), pp. 164–173.
  15. Armstrong, N. J., and Armstrong, R. J., "Some properties of repetends", Mathematical Gazette 87, November 2003, pp. 437–443.
  16. Kak, Subhash, Chatterjee, A. "On decimal sequences". IEEE Transactions on Information Theory, vol. IT-27, pp. 647–652, September 1981.
  17. Kak, Subhash, "Encryption and error-correction using d-sequences". IEEE Transactios on Computers, vol. C-34, pp. 803–809, 1985.