Chapter 5
Primitive Roots Modulo m.

5.1 Exponent of an Integer Modulo m

Let

a1,a2,,aφ(m) (A)

be the set of φ(m) positive integers not greater than m and prime to m; and let a denote any integer of the set (A). Now any positive integral power of a is prime to m and hence is congruent modulo m to a number of the set (A). Hence, among all the powers of a there must be two, say an and aν, n > ν, which, are congruent to the same integer of the set (A). These two powers are then congruent to each other; that is,

an aν mod m

Since aν is prime to m the members of this congruence may be divided by aν. Thus we have

anν 1 mod m.

That is, among the powers of a there is one at least which is congruent to 1 modulo m.

Now, in the set of all powers of a which are congruent to 1 modulo m there is one in which the exponent is less than in any other of the set. Let the exponent of this power be d, so that ad is the lowest power of a such that

ad 1 mod m. (1)

We shall now show that if aα 1 mod m, then α is a multiple of d. Let us write

α = dδ + β,0 β < d.

Then

aα 1 mod m,  (2) adδ 1 mod m,  (3)

the last congruence being obtained by raising (1) to the power δ. From (3) we have

adδ+β aβ mod m;

or

aβ 1 mod m.

Hence β = 0, for otherwise d is not the exponent of the lowest power of a which is congruent to 1 modulo m. Hence d is a divisor of α.

These results may be stated as follows:

I. If m is any integer and a is any integer prime to m, then there exists an integer d such that

ad 1 mod m

while there is no integer β less than d for which

aβ 1 mod m.

Further, a necessary and sufficient condition that

aν 1 mod m

is that ν is a multiple of d.

DEFINITION. The integer d which is thus uniquely determined when the two relatively prime integers a and m are given is called the exponent of a modulo m. Also, d is said to be the exponent to which a belongs modulo m.

Now, in every case we have

aφ(m) 1,aλ(m) 1 mod m,

if a and m are relatively prime. Hence from the preceding theorem we have at once the following:

II. The exponent d to which a belongs modulo m is a divisor of both φ(m) and λ(m).

5.2 Another Proof of Fermat’s General Theorem

In this section we shall give an independent proof of the theorem that the exponent d of a modulo m is a divisor of φ(m); from this result we have obviously a new proof of Fermat’s theorem itself.

We retain the notation of the preceding section. We shall first prove the following theorem:

I. The numbers

1,a,a2,,aa1 (A)

are incongruent each to each modulo m.

For, if aα aβ mod m, where 0 α < d and 0 β < d, α > β, we have aαβ 1 mod m, so that d is not the exponent to which a belongs modulo m, contrary to hypothesis.

Now any number of the set (A) is congruent to some number of the set

a1,a2,,aφ(m). (B)

Let us undertake to separate the numbers (B) into classes after the following manner: Let the first class consist of the numbers

α1,α2,,αa1, (I)

where αi is the number of the set (B) to which ai is congruent modulo m.

If the class (I) does not contain all the numbers of the set (B), let ai be any number of the set (B) not contained in (I) and form the following set of numbers:

α0ai,α1ai,α2ai,,αd1ai. (II’)

We shall now show that no number of this set is congruent to a number of class (I). For, if so, we should have a congruence of the form

aiaj ak mod m;

hence

aiaj ak mod m,

so that

aiad ak+dj mod m;

or

ai ak+dj mod m,

so that ai would belong to the set (I) contrary to hypothesis.

Now the numbers of the set (II) are all congruent to numbers of the set (B); and no two are congruent to the same number of this set. For, if so, we should have two numbers of (II’) congruent; that is, αkai αjai mod m, or αk αj mod m; and this we have seen to be impossible.

Now let the numbers of the set (B) to which the numbers of the set (II’) are congruent be in order the following:

β0,β1,β2,,βd1. (II)

These numbers constitute our class (II).

If classes (I) and (II) do not contain all the numbers of the set (B), let aj be a number of the set (B) not contained in either of the classes (I) and (II): and form the set of numbers

α0aj,α1aj,α2aj,,αd1aj. (III’)

Just as in the preceding case it may be shown that no number of this set is congruent to a number of class (I) and that the numbers of (III’) are incongruent each to each. We shall also show that no number of (III’) is congruent to a number of class (II). For, if so, we should have akaj βl mod m. Hence akaj alai mod m; or aj al+dk mod m, from which it follows that aj is of class (II), contrary to hypothesis.

Now let the numbers of the set (B) to which the numbers of the set (III’) are congruent be in order the following:

γ0,γ1,γ2,,γd1. (III)

These numbers form our class (III).

It is now evident that the process may be continued until all the numbers of the set (B) have been separated into classes, each class containing d integers, thus:

