TOPICS
Search

Decimal Expansion


The decimal expansion of a number is its representation in base-10 (i.e., in the decimal system), and is the base-10 counterpart of a binary expansion. It consists of decimal digits 0 through 9 whose positions determine their place values. Each decimal digit is multiplied by a power of 10, decreasing from left to right. The decimal point separates the units place, with place value 10^0=1, from the tenths place, with place value 10^(-1). For example, the number with decimal expansion 1234.56 is defined as

1234.56=1×10^3+2×10^2+3×10^1+4×10^0+5×10^(-1)+6×10^(-2)
(1)
=1×1000+2×100+3×10+4+5×1/(10)+6×1/(100).
(2)

Expressions written in this form sum_(k)b_k10^k (where negative k are allowed as exemplified above but usually not considered in elementary education contexts) are said to be in expanded notation.

Other examples include the decimal expansion of 25^2 given by 625, of pi given by 3.14159..., and of 1/9 given by 0.1111.... The decimal expansion of a number can be found in the Wolfram Language using the command RealDigits[n], or equivalently, RealDigits[n, 10].

Every nonzero real number with a terminating decimal expansion also has a nonterminating decimal expansion whose decimal digits are eventually all 9s. For example, 0.5000...=0.4999.... Apart from leading zeros, pairs of this form account for all nonuniqueness of decimal expansions.

The decimal expansion of a number may terminate (in which case it is a terminating decimal, e.g., 1/2=0.5), be eventually periodic (in which case the number is called a repeating decimal, e.g., 1/3=0.3^_), or continue infinitely without repeating (in which case the number is called irrational).

The following table summarizes the decimal expansions of the first few unit fractions. As usual, the repeating portion of a decimal expansion is conventionally denoted with a vinculum.

fractiondecimal expansionfractiondecimal expansion
111/(11)0.09^_
1/20.51/(12)0.083^_
1/30.3^_1/(13)0.076923^_
1/40.251/(14)0.0714285^_
1/50.21/(15)0.06^_
1/60.16^_1/(16)0.0625
1/70.142857^_1/(17)0.0588235294117647^_
1/80.1251/(18)0.05^_
1/90.1^_1/(19)0.052631578947368421^_
1/(10)0.11/(20)0.05

If r=p/q lies in [0,1) and has a terminating decimal expansion, then

r=(a_1)/(10)+(a_2)/(10^2)+...+(a_n)/(10^n)
(3)
=(a_110^(n-1)+a_210^(n-2)+...+a_n)/(10^n)
(4)
=(a_110^(n-1)+a_210^(n-2)+...+a_n)/(2^n·5^n).
(5)

Canceling common factors gives

 r=p/(2^alpha5^beta),
(6)

where this is a reduced fraction. A rational number has a terminating decimal expansion iff its reduced denominator has the form 2^alpha5^beta with nonnegative integers alpha and beta. These are the denominators of regular unit fractions. The first few such denominators are 1, 2, 4, 5, 8, 10, 16, 20, 25, 32, 40, 50, ... (OEIS A003592).

Any reduced fraction m/n with positive denominator n not of the form 2^alpha5^beta has an eventually periodic decimal expansion, and has a decimal period lambda(n) independent of m, which is at most n-1 decimal digits long. If n is relatively prime to 10, then the decimal period lambda(n) of m/n is a divisor of phi(n) and has at most phi(n) decimal digits, where phi is the totient function. It turns out that lambda(n) is the multiplicative order of 10 (mod n) (Glaisher 1878, Lehmer 1941). The number of decimal digits in the repeating portion of the nonterminating decimal expansion of a rational number is the multiplicative order of 10 modulo the part of its reduced denominator that is relatively prime to 10.

When a rational number m/n with (m,n)=1 has a nonterminating decimal expansion, the decimal period begins after s decimal digits and has length t, where s and t are the smallest integers with s>=0 and t>=1 satisfying

 10^s=10^(s+t) (mod n).
(7)

When n≢0 (mod 2, 5), s=0, and this becomes a purely periodic decimal with

 10^t=1 (mod n).
(8)

As an example, consider n=84.

 10^0=1 10^1=10 10^2=16 10^3=-8; 10^4=4 10^5=40 10^6=-20 10^7=-32; 10^8=16   ,
(9)

so s=2, t=6. The decimal representation is 1/84=0.01190476^_. When the denominator of a reduced fraction m/n has the form n=n_02^alpha5^beta with (n_0,10)=1 and n_0>1, then the decimal period begins after max(alpha,beta) decimal digits and its length is the multiplicative order of 10 modulo n_0, i.e., the least positive integer x such that 10^x=1 (mod n_0). If n_0=1, the fraction instead has a terminating decimal expansion with max(alpha,beta) fractional decimal digits. If q is prime and lambda(q) is even, then breaking the repeating decimal digits into two equal halves and adding gives all 9s. For example, 1/7=0.142857^_, and 142+857=999. For 1/q with a prime denominator other than 2 or 5, all cycles n/q with 1<=n<q have the same length (Conway and Guy 1996).

