Académique Documents
Professionnel Documents
Culture Documents
1 Introduction
We start off with a very famous theorem and the usual proof of it:
Theorem 1 (Wilsons Theorem). Let m be a positive integer. Then
(m 1)! 1 (mod m)
x2 1 (mod m)
(x 1)(x + 1) 0 (mod m)
x 1 (mod m) or x m 1 (mod m).
Hence,
(m 1)! 1 (m 1) 1 (mod m).
1
The multiplicative inverse of an integer x modulo a positive integer m is an integer
x modulo m which satisfies xx1 1 (mod m). It is well known that x1 exists if and
1
1
2 A Generalisation of Wilsons Theorem
While the only if -part is trivial, the proof of the if -part of Wilsonss The-
orem contains certain thoughts which can be adapted for one of the many
generalisations of Wilsons Theorem, which is usually credited with Euler.
Proposition 1. Let m 2 be a positive integer and let T (m) be the product
of all integers x with 1 x m and gcd(x, m) = 1, that is,
Y
T (m) := x.
1xm
gcd(x,m)=1
Then (
1 if m = 2, 4, pk , 2pk
T (m) (mod m),
1 else
where p is an odd prime number and k a positive integer.
The trained eye will recognize the numbers m for which T (m) 1 (mod m)
as exactly the numbers modulo which primitive roots exist. A more detailled
relation between these results requires deeper knowledge of algebra (in par-
ticular group theory) and is rudimentarily discussed in Section 3.
The main idea of the proof of Proposition 1 is very similar to the proof of the
if -part of Wilsons Theorem, for the concrete implementation, we however
shall require some more theory.
Defninition 1. Let m 2 be a positive integer. Then A(m) denotes the set
of all integers x coprime to m with 1 x m having order2 1 or 2, that is
Let furthermore (m) := |A(m)| and let P (m) be the product of all elements
in A(m), that is, Y
P (m) := x.
xA(m)
2
Lemma 1. Let m 2 be an integer. Then
P (m) (1)(m)/2 .
Proof. We have
Y Y Y
P (m) = x= x x(x)
xA(m) 1xm 1x m2
m|(x2 1) m|(x2 1)
Y Y
= x2 1 = (1)(m)/2 (mod m).
1x m2
1x m2
m|(x2 1) m|(x2 1)
We thus see that when analyzing P (m), it is not necessary to know the exact
residue classes in A(m) but sufficient to know only the number of them. In
the following, we will find a general formula for (m).
Proof. This directly follows from a trivial inspection: we have A(1) = {1},
A(2) = {1} and A(4) = {1, 3}.
x2 1 (mod 2k )
(x 1)(x + 1) 0 (mod 2k ). (1)
3
Since x 1 and x + 1 are two consecutive even integers, (1) is equivalent to
Proof. We have
x2 1 (mod pk )
(x 1)(x + 1) 0 (mod pk ). (2)
x 1, 1 (mod pk ),
so
A(pk ) = {1, pk 1}
and hence, (pk ) = 2.
It thus remains to find (m) for composite numbers m.
Lemma 6. The function is multiplicative, that is, for all positive integers
m, n with gcd(m, n) = 1 we have
(mn) = (m)(n).
4
Proof. Suppose that y1 , . . . , y(m) A(m) and z1 , . . . , z(n) A(n) are the
residues modulo m and n with order 1 or 2 respectively. Then x2 1
(mod mn) holds if and only if
for some integer i with 1 i (m) and some integer j with 1 j (n).
Obviously there are (m)(n) ways to choose such a pair (i, j) and since we
get a different residue modulo mn in A(mn) for different pairs (i, j) by the
chinese remainder theorem3 , we obtain (mn) = (m)(n).
From Lemma 3 to 6, we obtain the following formula for (m):
Theorem 2. Let m = 2k pk11 . . . pkr r be the prime factorization of a positive
integer m (r 0, k 0, ki 1). Then
r
2
if k 1
(m) = 2 r+1
if k = 2
r+2
2 if k 3.
x x1 (mod m1 )
..
.
x xr (mod mr )
5
3 Prospects
From a much more advanced point of view, we know from the Chinese Re-
mainder Theorem that
holds for any positive integer m 2 having the canonical prime factorization
m = p1 1 . . . pr r .
Furthermore,
(
i C(pi i ) if primitive roots modulo pi i exist
(Z/pi Z)
C2i 2 C2 if pi = 2 and i 3,
Y Y
x= g1a1 . . . gkak .
x(Cm1 ...Cmk ) 0ik
0ai <mi
6
times in this product. Hence,
Y m1 ...mk Pm1 m1 ...mk Pmk
a1 ak m1 a1 =0 a1 m ak =0 ak
g1 . . . gk = g1 . . . gk k
i=1,...,k
0ai <mi
m1 ...mk m1 (m1 1) m1 ...mk mk (mk 1)
m1 2 mk 2
= g1 . . . gk
m1 ...mk (m1 1) m1 ...mk (mk 1)
= g1 2
. . . gk 2
.
But g1l1 . . . gklk = 1 holds if and only if mi |li for all i = 1, . . . , k since we are
working with a direct product. Thus,
m1 ...mk (m1 1) m1 ...mk (mk 1)
g1 2
. . . gk 2
=1
holds if and only if we have
m1 . . . mk
mi | (mi 1) (3)
2
for all i = 1, . . . , k. But we know that m1 , . . . , mk are even, so (3) holds if
and only if k > 1 which in other words means that (Z/mZ) is not cyclic. If
k = 1 then
m1 (m1 1) m1 m1 (m1 1)
m1 but | ,
2 2 2
so
m1 (m1 1) m1
(mod m1 ).
2 2
Thus, if g is a primitive root modulo m, then
Y m1 (m1 1) m1
x=g 2 = g 2 = 1.
x(Z/mZ)
Hence, (
Y 1 if (Z/mZ) is cyclic
x=
x(Z/mZ)
1 else
which is just the claim of Proposition 1.
We see that the proof works not only with (Z/mZ) but with any finite
abelian group G which can be written as a product of cyclic groups of even
order. Therefore, we obtain the following generalisation:
7
Corollary 2. Let m1 , . . . , mk be positive integers and suppose that
G Cm1 . . . Cmk