( I) α0,α1,α2,,αd1, ( II) β0,β1,β2,,βd1, ( III)γ0,γ1,γ2,,γd1,................ () λ0,λ1,λ2,,λd1.

The set (B), which consists of φ(m) integers, has thus been separated into classes, each class containing d integers. Hence we conclude that d is a divisor of φ(m). Thus we have a second proof of the theorem:

II. If a and m are any two relatively prime integers and d is the exponent to which a belongs modulo m, then d is a divisor of φ(m).

In our classification of the numbers (B) into the rectangular array above we have proved much more than theorem II; in fact, theorem II is to be regarded as one only of the consequences of the more general result contained in the array.

If we raise each member of the congruence

ad 1 mod m

to the (integral) power φ(m)/d, the preceding theorem leads immediately to an independent proof of Fermat’s general theorem.

5.3 Definition of Primitive Roots

DEFINITION. Let a and m be two relatively prime integers. If the exponent to which a belongs modulo m is φ(m), a is said to be a primitive root modulo m (or a primitive root of m).

In a previous chapter we saw that the congruence

aλ(m) 1 mod m

is verified by every pair of relatively prime integers a and m. Hence, primitive roots can exist only for such a modulus m as satisfies the equation

φ(m) = λ(m). (1)

We shall show later that this is also sufficient for the existence of primitive roots.

From the relation which exists in general between the φ-function and the λ-function in virtue of the definition of the latter, it follows that (1) can be satisfied only when m is a prime power or is twice an odd prime power.

Suppose first that m is a power of 2, say m = 2α. Then (1) is satisfied only if α = 0,1,2. For α = 0 or 1, 1 itself is a primitive root. For α = 2, 3 is a primitive root. We have therefore left to examine only the cases

m = pα,m = 2pα

where p is an odd prime number. The detailed study of these cases follows in the next sections.

5.4 Primitive roots modulo p.

We have seen that if p is a prime number and d is the exponent to which a belongs modulo p, then d is a divisor of φ(p) = p 1. Now, let

d1,d2,d3,,dr

be all the divisors of p 1 and let ψ(di) denote the number of integers of the set

1,2,3,,p 1

which belong to the exponent di. If there is no integer of the set belonging to this exponent, then ψ(di) = 0.

Evidently every integer of the set belongs to some one and only one of the exponents d1,d2,,dr. Hence we have the relation

ψ(d1) + ψ(d2) + + ψ(dr) = p 1.  (1)

But

φ(d1) + φ(d2) + + φ(dr) = p 1.  (2)

If then we can show that

ψ(di) φ(di) (3)

for i = 1,2,,r, it will follow from a comparison of (1) and (2) that

ψ(di) = φ(di).

Accordingly, we shall examine into the truth of (3).

Now the congruence

xdi 1modp (4)

has not more than di roots. If no root of this congruence belongs to the exponent di, then if ψ(di) = 0 and therefore in this case we have ψ(di) < φ(di). On the other hand if a is a root of (4) belonging to the exponent di, then

a,a2,a3,,adi (5)

are a set of di incongruent roots of (4); and hence they are the complete set of roots of (4).

But it is easy to see that ak does or does not belong to the exponent di according as k is or is not prime to di; for, if ak belongs to the exponent t, then t is the least integer such that kt is a multiple of di. Consequently the number of roots in the set (5) belonging to the exponent di is φ(di). That is, in this case ψ(di) = φ(di). Hence in general ψ(di) φ(di) Therefore from (1) and (2) we conclude that

ψ(di) = φ(di),i = 1,2,,r.

The result thus obtained may be stated in the form of the following theorem:

I. If p is a prime number and d is any divisor of p 1, then the number of integers belonging to the exponent d modulo p is φ(d).

In particular:

II. There exist primitive roots modulo p and their number is ψ(p i).

5.5 Primitive Roots Modulo pα, p an Odd Prime

In proving that there exist primitive roots modulo pα, where p is an odd prime and α > 1, we shall need the following theorem:

I. There always exists a primitive root γ modulo p for which γp1 is not divisible by p2.

Let g be any primitive root modulo p. If gp1 is not divisible by p2 our theorem is verified. Then suppose that gp1 1 is divisible by p2, so that we have

gp1 1 = kp2

where k is an integer. Then put

γ = g + xp

where x is an integer. Then γ = gmodp, and hence

γh gh modp;

whence we conclude that γ is a primitive root modulo p. But

γp1 1 = gp1 1 + p 1 1! gp2xp + (p 1)(p 2) 2! gp3x2p2 + = p kp + p 1 1! gp2x + (p 1)(p 2) 2! gp3x2p + .

Hence