If n is a prime and 10 is a primitive root of n, then the decimal period lambda(n) of the repeating decimal 1/n is given by

 lambda(n)=phi(n),
(10)

where phi(n) is the totient function. Furthermore, the decimal expansions for p/n, with p=1, 2, ..., n-1 have decimal periods of length n-1 and differ only by a cyclic permutation. Such numbers n are called full reptend primes.

To find denominators with short decimal periods, note that

10^1-1=3^2
(11)
10^2-1=3^2·11
(12)
10^3-1=3^3·37
(13)
10^4-1=3^2·11·101
(14)
10^5-1=3^2·41·271
(15)
10^6-1=3^3·7·11·13·37
(16)
10^7-1=3^2·239·4649
(17)
10^8-1=3^2·11·73·101·137
(18)
10^9-1=3^4·37·333667
(19)
10^(10)-1=3^2·11·41·271·9091
(20)
10^(11)-1=3^2·21649·513239
(21)
10^(12)-1=3^3·7·11·13·37·101·9901.
(22)

The decimal period of a fraction with denominator equal to a prime factor above is therefore the power of 10 in which the factor first appears. For example, 37 appears in the factorization of 10^3-1 and 10^9-1, so its decimal period is 3. Multiplication of any factor by a 2^alpha5^beta still gives the same decimal period as the factor alone. A denominator greater than 1 and relatively prime to 10 has decimal period equal to the least positive integer t for which the entire denominator, including all prime power multiplicities, divides 10^t-1. For example, 11 has decimal period 2, whereas 11^2 has decimal period 22. The following table gives the primes having small decimal periods (OEIS A007138, A046107, and A046108; Ogilvy and Anderson 1988).

periodprimes
13
211
337
4101
541, 271
67, 13
7239, 4649
873, 137
9333667
109091
1121649, 513239
129901
1353, 79, 265371653
14909091
1531, 2906161
1617, 5882353
172071723, 5363222357
1819, 52579
191111111111111111111
203541, 27961

A table of the decimal periods e of small odd primes other than the special p=5, for which the decimal expansion is not periodic, follows (OEIS A002371).

pepepe
3131156733
763737135
112415738
13643217913
171647468341
191853138944
232259589796
292861601014

Shanks (1873ab) computed the decimal periods for all primes up to 120000 and published those up to 29989.


See also

10, Base, Binary, Binary Expansion, Decimal, Decimal Digit, Decimal Period, Decimal Point, Expanded Notation, Fraction, Midy's Theorem, Multiplicative Order, Numeral System, Regular Number, Repeating Decimal, Terminating Decimal, Unique Prime Explore this topic in the MathWorld classroom

Portions of this entry contributed by Christopher Stover

Explore with Wolfram|Alpha

References

Conway, J. H. and Guy, R. K. "Fractions Cycle into Decimals." In The Book of Numbers. New York: Springer-Verlag, pp. 157-163 and 166-171, 1996.Das, R. C. "On Bose Numbers." Amer. Math. Monthly 56, 87-89, 1949.de Polignac, A. "Note sur la divisibilité des nombres." Nouv. Ann. Math. 14, 118-120, 1855.Dickson, L. E. History of the Theory of Numbers, Vol. 1: Divisibility and Primality. New York: Dover, pp. 159-179, 2005.Glaisher, J. W. L. "Periods of Reciprocals of Integers Prime to 10." Proc. Cambridge Philos. Soc. 3, 185-206, 1878.Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, p. 25, 2003.Lehmer, D. H. "Guide to Tables in the Theory of Numbers." Bulletin No. 105. Washington, DC: National Research Council, pp. 7-12, 1941.Lehmer, D. H. "A Note on Primitive Roots." Scripta Math. 26, 117-119, 1963.Ogilvy, C. S. and Anderson, J. T. Excursions in Number Theory. New York: Dover, p. 60, 1988.Rademacher, H. and Toeplitz, O. The Enjoyment of Mathematics: Selections from Mathematics for the Amateur. Princeton, NJ: Princeton University Press, pp. 147-163, 1957.Rao, K. S. "A Note on the Recurring Period of the Reciprocal of an Odd Number." Amer. Math. Monthly 62, 484-487, 1955.Shanks, W. "On the Number of Figures in the Period of the Reciprocal of Every Prime Number below 20000." Proc. Roy. Soc. London 22, 200, 1873a.Shanks, W. "On the Number of Figures in the Period of the Reciprocal of Every Prime Number between 20000 and 30000." Proc. Roy. Soc. London 22, 384, 1873b.Shiller, J. K. "A Theorem in the Decimal Representation of Rationals." Amer. Math. Monthly 66, 797-798, 1959.Sloane, N. J. A. Sequences A002329/M4045, A002371/M4050, A003592, A007138/M2888, A046107, and A046108 in "The On-Line Encyclopedia of Integer Sequences."Wells, D. The Penguin Dictionary of Curious and Interesting Numbers. Middlesex, England: Penguin Books, p. 60, 1986.

Referenced on Wolfram|Alpha

Decimal Expansion

Cite this as:

Weisstein, Eric W., with contributions by Christopher Stover. "Decimal Expansion." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/DecimalExpansion.html

Subject classifications