info prev up next book cdrom email home

Decimal Expansion

The decimal expansion of a number is its representation in base 10. For example, the decimal expansion of $25^2$ is 625, of $\pi$ is 3.14159..., and of $1/9$ is 0.1111....


If $r\equiv p/q$ has a finite decimal expansion, then

$\displaystyle r$ $\textstyle =$ $\displaystyle {a_1\over 10}+{a_2\over 10^2}+\ldots+{a_n\over 10^n}$  
  $\textstyle =$ $\displaystyle {a_110^{n-1}+a_210^{n-2}+\ldots+a_n\over 10^n}$  
  $\textstyle =$ $\displaystyle {a_110^{n-1}+a_210^{n-2}+\ldots+a_n\over 2^n5^n}.$ (1)

Factoring possible common multiples gives
\begin{displaymath}
r={p\over 2^\alpha 5^\beta},
\end{displaymath} (2)

where $p\not\equiv 0$ (mod 2, 5). Therefore, the numbers with finite decimal expansions are fractions of this form. The number of decimals is given by $\max(\alpha,\beta)$. Numbers which have a finite decimal expansion are called Regular Numbers.


Any Nonregular fraction $m/n$ is periodic, and has a period $\lambda(n)$ independent of $m$, which is at most $n-1$ Digits long. If $n$ is Relatively Prime to 10, then the period of $m/n$ is a divisor of $\phi(n)$ and has at most $\phi(n)$ Digits, where $\phi$ is the Totient Function. When a rational number $m/n$ with $(m,n)=1$ is expanded, the period begins after $s$ terms and has length $t$, where $s$ and $t$ are the smallest numbers satisfying

\begin{displaymath}
10^2\equiv 10^{s+t}\ \left({{\rm mod\ } {n}}\right).
\end{displaymath} (3)

When $n\not\equiv 0$ (mod 2, 5), $s=0$, and this becomes a purely periodic decimal with
\begin{displaymath}
10^t\equiv 1\ \left({{\rm mod\ } {n}}\right).
\end{displaymath} (4)

As an example, consider $n=84$.

\begin{displaymath}
\matrix{
10^0\equiv 1 & 10^1\equiv 10 & 10^2\equiv 16 & 10^...
...iv 40 & 10^6\equiv -20 & 10^7\equiv -32\cr
10^8\equiv 16\cr},
\end{displaymath}

so $s=2$, $t=6$. The decimal representation is $1/84 = 0.01 \overline{190476}$. When the Denominator of a fraction $m/n$ has the form $n=n_02^\alpha 5^\beta$ with $(n_0,10)=1$, then the period begins after $\max(\alpha,\beta)$ terms and the length of the period is the exponent to which 10 belongs (mod $n_0$), i.e., the number $x$ such that $10^x\equiv 1\ \left({{\rm mod\ } {n_0}}\right)$. If $q$ is Prime and $\lambda(q)$ is Even, then breaking the repeating Digits into two equal halves and adding gives all 9s. For example, $1/7= 0.\overline{142857}$, and $142+857=999$. For $1/q$ with a Prime Denominator other than 2 or 5, all cycles $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 period $\lambda(n)$ of the repeating decimal $1/n$ is given by

\begin{displaymath}
\lambda(n)=\phi(n),
\end{displaymath} (5)

where $\phi(n)$ is the Totient Function. Furthermore, the decimal expansions for $p/n$, with $p=1$, 2, ..., $n-1$ have periods of length $n-1$ and differ only by a cyclic permutation. Such numbers are called Long Primes by Conway and Guy (1996). An equivalent definition is that
\begin{displaymath}
10^i\equiv 1\ \left({{\rm mod\ } {n}}\right)
\end{displaymath} (6)

for $i=n-1$ and no $i$ less than this. In other words, a Necessary (but not Sufficient) condition is that the number $9R_{n-1}$ (where $R_n$ is a Repunit) is Divisible by $n$, which means that $R_n$ is Divisible by $n$.