γp1 1 p(gp2x)modp2.

Therefore it is evident that x can be so chosen that γp1 1 is not divisible by p2. Hence there exists a primitive root γ modulo p such that γp1 1 is not divisible by p2. Q. E. D.

We shall now prove that this integer γ is a primitive root modulo pα, where α is any positive integer.

If

γk 1modp.

then k is a multiple of p 1, since γ is a primitive root modulo p. Hence, if

γk 1modpα,

then k is a multiple of p 1.

Now, write

γp1 = 1 + hp.

Since γp1 is not divisible by p2, it follows that h is prime to p. If we raise each member of this equation to the power βpα2, α>=2, we have

γβpα2(p1) = 1 + βpα1h + pαI,

where I is an integer. Then if

γβpα2(p1) 1modpα,

β must be divisible by p. Therefore the exponent of the lowest power of γ which is congruent to 1 modulo pα is divisible by pα1. But we have seen that this exponent is also divisible by p 1. Hence the exponent of γ modulo pα is pα1(p 1) since φ(pα) = pα1(p 1). That is, γ is a primitive root modulo pα.

It is easy to see that no two numbers of the set

γ,γ2,γ3,,γpα1(p1) (A)

are congruent modulo pα; for, if so, γ would belong modulo pα to an exponent less than pα1(p 1) and would therefore not be a primitive root modulo pα. Now every number in the set (A) is prime to pα; their number is φ(pα) = pα1(p 1). Hence the numbers of the set (A) are congruent in some order to the numbers of the set (B):

a1,a2,a3,,apα1(p1), (B)

where the integers (B) are the positive integers less than pα and prime to pα.

But any number of the set (B) is a solution of the congruence

xpα1(p1) 1 mod pα. (1)

Further, every solution of this congruence is prime to pα. Hence the integers (B) are a complete set of solutions of (1). Therefore the integers (A) are a complete set of solutions of (1). But it is easy to see that an integer γk of the set (A) is or is not a primitive root modulo pα according as k is or is not prime to pα1(p 1). Hence the number of primitive roots modulo pα is φ{pα1(p 1)}.

The results thus obtained may be stated as follows:

II. If p is any odd prime number and α is any positive integer, then there exist primitive roots modulo pα and their number is φ{φ(pα)}.

5.6 Primitive Roots Modulo 2pα, p an Odd Prime

In this section we shall prove the following theorem:

If p is any odd prime number and α is any positive integer, then there exist primitive roots modulo 2pα and their number is φ{φ(2pα)}.

Since 2pα is even it follows that every primitive root modulo 2pα is an odd number. Any odd primitive root modulo pα is obviously a primitive root modulo 2pα. Again, if γ is an even primitive root modulo pα then γ + pα is a primitive root modulo 2pα. It is evident that these two classes contain (without repetition) all the primitive roots modulo 2pα. Hence the theorem follows as stated above.

5.7 Recapitulation

The results which we have obtained in §§5.35.6 inclusive may be gathered into the following theorem:

In order that there shall exist primitive roots modulo m, it is necessary and sufficient that m shall have one of the values

m = 1,2,4,pα,2pα

where p is an odd prime and α is a positive integer.

If m has one of these values then the number of primitive roots modulo m is φ{φ(m)}.

5.8 Primitive λ-roots

In the preceding sections of this chapter we have developed the theory of primitive roots in the way in which it is usually presented. But if one approaches the subject from a more general point of view the results which may be obtained are more general and at the same time more elegant. It is our purpose in this section to develop the more general theory.

We have seen that if a and m are any two relatively prime positive integers, then

aλ(m) 1modm.

Consequently there is no integer belonging modulo m to an exponent greater than λ(m). It is natural to enquire if there are any integers a which belong to the exponent λ(m). It turns out that the question is to be answered in the affirmative, as we shall show. Accordingly, we introduce the following definition:

DEFINITION. If aλ(m) is the lowest power of a which is congruent to 1 modulo m, a is said to be a primitive λ-root modulo m. We shall also say that it is a primitive λ-root of the congruence xλ(m) = 1modm. To distinguish we may speak of the usual primitive root as a primitive φ-root modulo m.

From the theory of primitive φ-roots already developed it follows that primitive λ-roots always exist when m is a power of any odd prime, and also when m = 1,2,4; for, for such values of m we have λ(m) = φ(m).

We shall next show that primitive λ-roots exist when m = 2α, a > 2, by showing that 5 is such a root. It is necessary and sufficient to prove that 5 belongs modulo 2α to the exponent 2α2 = λ(2α). Let d be the exponent to which 5 belongs modulo 2α. Then from theorem II of §5.1 it follows that d is a divisor of 2α2 = λ(2α). Hence if d is different from 2α2 it is 2α3 or is a divisor of 2α3. Hence if we can show that 52α3 is not congruent to 1 modulo 2α we will have proved that 5 belongs to the exponent 2α2. But, clearly,

