Fulltext PDF

CLASSROOM
Cyclic Decimal Expansions
V Subramanyam
c/o S Nageswaran
271 III Cross, II Block
Introduction
Banashankari III Stage
Bangalore 560 085, India.
Anyone in the practice of playing with decimals will find
that the decimal expansions ('d~expansions' for short;
this. term. wilt recur repeatedly through the article) of
certain fractions exhibit a curious cyclicity of behaviour.
Consider for example the fraction 1/7 ~ 0.142857. We
observe the following features about the d-expansion:
it has pure periodicity, with no initial non-repeating
part; the length of the repeating portion is about as
large as it can be, for the length of the repeating portion of the d-expansion for 1/n cannot exceed n - 1; for
the fractions 2/7, 3/7, 4/7,
, the repeating portions
of their d-expansions are cyclic permutations of the repeating portion for 1/7; e.g., we have 2/7 ~ 0.285714,
3/7 = 0.428571, and so on. In this article we explore
such phenomena.
Statement and Analysis of the Problem
Let n > 1 be a positive integer. We are interested in values of n for which the d-expansion of l/n has pure periodicity and a rather long repeating portion, and shows
cyclic behaviour.
The first requirement holds if n is coprime to 10. It
is easy to show, via the pigeon-hole principle, that any
such n has an integer multiple An of the form 10k - 1,
that is, with only 9's in its base-l0 form. (For the proof,
consider the remainders in the following divisions:
(10-1)7A,
The remainder in each case is one of the numbers 1, 2, 3,
,A -1. Sooner or later a remainder must repeat, say
for 10 k ' -1 and 10 k " -1, where k" > k'. By subtraction it
follows that 10 k " - 10 k ' is a multiple of A, and therefore
-RE-S-O-N-A-N-CE--I-S-e-Pt-em--be-r-2-0-0-3---------~---------------------------7-5
CLASSROOM
It is unknown
whether there are
infinitely many
primes having 10
as primitive root.
- by factorization - that 10k"-k'· - 1 is a multiple of A;
here we use the coprimeness of A and 10.) In this case it
follows easily that 1/n = O.AAA. ., where A is written
as a number with k digits (with O's placed at the front,
as necessary) ~ For example, if n = 11, then A = 09
and 1/11 = 0.09; and if n = 37, then A = 027 and
l/n = 0.027.
For the second requirement, we consider the order of10 modulo n (which we now take to be coprime to 10).
That is, we find the least integer t > 0 such that lOt
1 (mod n); then t is a divisor of <p(n). (This is a consequence of Euler's generalization of Fermat's theorem the claim that for any integer a coprime to a prime p,
a P - 1 = 1 (mod p); Euler's generalization states that if a,
n are coprime integers, then arp(n) = 1 (mod n), where
<pC n) is the number of integers between 1. and n which
are coprime to n; <p is the 'totient function.') If t = <pen)
then 10 is a primitive root modulo n, and in such cases,
the length of the repeating portion of the d-expansion
of l/n is <p(n).
=
The Case When n is Prime
The particular case when n is prime is of interest, for
then <pen) = n - 1. The primes below 500 for which
10 is a primitive root are listed in Table 1. (We note
incidentally that it is an· open problem whether this list
continues indefinitely - that is, whether or not there are
infinitely many primes having 10 as a primitive. root.)
The composite numbers below 500 having 10 as a primitive root are 49, 289, 343 and 361. We can expect to
find the desired behaviour for any of these values of n.
Table 1. Primes below 500
having 10 as a primitive
root.
7,
61,
179,
263,
389,
17,
97,
181,
269,
419,
19,
109,
193,
313,
433,
23,
113,
223,
337,
461,
29,
131,
229,
367,
487,
47,
149,
233,
379,
491,
59,
167,
257,
383,
499.
-76--------------------------~----------------------------------------­
RESONANCE I September 2003
CLASSROOM
For example, for n
= 23 we get:
The composite
1/23 = 0.0434782608695652173913.
The repeating parts of the d-expansions of 2/23, 3/23,
are found to be cyclic permutations of the repeating
part for 1/23, for example, we have:
2/23
0.0869565217391304347826,
3/23
0.1304347826086956521739.
numbers below
500 having 10 as a
primitive root are
49, 289, 343 and
361.
The cyclic property is plainly visible.
The Case When 10 is not a Primitive Root Modulo n
What happens if 10 is coprime to n but not a primitive
root? Take n = 13; the order of 10 modulo 13 is 6, or
half of n-1. We get: 1/13 = 0.076923, 2/13 = 0.153846;
the two look completely different, so it appears that 13
does not have the feature we want. But, persevering, we
get 3/13 = 0.230769, and the repeating portion here is
indeed a cyclic-permutation of the string 076923. Indeed
we find the following:
1/13 = 0.076923,
2/13 = 0.153846,
= 0.230769,
4/13 = 0.307692,
9/13 = 0.692307,
10/13 = 0.769230,
12/13 = 0.923076,
5/13 = 0.384615,
3/13
6/13 = 0.461538,
= 0.538461,
8/13 = 0.615384,
7/13
11/13 = 0.846153.
So we find two distinct groups of fractions here. Significantly, 2 is the number of times that the order (= 6)
of 10 modulo 13 divides into 13 - 1. The numerators of
the fractions in the two groups may be found by repeatedly multiplying by 10 and taking remainders modulo
-E-S-O-NA-N-C-E-I-s-e-Pt-em-b-e-r-2-00-3--------~--------------------------n
R
CLASSROOM
13. For the first group we start with 1 and get:
=10, 10 x 10 =9, 9 x 10 =12, 12 x 10 3 x 10 =4, 4 x 10 =1.
1, 1 x 10
3,
The remainders are 1, 10, 9, 12, 3 and 4. If we start with
2 we get the remainders 2, 7, 5, 11, 6 and 8. (Interestingly, the. numbers in the first group are the quadratic
residues modulo 13, while those in the second group are
the quadratic non-residues modulo 13.)
We proceed similarly in general. Consider the next prime
number not on the above list; it is 31. We find that the
order of 10 modulo 31 is 15, which is half of 30; so here
too we expect to find two such groups of fractions. The
reader should persevere through the computations and
verify that this is indeed so.
On the other hand, taking n = 37 we find that the order
of 10 is a mere 3 (this is so because 999 = 103 - 1) has
37 as a divisor), which is 1/12 of 36, so we expect to
find 12 such groups of fractions! And indeed we do! we get:
1/27 = 0.027,
2/27
= 0.054,
4/27 = 0.108,
Similarly, taking n = 41 we find that the order of 10
modulo 41 is 5, or 1/8 of 40; so we expect to find 8 such
groups of fractions. Taking n = 53, we find that the
order of 10 modulo 53 is 13, which is 1/4 of 52; so we
expect to find 4 such groups. In each case the findings
are exactly as anticipated.
Why Does the Cyclic Property Hold?
We now consider why the cyclic property holds at all.
ak; then if
For any prime p > 5, let lip = O.al a2 a3
r is the remainder in the division 10 -;- p, we get 10lp =
al·a2 a3
ak al and therefore r /p = 0.a2 a3
ak al'
-n--------------------------~---------RE-S-O-N-AN-C-E--I-se-p-te-m-b-er--20-0-3
CLASSROOM
We see that the repeating string for r / p is a cyclic permutation of the repeating string for 1/p. And if s is the
remainder in the division lOr -+- p, then sip = 0.a3 a4
ak al a2; and so on. This shows how and why the cyclic
property arises.
The Case When n is Composite
If p>5 is prime and
th"e repeating part of
1/p has length 2k,
say 1/p O.ABAB ... ,
=
then it turns out that
A+B is the number
99 ... 9, where 9 is
Now consider the case when n is composite and has 10
as a primitive root; for example, n = 49 or 289. We
can expect similar cyclic behaviour for these n's. For
example, consider n = 49; the order of 10 modulo 49 is
<p( 49) = 42, so the repeating portion of the d-expansion
of 1/49 has a ~ength of 42. Here is 'fhat we get:
repeated k times.
1/49 =
0.020408163265306122448979591836734693877551,
2/49
=
0.040816326530612244897959183673469387755102,
3/49 =
0.061224489795918367346938775510204081632653,
The cyclic behavio~ is easy to spot. The same behaviour occurs for 1/289, 1/343 and 1/361; only, the
d-expansions are too unwieldy to display properly!
A Curious Symmetry of the Repeating String
We close with an analysis of a property of the repeating
string when it has an even number of digits, for example,
for 1/7 and 1/13 (the repeating strings have lengths of
6 in both cases). If we regard the 6-digit string as made
up of two 3-digit numbers, we get the numbers 142 and
857 in the first case, and the numbers 076 and 923 in
the second. In both cases the sum of the two numbers is
999. A coincidence? Not quite; we give two more such
instances. Consider the fraction 1/17; its d-expansion is
0.0588235294117647.
-se-p-te-m-be-r--20-0-3--------~--------------------------7-9
R
-E-S-O-NA-N-C-E--I
CLASSROOM
Suggested Reading
[1] G H Hardy and E M
Wright, An Introduction to the Theory of
Numbers.
[2] I Niven, SZuckennann
and H Montgomery,
An Introduction to the
Theory of Numbers
(Wiley).
The length of the repeating string is 16 (an even number), and we get two 8-digit numbers, 05882352 and
94117647, whose sum is 99999999.
We shall now show that if p > 5 is prime and the order
of 10 modulo p is even (implying that the length of the
repeating portion is even), then the property described
will hold for the d-expansion of lip.
Suppose that the repeating part of 1I p has length 2k,
say lip = O.ABABAB
where A and Bare k-digit
numbers (with O's placed in the front, as necessary).
This means that the order of 10 modulo p is 2k, and
1
P
10 k A + B
10 2k - 1 '
---~--
therefore 102k_1
= p (10 k
A+ B)
Since A and Bare k-digit numbers, we have 0 < A, B :::;
10 k - 1. We cannot have A = B, for then the repeating
string would be of length k, not 2k. This implies, in
particular, that 0 < A + B < 2(10k - 1).
The above equation yields (10 k -1 )(10 k +.1) = p(10k A +
B). Since p divides of the quantity on the right, it also
divides the quantity on the left. Using a baSIC property
of primes, we deduce that p divides one of 10 k -1, 10 k+ 1.
It cannot be that p divides 10 k - 1, because the order of
10 modulo pis 2k and not k, thereforep divides 10 k + 1.
We now write:
Since 10 k ,- 1 divides the quantity on the left, it divides
the quantity on the left too, therefore it divides A + B;
and since 0 < A+B < 2(10k_1), we must have A+B =
10 k -I. So A+B is a number with only 9's in its base-l0
form. This proves the assertion we made.
-80---------------------------~---------RE-S-O-N-AN-C-E--I-se-p-te-m-b-er--2o-o-3