The first few numbers with maximal decimal expansions, called Full Reptend Primes, are 7, 17, 19, 23, 29, 47, 59, 61, 97, 109, 113, 131, 149, 167, ... (Sloane's A001913). The decimals corresponding to these are called Cyclic Numbers. No general method is known for finding Full Reptend Primes. Artin conjectured that Artin's Constant $C=0.3739558136\ldots$ is the fraction of Primes $p$ for with $1/p$ has decimal maximal period (Conway and Guy 1996). D. Lehmer has generalized this conjecture to other bases, obtaining values which are small rational multiples of $C$.


To find Denominators with short periods, note that

$\displaystyle 10^1-1$ $\textstyle =$ $\displaystyle 3^2$  
$\displaystyle 10^2-1$ $\textstyle =$ $\displaystyle 3^2\cdot 11$  
$\displaystyle 10^3-1$ $\textstyle =$ $\displaystyle 3^3\cdot 37$  
$\displaystyle 10^4-1$ $\textstyle =$ $\displaystyle 3^2\cdot 11\cdot 101$  
$\displaystyle 10^5-1$ $\textstyle =$ $\displaystyle 3^2\cdot 41\cdot 271$  
$\displaystyle 10^6-1$ $\textstyle =$ $\displaystyle 3^3\cdot 7\cdot 11\cdot 13\cdot 37$  
$\displaystyle 10^7-1$ $\textstyle =$ $\displaystyle 3^2\cdot 239\cdot 4649$  
$\displaystyle 10^8-1$ $\textstyle =$ $\displaystyle 3^2\cdot 11\cdot 73\cdot 101\cdot 137$  
$\displaystyle 10^9-1$ $\textstyle =$ $\displaystyle 3^4\cdot 37\cdot 333667$  
$\displaystyle 10^{10}-1$ $\textstyle =$ $\displaystyle 3^2\cdot 11\cdot 41\cdot 271\cdot 9091$  
$\displaystyle 10^{11}-1$ $\textstyle =$ $\displaystyle 3^2\cdot 21649\cdot 513239$  
$\displaystyle 10^{12}-1$ $\textstyle =$ $\displaystyle 3^3\cdot 7\cdot 11\cdot 13\cdot 37\cdot 101\cdot 9901.$  


The 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 period is 3. Multiplication of any Factor by a $2^\alpha 5^\beta$ still gives the same period as the Factor alone. A Denominator obtained by a multiplication of two Factors has a period equal to the first Power of 10 in which both Factors appear. The following table gives the Primes having small periods (Sloane's A046106, A046107, and A046108; Ogilvy and Anderson 1988).

period primes
1 3
2 11
3 37
4 101
5 41, 271
6 7, 13
7 239, 4649
8 73, 137
9 333667
10 9091
11 21649, 513239
12 9901
13 53, 79, 265371653
14 909091
15 31, 2906161
16 17, 5882353
17 2071723, 5363222357
18 19, 52579
19 1111111111111111111
20 3541, 27961


A table of the periods $e$ of small Primes other than the special $p=5$, for which the decimal expansion is not periodic, follows (Sloane's A002371).

$p$ $e$ $p$ $e$ $p$ $e$
3 1 31 15 67 33
7 6 37 3 71 35
11 2 41 5 73 8
13 6 43 21 79 13
17 16 47 46 83 41
19 18 53 13 89 44
23 22 59 58 97 96
29 28 61 60 101 4

Shanks (1873ab) computed the periods for all Primes up to 120,000 and published those up to 29,989.

See also Fraction, Midy's Theorem, Repeating Decimal


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.

Dickson, L. E. History of the Theory of Numbers, Vol. 1: Divisibility and Primality. New York: Chelsea, pp. 159-179, 1952.

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 20,000.'' 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 20,000 and 30,000.'' 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 A001913/M4353, A002371/M4050, A046106, A046107, and A046108 in ``An On-Line Version of the Encyclopedia of Integer Sequences.'' http://www.research.att.com/~njas/sequences/eisonline.html.



info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein
1999-05-24