In this article we shall look at some elementary results in Number Theory,
partly because they are interesting in themselves, partly because they are
useful in other contexts (for example in olympiad problems), and partly because
they will give you a flavour of what Number Theory is about.
You will require a little knowledge in advance, but not much: you need to be
familiar with congruence notation, and you need to know that if
and
are
coprime (have highest common factor 1) then
has a multiplicative inverse
mod
(that is, there is an integer
such that
).
You can find an explanation of all of this in the article called
Modular Arithmetic.
You might also find it useful to know that an integer is a whole number
(..., -3, -2, -1, 0, 1, 2, 3, ... are all integers), and by
natural number, I mean a positive integer (1, 2, 3, ...). Sometimes
people include 0 as a natural number, but I'm not going to in this article.
We say that
divides
, written
, if there is an integer
such that
. So for example,
(as
), but
.
We need a little property of primes to help us later. The property is that if
is a prime and
, then
or
. Is this obvious? Well, no,
not really, because it's not true unless
is a prime. For example, 4
divides
, but 4 does not divide 6 and 4 does not divide 10.
Let's prove it (for primes, of course!). We know that
. If
or
, then obviously the result is true, so let's suppose that it doesn't.
Now we're going to use Bézout's Theorem, which says that
and
are coprime if and only if there exist integers
and
such that
. Since
,
and
are coprime (remember,
is a prime).
So there exist integers
and
such that
. Similarly, there are
integers
and
such that
. Let's multiply these equations
together. Then
.
But
and certainly
, so
divides the right-hand side, so
.
But this is absurd. So
or
.
We can use this result and induction to prove the following very important
theorem:
The Fundamental Theorem of Arithmetic: Every natural number
can
be expressed in an essentially unique way as the product of prime numbers.
By "essentially unique'', I mean "counting different orderings of the primes
as the same'':
, but I'm counting these products as
essentially the same. You should also note the very important fact that 1 is
not a prime number - otherwise this theorem would clearly be false!
I'm not going to prove this result here, but you might like to have a go
yourself, or you can look it up in any introductory book on number theory.
The first theorem we're going to prove is called Fermat's Little Theorem,
sometimes, confusingly, known as FLT (confusing because FLT is also used to
refer to Fermat's Last Theorem, which is something quite different!). Here's
what the theorem says:
Theorem: Let
be a prime and
a natural number not divisible by
. Then
This is in essence the same as the following statement:
Let
be a prime and
a natural number. Then
Why is this really the same? If
, then it's pretty obvious
that
. If
, then it has an inverse,
so we can multiply both sides of (2) by the inverse and get back (1). Also, I hope
it's clear that we can multiply both sides of (1) by
to get (2).
Let's prove the theorem (we'll prove (1)). Consider the set
. This contains all of the distinct non-zero elements
mod
(that is, they are all different, and none of them is zero mod
).
Since they are all non-zero, if we multiply them all together, we'll get
something non-zero mod
(repeatedly using the result from earlier that if
then
or
). Now consider the set
,
where we reduce each element mod
(so it lies between 0 and
). Now
none of these numbers is 0 mod
, and they are all distinct (check this, if
you don't believe me!). So it's the set of all of the non-zero elements mod
. So certainly multiplying all the numbers in the second set gives the same
answer as multiplying all the numbers in the first set (mod
). In symbols,
. Since
, we can
divide by it, leaving
.
The next theorem is a generalisation of Fermat's Little Theorem, but first we
need to define a new function.
The Euler phi function, also known as the Euler totient function,
is defined as the function
(that is,
taking values in the natural numbers and giving values in the natural numbers)
where
is the number of natural numbers less than or equal to
that
are coprime to
. So
for all primes
(because everything
less than
is coprime to
), for example. Another example:
,
since 1, 2, 4, 7, 8, 11, 13 and 14 are exactly the natural numbers less than
and coprime to 15.
This function has a special property. If
and
are coprime, then
. I'm going to leave the proof of this to you as an
exercise, because with a couple of hints it's not too hard. We've already
worked out what
is if
is prime. Now work out
and
then work out
where
is a natural number. Now work out
, where
and
are different primes, and work up to
, again where
and
are distinct primes. Spotted the
pattern? Now use the Fundamental Theorem of Arithmetic (see above) to prove
that
for coprime
,
.
Now let's look at a generalisation of Fermat's Little Theorem, sometimes
called the Fermat-Euler Theorem.
Theorem: Let
be a natural number and
an integer coprime to
. Then
.
Why is this a generalisation of Fermat's Little Theorem? Well, consider when
is prime. Then
, and we get back exactly the statement of
Fermat's Little Theorem.
I'm going to leave the proof as an exercise, as it's very similar to the proof
of Fermat's Little Theorem.
We now come to the last theorem in this article, called Wilson's
Theorem.
Theorem: Let
be a prime number. Then
(where ! denotes factorial).
At first sight, it might seem totally unclear how one could go about proving
this, but there is a beautiful and simple proof that I shall outline now.
Remember that each of the numbers 1, 2, 3, ...,
has an inversemod
? So we can pair off numbers, so that a number in the pair is the inverse
of the other number in the pair. But a number could be the inverse of itself.
When does this happen? If you think about it, you'll see that
is its own
inverse only if
. That is,
is its own inverse only if
, and since
is prime, we see that we must have
or
, so the only numbers between 1 and
that are their own inverses are 1 and
. Now let's think back to
. Each pair
contributes 1 to this product, so the only
things we have left to worry about are 1 and
. So
, as we wanted.
I hope this has given you a flavour of what Number Theory is about; there
are numerous books available that continue to develop the theory, and large
numbers of olympiad problems you might like to tackle with your new knowledge!