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 [Maple Math] (where p is any prime with [Maple Math] ) appears to an investigator to be (and may be proved using Fermat's little theorem to be):

either ( [Maple Math] )

or a divisor of ( [Maple Math] )

Start . Many sensitive young people are fascinated (or, at least, used to be!) with phenomena like :

[Maple Math]

[Maple Math] ... ad infinitum

[Maple Math]

[Maple Math]

[Maple Math] ... ad infinitum

[Maple Math] 142857 142857 ... ad infinitum
[Here, and elsewhere, I make spaces to emphasise the periodic block.]

[Maple Math] 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 [Maple Math] (where m and n are positive, [Maple Math] ) has a periodic decimal expansion provided n is not divisible by 2 or 5

[Maple Math] 047619 047619 (I have deliberately made spaces to emphasise the periodic block) ...

otherwise [Maple Math] has an eventually periodic decimal expansion

[Maple Math] 45 45 45 45 ... (here n is divisible by 2)

[Maple Math] 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 ( [Maple Math] ) the length of the period of the decimal expansion of [Maple Math] is either ( [Maple Math] ) or a divisor of ( [Maple Math] ). 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:

[Maple Math] 142857 142857 ... [period length 6]
[Maple Math] 0 [Maple Math] ... [period length 16]
[Maple Math] 0 [Maple Math] ... [period length 18]

and the other primes
p , up to 100, for which [Maple Math] has period length ( [Maple Math] ) are 23, 29, 47, 59, 61 and 97. Anyone who knows sufficient Number Theory will know that they are primes p for which [Maple Math] ; 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
[Maple Math] for [Maple Math] , etc, then the eye returns to look at the decimal expansions of the reciprocals of the other primes (not 2 or 5), and notices:

[Maple Math] 3 3 3 3 3 ... [period length 1]
[Maple Math] 09 09 09 09 ... [period length 2]
[Maple Math] 076923 076923 ... [period length 6]
[Maple Math] 0 [Maple Math] ... [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

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> order(10, 7);

[Maple Math]

> pdexpand(1/31);

[Maple Math]

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);

[Maple Math]

means that [Maple Math] 428571 428571 428571 ... ad infinitum , and

> convert(PDEXPAND(-1, 2, [1, 1], [9, 0, 1, 3]), rational);

[Maple Math]

means that [Maple Math] 9013 9013 9013 ... = [Maple Math] .

> pdexpand(1/7);

[Maple Math]

> pdexpand(1/21);

[Maple Math]

> pdexpand(1/22);

[Maple Math]

> pdexpand(1/185);

[Maple Math]

>

In passing I cannot resist asking if from: [Maple Math] 09 09 09 ... (A)

my reader can determine the decimal expansion of [Maple Math] ? In other words, what do you get if you square both sides of (A)?

> pdexpand(1/11);

[Maple Math]

> pdexpand(1/11^2);

[Maple Math]

And [Maple Math] ?

> pdexpand(1/11^3);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

>

A suggestion for playing . Much fun may be had by investigating (and explaining what's going on with) decimal expansions of [Maple Math] , ... ; [Maple Math] , ... ; 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, [Maple Math] :

[Maple Math] 142857 142857 ... ad infinitum

How does one prove that the non-terminating decimal on the right hand side is equal to the (rational)

number [Maple Math] ? 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:

[Maple Math] for [Maple Math] < 1

and thus:

.111... ad infinitum = [Maple Math] = [Maple Math]

.010101... ad infinitum = [Maple Math] = [Maple Math]

.001001001... ad infinitum = [Maple Math] = [Maple Math]

etc

Two points, now, are simply these:

1. Fermat's little theorem (with [Maple Math] , [Maple Math] ) forces [Maple Math] to have the decimal (10) expansion that it has.

2. The decimal expansion of [Maple Math] , being what it is, forces Fermat's little theorem to hold for [Maple Math] , [Maple Math] .

Why? It's simple;

1. By Fermat's little theorem, with [Maple Math] and [Maple Math] , we have [Maple Math] (mod 7), and thus 7 divides ( [Maple Math] ). Performing the division by 7 we find that [Maple Math] *142857, and so it follows that:

[Maple Math] = .142857 142857 142857 ... ad infinitum

2. If one has determined that the decimal expansion of [Maple Math] is given by:

[Maple Math] 142857 142857 ... ad infinitum

then one has [Maple Math] , namely [Maple Math] *142857. Thus 7 divides ( [Maple Math] ), and so it follows that [Maple Math] (mod 7).

I hardly need write any more on this?

Contact details 

After August 31st 2007 please use the following Gmail address: jbcosgrave at gmail.com


This page was last updated 18 February 2005 15:08:45 -0000