Section 2. Decimal (and other) expansions of rational numbers.
Here the simple, and obvious point I wish to make is not only does Fermat's little theorem
explain
, or help one to
understand
certain
well known
phenomena in connection with the decimal expansions of rational numbers, but that those
very phenomena
themselves - with
general bases
being used (and not just decimal, i.e. base 10) - can lead someone to
re-discovering
of Fermat's little theorem. In particular, if one were working with young students, then, with proper guidance, they could be led to conjecture Fermat's little theorem.
Specifically I refer to the quickly observed fact that the
number of digits
in the period of the decimal expansion of
(where
p
is any prime with
)
appears
to an investigator to be (and may be
proved
using Fermat's little theorem to be):
either (
)
or a
divisor
of (
)
Start
. Many sensitive young people are fascinated (or, at least, used to be!) with phenomena
like
:
...
ad infinitum
...
ad infinitum
142857 142857 ...
ad infinitum
[Here, and elsewhere, I make spaces to emphasise the periodic block.]
285714 285714 ...
ad infinitum
and - as almost everyone who has ever investigated such matters (without knowing that it has all already long been discovered) - one quickly finds that
the rational number
(where
m
and
n
are positive,
) has a
periodic
decimal expansion provided
n
is not divisible by 2 or 5
047619 047619 (I have deliberately made spaces to emphasise the periodic block) ...
otherwise
has an
eventually periodic
decimal expansion
45 45 45 45 ... (here
n
is divisible by 2)
054 054 054 ... (here
n
is divisible by 5)
Anyone who gets preoccupied with the
lengths
of those periodic blocks quickly makes an often made (re)discovery: for prime
p
(
) the
length
of the period of the decimal expansion of
is either (
) or a divisor of (
). A sensitive eye gets
quickly drawn
towards the 'prime' element in all of this because the examples with
long periods
- long in relation to the size of the denominator - having encountered examples like:
142857 142857 ... [period length 6]
0
... [period length 16]
0
... [period length 18]
and the other primes
p
, up to 100, for which
has period length (
) are 23, 29, 47, 59, 61 and 97. Anyone who knows sufficient Number Theory will know that they are primes
p
for which
; in other words they are primes for which 10 is a
primitive root
. [See, too, Section 7 on open problems].
As soon as the eye has got drawn in to
for
, etc, then the eye returns to look at the decimal expansions of the reciprocals of the other primes (not 2 or 5), and notices:
3 3 3 3 3 ... [period length 1]
09 09 09 09 ... [period length 2]
076923 076923 ... [period length 6]
0
... [period length 15]
Maple has a command for computing those
p
eriodic
d
ecimals expansions, and it's called 'pdexpand'. To access it one needs to load Maple's Number Theory package:
>
with(numtheory);
Warning, new definition for M
Warning, new definition for order
>
order(10, 7);
>
pdexpand(1/31);
This is not a Maple tutorial, but anyone who wishes may consult what Maple has to say about 'pdexpand' by executing the following line (first remove the '#', and then execute):
>
# ?pdexpand
>
pdexpand(135/14);
means that
428571 428571 428571 ...
ad infinitum
, and
>
convert(PDEXPAND(-1, 2, [1, 1], [9, 0, 1, 3]), rational);
means that
9013 9013 9013 ... =
.
>
pdexpand(1/7);
>
pdexpand(1/21);
>
pdexpand(1/22);
>
pdexpand(1/185);
>
In passing I cannot resist asking if from:
09 09 09 ... (A)
my reader can determine the decimal expansion of
? In other words, what do you get if you square both sides of (A)?
>
pdexpand(1/11);
>
pdexpand(1/11^2);
And
?
>
pdexpand(1/11^3);
>
A suggestion for playing
. Much fun may be had by investigating (and explaining what's going on with) decimal expansions of
, ... ;
, ... ; etc. A knowledgeable practitioner should be able to quess, and
prove
results.
A word of warning
. One must be careful about saving ones before executing some commands!!
Returning to above
. And now to observe the
obvious
connection to Fermat's little theorem. All, I believe, becomes clear from almost one reflection; simply consider the decimal expansion of, say,
:
142857 142857 ...
ad infinitum
How does one prove that the
non-terminating
decimal on the right hand side is equal to the (rational)
number
? Of course one needs to have studied infinite series to give a precise meaning to such an object...
It's very simple, and straightforward, providing one
knows
that:
for
< 1
and thus:
.111...
ad infinitum
=
=
.010101...
ad infinitum
=
=
.001001001...
ad infinitum
=
=
etc
Two points, now, are simply these:
1. Fermat's little theorem (with
,
) forces
to have the decimal (10) expansion that it has.
2. The decimal expansion of
,
being
what it is, forces Fermat's little theorem
to hold
for
,
.
Why? It's simple;
1. By Fermat's little theorem, with
and
, we have
(mod 7), and thus 7 divides (
). Performing the division by 7 we find that
*142857, and so it
follows
that:
= .142857 142857 142857 ...
ad infinitum
2. If one has determined that the decimal expansion of
is
given by:
142857 142857 ...
ad infinitum
then
one has
, namely
*142857. Thus 7 divides (
), and so it
follows
that
(mod 7).
I hardly need write any more on this?