52α3 = (1 + 22)2α3 = 1 + 2α1 + I 2α,

where I is an integer. Hence

52α3 1 mod 2α.

Hence 5 belongs modulo 2α to the exponent λ(2α).

By means of these special results we are now in position to prove readily the following general theorem which includes them as special cases:

I. For every congruence of the form

xλ(m) 1 mod m

a solution g exists which is a primitive λ-root, and for any such solution g there are φ{λ(m)} primitive roots congruent to powers of g.

If any primitive λ-root g exists, gν is or is not a primitive λ-root according as ν is or is not prime to λ(m); and therefore the number of primitive λ-roots which are congruent to powers of any such root g is φ{λ(m)}.

The existence of a primitive λ-root in every case may easily be shown by induction. In case m is a power of a prime the theorem has already been established. We will suppose that it is true when m is the product of powers of r different primes and show that it is true when m is the product of powers of r + 1 different primes; from this will follow the theorem in general.

Put m = p1α1p2α2prαrpr+1αr+1,n = p1α1p2α2prαr, and let h be a primitive λ-root of

xλ(n) 1modn. (1)

Then

h + ny

is a form of the same root if y is an integer.

Likewise, if c is any primitive λ-root of

xλ(p r+1αr+1 ) 1modpr+1αr+1 (2)

a form of this root is

c + pr+1αr+1 z

where z is any integer.

Now, if y and z can be chosen so that

h + ny = c + pr+1αr+1 z

the number in either member of this equation will be a common primitive λ-root of congruences (1) and (2); that is, a common primitive λ-root of the two congruences may always be obtained provided that the equation

p1α1 prαr y pr+1αr+1 z = c h

has always a solution in which y and z are integers. That this equation has such a solution follows readily from theorem III of §1.9; for, if c h is replaced by 1, the new equation has a solution ȳ, z̄; and therefore for y and z we may take y = ȳ(c h), z = z̄(c h).

Now let g be a common primitive λ-root of congruences (1) and (2) and write

gν 1modm,

where ν is to be the smallest exponent for which the congruence is true. Since g is a primitive λ-root of (1) ν is a multiple of λ(p1α1prαr). Since g is a primitive λ-root of (2) ν is a multiple of λ pr+1αr+1 . Hence it is a multiple of λ(m). But gλ(m) 1 mod m; therefore ν = λ(m). That is, g is a primitive λ-root modulo m.

The theorem as stated now follows at once by induction.

There is nothing in the preceding argument to indicate that the primitive λ-roots modulo m are all in a single set obtained by taking powers of some root g; in fact it is not in general true when m contains more than one prime factor.

By taking powers of a primitive λ-root g modulo m one obtains φ{λ(m)} different primitive λ-roots modulo m. It is evident that if γ is any one of these primitive λ-roots, then the same set is obtained again by taking the powers of γ. We may say then that the set thus obtained is the set belonging to g.

II. If λ(m) > 2 the product of the φ{λ(m)} primitive λ-roots in the set belonging to any primitive λ-root g is congruent to 1 modulo m.

These primitive λ-roots are

g,gc1 ,gc2 ,,gcμ

where

1,c1,c2,,cμ

are the integers less than λ(m) and prime to λ(m). If any one of these is c another is λ(m) c, since λ(m) > 2. Hence

1 + c1 + c2 + + cμ 0 mod λ(m).

Therefore

g1+c1+c2++cμ 1 mod m.

From this the theorem follows.

COROLLARY.The product of all the primitive λ-roots modulo m is congruent to 1 modulo m when λ(m) > 2.

EXERCISES

1.
If x1 is the largest value of x satisfying the equation λ(x) = a, where a is a given integer, then any solution x2 of the equation is a factor of x1.
2*.
Obtain an effective rule for solving the equation λ(x) = a.
3*.
Obtain an effective rule for solving the equation φ(x) = a.
4.
A necessary and sufficient condition that aP1 1 modP for every integer a prime to P is that P 1 modλ(P).
5.
If aP1 1 modP for every a prime to P, then (1) P does not contain a square factor other than 1, (2) P either is prime or contains at least three different prime factors.
6.
Let p be a prime number. If a is a root of the congruence xq 1 modp and α is a root of the congruence xδ 1 modp, then aα is a root of the congruence xdδ 1 modp. If a is a primitive root of the first congruence and α of the second and if d and δ are relatively prime, then aα is a primitive root of the congruence xdδ 1 modp.