Sei sulla pagina 1di 222

ELEMENTARY THEORY OF NUMBERS

INTERNATIONAL SERIES IN

PURE AND APPLIED MATHEMATICS


William Ted Martin and E. H. Spanier
CONSULTING EDITORS

ahlfors Complex Analysis


bellman Stability Theory of Differential Equations
buck Advanced Calculus
busacker and saaty Finite Graphs and Networks
cheney Introduction to Approximation Theory
coddington and levinson Theory of Ordinary Differential Equations
dettman Mathematical Methods in Physics and Engineering

epstein

Partial Differential Equations

golomb and shanks Elements of Ordinary Differential Equations


graves The Theory of Functions of Real Variables
Greenspan Introduction to Partial Differential Equation?
griffin Elementary Theory of Numbers
hamming Numerical Methods for Scientists and Engineers
hildebrand Introduction to Numerical Analysis
householder Principles of Numerical Analysis

Elements of Pure and Applied Mathematics


Vector and Tensor Analysis
lepage Complex Variables and the Laplace Transform for Engineers
nehari Conformal Mapping
newell Vector Analysis
ralston A First Course in Numerical Analysis
rosser Logic for Mathematicians
rudin Principles of Mathematical Analysis
saaty and bram Nonlinear Mathematics
Simmons Introduction to Topology and Modern Analysis
Sneddon Elements of Partial Differential Equations
Sneddon Fourier Transforms
stoll Linear Algebra and Matrix Theory
struble Nonlinear Differential Equations
lass

lass

weinstock
weiss

Calculus of Variations

Algebraic

zemanian

Number Theory

Distribution Theory and Transform Analysis

ELEMENTARY
THEORY OF NUMBERS

HARRIET GRIFFIN
Associate Professor of Mathematics

Brooklyn College

McGRAW-HILL BOOK COMPANY,


NEW YORK

TORONTO
1954

INC.

LONDON

ELEMENTARY THEORY OF NUMBERS


Copyright, 1954, by the McGraw-Hill Book Company, Inc. Printed in the
United States of America. All rights reserved. This book, or parts thereof,
may not be reproduced in any form without permission of the publishers.
Library of Congress Catalog Card

Number 53-12046

6789-MP-9876
24785

PREFACE
The arithmetic theory of numbers is ever a fascinating subject, the
fundamentals of which can be presented with ease and profit to the average undergraduate student of mathematics and to those who are preparing to teach mathematics provided that these students are stimulated
by a clear and logical treatment of carefully selected topics. It is the
aim of this textbook to offer such a development of the subject. The
facts and methods of proof are old, indeed, but the author believes that
her experience of teaching the theory of numbers for over fifteen years
has enabled her to choose the topics that not only develop the student's

an ample basis for


more advanced work. The simplicity and lucidity of the presentation
have been tested time and again in the classroom. Experiment has
shown that the student appreciates knowing on exactly what foundation
insight into the problems of this field but also furnish

Consequently, care has been taken


he can readily understand. Definitions are precise, but in elementary form.
Each new concept is illustrated.
Theorems are proved in detail. Brief historical comments
elucidate the material and provide a setting for it.
The exercises are
graded. They include a sufficiently large number of numerical problems
the reasoning
to orient

him

is

to be constructed.

at a level

and

in language

to develop the student's power of inspection,

some to test his understanding of simple theoretical questions, and others to challenge his originality.
It is to be emphasized that this book is just a text.
It is written for
the student rather than the teacher. It is neither erudite nor exhaustive.
The reader with a good grasp of algebra and the ability to concentrate
will be able to understand it.
It is hoped, moreover, that it will interest

him and induce him to pursue his inquiries further.


The author is indebted to her students in both the graduate and undergraduate divisions of Brooklyn College for their help in accomplishing
this work.
They have patiently perused mimeographed and lithoprinted

by their lively reactions the parts to be retained,


improved, or deleted. One of them, Miss Alice Osterberg, has given
expert assistance in reading the proof. Their contributions are gratefully
acknowledged.
material, indicating

Vi

PREFACE

It is apparent that there is more material in the text than can be


covered by the average class of undergraduates in only one semester.
Owing either to the importance of the information or to the method of
proof involved, however, with the exception of Theorem 3-20, on the

number

of primes not exceeding the positive integer n, it is suggested


that no theorem be omitted until Chap. 4 has been completed. Then,
for the ordinary course,

Theorems

5-7, 5-8, 5-9,

and

5-11,

Theorems

6-3

through 6-6 and 6-9 through 6-12, Theorems 7-11 through 7-16, as well
For the convenience of the reader the
as all of Chap. 8 may be omitted.
theorems just mentioned have been marked with an asterisk. Most
instructors will wish to include as much of Chap. 9, on quadratic residues,
as time permits.
Theorems from Chap. 10 may be selected at pleasure
provided that Theorem 10-4, on the Pythagorean triangle, is included.
The last two chapters will, doubtless, have to be omitted in a 45-hour
course.

Harriet Griffin

CONTENTS
PREFACE

chapter

THE FUNDAMENTAL LAWS

1.

1-2.

The development of the integers


The system of rational integers

1-3.

Definitions

1-4.

The

1-1.

2
6

principle of

chapter

Archimedes

2.

THE LINEAR DIOPHANTINE EQUATION

2-4.

The form ax + by
The Diophantine equation ax + by = n
A method for finding a solution of ax + by = n
The solution of the linear Diophantine equation in more than two

2-5.

Simultaneous linear Diophantine equations

2-1.
2-2.
2-3.

chapter

3-3.
3-4.

Unique factorization

3-5.

Fermat's method of infinite descent


The Euclidean algorithm

3-2.

3-6.
3-7.
3-8.
3-9.

The
The

least

common

3-12.

The highest power of a prime that


Some theorems on primes

Congruent integers

4-2.

Basic properties of congruences

4-3.

The

4-5.

is

53
54
56
58
62

residue classes
<j>

a factor of n!

36
37
40
46

PROPERTIES OF CONGRUENCES

4-1.

4-4. Euler's

23

33
34

an integer
Perfect numbers

4.

21

31

multiple

divisors of

chapter

19

variables

25
25
26
28
30

3-10. Scales of notation


3-11.

16

PROPERTIES OF INTEGERS

3.

The composite
The sieve of Eratosthenes
The number of primes

3-1.

14

function

Residue systems modulo

m
vii

CONTENTS

Vlll

chapter
5-1. Identical

5-2.
5-3.
5-4.
5-5.
5-6.
5-7.
5-8.

5-9.

Equivalent congruences
Linear congruences
Division of polynomials

The number and multiplicity of


The Chinese remainder theorem

6-2.
6-3.

of f(x)

The Mobius function

An

7.

7-1.

The X function
Belonging to an exponent modulo
Another test for a prime

7-7.

7-8.
7-9.

7-10.

7-11.

89
92
93
96

ON BELONGING TO AN EXPONENT

7-2.

7-6.

88

Mobius inversion formula

application of the

chapter

7-5.

Fermat's theorem
Applications of Fermat's theorem
Wilson's theorem

6-4.

7-4.

= 0(mod m)

(mod p 8 )

98
100
104
105
107
108
112
114
116
118
118

Primitive roots
Gauss' method for finding a primitive root modulo p
Primitive roots modulo p n and 2p n
Primitive X roots
Integers belonging to a divisor of X(2 n ) modulo 2 n
Integers belonging to a divisor of <j>(p n ) modulo p n
Integers belonging to a divisor of <f>(2p n ) modulo 2p n
Integers belonging to a divisor of X(m) modulo m

chapter

8.

INDICES

a prime modulus
8-2. Euler's criterion for the solvability of x n

125
129

8-1. Indices for

chapter

9.

The

9-2.

Quadratic residues
The Legendre symbol
The prime moduli of which an integer
The Jacobi symbol
The solution of x 2 = a (mod 2 n )

9-4.

9-5.

9-6.

chapter

10.

10-3.

Fermat's

10-4.

The area of an integral right triangle


The generalized Wilson theorem
The Pellian equation

10-5.

last

is

a quadratic residue

134
135
139
140
152
156

SOME FAMOUS PROBLEMS

10-2.

10-6.

c(mod m)

general quadratic congruence

The Waring problem


The equation x 2 + y 2 =

10-1.

QUADRATIC RESIDUES

9-1.

9-3.

66
68
70
72
75
79
80
84
85

THE THEOREMS OF FERMAT AND WILSON AND


THE MOBIUS FUNCTION

6.

6-5.

7-3.

...

the solutions of a congruence

Other simultaneous linear congruences


of solutions of the congruence fix)

The number
The solution
chapter

6-1.

THE SOLUTION OF CONGRUENCES

5.

and conditional congruences

z2

theorem

158
167
168
168
170
172

CONTENTS
chapter
11-1. Integral

domains and

11.

POLYNOMIALS

fields

Polynomials with respect to a prime modulus


11-3. A method for solving a congruence modulo p, a prime
11-2.

chapter
12-1.

The additive theory

of

12.

IX

177
186
188

PARTITIONS

numbers

12-2. Partitions with repetitions


12-3.

Diagrams

12-4.

Generating functions for the number of partitions

of partitions

190
191
192
193

BIBLIOGRAPHY

197

INDEX

199

CHAPTER

THE FUNDAMENTAL LAWS


1-1.

The Development

of the Integers.

The

rational integers are the

many centuries of development of the concept of number.


Doubtless man learned first to distinguish oneness and otherness without

result of

abstracting the idea of

number

is

elements,

number

itself.

The

basic notion in the concept of

that of one-to-one correspondence.

and B, and

if

to each element of

If there are

there

is

two

sets of

assigned exactly

one element of B, while each element of B is thereby related to a single


element of A, the relationship is called a one-to-one reciprocal correspondence.
By means of such a relation a man could determine that he had
exactly as many rings as he had fingers even though he had not learned to
Any two sets that can be put into one-to-one correspondence are
count.
Thus the concept of number implies the
said to have the same number.
abstraction of that property which is common to sets that are so related.
However imperfect these concepts may have been, man did eventually
learn to count and to represent by marks the ideas now represented by
the symbols 1, 2, 3,
These numbers have the single property of
denoting quantity. They answer the question, How many units? They
are the natural numbers, and they were the only numbers known to the
Greeks until Diophantus (c. 275) extended the concept of number to
include fractions.
To be sure the Ahmes papyrus, which was written
before 1700 B.C., indicates that in their calculations the Egyptians
employed symbols that are equivalent to fractions with numerator one,
but such symbols, even to the Greeks of Euclid's time, referred to the
notion of magnitude rather than number. The art of calculating was
thus distinguished from the science of number. It is to be noted that
zero is not among the natural numbers.
The Greeks had no symbol for
It was probably not until the fifth century that the Hindus introzero.
duced a symbol for zero and the principle of position in writing numbers.
These were, indeed, great accomplishments in the field of arithmetic.
By the twelfth century the advancement of the Hindus in algebra almost
matched their achievements in arithmetic, for they were the first to
.

recognize the existence of negative quantities even though they did not

admit them as solutions of their problems. It was not until the sixteenth
century that European mathematicians reached this stage of development
1

ELEMENTARY THEORY OF NUMBERS

of the idea of number, and it remained for Descartes (1596-1650) to grasp


completely the concept of signed numbers.*

The signed numbers have two

They compound

basic properties.

the

Thus, although each of the symbols + 1, 1, +5, and 5 represents but one number, that number has
two fundamental attributes. It is evident, moreover, that a one-to-one
correspondence can be set up between the positive integers and the natural

idea of quantity with that of quality.

numbers
1-2.

in the following

The System

bers, arithmetica, is

numbers

1, 2, 3,

*-* 1,

+2
The

+3

- 2,

<-> 3,

theory of numproperly concerned with the study of only the natural

Nevertheless,

1, 2,

rational integers 0,
itself, this

+1

manner:

of Rational Integers.

we

shall

make use

of the

system

of

because, besides being of interest in

set has properties not possessed

enable us to develop

classical

by the natural numbers that

many theorems expounding

the qualities of the

natural numbers through methods that have the facility characteristic


of

an algebraic presentation.

Throughout

this text, therefore, the

word

" integer," unless otherwise stated, will refer to a rational integer, and the
x, y, z, will

Moreover, we

represent these integers.

letters a,

b, c,

shall, as

a rule, observe the usual convention of omitting the positive

+1, +2, +3, ....


we study about these integers?

signs in writing

What

shall

Just consider the integers

through 10, and they will serve to illustrate some salient facts.
It is apparent that the product of three consecutive integers is divisible
by 6, that when two consecutive even integers are chosen, one is divisible
by 4. You will claim you have known all your life that we need only the
10 digits 0,1,
9 to write any integer, but can this be accomplished
in another way?
Have you ever noticed the remarkable fact that, of the
consecutive integers 8 and 9, one is a perfect cube and the other a perfect
square? Surely you have not overlooked the familiar right triangle

from

whose

sides

have the lengths

3, 4,

and

5.

Can you

Again, the

sum

of the positive

having this
Although for its size 6 has many divisors, you notice that
Observe how close the first few integers of the
5 has but 1 and 5.
Would you be interested in examining the law indicated
latter type are.
by the following equations?
divisors of 6

is

double

itself.

find another integer

property?

5=1+1+3
7=1+1+5=1+3+3
9

+ 1+7

1+3 +

Perhaps these few examples


other significant facts.
*

F. Cajori,

"A

10

1+3

6=1+5=3+3
8=1+7=3+5
3

will stimulate the reader to look for

Having made a discovery, he

History of Mathematics."

certainly will

some
want

THE FUNDAMENTAL LAWS


to determine

and

why it

so, starting

is so.
That, indeed,
with elementary notions,

is

the attitude

we

we wish

up a

shall set

to foster,

basis for

show-

ing that certain laws do hold.

We

is familiar with the concepts of numsum, difference, product, equality, greater than,
absolute value, etc. We shall assume that he understands the fundamentals of algebra and the derivative with respect to x of a rational
We shall also suppose
integral algebraic function of the real variable x.
that he is familiar with the content of the following system of postulates
which the integers obey:

shall

assume that the reader

ber, uniqueness, relation,

1.

The

set of rational integers contains

+1

(positive real one)

and at

one other integer.


2. The law of closure for addition: For each pair of integers a and b,
in that order, the sum of a and b exists and is a unique integer c.
Thus
a
b = c.
b = b
a.
3. The commutative law for addition: a
4. The associative law for addition (a + b)
c = a + (6 + c)
5. The equation a + x = c has a solution for x that is an integer.
The second postulate tells us that the operation of addition exists for
the rational integers. Moreover, since +1 is in the set, we can generate
a subset of integers by merely adding
1 to itself and to each result so
least

Thus we have 1 + 1 = 2, 2 + 1 = 3,
We call all
these numbers positive integers, and 1, 2, 3,
are distinct.
Furthermore, if a + c = b and c is positive, we say that a < b (a is less
than b) or that b > a (b is greater than a)
The set of rational integers is
ordered by this relation "less than."
The fifth postulate says that subtraction exists, and we therefore write
the statement a + x = c in the form c a = x.
We shall show later
that we can derive the fact that there is a single integer
such that
= a for any integer a.
a +
6. The law of closure for multiplication: For each pair of integers a
and b, in that order, the product of a and b exists and is a uniquely determined integer c. Thus a b = c, or ab = c.
7. o( + l) = a for any integer a.
8. The commutative law for multiplication: ab = ba.
9. The associative law for multiplication: (ab)c = a(bc).
10. The distributive law: a(b + c) = ab + ac.
11. The cancellation law for multiplication: If ab = ac and a tA 0, then
obtained.

c.

is no integer x such that a < x < a


1.
statement means that there is no integer between a and a
1.
Hence, a and a + 1 are called consecutive integers. We say, then, that
the rational integers form a discrete set, for when they are arranged

12.

The

There
last

ELEMENTARY THEORY OF NUMBERS

according to the relation "less than" and then separated into any two
parts without disturbing the array, there is a first integer in one part and
a last integer in the other.

>

sequence of integers rii, where i = 1, 2, 3,


such that
> has a least positive integer.
a = 6 and c = d, then a + c = 6 + d and ac = bd.
a = b, then either one may be substituted for the other in any

Any

13.
fti

n2

14. If
If

15.

>

'

relation.

has a property and if n + 1 has this property whenever the


n has it, then every positive integer has the property.
This last postulate is the one on which the method of mathematical
16.

If

+1

positive integer

induction, sometimes called "finite induction,"


this

method

is

sum of a finite number of


second postulate. Thus a
b
c = (a
b)
(a
b
c)
d, and, in the general case, a
the

+ +

(a

+ +
+b+

+
+6+

We

based.

shall use

For example, we can define


integers inductively on the basis of the

both definition and proof.

for

m)

c,

a+6+c+d=

+m+n=

n.

It is worth while recalling that the relation "equals" which we have


used so frequently in stating these postulates has the following properties
1. Equals is reflexive; that is, a = a.
2. Equals is symmetric; that is, if a = b, then b = a.
is, if a = b and b = c, then a = c.
which we have stated above is certainly not
the most concise one that might have been chosen. To be sure, some of
the statements can be derived from others. But the set is sufficiently
elementary for our purposes and permits us to develop the ideas we need
on a basis that will be readily understood by the student.
We shall prove first that there is a unique integer such that, for any

3.

Equals

integer

b,

transitive; that

is

The system

of postulates

The

b.

a particular integer a there

and
But c

this integer Oi

Oi

a.

fifth
is

postulate

shall

show that

exists

such that b

is

unique, for

if

Oi

us that corresponding to

+ a.
= (c + a) + Oi
= c + (a + Oi)
= c +a
=

This integer Oi

tells

an x such that a

b for

a.

any

We

shall call

b.

We

have

Hence,

there were a second integer O2 such that

any b, then 2 + Oi = 2 and Oi + 2 = Oi. But Oi +


There is, then, but a single integer,
2 =
2 + Oi, and therefore Oi =
2
= b for any b. We may also write
zero, designated by 0, such that b +
this statement in the form 6 6 = 0.

b for

Since

6, it

follows immediately that

if

6 is positive, 6

is

greater

THE FUNDAMENTAL LAWS


than

Moreover,

and conversely.

zero,

and

shows that

+1

are consecutive integers.

Furthermore, for each integer a there exists an integer x such that


x = o. This integer x is called the negative of a. It is the inverse
Thus a +
of a with respect to addition, and it is designated by a.

_f_

a) =0.

This inverse is unique because the following argument shows


is always unique.
Suppose that subtraction is not unique and that when a and c are given,
both b\ and 6 2 are such that
(

that subtraction

6i

+ a)

62

Since

and

a) +

since

(-a)
it

(a

6i)

= (-a)

+
+

(a

6 2)

a]

62

follows that

[(-a)

a]

6i

[(-a)

6i

&i

and that
b2

Hence,
6

Consequently, subtraction is unique.


The inverse of a positive integer is said to be a negative integer. Accordingly, we write (+2) = 2 that is, the negative of positive two is nega;

Moreover, each of these negative integers is less than zero, for


For the same reason, ( a) = a.
( a) + a = 0, where a is positive.
This means that a is the inverse with respect to addition of a; that is, a
This statement implies that the positive
is the negative of negative a.
To summarize, we
integers are the negatives of the negative integers.
have proved that:
Theorem 1-1. There is a unique integer such that, for any integer 6,

tive two.

b.

Theorem

1-2.

Subtraction

is

unique, and each integer has a unique

inverse with respect to addition.

Has

it

ever occurred to you that

principles

a^0,
is

so.

Hence,

unique.

We

0*0 =

0.

for

any

that a

b because of the basic

b-a-\-b'0 = b-a.

Therefore, b

statement includes

Theorem

6-0 =

We know

stated?

consider the equation

uniquely
tion

we have

However,

c.

and so when
b a = c and
= c, and subtraca,

But

Notice that when 6

0.

0,

this

Thus we have:

1-3.
For any integer 6, 6
have seen that c + ( c) =0.

0.

Hence, ac

+ a(c)

0.

ELEMENTARY THEORY OF NUMBERS

( oc) = 0, and this inverse is unique. Consequently, a(c)


When c = 1, this equation includes a( 1) = (a( + l)) = a.
Furthermore, subtraction can be accomplished by addition, for we can

But

ac

= ac.
prove

Theorem

1-4.

+ b).
(

According to the definition of subtraction, a b = x, where the


integer x is such that b + x = a.
We wish to prove that a + ( b) is the
b) for x in the last equation, we
proper value of x. Substituting a
(
have
b
[a +(-6)] - b + [(-b) +a]
= [b + (~b)]

+a

=
=
a

>

member

If a > b, then b > a, and conversely.


then a = b
c with c positive, and, by multiplying each
c).
of the equation by 1, we find that a = ( b)
(

Theorem
If

1-5.

b,

a) + c = [( b) + c)] + c, and finally a) +


that 6 > a. The converse is now evident.
Theorem 1-6. -(a - 1) = -a + 1.
We know that
-(a- 1) = (a- 1)(-1)
Hence,

= b,

so

= [a+(-l)](-l)
= -a + 1
no integer between a and (a 1) that is, if two
integers are consecutive, as are a 1 and a, so are their negatives.
We

As a

result there

must conclude,

is

therefore, that the integers are positive, zero, or negative.

EXERCISES
a
a

=
=

7.

On

4.

Show that
Show that
Show that
Show that

5.

If

6.

Prove that a(b

1.

2.
3.

8.

then the negative of a equals the negative of


cannot also be true that a > b.
a < b and a > b cannot both be true.
if a < b and a = b + c, then c is a negative integer.
+ c and c is negative, prove that a < b.
if
if

b,

b.

b, it

c)

ab

ac.

the basis of postulate 11, prove that if ab =


and a ? 0, then 6=0.
Show that the theorem of Exercise 7 is a sufficient condition for the cancellation

law for multiplication.


9. Prove the law of signs for addition.
10. Prove the law of signs for multiplication.
1-3. Definitions.

with the principle of

The law
finite

of closure with respect to addition together

induction shows that

tion of addition to a finite

number

when we apply

the opera-

of integers of our set, the result is

THE FUNDAMENTAL LAWS

We know

necessarily in the set.

into addition

and that the

to the use of integers,

product of a

also that subtraction can be converted

result

When we

unique.

is

restrict ourselves

also evident that our laws provide that the

it is

number

finite

them always

of

But

exists.

and

any

b are

mean by

An

an

when a
we

necessary to define what

it is

integer a

Under these conditions

be.

The operation
no integer

If

division.

integer b is said to divide

that a
b.

and therefore

integers,

not always

it is

possible to find an integer that will satisfy the equation ax

if

written in the form b

is

we

c exists,

write b

there exists an integer c such

a and

a and read

Jf

is divisible by
"b divides a."

also said that a

it is

it,

is

read,

"b does not divide a."

When 6^0 and c exists, c is unique, for if a = bci and a = bc then


When
bci = bc and c\ = c by the cancellation law for multiplication.
b = 0, c does not exist unless a = 0, in which case c is not unique.
When a = bc,b is said to be a factor of a, or a divisor of a a is a multiple
2,

and when

of b;

0, c is

the quotient of a by

referred to as the factor of a that

is

The

b.

complementary to

integer c

is

often

b.

and \a\ = a if a is negaand a = be, then \a\ > \b\,


for a = be implies that neither b nor c is zero and that \a\ = \b\ \c\.
But
Hence, \c\ = 1 + r, where r > 0, and
\c\ being positive, it is at least +1.

We recall that

\a\
\a\

=
=

|6|(1

Since b

Theorem
Theorem

Since 6

\b\

>

if

positive or zero

is

1-8.

If b

1-9.

If 6

when

When

\b\r.

0, \a\

>

integers d

b,

(ce)d

is

it

0,

thus

evident

that

\b\.

and if c divides b, then c divides a.


and e exist such that a = bd and b =

ce.

and therefore c a.
divides a, and b divides c, then b divides a + c.
divides a, and b does not divide c, then b does not

c(ed),

c.

a,

then a

we should have a
b

If b divides a,

1-7.

a and

Hence, a

divide a

r)

and when

\b\,

Theorem

\a\

It is clear, therefore, that

tive.

would divide

Theorem

-\-

= bd and a + c =
= be and 6e = 6c?

6c?

If 6

c.

did divide a

Hence, b(e

c.

d)

c,

c,

and

c.

1-10.

tive integers 0,

between two of the nonneganot divisible by b unless the two

If 6 ?* 0, the difference

1, 2,

|6|

1 is

integers are equal.

Choose ri and r 2 so that


< ri < |6| and
ments are often combined by writing
<
ri

>

r2

mb >
b

0.

If ri

But

r2

mb, then

ri

= mb

<
r2

< \b\.
< \b\.)

or

common

divisor, of

two

or

Suppose that

Therefore,

this result is contrary to the hypothesis,

\ (n - r 2 ).
A common factor,

(These state-

r2

ri, r 2

more

n >

|6|,

for

and consequently

integers

is

an integer

that divides each of the given integers.

greatest

common

divisor of a set of

two

or

more

integers, not all zero,

ELEMENTARY THEORY OF NUMBERS

8
exists,

is, if it

mon

common

divisor of the set that

divisor of a set of

one of

refer to the

common

greatest

by every com-

The symbol d =

cti.

common

greatest

is

(a h

unchanged
a2

if

a r)

divisor of the set a\,

-15), and 12

(6, 12,

It is evident, too, that the greatest

divisor.

divisor of a set of integers

divisible

is

We notice then that if -\-d is a greatest common


integers, so is d.
It is conventional, however, to
the two integers -\-d and d that is positive as the

divisor of the set.*

any a
is

0,2,

common

of the set is replaced

by

used to denote that d is the


3 =
,
.
.
, ar ; for example,

(36,48).

A common multiple of two or more integers is an integer that is divisible


by each of the given integers.
A least common multiple of two or more integers is, if it exists, a common
multiple that

is

a divisor of every

It is evident that

then

is also.

integer that

common

fits

a ^
Again,

if

is

common multiple of the given


common multiple of a set of

a least

it is

usual in this case to refer to the positive

the definition as the least

multiple

is

unchanged

di. The least common


A unit is an integer that

by

integers.
integers,

if

any

common

multiple of

6,

The

multiple.

of the given integers

15, and 9

divides every integer.

az

is

least

replaced

is 90.

Since

+1 and 1

divide every integer, they are both units.

have but two units, +1 and 1.


be denoted by x. Then x divides +1, and
therefore \x\ < +1.
But because +1 is a unit and x is an integer, +1
divides x and thus +1 < \x\ since x 9^ 0.
Consequently, \x\ = +1, and

Theorem

1-11.

The

rational integers

If there is a third unit, let it

is

+1

The

or

1.

null element is

an integer that divides only

the definition of division that zero divides only


ever, a

no integer

0,

itself.

itself.

We know
For any

a,

from
hoAv-

and consequently any integer divides zero. Therefore,


from zero is a null element. Hence, we have:

different

Theorem 1-12. Zero is the null element of the rational integers.


The associates of an integer are the results of multiplying it by the units.
Thus +6 and 6 are a set of associates. When an integer is divisible by
some integer, it is obviously divisible by each of the associates of that
integer and consequently in any problem it is necessary to show only the
division by one of the associates.
A prime is an integer, not a unit, that is divisible by only its associates
units.
This definition implies that the greatest common divisor
a prime p and an integer a is 1, or the positive associate of p.

and the
of

* This definition and that of a least common multiple are so worded that they will
apply equally well in a domain of algebraic integers where we cannot say of two disFor instance, the set of algebraic
tinct integers that one must be less than the other.
integers of the form a + bi with a and b rational integers is not ordered by the relation
"less than."

THE FUNDAMENTAL LAWS

An integer that is not the null element, a unit, or a prime is a composite.


Two or more integers are prime to each other, or relatively prime, if their
The integers 6, 9, and 14 are relagreatest common divisor is +1.
tively prime.

Two

or

more

integers are said to be prime each

common

to each,

or relatively

is +1.
The integers 3, 4, and 35 are relatively prime in pairs.
Theorem 1-13. If d is the greatest common divisor of a and b, the
quotients obtained by dividing them by d are relatively prime.
If d = (a, b), let a = a Q d and b = bod.
Let e be any common divisor
Then ao = ek, b = em, and a = dek, b = dem. Hence,
of a and b
de is a common divisor of a and b and must divide d; that is, d = des.
Therefore, es = 1.
But this is impossible unless e = +1. Conse-

prime in pairs,

if

the greatest

divisor of all possible pairs

quently, (o
1-4.

who

The

1.

Among

Principle of Archimedes.

the early mathematicians

contributed to the theory of numbers were Euclid

Archimedes
of numbers.

(c.

225

B.C.).

(c.

300

B.C.),

and

much interested in the theory


many propositions concerning

Euclid was very

He collected and organized


the integers in his " Elements. " On the other hand, although Archimedes

is considered one of the greatest mathematicians of all time, he did


with this branch of the subject and but one theorem in the theory of
numbers bears his name. This theorem is, however, a basic one.
We shall assume the principle of Archimedes extended to include the
rational integers.
This principle states that any integer a either is a
multiple of an integer b ^
or lies between two consecutive multiples of
b; that is, corresponding to each pair of integers a and 6^0, there exists
an integer m such that, for b > 0,

little

1)6

< (m

l)b

mb < a < (m
and, for b

<

0,

mb <
Theorem
integers a

1-14.

and

The theorem

6^0,

Euclid.

of

there exist two integers

= bm

<

m
<

Corresponding to
r such that

two

and
|6|

and m and r are unique.


Except for the unicity of m and r the theorem follows immediately
from the principle of Archimedes, for when b > 0, it is evident that the
inequalities yield
< a mb and a mb < b, and when b < 0, <

a
mb and a
mb < b. Thus r = a mb exists and fulfills the
required conditions. Suppose then that a bm\ + n and a = bm 2 + r 2
where
< r 1} r 2 < \b\. Hence, b{m m 2 ) = r 2 r h and b divides
,

ELEMENTARY THEORY OF NUMBERS

10

r2

= r and
m =

Therefore, r\

r\.

2,

equation shows that mi

We shall

call r

Theorem

the remainder and

An

1-15.

integer a

b (mi

2)

and that mi

=
=

ra 2

= bm

6^0,

this

m the quotient in the division of a by b.


or

is

not prime to an integer

is

according as the remainder in the division of a by b


The theorem of Euclid shows that

Since

0.

<

<

or

is

is

6^0

not prime to

b.

\b\

and hence an integer d divides a and b if and only if d divides both r and
For example, to find out whether or not 152 is prime to 21, just divide
b.
152 by 21, getting the remainder 5. Since (5, 21) = 1, then (152, 21) = 1.
Theorem 1-16. All integers take the form 2n or 2n + 1.
According to the theorem of Euclid, any integer a can be expressed in
the form
< r < 2
a = 2n + r
so that r

An
even

either

is

even integer
is

The

odd.

or
is

1.

one that

a multiple of

is

An

2.

classification of the integers into

integer that

is

not

odd and even integers

was made by the Pythagoreans.

EXERCISES
Prove that the product of any two consecutive integers is divisible by 2.
integers can be written in the form n(n + 1).
Euclid, n has the form 2k or 2k
1, whence
the product has the form 2k(2k + 1) or (2k + l)(2k + 2) = 2 (2k + 1)(& + 1). In
/
either case the product has the factor 2.
2. Show that the sum of an integer and its square is even.
*
3. Show that all integers take the form Sn, Sn + 1, or Sn 1.
4. Prove that the product of any three consecutive integers is divisible by 3.
5. Prove that the square of an odd integer has the form 8n + 1.
6. Prove by induction: 1 + 3 + 6 +
+ n(n + l)/2 = n(n + l)(n + 2)/6
1.

The product of any two consecutive


But then, according to the theorem of

for

n >

0.

When n = 1, the left-hand member is 1 and the right-hand member is l(2)(3)/6 = 1.


The statement is thus true in the first case. Now assume that the statement is true
for n = k.
The first term of this series is 1, and the th term, given by the term
formula n(n

l)/2, is k(k

_o.
1J
1 + 3 +

Hence,

l)/2.

k(k

1)

k(k

l)(fc

where the right-hand member of the equation is the sum


series obtained from the formula for the sum of n terms.

We

must now show by a general method that the sum

the series can be correctly obtained from the

we

shall build

cated

sum

up the

of the first

series of k
A;

terms.

The

+2)

sum

of the first k

terms of the

terms of

To accomplish

this end,

of the first k

formula.

terms by adding the (k + l)st term to the indi+ l)st term is obtained from the term formula

(k

THE FUNDAMENTAL LAWS

by substituting k
one

member

n and

for

l)(k

if we add this number to


member also to maintain an

But

2)/2.

to the other

it

Thus we have

equality.

,,,,
1+3+-..+ k(k 2+

l)

But the right-hand member


*(*

is (k

we must add

of Eq. (1),

11

+ !)(* +2) +
6

(*

+ l)(k+2)

(k

+ l)(k+2)
6
+

k(k

and

of Eq. (2) can be factored

l) (*+2)
+ !)(*
+2)

. n
(t

1WJ
ON
+ 1)(t+2)
.

(k

g+
.

l)(k+2)
2

(2)

simplified, giving

1\
l).

(Jfe

+ l)(*+2)(*+3)

is correct in the fcth case, (k + 1) (k + 2)


+ 3) /6 is the correct
+ 1 terms. Consequently, unless the sum formula gives this result
+ 1 terms, the sum formula is in error. Substituting + 1 for n in
+ l)(n + 2)/6, we find that it also gives + l)(fc + 2) + 3)/6.

Assuming that the law

sum

(k

(A;

of the first k

sum

for the

of k

fe

the formula n(n


We must conclude that this formula

(fc

(A;

gave the correct result for n = 1,


and, upon the assumption of its truth for n = k, we found it gave the correct result
Hence, being true for n = 1, it is true for n = 2, 3,
for n = ft + 1.
7. Prove by induction: 1 + 2 +
n = n(n + l)/2 for n > 0.
2
8. Prove by induction: l
+ 22 +
+ n 2 = n(n + l)(2n + l)/6 for n > 0.
9. Prove by induction: l 3 + 2 3 +
+ n 3 = n 2 (n + l) 2 /4 for n > 0.
10. Prove by induction that a n b n is divisible by a b if n is a positive integer.
If n = 1, a b is divisible by a b.
is

correct, for it

Assume that ak

bk

(a

ak+i

=
=

Now

b)F(a, b).

&fc +i

the quotient ak and the remainder ak b

b k+1

(a

divide ak+1

b k+1

by a

b,

getting

Thus

+
+

h)a k
6)a*

a 6
fc

6(a

fc

- 6 fc+1
- bk
)

But since a b is a factor of a k b k the distributive law


factor of a k+1 b k+1
Then according to postulate 16, a n
ioT/n > 0.

shows that a

b n is divisible

b is a

by a

n is a positive odd integer, a n + 6 n is divisible by a + 6.


Prove that if n is a positive even integer, a + 6 is a factor of a n 6 n
Prove by induction that 10 n + 3 4 n+2 + 5 is divisible by 9 if n is zero

v^ll. Prove that


12.

if

13.

^
or a

positive integer.
If

0,

then

+3(16)

+5 = 54
+ l)st

the difference between the (n

and this integer is divisible by 9. Now form


and the nth case and simplify by factoring,

getting the result


10+i

+3

+5 -

4-+ 3

The right-hand member

is

(10"

4"+ 2

clearly divisible

by

9.

5)

and hence the theorem

true for
7 2n

b.

7n
3 4 "+ 2

c.

15.

true for

n =

43

But, being true for n

1.

4- +2 (3)

=
5

and applying
is

a multiple of

1, it is

likewise

the positive integers.

Prove that:
+ 16n

14.
a.

two

all

is

+3

Substituting n

the distributive law, the above equation implies that 10


9,

10*(9)

1 is

divisible

by 64

for

n >

0.

+ 3 5 W - 5 is divisible by 24 for n >


+ 5 " +1 is divisible by 14 for n > 0.

0.

Prove that the cube of any integer

is

equal to the difference of the squares of

integers.

To

solve a problem of this type,

we

often set

up a few examples with the purpose

of

ELEMENTARY THEORY OF NUMBERS

12
discovering the law

by

Thus

inspection.

=
=
=
=

23

33
43

p _

Q2

32

32

62
10*

l2

62

reminds us of the sum of the series 1+2


The sequence of integers 1, 3, 6, 10,
+
+ n = n(n + l)/2. Hence, we should like to show that n 3 is the difference
of [n(n + l)/2] 2 and [(n l)n/2] 2
This statement is correct, for
.

V n(n

Show
Show
Show

16.

17.
18.

or 5n

1) 1

that

if

that

if

7z
2x

that

if

an integer

(n

l)rc

n 2 (n 2

a multiple of
is

2^i

n2

2w

i;

3,

5,

that the square of an integer that

is

not a multiple of 2 or 3

is

of the

form

1.

Prove that the sum of the odd integers from

20.

then 28z 2 13x 5 is a multiple of 9.


then 14z 2 + 19a: 19 is a multiple of 25.
both a square and a cube, it is of the form bn, bn + 1,

a multiple of

is

1 is

4.

Show

19.
24A;

square, n 2

through In

is

a perfect

21. Prove that every odd cube, n 3 is the sum of n consecutive odd integers.
Find
a corresponding law for an even cube.
22. We have assumed the principle of Archimedes, but just as some of our other
postulates are not independent, it is possible to prove the principle of Archimedes on
the basis of the assumptions already made.
= 0. If a = b,
and 6 > 0. If a < b, then
< a < b and
Case 1. Let a >
= 1, If a > b, there is a positive multiple of b that is less
then b = a < 26 and
,

than

But

a.

<

Thus

in the sequence of multiples of

(a

there

<

(a

>

ab

>

1)6.

1)6

Let a

2.

1)6

is

>

greater than

a.

Let this multiple of 6

Then

mb < a <
Case

6,

a least positive multiple of 6 that

is

be (m

<

and

>

(in

1)6

Then nonnegative

0.

cb

<

\a\

<

(c

c exists so

that

1)6

and
-cb > a
If

> (-c -

1)6

a < cb, let m = c 1, but if a = cb, then a < ( c + 1)6 and m = c.


Let the student complete the proof.
23. If a ^
and |6| > \a\, then 6 does not divide a.
24. What values can you assign to r in order that 4n + r include all odd primes?
26. Using the idea of Exercise 24, write another set of expressions whose values

include

all

26. If

n(n

odd primes.
is

l)/2.

a positive integer, the triangular numbers are given by the formula

Find by

trial

some

integers that are both square

and

triangular.

THE FUNDAMENTAL LAWS

13

even integers closed under the operation of addition? Do the odd


Is the set of even integers closed under multiplication?
important property that pertains to multiplication does the set of even integers

27. Is the set of

integers have this property?

What
lack?

Peano stated the following postulates, together with the principle of finite
numbers
a. There is a number 1.
+
b. Every number n has a unique successor n
c. The number 1 is not the successor of any number.
d. If n + = m + then n = m.
Define addition and multiplication, and derive the commutative, associative, and
distributive laws for the natural numbers on the basis of these postulates.
28.

induction, to define the natural

CHAPTER

THE LINEAR DIOPHANTINE EQUATION

The Form ax
by.
A polynomial in the variables Xi, x 2
xT
a rational integral algebraic expression in these variables.
Thus
~
a n where the exponents of the variable x are
a Qx n
aix n l
2-1.

is

positive integers or zero,

bixy

bzxy

is

is

a polynomial in

a polynomial in x and

The

y.

x.

The

expression b\X 2

degree of a polynomial

is

the

degree in all its variables of its term or terms of highest degree. The first
polynomial is of degree n, and the second is of the fourth degree. The
second, however, is of only the second degree in x, but it is of the third
degree in y. If all the coefficients of a polynomial are integers, it is said
to be an integral polynomial.
x r is a homogeneous polynomial
A form* in the variables x h x 2
in these variables; that is, each term of the polynomial is of the same
The degree of a form is the degree in all its variables of any term
degree.
The polynomial Sx 2 y + 5xy 2 y z is a form of the third
of the form.
All the forms with which we shall be concerned will have
degree.
We shall make use of the form ax + by to show
integers as coefficients.
that the greatest common divisor of two rational integers (not both zero)
,

exists

and

is

a rational integer.

Theorem 2-1. The least positive integer in the set of integers defined
by ax + by, where a and b are not both zero, is the greatest common
divisor of the set.

by when
Consider the set of integers defined by the linear form ax
a and b are constants and x and y are variables whose values are all the
Since there is but a finite number of integers between zero and
integers.
by contains a positive integer,
any positive integer, and since the set ax

this set

Let

has a least positive integer.

L =
This integer

ax

it

be represented by

by

divides every integer of the set because, according to the

This technical use of the word "form" is not to be confused with the ordinary
we have made use of the term. When we say, for instance, that an
integer has the form Qk + 1, the word is synonymous with "mold" or "structure"
and in this case designates that the given integer is always a multiple of six, plus one.
Whenever "form " is used to mean a homogeneous polynomial, the implication will be
*

sense in which

clear

from the

text.

14

THE LINEAR DIOPHANTINE EQUATION


of Euclid, corresponding to the integers

theorem

there exist integers

and

n = ax

by\

and L

such that

n =

15

mh +

<

<L

Hence,
ax\

byi

a(zi

mxo)

= m(ax

by

m?/

and

Therefore, r

is

an integer

6(?/i

of the set, but, being less

than L,

must be

0.

The

least positive integer of the set thus divides every integer of the set

and

is

necessarily a

greatest

common

any common

therefore

common

divisor of the set.

But L

divisor of the set ax

is

in the set,

Hence,

divisor of the set divides L.

by, for it satisfies

is

and
the

the stated

by being a positive integer which is a common divisor of the


and which is divisible by every common divisor of the set.
Theorem 2-2. The greatest common divisor of a and b, where not
both are zero, exists and is the least positive integer in the set defined by

definition
set

ax

-f-

by.

and b are determined by the form ax + by, when x = 1,


when
and
x = 0, y = 1, respectively. Hence, Theorem 2-1 shows
0,
y
But L = ax + by and thus srny
that L is a common divisor of a and b.
common divisor of a and b divides L. Therefore, the greatest common
divisor of a and b exists and is L.
Theorem 2-3. If d is the greatest common divisor of a and b, then d is

The

integers a

the greatest
If

(a,

common
b),

divisor of the set, for ax

common

fore, the greatest

Theorem

by

by

divisor of a

divisor of the set ax

ax

d,

is

The

and

and

b d,

+
b,

we

b y).

On

for both a

d.

by.

see that d

is

common

the other hand, any

and

b is a divisor of d.

by necessarily divides

common

2-4.

d(a x

divisor of the set divides a

But any common

divisor of the set of integers ax

so that a

The

b are in the set.

Thus a common
integer d

is,

there-

divisor of the set.

greatest

common

divisor of the set of integers

unique.

Suppose that both d\ and d 2 are greatest common divisors of the set
+ by and that they are positive. Then, according to the definition,
Consequently, d\ < d 2 and d 2 < d\, so that di = d 2
d\ di and d 2 d\.
then,
that the greatest common divisor of a and b is the least
It follows,
positive integer in the set ax + by and that d = (a, b) can be expressed
as a linear function of a and b with integral coefficients.
Thus 4 =
=
=
12(-18) + 20(11).
(12, 20) can be written 4
12(2) + 20(-l)
The fact that the greatest common divisor of any two rational integers
a and b, where not both are zero, can be written in the form ax + by with
x and y rational integers is an important characteristic of the set of
ax

ELEMENTARY THEORY OF NUMBERS

16

Not

all sets of integers have this property.


Consider,
even rational integers. Although the integers 4 and
6 have the greatest common divisor 2 which is in this particular set, 2
cannot be written in the form 2 = 4x + Qy, where x and y are selected
from the set of even integers.
Theorem 2-5. The set of integers ax + by consists of all the multiples
of d = (a, 6).
It has been shown that every integer of the set ax + by is a multiple of
Moreover, every multiple of d = ax + by is in the set, for k(ax Q +
d.

rational integers.

for instance, the set of

by

a(kx

b(ky

).

bers of the set defined

Therefore,

by ax

all

and only multiples

of

d are

mem-

by.

It is interesting to notice that because d is not zero, the set ax + by


never consists of just one integer. Furthermore, the sum and difference
by are also in this set.
of any two integers defined by ax
Any set of at least two elements is called a modul if its elements obey

the associative and commutative laws for addition and if the equation
a + b = c is satisfied by an element of the set whenever two of the three
elements a, b, c are chosen from the set. It is now apparent that the
integers ax + by form a modul.

EXERCISES
Describe the set of integers 3z + 6y.
Use the form ax + by to define a set of integers all of which are even.
3. Use the form ax + by to define a set of integers that are multiples of 5.
Are
all multiples of 5 included?
4. Use the linear form in two variables to determine a set of even integers that are
multiples of 5.
by include all the integers?
5. When will the set ax
1.

2.

2-2.

The Diophantine Equation ax

was the one Greek mathematician

of note

by

n.

Diophantus

who devoted

(c. 275)
himself to algebra.

He solved quadratic equations in a single variable, but he found only one


answer and discarded all but positive rational numbers as solutions. He
even considered types of quadratics in two unknowns and two simultaneous equations of this kind. He is credited with enlarging the concept
Because he sometimes restricted his
of number to include the fractions.
solutions to integers, his name is now attached to the kind of equation
defined below.
Diophantus developed no general method for the solution
of these equations, however. It was not until the Hindus attacked the
problem that such general methods were devised.
A Diophantine equation is a rational integral algebraic equation in
which the coefficients of the variables and the absolute term are integers
and of which the solutions, or values of the variable or variables that

THE LINEAR DIOPHANTINE EQUATION


must be

satisfy the equation,

and two-dollar

bills

Theorem

paid in five-dollar

bills?

The

2-6.

Such an equation would be used

integers.

how many ways can $25 be

to solve the problem: In

17

linear

Diophantine equation ax

-\-

by

= n

has a

and only if the greatest common divisor of a and b divides n.


Since we have shown that d (a, b) divides ax + by for all integral
values of x and y, if ax + by = n has a solution, d divides n.
Because d has been proved to be an integer
If d divides n, let n = n d.
of the set ax + by, it follows that n = no(ax + by ) = a(n x ) + b(noy Q ).
This result shows that x = n Q xo, y = n yo is a solution of the equation.
Corollary.
A necessary and sufficient condition that a and b be relatively prime is that there be a solution of the linear Diophantine equation
solution

ax

if

by

1.

if (a, b) = d and ax
by = n
then this very pair satisfies a Q x
b y = n'
where a = a Q d, b = b d, n = n'd. Again, if (a, b) = 1, the equation
kby =
by = n has a solution and that same solution holds for kax
ax
The problem of solving the equation ax
by = n is, therefore,
kn.
reduced to finding a general method for solving the equation in the case
where the coefficients of the variables are relatively prime.
Theorem 2-7. If m divides ab, and m and a are relatively prime, then

The preceding proof

has a solution x

also implies that

m divides

b.

Since (m, a)
y

1,

the equation

mx

ay

Xi,

(m, a)

has a solution x

Then

z/i.

b(mxi

ayi)

mbxi

abyi

and

But

mb, and

m\

ab.

Observe that Theorem


1,

it is

necessary that a

sequently, 6

0,

Therefore,

= +1.

But

b.

when

2-7 holds even

0, for

then

ab implies that ab

if

0.

Con-

and m\b.

Notice also that if m ^ + 1 is prime to an integer n, then m does not


divide n.
On the other hand, if m does not divide n, the integers m and n

need not be relatively prime; for example, 6 \ 15, but (6, 15) = 3.
Corollary 1.
If m is prime to both a and b, then m is prime to ab.
Corollary 2.
If m is prime to a h a 2
, a^, then m is prime to their
,

product.

EXERCISES
*
1. Prove that the product of three consecutive integers is divisible by 6.
Let P = n(n + l)(n + 2). Then P is divisible by both 2 and 3. Hence, P
= 3m. But (2, 3) = 1, and 2 3m. Therefore, 2 m. Thus m = 2s, and
|

3 (2s)

6s.

2k

P =

ELEMENTARY THEORY OF NUMBERS

18

4.

Show that n(n 2 1) is a multiple of 24 if n is odd.


Show that n 5 n is a multiple of 30.
If n 2 is divisible by 3 but not by 4, then n 2 1 is divisible by

6.

Prove that

2.
3.

A number

rational

is

4.

V2 is irrational.
if

and only

if it

can be expressed as a quotient a/b of two


Hence, assume that
a 2 we see that b a 2
Now apply Theorem

rational integers with the denominator 6 different from zero.

y/2 = a/b with (a, b) = 1. From 26 2 =


and show a contradiction.
6. Prove that V^3 and -^2 are irrational.

2-7,

7.

When m is

= +d
9.

=
=

If (a, b)

2.

Show

integer,

b)

1,

if (a, 6)

1,

6,

the greatest

6) is

common

common

2.

62

and a

divisor of a 3

+
+

6 is either 1 or 2.
63

and a 2

6 2 is

6.

The

common

greatest

divisor d of a finite set of integers

On can be expressed in the form

for

Xi,

1,2,

a 2 2
.

"

nX

n, are integers.

oi,

a 2 and a 3 and let d\


,

Then

(a h a 2 ).

exist so that

Any common

divisor of a h a 2

a 3 and hence a divisor of d 2


,

a divisor of

divisor of a 2

the greatest

aiyi

of di, a 2

c.

-\-

Let us start with the integers


2/ 2

(ac, be)

(a

the greatest

ai^i

where the

then

0,

1,

2-8.

>

(a

Theorem

and

that

a divisor of a

and

irrational.

an

Thus d =

11. If (a, 6)

?/i

is

common divisor of a + b and a b is either 1 or 2.


b) = 26 and (a + 6) + (a 6) = 2a. Furthermore,

Notice that (a
(2a, 26)

0i, as,

it is

or d.

10. If (a, 6)

12.

a positive integer, prove that if \/m is not an integer,


of two fractions a/b + c/d in their lowest terms

sum

the

8. If

CL2V2

di

and a 3 must be a common divisor of d\ and


But d 2 is itself a common divisor
(di, a 3 ).

and a 3 and therefore d 2


,

three integers.

Since integers

Z\

is

the greatest

and

z 2 exist so

common

divisor of these

that

diZi

a 32 2

d2

a 2 y 2 )zi

a 3z 2

d2

a 3 3

d2

we have
(i2/i

and

finally

diXx

a 2 2

Using induction, we can similarly

raise the

number

of the integers in the

set to n.

Furthermore, as in Theorem 2-6, we can now show that when d =


a2
a n ) and d m, there exist integers x'i7 where i = 1,2,
n, that satisfy the equation a\X\ + a 2 x 2 +
+ a nx n = m and that
if such an equation has a solution in integers, d
m.
ak
Corollary.
If d\ is the greatest common divisor of a h a 2
then the greatest common divisor of d\, a 2 ,
.
a,k, a*+i is the greatest
(oi,

common

divisor of d\

and

a^+i.

THE LINEAR DIOPHANTINE EQUATION

Theorem

2-9.

If

19

a and b are relatively prime and x = x y = y is a


by = n, all solutions are given by the equa,

solution of the equation ax

= x + kb, y = y ka for all integral values of k.


f
Supposing that both pairs of integers Xo, yo and x y' satisfy ax
by = n, we have
tions x

axo

by

= n

ax'

by'

xo)

and
so that
a(x'

b(y

and
a{x'

b{y'

provided that 6 ^ 0, it follows that b (V


x = kb, or x' = x
/b5.
Substituting
therefore

a/
xo, we obtain
akb = b(y f y )
Since

(a,

b)

that

1,

After applying the cancellation law,

the original equation

That the
all

and

kb

for

integers x

we find

that

y'

ka.

If b

0,

clearly trivial.

is

kb,

+ by = n for
by substituting

ka satisfy ax

integral values of the parameter k can be determined

them

Xo)

x'

in the given equation.

A Method

2-3.

for Finding a Solution of ax

by

n.

If (a, b)

and d\n, we have shown that, by dividing each term of the equation
ax + by = n by d, we obtain an equivalent equation, that is, one which
is satisfied by all and only the solutions of the original equation.
Consequently, it will be sufficient to solve the equation ax + by = n when

(a, b)

If

1.

n, so that

n n

a, let

and x = n

and the equation

is

satisfied.
If

Jf

n,

then a

1 and we may

5*

suppose that

qia

+n

<

ri

<

|a|

w =

#20

7*2

<

r2

<

|a|

(oia

q 2a

r2

by

= n

exists, riy

<

\a\

<

\b\.

Then

and
Therefore,

ax
Since a solution oi ax
ri?/

az

r2

by substituting
T\

Jf

r 2,

If

-\-

r2

choose

ri)i/

0,

a multiple of a; that is,


thus determined. Then

r% is

and y

is

in the original equation, a value for x is found.

proceed as before, using y and

divisor since r\

<

z as

the variables and

Therefore, where

\a\.

qsri

r3

<

rz

<n

But

if

as the

ELEMENTARY THEORY OF NUMBE

20

and

#47-1

7*4

ny =

q*ri

r4

T2

<

<

r4

ri

we have

(gs^i

+ r )
3

and, as above,

r 3z

riw

r4

we continue in this manner, we find that \a\ > r\ > r >


>
> 0. Each of the remainders r 2k+ and r 2 +2 determined when
respectively, are divided by r 2k -i is less than r 2k -\.
r 2 fc-3 and r
We see,
therefore, that each new set of two nonnegative remainders has an upper
bound r 2 k-i which is smaller than the upper bound of the preceding set of
two. Within a finite number of steps the process will necessarily end, for
Supposing that this happens when k = s, the
some r 2 k-i will divide r 2k
and u = m,
equation r 2s -\U + r 2s -%v = r 2s will be solved by letting v =
where r 2s = mr 2s _i. The original variables can then be determined by
If

r 2s _i

2fc

fc

substitution.

23a;

S7y

Solve the Diophantine equation 69x

Example.

Since

Solution.

111)

(69,

3,

we

14)y

(130) (23)

solve

Illy

9000.

the equivalent

equation

Thus

3000.

2Sx

(23

10

Hence,

Uy +

2Sz

10

9)2

10

9z

+ Uw

10

(9

9v

4)t>

5s

1)

IH-l

'

and
14t/

(14

so that

Again,

9z

S)w

and

bw
Therefore,

bw

(5

and

4^
Finally,
4z;

so that

(4

a^
1, w =

+
j

= 2,

l/

and

124.

Therefore,

quently,

the solutions of the original equation are of the form

all

2,

x
y

=
=

124
4

?/

37k

23/c

4,

a;

Conse-

THE LINEAR DIOPHANTINE EQUATION


If we wish only the
we take

21

positive integers that satisfy the given equation,

124

37/c

>

23/c

>

-v

and
so that
4

124

Hence, k can have only the values 3, 2, 1, and

0.

EXERCISES
number

Solve the equations and determine the

of solutions for

which both x and

y are positive.

16x + 7y = 601.
2. Ux - 45y = 11.
75z + 91y = 320.
4. 56x - 50y = 74.
40x - 63?/ = 135.
6. 123a; + 57y = 393.
77z + 165?/ = 3553.
Separate 1591 into two parts such that one part is a multiple of 23 and the other

1.

3.
5.

7.
8.

a multiple of 34.

More than
Diophantine equation in more than two
variables or a simultaneous set of such equations can be solved very
2-4.

Two

The

Solution of the Linear Diophantine Equation in

Variables.

single linear

when there is a solution, by the reduction of the augmented


matrix of the equation or system of equations to a canonical form. * This
method enables us to determine a linear transformation the application
of which substitutes for the original equation or equations a set of one or
more equations which is easily solved. We shall not develop any of this
theory, but we shall show in the case of a single equation in three variables
how a linear transformation can be used to facilitate the finding of the
expeditiously,

solutions.

Consider the equation


d\X
If (ai,

a 2 a 3)
,

d,

there

to find the solutions

by

d.

is

a 2y

a zz

= m

no solution unless d

we should

first

(1)

Supposing that d m,
of the equation

m.

divide each

member

Therefore, let us assume that (a h a 2 a 3 ) =


and sufficient that d\ divide a z z
,

(a h a 2 ), it is necessary

there be a solution of the given equation.

atf

has the solutions z


*

H.

New

diw,

dit
t

But

(a 3 , di)

a z w, where

J. S. Smith, "Collected Mathematics Papers," Vol.


York, 1894.

1,

Then

1.

if

d\

m in order
=

1,

that

and therefore

to is

one

Oxford University Press,

ELEMENTARY THEORY OF NUMBERS

22

Hence,

solution.

gives

all

Now

diw, for

and only values

is

a multiple of

d\.

consider the linear transformation

=
=

x
y

We,

integral values of the parameter w,

all

which a 3 z

of z for

of course,

wish u and

+bv
+cv

biu

c\U

(2)

and we know that

to be integers,

c 2x

bic 2

biy

bic 2

b 2y

b 2 c\

Cix
b 2 Ci

Therefore, any choice of integral values for

bic 2

b 2 Ci

61, b 2 , Ci, c 2

that

makes

will force

u and

Applying

this transformation (2) to the original equation (1),

stituting z

v to

diw, the resulting equation

ai(biu

be integers since x and y have only integral values.

b 2 v)

a 2 (ciu

c 2 v)

and sub-

is

a 3 (^o

diw)

= m

or
(01&1

a 2 Ci)u

(ai&2

a 2 c 2 )v

a 3 diw

dit

(3)

since

a dz

= m

^1^0

Because we introduced two independent variables u and

v,

we

are per-

mitted to impose a second condition upon the coefficients of the transformation. We, therefore, set
aib 2

Since

(a,i,

a 2)

di, let a\

doidi,

dQidib 2

a>iC 2

a2

aoarfi,

= a 02 dic

and then

or
01?>2

Let

us, therefore,

6iC 2

6 2 Ci

choose

b2

CLo 2 C 2

= a 02 and

c2

02Ci

condition

determines 61 and C\ since (a i, a Q2 ) = 1. Choose a set


determined for b\ and Ci in which neither bi nor Ci is zero.
we multiply each member of the last equation by d\, we have

this equation

if

Then the

of values so

Now

floi-

becomes
aoi&i

and

a x bi

a%c x

= d

THE LINEAR DIOPHANTINE EQUATION


and therefore the transformed equation

d\U

takes the form

(3)

a^diw

23

dito

and

u =
which
Eqs.

a>zw

the same as the value found for

is

(2) for

of the

to

x and

y,

we

Then by

t.

eliminating u from

find that the solutions of the original equation are

form
x
y
z

=
=
=

bit

a 02 v

crfo

a 01 v

20

+ dzbiw
+ a ciw
3

diw

where v and w are the parameters. That all these values of x, y, and z
determined by integral values of the parameters satisfy the equation is
easily verified.
It

evident that the solution of a Diophantine equation in four

is

now be made

depend upon the solution of one with three


we have used equations in two variables
in the above development to solve an equation in three variables.
Example. Solve: Qx + 24?/ - 41z = 91.
Solution.
(6, 24) = 6, and Alz + Qt = 91 has the solutions z =
The equations aib 2 + a 2 c 2 = and 6ic 2 b 2 Ci =
1 Qw, t = 22 41w.
1 become 6b 2 + 24c 2 =
and bi + 4d = 1, so that b 2 = 4, c 2 = 1;

=
=
= t, it is easy to compute the answer in the
1.
Since
C\
u
bi
3,
form x = -3(22 - 41ti>) - 4v = -66 + 123w - 4v, y = 22 - 41w +
variables can

variables in the

v,

2-5.

to

same manner

as

Qw.

Simultaneous Linear Diophantine Equations. A set of two equamay or may not have a solution in integers. Con-

tions in three variables


sider the set

aix
bix
If (ai,

2,

a2

there

CJ3)

is,

+ay+az =
+by+bz =
2

mi

ra 2

mi

d 2 fails to divide
no solution for the set. But even when these conthere need not be a common solution.
Take, for

di does not divide

or

if (61, 62, &s)

of course,

ditions are fulfilled,


instance, the set

2x
2x
If

the second equation

is

+
-

When

together with an

equation, but because

subtracted from the

4y

Any y and z that,

+z=
+ 3z =

Sy

(4, 2)

2,

2s

first,

the result

is

= -

x, satisfy

the given set must satisfy this

the equation has no solution whatever.

each individual equation has a solution, we can always determine

ELEMENTARY THEORY OF NUMBERS

24

common

exist,

by solving one equation and sub-

stituting these values in the second.

Thus, when the solutions of the

the

solutions,

they

if

equation
aix

a 2y

ri

=
=

= mi

a 3z

(5)

are

with parameters

&2?/

>32

= m we
2,

r2
r3

+
+
+

The given equations have


is

(5),

+
+

t\W
t2

(6)

s 3^

common

Wo
v

in bix

Bv = C
solution

Suppose the solutions

solvable.

w =
v =
When

s 2v

and w, upon substituting these expressions


obtain an equation of the form

Aw +
tion

SiV

-\-

exist

and only if this last equaand are of the form

if

Bit

Ait

these values are substituted in the solutions (6) of the


common solutions of (4) take the form

first

equation

the

x
y
z

where there

but one parameter

is

Example.

= X
= Y
= Z

+ Kit
+K
+ K^
2t

t.

Solve the set of equations: 6x

2x

24?/

Sy

412

7z

91,

2.

Substituting in the second equation the solutions of the


one arrived at in the preceding example, we have 2( 66 + 123w
Hence
4w) - 3(22 - 41tc + v)
7(1 - Gw) = 2, or 327w - Uv = 193.
=
-2
=
-77
w
+ life, and v
+ 327/c. Therefore x = -66 + 123(-2
Solution.

first

lift)

(-77

- 4(-77 +
=

327/c)

= -4 + 45/c; y =
124/c; 2 = 1- 6(-2 +

327/c)

27

- 41(-2 + 11/c) +
11/c) = 13 - 66/c.
22

EXERCISES

1.

Solve: 2x

3.

Solve: 10a;

5.

Solve the set: 2x

7.

A room has

to realize exactly

the children,
8.

$100,

If

5y

16?/

3s

17.

2.

4z

4.

2y
4y

7x 100 seats.

$10

if

the

Solve: 3z

6y

2z

11.

= 521.
= 22,
= 11,
6. Solve the set: x + 3y - hz = 29.
5a: - 5y - 3z = 33.
How many men, women, and children should be admitted
men will pay 50 cents each; the women, 20 cents each; and
48.

Solve: 127a:

319?/

43z

7z

cent each?

100 pieces of

how many

money

of each

in denominations of 50 cents,
denomination must there be?

$5,

and $10 are

to

amount

to

CHAPTER

PROPERTIES OF INTEGERS

3-1.

The Composite.

most familiar
proved it?

is

Perhaps one of the facts with which you are

that a composite has a prime factor, but have you ever

Theorem

3-1.
Every composite has a prime factor.
Because any negative integer can be expressed as the product of its
positive associate and the unit 1, we shall assume that the composite m
Since m is neither a unit nor a prime, it has a factor that is
is positive.
not a unit or an associate of m. Therefore, let m = /i/ 2 where both
Then /i < m, and /i is either a prime or another
factors are positive.
composite.
If /i is a prime, the theorem is complete, but if /i is a comThen
posite, it, in turn, has a factor other than an associate or a unit.
< /3 < /i. If /3 is not a prime, the line of reasoning
/i = fzfA, where
continues in the above manner, but only for a finite number of steps, for
,

since

m > /i > / >


3

we must
ciates

way

>

arrive at a positive factor f<m-\ that is divisible only by its assoThe integer 2n -i is, therefore, a prime, and by subunits.

and the

stitution
3-2.

it is

obviously shown to be a factor of m.

The Sieve

of Eratosthenes

(c.

230

B.C.).

to test whether or not a positive integer

It is evident that
is

one

a prime would be to

write all the integers from 1 through m; then to leave 2, and strike out
every second integer thereafter; next to leave 3, and strike out every third
integer thereafter; generally, to leave the next unstruck integer p, and

Each

strike out every pth integer thereafter.

integer except

that

is

not

For how long must this


process be continued before we know that m is a prime? Eratosthenes
answered this question by means of the following theorem and thus
crossed off

by

this process is obviously a prime.

presented a useful test for a prime:

Theorem

3-2.

A positive integer m is prime if it has no positive prime

factor less than or equal to /,

where I

is

the greatest integer such that I 2

than or equal to m.
Suppose that m is not a prime but is a composite. Then m has a prime
This prime factor p must be greater than / according to the
factor.
is less

25

ELEMENTARY THEORY OF NUMBERS

26

hypothesis of the theorem. But when m = pf, the complementary factor


/ must also be greater than /, for if it were not, a prime factor of it, which
would necessarily be a prime factor of m, would be less than or equal to /.
Therefore, both p and / are at least equal to /
1, and m = pf shows

that

m >

(I

l) 2

This statement is contrary to the hypothesis which says that (I + l) 2 >


m, and hence m is a prime.
Example. To test 2503 to see whether or not it is a prime, we try to
divide 2503 by the primes 2, 3, 5, through 47, since in this case I is 50.
Because none of these primes is a divisor of 2503, this integer is a prime.
3-3. The Number of Primes.
Euclid included the following theorem
in his " Elements."
Theorem 3-3. The number of primes is infinite.
So that we may understand the method of this proof, let us recall that a
set of elements is said to be infinite if it has a proper subset, that is, a
subset different from the whole set, which can be put into one-to-one
correspondence with the whole set. Otherwise, a set is said to be finite.
Consequently, if it can be shown that, in addition to a finite subset of a
set, there is always another element that belongs to the set, the set is
infinite.

Suppose that the number of primes is finite. Then there is a largest


by taking the product of all the primes
prime p. Form the integer
from 2 through p and adding the integer 1 thus

(2

N is either a prime or a composite.

p)

But

if

which is contrary to the assumption.


This factor is not one
tive prime factor.

If

p,

5,

p, or

N
N

is

a prime,

is

a composite,

of the

according to the distributive law

it

it is

greater than

has a posiprimes in the set 2, 3,


it

would divide

1,

which

is

a prime larger than p. Because we have


shown that when we assume the number of primes is finite, we can always
find a positive prime that was not previously counted, the number of
impossible.

primes

Consequently,

it is

is infinite.

moreover, that Euclid's proof shows that if p h p 2


,
prime lies in the interval from p r
1
1.*
This interval provided one of the first
pr
answers to the question, Where is the next prime larger than a given
prime?
It is evident,

p r are the first


through pip 2

'

'

r primes, the next

* D. N. Lehmer has compiled a "List of Prime Numbers from


Carnegie Institution of Washington, Washington, D.C., 1914.

to 10,006,721,"

PROPERTIES OF INTEGERS

Theorem

27

The number of primes of the form An 1 is infinite.


number of positive primes of the form 4n 1 is finite, and

3-4.

Suppose the

p be the largest one of them. Determine all such primes from 1


through p, and form their product. Then construct the integer N by
multiplying this product by 4 and subtracting 1 from the result. Thus
let

(4

p)

one of the form An 1 that was not previously


counted, for it is larger than p. But if iV is a composite, it has an odd
prime factor. Consequently, this factor has the form 4n 1 or 4n + 1.
If it is of the form An 1, it is not one of the primes from 1 through p, or
by the distributive law it would divide 1, and that is impossible. ThereBut
fore, if the prime factor is of this form, it is a prime larger than p.
has the form An
if the prime factor of
1, there is a complementary
factor of the form An I, for the complementary factor must also be odd,
If

AT"

is

a prime,

it is

and the product


(4s

does not yield the form An


(4s

1)(4
1,

1)

4/c

whereas the product

l)(At

1)

Ak

We observe immediately that this complementary factor At I


prime
factor.
has a
The argument is now repeated with reference to this last prime factor.
Since the size of each of the positive factors having the form An 1
decreases as the argument proceeds, we must finally arrive at a factor
having the form An 1 that has only itself and 1 as positive factors.
This integer is, therefore, a prime. It is of the proper form, and it is not
one of the primes from 1 through p. It is, therefore, larger than p, and,
as a result, the number of primes of the form An 1 is infinite.
Dirichlet (1805 1859) showed by using advanced methods that the
arithmetic progression determined by an + b, where a and b are fixed
integers and (a, 6) = 1, while n has all integral values, contains an infinite
number of primes. Although for many years elementary proofs were
known for special cases of this theorem, such as An 1, no proof of
the general theorem that did not make use of the methods of analysis
employed by Dirichlet had been developed until 1949. About this time
certain mathematicians (Paul Erdos, Atle Selberg, H. N. Shapiro, and
H. Zassenhaus), working on the prime number theorem and in the theory
of algebraic numbers, developed methods that produce new proofs of
Dirichlet's theorem.
These are, however, beyond the scope of this text.
does.

ELEMENTARY THEORY OF NUMBERS

28

Theorem

If 2 n

3-5.

a prime, n

1 is

is

a prime.

a composite and that n = nin 2 where 1 < n\ < n.


Then 2 nin 1 has the factor 2 n 1 which is neither 1 nor 2 n 1.
Consequently, n must be a prime if 2 n 1 is a prime.
Notice, however, that when p is a prime, 2 P 1 need not be a prime,

Suppose that n

is

when p =

for

11,

2 11

has the factor 23.

EXERCISES
1.

6n

Show

that

all

2.

Show

3.

Prove that n 4

4.
5.

primes except 2,

are represented

by the forms 6n

and

1.

that there

is

an

is

number

infinite

primes of the form 6n

of

composite when n

>

1.

1.

Show that if 2 n + 1 is an odd prime, n is a power of 2.


Determine whether or not 1781 and 4079 are primes.

We

Unique Factorization.

3-4.

the case where

have previously proved by means of


ab and (m, a) = 1, then m\b.
In
theorem can also be proved in the follow-

when

a rather long discussion that

m is a prime this

ing manner:

Theorem

3-6.

If

is

a prime and p does not divide a or

b,

then p does

not divide ab.

Take

a, 6, and p positive integers, and consider the case in which


and b < p. We shall prove that the prime p does not divide ab
by assuming the contrary and showing that we arrive at an impossibility.
According to the principle of Archimedes there exists a positive integer k

<

p,

such that for a

>

ka

where the equality sign

is

<

<

(k

l)a

omitted because p

<

<

(p

ka

<

is

a prime.

Therefore

and

But

if

p divides

ab,

ka)b

<

ab

then p divides pb kab and this positive integer is a


This argument leads to the conclusion
is ab.

smaller multiple of b than

is always a positive multiple of b that is divisible by p and is at


same time smaller than the one last found. Accordingly there would
be an infinite number of multiples of b between b and ab. The result is,
of course, impossible, and consequently p Jf ab.
Suppose now that not both a and b are less than p. Then

that there
the

a
b

= mip
= mp
2

+
+

ri

r2

<

ri,

r2

< p

PROPERTIES OF INTEGERS

29

Thus

= Kp

ab

rir 2

and r 2 are positive and


and therefore p \ ab.
The result implies that if p ab, p divides at least one of a and b.
Theorem 3-7. If p is a prime and p does not divide a where i = 1,2,
n, then p does not divide the product of the a
an
But p does
a n then p divides a or a 2 a 3
If p divides aia 2
In like manner p divides
an
not divide oi, and so it divides a 2 a%
Finally, p would have to divide a n but it does not, and
an
o 2 or a 3
and

if p
than

less

ab, it follows that

We know

p.

nr 2 where both

r\

this division is impossible,


\

t-,

{.

p does not divide the given product.


Theorem 3-8. Fundamental theorem of arithmetic. Except for
associated primes and the order of the factors, a composite can be factored
into primes in one and only one way.
Assuming that m is a positive composite, according to Theorem 3-1, m
has a positive prime factor pi so that m = piirii. If mi is not a prime, we
again apply this theorem and obtain mi = p 2 m 2 and m = pip 2 m 2
Since
m > mi > m 2 >
> 0, we need carry out this process only a finite
number of times until we have factored m into positive primes. Thus
therefore

m =

PiPi

'

Pn-

'

Suppose that there


that

m=

qiq 2

a second factorization of

is
r,

>

where n

P1P2

pn

Therefore, p\ divides the product qiq 2

= 1, 2,
r.
+ 1 and qi, and

primes qh where j
divisors of qi are

Pi

'

m into positive primes so

Then

r.

qiq2

'

qr

qr and must divide one of the


Suppose pi divides^i. The only
since pi and qi are positive primes,

Hence,

q\.

P2PZ

Pn

qiqz

'

'

qr

Continuing this process, we see that when n = r, each p where i = 1,


n, is identical with a corresponding qj} but when n > r, we
2,
{,

finally

have
Pr+l

and each

of the integers

'

Pn

p n must be a

Therefore, the
primes is unique.
It is obvious, then, that if we gather the equal primes together into the
power form p s any composite m can be written in the form pi n ^p 2 n2
n
p r *, where the factorization is unique except for the use of an associate
in the place of any prime and the order of the factors.

p r+i,

factorization of the positive composite

The reader may

unit.

m into positive

well

remember that an

expression shows factors of

all

algebraic factorization of an

integers represented

by the expression, and

ELEMENTARY THEORY OF NUMBERS

30

the factorization may, therefore, be used to demonstrate a property of all


-\- I and a 1, we
never
1
represents a prime. In factoring
can show that, for a > 2, a
an integer that is written in polynomial form into the product of two
integers, however, one must recall that while the expression may not be

these integers.

For instance, by using the factors a


2

may be factorable in just


a particular integer represented by the

factorable algebraically into rational factors or

one

way

besides itself

expression

may have

and

1,

several factorizations.

It is

evident that although

+ 1 lacks factors in our domain, yet, for the particular


+ 1 = 26 has the factors 2 and 13. Again, an integer

the expression a 2

value a = 5, a 2
represented by a 2

may have

by the

factors other than those given

2
1 of a 1.
For instance, when
only rational factors a 1 and a
2
=
=
1
24 and this integer has the factors 3 and 8, 2 and 12, as
a
5, a
well as 4 and 6.
Hence, we must be careful to avoid drawing the conclu-

sion that an integer lacks factors just because the algebraic expression of

which

it is

a value

fails

to produce the factors.

EXERCISES
Show that if both x and y are odd, there is no z such that x 2 + y 2 = z 2
Show that if {a, b) = 1 and ab = c n then a = s n b = t n
3. Show that an integer can be represented as a difference of two squares if and only
Show also that the representation is unique when
it is of the form 2n + 1 or 4n.
1.

2.

if

is a prime.
Find the positive integers x that make x(x
Find the positive integers x that make x(x

the integer
4.

5.

Method

+ 42)
+ 84)

a perfect square.
a perfect square.

Although it was fairly


prime
of the form 4ft -j- 1
easy to show
the problem of
difference
squares,
represented
uniquely
as
of
two
can be
a
expressing a prime of the form 4ft + 1 as a sum of two squares attracted
the attention of mathematicians for many years. Fermat claimed in
1641 that he had proved the theorem by the inductive method, called the
method of infinite descent, which was exhibited in the proof of Theorem
3-6.
Thus he said, " If a prime 4n + 1 is not a sum of two squares, there
is a smaller prime of the same nature, then a third still smaller, etc., until
the number 5 is reached."* Since 5 is the smallest positive prime of the
form 4n + 1, and since it can be written 5 = l 2 + 2 2 the method leads
to a contradiction and consequently each prime of the form 4ft + 1 is a
sum of two squares. Whether or not Fermat actually proved the theorem
we do not know, but Euler is generally credited with developing the first
proof together with the proof of the unicity of the representation.
It
was not until 1843, however, that he established a point that he needed
3-5. Fermat's

of Infinite Descent.

in Exercise 3 of the last set that a

* L.

E. Dickson, " History of the Theory of

Numbers,"

Vol. 2, p. 228.

PROPERTIES OF INTEGERS

31

In the meantime by 1801 Gauss had applied

for a rigorous proof.

the theory of binary biquadratic forms to show the existence of the


representation. *

But Fermat's method

of infinite descent used, as

proof of the above theorem


it

is

more

could be applied with

of particular interest.

prove the impossibility of certain

facility to

which Theorem 3-6

he claimed, in the
He admitted that

an example, than to show affirmative


statements. He made use of the method in the one specimen of a
detailed proof that has been left by him when he showed that if integers
relations, of

is

are the sides of a right triangle, the area cannot be a perfect square.

a, b, c

The Euclidean Algorithm. An algorithm is a method of obtaining


a result by repeated applications of an operation and is such that an
element determined by one application of the operation is used at least
once in a succeeding application until the desired result has been found.
It is important to have a method for finding the greatest common
3-6.

divisor of

mon

two

divisor

is

integers a

and

b.

If

one integer

is zero,

either or both integers are negative, the greatest

same

as

it is

common

divisor

Taking both a and


up the Euclidean algorithm
a and b.

for the positive associates.

therefore, with a

the greatest

the greatest com-

evidently the positive associate of the other integer, and

>

we

b,

common

shall set

divisor of

is

if

the

b positive,

for finding

Applying the theorem of Euclid, we have

= rriib + r\
= ra ri + r 2
= m r2 + r3

a
b
ri

Because

>

r\

>

r2

cations of the theorem


of r k -i.

Then

r k is

rrtiTi-i

+ Ti

= m k r k -i +
= m k+x r k

r k -!

Ti-2

r k -2

<n < b
<r < n
< r3 < r

>

we must

the greatest

>

<
<

rk

r*

>

Ti

rk

0, it is

<
<

Ti-i

r*_i

evident that after k appli-

arrive at a remainder r k that

common

divisor of a

and

b,

is

a divisor

for first of

all

In like manner because r k divides r k -i and


Using the steps of the algorithm in reverse
rfc-2, it must divide r _ 3
order, we observe, therefore, that r k divides each r* and finally that it is a
common divisor of b and a. But any common divisor of a and b divides
Proceeding in this manner,
ri, and by the second step it also divides r 2
we see that any common divisor of a and b divides r k Therefore, r k is the
greatest common divisor of a and b.
The first step of the algorithm shows that n can be expressed linearly

rk

r k -2 since it divides r&_i.


fc

* Ibid., p. 233.

ELEMENTARY THEORY OF NUMBERS

32
terms of a and

in

b,

for

mj)

h so that r 2

ri

Moreover,

2 a.

r2

2r

ra 2 (a

raib)

+ mim

(1

2 )b

+Mb
+Nb

= Mia
n = N a

Ti-i

we

Thus from the equations

see that since


ri+ i

u-i

mi+iTi

r l+1

Qid

Q 2b

then

Hence, as was shown by a different method in Chap. 2, r k the greatest


common divisor of a and b, can be expressed as a linear function of a and
b with integral coefficients.
In the special case where b a so that ri = 0, it is evident that b is the
,

and b and that b = a(0)


b(l).
applying the unique factorization theorem, it is also apparent that
if the integers a i} where i = 1, 2,
n, are factored into powers of
distinct primes so that
greatest

common

divisor of a

By

en

vr^

=1

the exponents being positive integers or zero, the greatest

common

divisor

r
s

of the di is
3

Pj in

pj

] [

>,

where each

the factorizations of the

the smallest exponent that occurs for

a;.

Find the greatest

Example.
573

Sj is

=1

291

282,

Hence, the greatest

291

common

common

282

divisor

9,

divisor of 573

282

(31) (9)

and 291.

3,

(3) (3)

is 3.

EXERCISES
Find the greatest common divisor of 5040 and 4704.
Express the greatest common divisor of 168 and 525 as a linear function of these
numbers.
ba
3. If d = (a, b), then d is the number of integers in the sequence a, 2a, 3a,
Prove it.
that are divisible by b.
4. Show that the sum of a finite number of rational fractions in their lowest terms
cannot be an integer if the denominators are prime each to each.
2"
5. Prove that two integers having the form 2
+ 1 are relatively prime. From
1.

2.

this fact develop another proof that there are infinitely

the form 2 2 "

are called Fermat numbers.

mula generated primes

He

for all integral values of n.)

many

primes.

(Integers of

believed erroneously that the for-

PROPERTIES OF INTEGERS

33

Prove that the number of divisions required to find the greatest common divisor
two positive integers written in the scale of 10 by means of the Euclidean algorithm

6.

of

does not exceed

five

times the number of digits in the smaller integer.

3-7. The Least Common Multiple


Theorem 3-9. If d is the greatest common

integers a

and

and

that a

b so

a Q d, b

divisor of the positive

the least

b d,

common

multiple of a

b is a b d.

Any common
But

form ma.
because (a

multiple of a and b
it

a multiple of a and therefore has the

is

also a multiple of b

is

follows that b

1, it

b d ma d, and
common multiple

Thus

b d.

Hence, any

m.

and b has the form ka bod.


ka b d, and in order that an integer be a common
However, a
multiple of a and b, it is sufficient that it have the factors a and b d.
Therefore, the positive common multiple of a and b that divides every
of a

common

multiple

Corollary

multiple

Corollary

common

W-

if

integer

and only

is

common

the least

3-10.

If

common

and

the least

common
,

the least

is

multiple of their least

is

the least

that

is

it

is

a multiple of a 3

multiple of

divides

all

it is

is

an

cin-i,

is

their

common

the least

a multiple

and a 3 is a multiple of L.
oi, a 2 and a 3 for it is a com-

of a h a 2

common

multiples.

of integers

multiple of a n and the integer

ccmmon multiple of the set Oi, a


Any common multiple of the nonzero

the least

Corollary.

an

multiple

In like manner we can extend the theorem to show that:


Theorem 3-11. The least common multiple of the set
.

then

common

multiple of them, and

Thus any common multiple

L 12

is

common

besides being a multiple of Li 2 an integer

a2

Then L is a common
of L 12 and a 3
But any common multiple of a and a 2 is a
common multiple L i2 For the same reason, if

common multiple

Therefore,

multiple of a\ and a 2

multiple of a h a 2 and a 3

Let L be the least

ai,

is

a%.

multiple of a 1} a 2 and a 3

mon

multiple of the nonzero

the smallest positive integer that

if it is

multiple of them.

the least

of L.

common

a and b are relatively prime, their least

An

2.

and

Theorem
of L12

is

If

1.

the positive associate of their product ab.

is

integers a

2,

a n _i.

integers a h a 2

a multiple of the smallest positive integer of which each a z

is

a factor.

It is

obvious that when a {

]} p/
3

ni
>,

where

1,

2,

n, the

=1
r

least

common

multiple of the a {

is

J J p/**,

where Gj

is

the exponent of the

highest power of p3 occurring in the factorizations of the a z


-

-.

ELEMENTARY THEORY OF NUMBERS

34

EXERCISES
1.

If

where a and

(a, b),

show that ab

b are positive,

d and the least common multiple of a and b.


k
2. Show that if 2 is the highest power of 2 that
2, 3,

then that integer of the set that

n,

only integer in the set that


3. Prove that \
\

by 2 k

divisible

is

equal to the product of

is

a factor of an integer of the set 1,


k
is 2 itself and is the

is

a multiple of 2

is

fc

1/n is not an integer.


necessary and sufficient condition that a positive common multiple
of the
n, be their least common multiple is that
nonzero integers a t where i = 1, 2,
Prove it.
the quotients M/ca be relatively prime.
4.

-,

6.

Show that

the product of n positive integers

common multiple and

common

the greatest

is

equal to the product of their least

divisor of all possible products that can be

formed by taking the integers n 1 at a time.


r, is a set of integers having (m,, m,) =
6. If rrii, where i = 1, 2,
r, and if A is the least common multiple of m h m 2
j = 1, 2,
and m r then the greatest common divisor of rm and Ai is the
m i+h
.

mon

di 2

The Divisors

d<,-i, d*,*+i,

we mean

and we designate

the

by r(ra).

it

di r

m_i,

least

com-

When we refer to the number of


number of positive divisors of that
Thus r (6) = r( 6) =4. We also

an Integer.

of

where

di }-,

divisors of an integer m,

integer

multiple of da,

3-8.

use the symbol <r(m) to represent the sum of the positive divisors of m.
It is evident that the number of divisors of a prime p is 2 and the sum
is just p + 1 if p > 0.
Moreover, the divisors of p a are 1, p, p 2
2
a + 1, and their sum is 1 + P + P +

of the divisors

is

Theorem
of

3-12.

m is (a\ +

<m

If

1)(2

Pl

1)

i+i

Pi

'

ai

pi p2

(r

p2

P2

pr

ar

r+i

Pr

their

number

a
-

the

Pr

and so

and the sum

1)

2 +i

az

number

of divisors

of the divisors of

m is

If

m =

J Pi

ai
,

it is

evident that each divisor of

m which is also a divisor

i = l

of p\ ai is a

term

in the expression

Pi

Pi

Moreover, only these terms are divisors


ner the terms of
1

P2

P2

'

of

'

both

Pi

ai

m and pi

(1)
ai .

In like man-

(2)

P2">

If we multiply these
and only the divisors common to m and p 2 a2
of
the
result
is
a divisor of pi ai p 2 a2
terms
the
each
of
together,
two sums
and furthermore these terms give all the common divisors of pi ai p 2 a and
This product of (1) and (2) is
m.

give

all

PROPERTIES OF INTEGERS
1

Pi

Pi

'

'

Pi"

Vi

P1P2

Pi

35

+ ' +
+
P2 +

2>2

Pi

ai

ai

'

'

Pi p2

a*

it has (i + l)(a 2 + 1) terms.


Continuing the reasoning in this manner, we see that the terms of the
expansion of the product

and

(1

give

Pi

all

'

and only

Pl 0(l
tt

P2

'

'

'

P2

'

(1

+ Vt +

1)

'

'

Pr')

(3)

There are

divisors of m.

r(ro)

terms in this

The sum
(3)

and

is,

(i

l)(a 2

1)

(,

and therefore that

result,

of the divisors of

m is the

the

is

sum

11 (*
t-i

!)

number

of the

of divisors of m.
terms in the same product

therefore,
r

<r(m)

= \\
i

(1

+P +
t

Pf) = J! g

-1

^~T

EXERCISES
r

Prove that the sum of the nth powers of the divisors of

1.

p.(i+D

n
i

P<

=l

Find the smallest positive integer with 6

2.

Since 6

=6-1 =2-3 =

the required

number

smaller than 2 5

(ai

l)(a 2

are either the pair

5,

l),

m =

JJ
i=l

p*"** is

divisors.

the exponents of the prime factors of

or the pair

1, 2.

Evidently 2 2

12

is

Find some integers having 10 divisors.


Find the smallest positive integer with 15 divisors.
-1 n -1
have
5. Prove that if n = ninz, with n\ > ni > 1, so that both 2 n_1 and 2 n
3
n divisors, then 2 n_1 > 2 n i- 1 3 n 2 _1
n -1 3"~ 1 5 n -1 is less
6. Prove that if n = nintfiz, with 1 < n\ < ni < n 3 then 2
than 2 2 n 3-i3H-i and both have n divisors. Consider the cases in which n 2 = n%, in
which ni = n 2 and in which n\ = ni n^.
7. Find by trial positive integers n such that the sum of the divisors of n is a
3.

4.

ri

perfect square.

Find all primes that are one less than a perfect square. Is there a prime that
than a perfect cube? Can you find a prime that is one less than n 4 ? Prove
a general statement to cover these results.
9. Find by trial positive integers n such that the sum of the divisors of n is a
8.

is

one

less

multiple of n.

Prove that a positive integer is the sum of consecutive positive integers if and
not a power of 2.
11. Prove that the number of divisors of a positive integer is odd or even according
as the integer is or is not a square.
10.

only

if it is

ELEMENTARY THEORY OF NUMBERS

36

Prove that the product of the divisors of a positive integer n

12.

the

number

n 8/2 where
,

s is

Prove that if r is the number of distinct prime factors of n > 0, the number of
which n can be factored into two relatively prime factors is 2 r_1

13.

ways

is

of divisors of n.

in

Examine the

Numbers.

6, and you will notice


Observe also that the sum of the
divisors of 28 is 56.
A positive integer is said to be perfect if the sum of
its divisors is double itself.
Besides 6 and 28, the integers
496, 8128,
to
Hi* 3??ZNotice that all these
130,816, 2,096,128, and 33,550,336 are perfect.
perfect numbers are even.
Although no odd perfect number has ever
been found, mathematicians have not been able to prove that none exists.
It has been shown, however, that if one does exist, it is greater than 10
billion.*
On the other hand, we can prove:
Theorem 3-13. An even integer is perfect if and only if it has the
~
form 2 P 1 (2 P 1), where 2 P 1 is a prime.
If an integer is of the given form, which is due to Euclid, the sum of its

3-9. Perfect

the interesting fact that their

sum is

divisors of

12.

'

divisors

'

'

is

(1

2^- 1 )(l

2P

1)

2^(2^

1)

and hence the integer is perfect.


The converse was first proved by Euler, but we shall present a method
due essentially to L. E. Dickson. Assume that m is of the form 2 k q,
where q is odd. If, further, m is perfect, by letting s represent the sum of
all the divisors of q except q itself, we have

2 k+i q

But 2 k+l

1 is

2 *+i

substituting this value in the


q

l)(g

+ s)
+

2 k+l divides q

odd, and hence


q

Upon

so that

2 k+l n

first

(2* +1

s,

equation,

we obtain

l)n

But by subtracting q from q + s we


s = n = q.
Then the equa l)q gives 1 = 2 k+1 1, and k = 0. In this case the
tion q = (2
But if we suppose that n is a
original integer 2 k q would not be even.
divisor of q that is not q and not 1, then n = s is at least the sum of the
However, it is impossible that n > n + 1. Accorddivisors n and 1.
Thus q is a prime.
ingly, n = l, and the only divisors of q are q and 1.
Consequently, n

find that s

n.
k+l

is

a divisor of

Now

let

q.

us suppose that

1
Since q = 2 k+l 1, the exponent k
even perfect number has the form 2 P_1 (2 P

is

a prime.
1), in

Therefore, every

which both 2 P

and

p are primes.
*

Am. Math. Soc, Vol. 49, No. 10, pp. 712-718,


Am. Math. Monthly, Vol. 56, No. 9, pp. 628-629, 1949.

A. Brauer, Bull.

hard,

1943.

H. A. Bern-

PROPERTIES OF INTEGERS

37

less than or equal to 257 are


Marin Mersenne, who
mathematician
called
Mersenne was interested in discovering which
lived from 1588 to 1648.
of these numbers 2 P 1 are primes and made certain decisions about
their primality even though he lacked the modern facilities for testing
numbers of this magnitude. It has taken many years to decide that
In 1944, six Mersenne
exactly 12f of the Mersenne numbers are primes.
=
the
primes
to
numbers corresponding
157, 167, 193, 199, 227, and 229
p
The
tremendous
task of investigating the charremained to be tested.
H. S. Uhler. He completed
numbers
was
carried
by
out
acter of these 6
finding
prime
no
among them. We now know that
the work in 1947,
=
only the primes p
2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, and 127 deter.mine Mersenne primes of the form 2 P 1 and hence that only these 12
Mersenne numbers yield perfect numbers. The largest of these perfect

Integers of the form 2 P

Mer serine numbers*

with p a prime

after the

digits J when written in the scale of 10.


The author is indebted to D. H. Lehmer for the information that during
the year 1952 it was demonstrated by the electronic calculator SWAC

numbers has 77

that 2 P

is

more

quently, five

prime for p

521, 607, 1279, 2203,

integers are

now known

and 2281.

to be perfect.

Conse-

It is particu-

gaps between some of these primes.


Doubtless you have noticed that each of the first seven perfect numbers
given above ends in 6 or 28. It has been proved that all perfect numbers
of Euclid's type end in this way.
larly interesting to notice the large

an integer n the sum of whose positive


first integer n the sum of whose divisors
is Sn is 120.
Fermat found the second one, which is 672. The third is
The first integer the sum of whose divisors is four times itself
523,776.
Recently some new multiply perfect numbers have been
is 30,240.
multiply perfect number

divisors

is

is

The

a multiple of n.

discovered.

Two

integers are said to be amicable

if

their

sum

is

sum

the

of the

numbers is 220 and


284.
Another pair, 17,296 and 18,416, was found by Fermat.
3-10. Scales of Notation.
Have you thought of 5347 in the form of
the polynomial 5x z + Sx 2 + 4x + 7, where x = 10?

The

divisors of each one.

Theorem
form

m =

3-14.

are such that


*

+
<

Any
a\r n

~l

<

smallest pair of amicable

m can be written uniquely in the


a n where r > 1 and the coefficients

positive integer

+
r

and

+
<

a$

<

r for i

1, 2,

n.

R. C. Archibald, Scripta Mathematica, Vol. 3, No. 2, pp. 112-119, 1937.


H. S.
f D. H. Lehmer, Bull. Am. Math. Soc, Vol. 53, No. 2, pp. 164-169, 1947.
Uhler, Bull. Am. Math. Soc, Vol. 53, No. 2, pp. 163-164, 1947; ibid., Vol. 54, No. 4.
pp. 378-380, 1948; Scripta Mathematica, Vol. 18, No. 2, pp. 122-131, 1952; Proc.
Natl. Acad. Sci. U.S., Vol. 34, No. 3, pp. 102-103, 1948.
t H. Gupta, Am. Math. Monthly, Vol. 42, No. 3, pp. 163-164, 1935.
B. Franqui and M. Garcia, Am. Math. Monthly, Vol. 60, No. 7, pp. 459-462, 1953.

ELEMENTARY THEORY OF NUMBERS

38

When m

rn

written in the form a

is

air"

-+-

conditions designated in the theorem,

-1

-\-

a n with the

said to be expressed in the

is

and r is called the base, or radix.


For a given m and r > 1, we know that

scale of r

m =

qir

-\-

an

qi

qtf

a n _i

ft

ft fir

=
=

fti-l

?n

<

where

>

<

a*

arrive at q n

r,

for

which

1, 2,

qn - 2

m =
This representation

rn

air 71

<

bj

<

"1

and

r(a r n-1

is

n- s

tion

is

>

0,

n.

less

Furthermore, we must finally


than r, because m > q > q 2 >

+a
+ ar +

a Qr

a xrn

a r2

an

a n -i

a,

and

a n -j
and then
aorn

Since r

=
=

0, 1,

s,

find that each 6 S _;

>

Ol

unique, for

rn

Therefore, r divides b s

we

a n -i

Then

0.

g n _i

with

ft^r

and

positive

is

_ s _!

b r

-1

b r8

+ a

vl'^

and

bs

b^ '
8

++?>

then

s,

s- 1

>

if

until,

a2

an

if

n =

(ln

fe 8

_i)

bs

an

Continuing in this manner,


= a but if
s, we have b
,

_s _ i

the remaining coefficients must

all

be

and the representa-

unique.

on the basis of this theorem that we know we can write an integer


one way in the Hindu- Arabic system, which uses the scale of 10
and the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The integer 363 in the
ordinary scale becomes 2423 in the scale of 5, while it is 101,101,011 in the
It is

in just

scale of 2.

Corollary.

one

way

as a

Any positive integer n can be


sum of distinct powers of 2.

expressed in one and only

We can apply this corollary to show that for weighing approximately


any load not exceeding 127 lb but seven weights of 1, 2, 4, 8, 16,32, and 64 lb
each are needed for the

scales, for

127

is

written 1,111,111 in the scale of

2.

PROPERTIES OF INTEGERS

39

It is interesting to notice that the Egyptians recognized that an integer


can be expressed as a sum of powers of 2 and that they made use of this
Suppose, for instance, that 237 was to be
fact in doing multiplication.
1
They
would
first determine that 45 = 32 + 8 + 4
45.
by
multiplied
multiples
of
237
the
process
of
the
corresponding
by
compute
then
and

Accordingly, the calculations would be:

doubling.

4
8

16

32

Then
7584

all

237
474
948
1896
3792
7584

that was necessary was to find the sum, 237

948

1896

10,665.

They carried out division in a similar manner. If 539 was to be divided


by 41, they used the process of doubling on the divisor until they could
find suitable multiples of it which, when added, would give a result smaller
than 539 but less than 41 units from it. Their work might be indicated
as follows:

41

But 328
or 539

164

13(41)

+ 41 =
+ 6.

533,

82

164

328

and so 539 = 8(41)

4(41)

1(41)

6,

The digital idea is the basis for many of our computing machines.
Indeed even the abacus, which was probably the earliest mathematical
machine, makes use of it. Each rod of the abacus corresponds to the
place a digit occupies

when the number

is

written in the scale of 10, and

Corresponding to the
machines use the contrivance of a

the beads on the rods correspond to the digits.


digital places,

some

of the calculating

gearwheels that rotate when certain levers are pressed. Each


has 10 teeth to correspond to the 10 digits, and upon a
cogwheel
such
complete rotation of a given wheel there is a mechanism that turns the
wheel corresponding to the next higher digital place through one-tenth
series of

of a rotation.

In setting up some of the modern electrical calculating machines it has


been found practical to use the binary rather than the denary system of
In spite of the increased number of digital positions necessary
notation.
for representing any number greater than one in the scale of 2 as compared with the scale of 10, fewer electronic tubes are required by machines

ELEMENTARY THEORY OF NUMBERS

40

constructed on the basis of this system, for but two digits,

needed

The

in

and

1,

are

The mechanism is, therefore, decidedly simpler.


the Institute for Advanced Study in Princeton is of this

each position.

calculator at

type.*

EXERCISES
1. Prove that any positive integer can be expressed uniquely as a sum of distinct
powers of 3 with coefficient 1, 0, or +1. From this representation show that a set
of five weights is sufficient to weigh any load of at most 121 lb if a balance scale having
two pans is used.
Then write 42 and 352 in the
2. Set up multiplication tables for the scale of 5.
Check the answer by
scale of 5, and find their product when they are so written.

converting the result to the ordinary scale of 10.


3. If 42 and 352 are in the scale of 6, find their sum and product in that scale.
4. Explain the ordinary process of multiplication by writing 382 and 73 as polynomials in 10 and finding the product of the polynomials.

In what scale is 374 written if it is the square of an integer?


Prove that the fraction a/b with (a, b) = 1 and a < b can be expressed uniquely
Show that the decimal either terminates or repeats in cycles of not
in decimal form.
more than 6 1 digits. For what values of b will the decimal terminate?
7. If (a, b) = 1 with a < b and if in calculating the value of a/b in decimal form a
remainder b a occurs, show that half of the repeating cycle of digits has been found
and that the remainder of the cycle can be determined by finding in order the differences between 9 and the digits already established.
5.
6.

3-11.

The Highest Power

positive integer,

definition

<

<

is

a.

Theorem

is

of a

Prime That

3-15.

U? =

^~?

and

2,

For any a and

Let

a and

(3,

where n

a,

= -3.

b greater

[[]'
_

than

0,

-hi
lab]

"

&

so thaib

T)_

n = aa
a = 3b
/

+
+

<
<

"i

r 2

7*1

r2

<
<

a
b

Therefore,

n =
Mathematical Machines,

Sci.

ar 2

American, April, 1949, pp. 29-39.

If

<

n.

= aa

the largest integer a such that aa

equivalent to saying that

Thus

Is a Factor of n\.

is

This

with

PROPERTIES OF INTEGERS

41

and

[sl-'+N*]

However, r 2 is at most b
at most a(jb 1) + a

is

Corollary

If

1.

1,

and

r is at

a&

2,

If

2.

>

Corollary 3.

If ra, n,

Corollary

If

Letting

t,

4.

>

and

n = wi

and thus ar 2

1,

a2

s+,\

1,

then

aa

*)

where the n^

t ,

>[?] +

[>]

i;

(ai

1,

positive,

n2

= a we have n; =

n =

>

and a are

are positive, then

a positive prime,

is

p<

Corollary

most a

Therefore,

1.

ri

< n <

r2

+ [si

+
[

n with

for

Therefore,

a.

'

'

and

ai

a2

OL t

Hence,

[i]^ [?] + [?]+ +[?]


If p is a positive prime, let E p (m) be the exponent of the

highest power

prime p that is a divisor of ra. Using this symbol, we shall prove


the following theorem due to Legendre (1752-1833).
It will help you to
appreciate how E p (n\) increases as n increases.
Theorem 3-16. If both n and the prime p are positive, the exponent
of the

of the highest

EJnl)

power

of

K+

p that divides n\

[?]

--

is

\M-

ELEMENTARY THEORY OF NUMBERS

42

Consider the set of integers


1, 2,

The

p,

shows that there are

=E

is

p,

p"

(4),

r-i
thereby obtaining the factor pL^-l.

But the last

integer of the

Lp

We

P-

o
2

new

set

set.

coeffi-

All other

Therefore,

1, 2,

[;])

can, as before,

that

Likewise,

<

we remove
p

s+1

Corollary.

Theorem
n = a Qp s

is

a multiple of p

is

,? J from
remove the factor pLp
2

new

showing that

set,

*M*[S] + &] + *('-


<

and the

the product of the integers of the

(4)

|j] p)

.o-[;]+*.0->

take out one factor p from each of these multiples of p that are in

the set

Hence,

(v-2p

multiples of p in this

integers of the set are prime to p.

E p (n\)

V\

by p

last integer of the set that is divisible

cient of p

Now

2p,

r-i
the factors pL? -

If

n =

3-17.

If

-{- +

r-iJ
pLp
4

so that

^
\

#P
>

0,

while

a&,

((a6)I)

is

[?])
.

-^

> a# p

0.

until

we

find that

Therefore,

(6!).

written in the scale of the prime p so that

a s then
,

>

di

PROPERTIES OF INTEGERS

= ap
1, 2,

Because n
a,i

<

for

n
Lpj
n

aip s
.

~l

43

<

a s with

<

<

p and

s,

a p s_1

aip s_2

a ps

~2

ai7?

s_3

as _ 2p

as_ 2

a s _i

fe]Therefore

a,_i

or
tf,(n!)

a ps

aip s

~1

'
'

(27)5

We may
scale

(138

of

a s _ip

(a

ai

a s _ip

as

3;

1.

[|?]

Hence

we have

6)/4

Oi

- a s -i

a 8 -i

- as

a.)

of the highest

27; 27

5 (138!)

53

--

(5)5

27

also use the second formula for

5,

ao

Find the exponent

Example.

+ 0;

Pp-

va ps

138

0(5 2 )

2(5)

power

^J =

2;

E p (n\).

of 5 in 138!.

(1)5

33.

Writing 138 in the

Therefore

3.

5; 5

J,(138!)

33.
t

Theorem

3-18.

The

expression n!/ai!a 2

t \,

where

a{

>

n,

i=i
is

an

integer.

We shall show that n!/ai!a

at

is

an integer by proving that the

highest power of any prime contained in the denominator

is

at least

equaled by the highest power of that prime contained in the numerator.


We know that

w* - [=] + [>] +

+ [] +
+

Lp

(5)

ELEMENTARY THEORY OF NUMBERS

44

Since a\

therefore

+
-^
2

+ <H = n,

for

if

1, 2,

the integers that follow

sum

in the

it

*;'""; [?] +

m <

for

exceeds n,

may

1,

.fe]

.;;;

exceeds each

and

a*,

+ ...+[p]

fe]

are also

it

Hence,

---

*^-[|] + [p] +
where, of course, some

s+1

be

0, in

which case

all

Likewise,

0.

+
.7.'.

[r]

But by Corollary 4 above,

L?J - L^J
As a

result of

summing by columns

conclude from Eq.

(5)

by

divisible

Yv

'

the expressions

+ E p (a

ai \)

and thus the given expression

is

The product

1.

'

'

the

(6) for

EP (ai\), we

that

E p (n\) > E p
Corollary

l_^j

of

2 \)

+ E p (a

\)

an integer.
any n consecutive positive integers

is

n\.

(k + n - l)/n\ = (k + n - 1) !/
+ l)(fc + 2)
and therefore is an integer.
This corollary shows that the coefficients in the expansion of (a + b) n
with n a positive integer are themselves integers, a fact otherwise known
from the multiplication itself. As a matter of fact Theorem 3-18 proves
that the coefficients in the expansion of (6i + b 2 +
+ b r ) n for n > 0,
obtained by means of the multinomial theorem are integers, for any term
of the expansion takes the form

The

(k

expression k(k

1) \n\

ai!a 2

where a

a2

'

'

In particular

it is

Corollary

If

b r) p

2.

'

now
is

ar

ar

bi

ai

b 2a *

'

b ra -

n.

evident that:

a positive prime,

except the coefficients of the

multiples of p.

all

the coefficients of

&* p ,

where

1, 2,

(6i
.

b2
r,

are

PROPERTIES OF INTEGERS

45

with d\ + a 2
ar p, is
an integer, and furthermore since each a,- either is positive and less than
p or is 0, there is no factor p in the denominator. Hence, (p 1)!/

The

atlas!

expression p\/ai\a 2

ar

is

ar

\,

an integer, and the required

coefficient is

Mp.

EXERCISES
If aP

1.

by p 2
2.

3.

show

bp

where p

is

a positive prime,

is

divisible

by

p,

prove that

it is

divisible

Prove that

If

re

is

if

m,

n,

and a are positive

number and

a real

integers,

the largest integer that

[x] is

is less

than or equal to

x>

that:

a.

[(1

b.

[(1

+
+
+

\/S) n ], for n > 0, is odd or even according as n


2n
1 is divisible by 2 n+1 for n > 0.
\/3)
]

-\/o>]

+
+1

is

by

divisible

c.

[(3

4.

For which values of n

5.

Is there a positive integer

is [4 n

is

even or odd.

2".

(2

\/2)

n
]

n such that 3 200

divisible

by 112?

the highest power of 3 contained

is

inn!?
Applying Theorem 3-17, let (n l)/2 = 200, for the sum of the coefficients of the
powers of 3 necessary to express n in the scale of 3 is at least 1. Then n is at least 401.
However, 402 has the factor 3,
But the highest power of 3 contained in 401! is 3 196
so that 402!, 403!, and 404! have the factor 3 197 but 405 has the factor 3 4 so that 405!
Hence, there is no n such that n\ has the factor required.
has the factor 3 201
19
is the highest power of 5 contained inn!.
6. Find a positive integer n such that 5
With how many zeros does 100! end?
7. Show that 95! ends with 22 zeros.
8. Find the highest power of 12 contained in 500!.
9. Prove that the exponent of the highest power of 3 contained in (3 r 2)! is
.

(3*-

10.
11.

2r

l)/2.

Find the exponent of the highest power of 5 that is a factor of (5 r 1)!.


If m >
and r(ra) means the number of positive divisors of m, show that

*>+*>++*) -R] + [5] +


12. If

m >

and a(m)

is

the

sum

....+ [2]

of the positive divisors of m, prove that

a)+w + ---+--[f]+.[5]+8[;] +

...

+ .[2]

When a > and b > 0, prove that if m = ab, then m\ is divisible by


m = ab with a and b positive integers, prove that m! is divisible by the
common multiple of (a\) b and (6!) a
15. Prove that when (m, n) = 1 and m and n are positive integers,
13.

14. If

(m

+n -

1)!

m\n\
is

an
16.

integer.

Prove that when

and n are positive

integers,

(2m)!(2n)!

7n\n\(m
is

an

integer.

n)\

(a!) 6 .

least

ELEMENTARY THEORY OF NUMBERS

46

n =

17. If

Oi

0,2

a>r

with

>

all en

and

(ai,

a2

ar)

<2,

then
I

d(n
ai!a 2

an

is

1)!

ar

integer.

m,

and a are

18.

If

19.

Prove that

n,

positive integers, under

what conditions

will

[t>[;]+*R]
.

(x+r-i

i)

(x

w hen

l)(x 2

is

1)

(z r

1)

is

a factor of (x n

l)(x n+1

l)

a positive integer.

3-12. Some Theorems on Primes.


We have already found some polynomials like 4as 1 that represent an infinite number of primes for
integral values of x, but we have noticed that not all the values of these
polynomials obtained when integers are substituted for the variable are

when x = 4. The polynomial


produces primes f or x = 0, 1, 2,
39, and 40. Mathematicians have not yet produced an
3,
integral polynomial of the second degree in one variable that can be
shown to represent an infinite number of primes, nor have they proved
On the other hand, certain
that such a polynomial does not exist.
quadratic forms represent an infinitude of primes.
If f(x) is a function of x whose value is a prime whenever x is a positive
integer, then f(x) is a prime-representing function.
Mathematicians have recently developed prime-representing functions*
that require the symbol [as], denoting the largest integer less than or equal
to x, but it is interesting to observe that no algebraic expression that
represents an infinite number of distinct primes, and only primes, has
been discovered. Euler (1707-1783) showed that Fermat (1601 - 1665)
2n
was in error in thinking that all integers of the form 2 + 1 are primes
1 = 4,294,967,297 has the factor 641.
It has
by showing that 2 32
been proved, however, that no rational function of x except a constant
can be a prime-representing function, f We shall prove the corresponding
well-known theorem about a polynomial.
Theorem 3-19. An integral polynomial of at least the first degree
cannot represent primes alone.
Suppose that, for x = x' where x' > 0, f(x) = a x n +
+ an
Substituting x = x'
mp in /(as), we obtain
represents the prime p.
For instance, 4x

primes.

x2

41

is

gives 15

extraordinary, for

it

',

f(x'

where the

mp) = a Q (x

mp) n

a x {x

mp) n ~

coefficients in the expansions are integers

and

in

+ a

each expansion

* W. H. Mills, Bull. Am. Math. Soc, Vol. 53, No. 6, p. 604, 1947.
Am. Math. Monthly, Vol. 58, No. 9, pp. 616-618, 1951.
t R. C. Buck, Am. Math. Monthly, Vol. 53, No. 5, p. 265, 1946.

E.

M. Wright,

PROPERTIES OF INTEGERS
every term except the

mp) = a

f(x'

first is

a multiple of

x' n

aix'

n-

Therefore,

p.

'

'

47

+ Kp

an

or

+ Kp
and f(x' + mp) is not a prime unless f(x' + ^p)
Hence, p f{x'
n 1, f(x''+ mp) =
Suppose that, for m = 0, 1, 2,
is p or p.
yield
the
equation f(x) = p of
of
m
can
or
other
value
no
Then
p,
p.
+ mp)
+ mp),

f{x'

= p

degree n would have more than n roots.


can yield p. Consequently, there

mp >

and /(V

mp)

In like manner, but n values of


is

a value of

for

which

x'

^ p.

Moreover, if the integral polynomial f(xi,x 2


, n ) represented
x n = a n the integral polynomial
primes alone, then for x 2 = a 2
,a n ) having but one variable would represent primes for all
f(x h a 2
The given polynomial is thus not a prime-reprepositive values of xi.
,

senting function.

In the proof given above

it

has been necessary to refer to the theorem

number of roots of a rational integral algebraic equation which


depends upon analysis for its validity. A property of the whole set of
complex numbers is accordingly made use of in order to show a characterSuch cases, in which we use a domain that
istic of the rational integers.
of
itself
the
one with which we are particularly conpart
includes as
rare
in
mathematics.
Can you name some of them?
cerned, are not
on the

EXERCISE
~
Prove that for integral values of x an integral polynomial a x n + a\X n
+
has an infinite number of distinct prime factors.
(Assuming the
l

+ a n of degree n >

number

is finite,

substitute multiples of a n \[ pi for x.)


i

*Theorem 3-20 (Legendre).


n is

=i

The number

of positive

primes not exceed-

ing the positive integer

7r(n)

= n

+r

Lf

lPi\

Z/ IViVA
M=
l

(-!)'

P1P2

'

Pr\

2
where p h p 2
p r are all the positive primes such that pi < n
where i = 1,2,
r.
Determine I so that / is the largest integer whose square is less than or
equal to n. Then find all positive primes p h p 2
p r that are less
,

ELEMENTARY THEORY OF NUMBERS

48
than or equal to

n are

divisible

I.

Since exactly

by p h none

integers from

1,2,...,

of the integers

of these multiples of

In like manner,

prime.

Mi =

p h except p\

itself, is

through n are divisible by

LPzj

p2

Of these multiples

and

pi,

p 2 however,

of

= [il

IPii

number of integers from


two primes, pi and p 2
Assuming then that
the

the

first

Mi

pi

and hence

M
is

by both

are divisible

fe]

- \jl]

LP*}

LP1P2J

through n that are divisible by either of

1
.

LVkj

+ [-=-1+

LpiPz]

LP1P2]

iPk-iPk]

+(-rLP1P2

LP1P2P3]

pk \

the number of integers from 1 through n that are divisible by at least


one of the first k primes pi, p 2
Pk, we shall find the number of
integers from 1 through n that are divisible by the next prime p k +i and
that are prime to all the first k primes.
The number of integers from 1 through n that are divisible by p k +\ is
is

n
Pk+ij

Of these integers
Pk+i

Pi

examine the

the coefficients of m+i, which are 1,2,


or not the integers are divisible

operate on

pi, for

if

we

set of multiples of Pk+i,

p k+h 2p*+i,

how many

by

are also divisible


J

by

p\.

\-^-\

by p h p 2

we operated on n above.

or

p r we must
,

Hence,

[-1
lPk+i

Pk+i.

Pk

determine whether

IPk+i]
Likewise, if we wish to determine

of these integers are divisible

just as

Pk+i

P1P2
"

-1

Pk+
L

Pk-iPk

(-D

.Pk+i.

[pip 2

"

Pk:

49

PROPERTIES OF INTEGERS

number of integers from 1 through n that


by at least one of the primes p h p 2

the

is

also

r
*

LP1P2

Pt

and subtracting M'k from

jlI

_ r_5_i

_p k +ii

LPiPk+i]

Pk-

fjLl
PlP2

by p k+ i and
Using the fact that

are divisible

pp*+iJ

we have

+
f_=_i
IPkPk+ij

\^\ +
LPiPzPk+i}

(8)

p*p*+i.

number of integers from 1 through n that are divisible by p k+ but


Adding this number (8) to
not by any of the primes p p 2
Pan
that
are divisible by at least
1
through
from
the number (7) of integers
find
that
one of pi, P2,
Pk, we
as the

1}

=-+...+

fc+1

zlI
p*J

-fe]

+ r jl] _ [jl]
LP1P2J

Lpfc+iJ

JL -]+

+(-i)4

PkPk+ij

LP1P2

PkPk+ij

number

of integers from 1 through n that are divisible by at least one


This formula (7) with k = r, thereprimes p h p 2}
Pk, Pk+i.
But by Theorem 3-2 any positive integer
fore, holds for the first r primes.
less than or equal to n and greater than p r is a prime unless it is divisible by
one of these first r primes. Hence, n
r is the number of integers
and p r
Consequently,
from 1 through n that are prime to pi, p 2
this number counts the integer 1 and all primes greater than p r but it
does not include the primes pi, P2,
p r themselves. Therefore
is

the

of the

w(n)

= n

+r

number of positive primes that are less than or equal to n.


Sometimes the symbol <fr(n,r) is used to indicate the number of positive
integers not exceeding n and prime to the first r primes.
Then 4>{n,r) =
and
the
number
n
of
positive
primes
exceeding
not
n can be
r
is

the

written
ir(n)

<f>(n } r)

+r

r is the number of positive primes not exceeding y/n.


This formula obviously becomes impracticable when n is large. In
1870 Meissel developed another formula the use of which is less cumber-

where

ELEMENTARY THEORY OF NUMBERS

50

some, but even though his method has been improved upon,* no expeditious method for finding the exact number of positive primes less than
a large n has been discovered.
On the other hand, due to the work of Legendre and Gauss (1777-1855)
in applying analysis to the theory of numbers, we have formulas which
approximate the number of primes not exceeding x. Legendre stated the
empirical formula

F(x)

logx

1.08366

which agrees very well with t(x) so long as x is not greater than
Gauss discovered "the integral logarithm of x,"

but

we have no

their

observation.

[*

dt

J 2 log

reason to believe that he developed a proof of

work on that

in developing

0) =

of

1,000,000.

it.

Basing

Riemann (1826-1866), mathematicians succeeded

an asymptotic formula that


1900 they had proved what

By

a refinement of Gauss'

is
is

called

"the prime number

theorem,"
lim
x

-*&- =

^ z/log

as 1948 Paul Erdos and Atle Selberg developed new and more
elementary methods for showing this limit.
As a matter of fact although many theorems about primes have been
demonstrated, we can still state a large number of theories that mathematicians believe to be true but which remain unproved. We have seen
that Euclid established an interval within which there must be a prime.
Again it has been proved that if p 1} p 2
Pn-i are the first n 1
primes, when n > 4, the next prime p n is such that

As recently

Vn

<

PlP2

'

'

Pn-l

Furthermore, Tchebysheff (1821-1894) developed a better result by


proving that for a real number n > \ there is always at least one prime
between n and 2n 2. But the problem of naming the next prime after
any given prime remains unsolved. Likewise, we have no formula for
finding even one prime greater than a given one.
It has been previously pointed out that Dirichlet (1805-1859) proved
that there is an infinite number of primes among the terms of any arithmetic progression in which the first term and the difference are relatively
prime.
Kronecker (1823-1891) later showed an interval within which
the next prime after a given one of such a progression must lie.
* A. Brauer,

Am. Math. Monthly,

Vol. 53, No. 5, pp. 521-523, 1946.

PROPERTIES OF INTEGERS

51

Kronecker remarked, but there is no proof, that every positive even


integer can be represented as the difference of two positive primes in
If this theorem is true, it means that there are
infinitely many ways.
infinitely many pairs of primes that differ by 2, and hence no matter how
far out we go in the sequence of consecutive positive integers there will
always be primes that are as close to each other as it is possible for them
to be.
Of course the frequency of the appearance of such primes decreases
We can show, moreover, that if we take
as the primes increase in size.
integers,
we can find as many consecutive
large
positive
sufficiently
which
are
composites, for none of the integers
all
of
integers as we please
n\

>

2,

n\

3,

n\

Hence, as we move out in the sequence of positive integers, there must be consecutive primes whose difference is larger
than any assigned integer.
Euler mentioned that Goldbach (1742) had stated the empirical
theorem that every even integer greater than 2 can be represented as the
sum of two positive primes. Although the truth of this conjecture has
been verified in many cases, it has never been proved. Goldbach also
said that every odd integer greater than or equal to 9 is the sum of three
odd primes. In 1937 Vinogradov proved by analytical means that this
theorem is true for sufficiently large odd integers.
If we examine a table of primes, we notice that there is at least one
2
prime between any two consecutive squares n 2 and (n
l)
but whether
or not this statement is always true, we do not know.
Again, we do not
know whether or not there is an infinite number of primes of the form
is

a prime

when n

1.

(2n) 2

1.

ELEMENTARY THEORY OF NUMBERS

52

Table of Primes

2003
2011
2017
2027
2029
2039
2053

2371
2377
2381
2383
2389
2393
2399
2411
2417
2423

2749
2753
2767
2777
2789
2791
2797
2801
2803
2819

1663
1667
1669
1693
1697
1699
1709
1721
1723
1733

2063
2069
2081
2083
2087
2089
2099
2111
2113
2129

2437
2441
2447
2459
2467
2473
2477
2503
2521
2531

2833
2837
2843
2851
2857
2861
2879
2887
2897
2903

1381
1399
1409
1423
1427
1429
1433
1439
1447
1451

1741
1747
1753
1759
1777
1783
1787
1789
1801
1811

2131
2137
2141
2143
2153
2161
2179
2203
2207
2213

2539
2543
2549
2551
2557
2579
2591
2593
2609
2617

2909
2917
2927
2939
2953
2957
2963
2969
2971
2999

1087
1091
1093
1097
1103
1109
1117
1123
1129
1151

1453
1459
1471
1481
1483
1487
1489
1493
1499
1511

1823
1831
1847
1861
1867
1871
1873
1877
1879
1889

2221
2237
2239
2243
2251
2267
2269
2273
2281
2287

2621
2633
2647
2657
2659
2663
2671
2677
2683
2687

3001
3011
3019
3023
3037
3041
3049
3061
3067
3079

1153
1163
1171
1181
1187
1193
1201
1213
1217
1223

1523
1531
1543
1549
1553
1559
1567
1571
1579
1583

1901
1907
1913
1931
1933
1949
1951
1973
1979
1987

2293
2297
2309
2311
2333
2339
2341
2347
2351
2357

2689
2693
2699
2707
2711
2713
2719
2729
2731
2741

3083
3089
3109
3119
3121
3137
3163
3167
3169
3181

233
239
241
251
257
263
269
271
277
281

547
557
563
569
571
577
587
593
599
601

877
881
883
887
907
911
919
929
937
941

1229
1231
1237
1249
1259
1277
1279
1283
1289
1291

1597
1601
1607
1609
1613
1619
1621
1627
1637
1657

71

283
293
307
311
313
317
331
337
347
349

607
613
617
619
631
641
643
647
653
659

947
953
967
971
977
983
991
997
1009
1013

1297
1301
1303
1307
1319
1321
1327
1361
1367
1373

73
79
83
89
97
101
103
107
109
113

353
359
367
373
379
383
389
397
401
409

661
673
677
683
691
701
709
719
727
733

1019
1021
1031
1033
1039
1049
1051
1061
1063
1069

127
131
137
139
149
151
157
163
167
173

419
421
431
433
439
443
449
457

739
743
751
757
761
769
773
787
797
809

179
181
191
193
197
199
211
223
227
229

467
479
487
491
499
503
509

811
821
823
827
829
839
853
857
859
863

2
3
5
7
11

13
17

19
23
29
31

37
41
43
47
53

59
61

67

461
463

521
523
541

1993
1997
1999

CHAPTER

PROPERTIES OF CONGRUENCES

4-1.

We

Congruent Integers.

have shown that when n and

9^

are given, the integer n can be expressed uniquely in the form

= qm

<

Now we separate all integers n into

<

\m\ classes

\m\

according to the remainders

upon being divided by m. We say that two integers


r
congruent
modulo
m if and only if the integers produce the same least
are
nonnegative remainder upon being divided by m ^ 0.
Gauss (1777-1855) introduced this idea of congruence, and it was he
who suggested the notation a = 6(mod m), which is read, "a is congruent
The value
to b modulo m," or "a is congruent to b for the modulus ra."
is
that
emphasis
is
placed
upon the imporof this concept and its symbol
that they yield

tant integers in the equations

+r
q m + r

giw

and

<

when

Since the definition requires that


in the

above equations be

difference a

a
r2

S3 b (mod

<

\m\,

m), for

r2

r\

Theorem

4-1.

their difference

by m.

b is divisible

then a

Therefore,

identical,

is

b
.

if

= qim

m(qi

q 2)

r\

it

<

\m\
b (mod

Conversely,

and

+n

m) the remainders

follows immediately that the

b
r2

q2

and

if

m+

ri

r2

km, then
where
< n,
b

r 2 is divisible

by m.

Thus we have:

Two

integers are congruent

divisible

by

m^

modulo

if

and only

if

0.

If a and b have distinct remainders r x and r 2 where


< r h r 2 < \m\,
upon being divided by m, then a and b are said to be incongruent modulo m.
The difference between two incongruent integers modulo m is, therefore,
not divisible by m. In this case we write: a ^ b(mod m).
When two integers are congruent to each other modulo m, each is said
,

to be a residue of the other for that modulus.

Thus, because 12

2(mod 10), 2 is a residue of 12, and 12 is a residue of 2 modulo 10.


The totality of integers congruent to a given integer for the modulus
constitutes a residue class modulo

m.
53

=
m

ELEMENTARY THEORY OF NUMBERS

54

These definitions imply that each integer belongs to exactly one residue
modulus and that each residue class modulo m contains
one and only one of the integers 0, 1, 2,
\m\ 1.
Hence, there
class for a given

modulo m.

are exactly \m\ residue classes

Any set of \m\ integers selected so that no two of them belong to the
same residue class modulo m forms a complete residue system modulo m.
Thus for the modulus m the set of integers 0, 1, 2,
\m\ 1 or the
.

chosen to represent the classes of which the


individual integers are members.
The class represented by contains all
and only multiples of m, and the class represented by r consists of all the
set

1, 2, 3,

integers of the

\m\ is often

km

form

Any

r.

km

Since, as

\m\

km

a complete residue system

1 is, therefore,

one and

set of \m\ integers containing

only one integer represented by each of the forms km,

we have already shown, an

integer

according as the remainder obtained upon

or

is

is

1,

km

not prime to

by

2,

modulo m.

not
prime to m, the set of remainders from 1 through \m\ 1 which are prime
These
to m represents all and only the integers that are prime to m.
integers, prime to m, are thus separated into residue classes modulo m
that are in one-to-one correspondence with the positive integers from 1

through

Any
of

\m\

the modulus

division

is

or

is

that are prime to m.

set of integers

them belongs

its

prime to

and selected so that one and only one

to each of the residue classes of integers prime to

for

For the

constitutes a reduced residue system modulo m.

modulus 5 the set 1, 2, 3, 4 is a reduced residue system, but for the


modulus 6 the integers 1 and 5, as well as the set 1 and 1, form such a
system.
It is evident also that the residue classes for the

modulus

are iden-

with the residue classes modulo m, for when the sign of


changed, we need change only the sign of q in the equation

tical

= qm

Thus any congruence that holds


the other one.

<

for either

<

is

\m\

m or m as modulus holds for

It is convenient, therefore, to use only positive integers

and we

shall hereafter adhere to this convention without


statement of the fact in the discussion.
4-2. Basic Properties of Congruences.
The relation of congruence
has some properties similar to those of equality:
1. For any modulus m, a = a(mod m).
2. If a = b (mod m), then b = a (mod m).
3. If a = 6(mod m) and b = c(mod m), then a = c(mod m).
4. If a = 6(mod m) and c = d(mod m), then a c = b d(mod m).

as moduli,

making a

From
d

specific

the equations a

km,

tm,

we have

+ Lm.
5.

If

b (mod

m) and

= d(mod

m), then ac

bd(mod m).

PROPERTIES OF CONGRUENCES
6.

If

7.

If

55

= b (mod m), then a n = 6 n (mod m), where n is a positive integer.


a = b (mod m) and /(rr) = a x n + aix n_1 +
+ an is an
then
integral
coefficients,
with
function
of
x
rational
f(a) =

integral

/(6)(mod m).

show that the congruence relation is reflexive,


symmetric, and transitive. It is also clear that when a + b = c(mod m)
and b = d(mod m), then a + d = c(mod m). In a congruence the laws
thus permit the substitution of a number or expression in the place of a

The

first

three statements

The application of the fifth


statement allows us to conclude that when ac + b = 0(mod m) and
Accordingly, we infer that for
c S3 e (mod m), then ae + b = 0(mod m).
a given modulus a congruent number or expression may be substituted
term congruent to

for a factor of a

"

When

it

for the given modulus.

term

of a congruence.

the relation, substitutions of the above types are


covered by the familiar postulate, " Equals may be subIt is, however, not true that
stituted for equals in any operation."
integers which are congruent for a modulus m may always be substituted

two

just

equality"

is

of those

one for the other in a congruence modulo m. If a s = b (mod m) and s =


= b (mod m), for a s need not be
2 (mod m), it need not happen that a
congruent to a* modulo m. Notice that 5 2 = 4 (mod 7) and that 2 =
9(mod 7) but 5 9 = 6(mod 7), so that 5 2 ^ 5 9 (mod 7).
The congruence relation also has the following properties that pertain
1

to division:

m and a = b (mod m), then a = 6 (mod d).


and a = b (mod m 2 ), then a = b (mod L), where L
is the least common multiple of m x and m 2
is such that (c, m) = 1, then a =
3. If ac = be (mod m) and c ^
b (mod m).
4. If ac = be (mod m) and (c, m) = d, then a = 6 (mod m ), where
1.

If

is

a divisor of

2.

If

b (mod mi)

m =m

d.

We

can find the remainder when 2 30 is divided by 17


by simple operations on congruences. Since 2 4 = 16 (mod 17) and 16 =
l(mod 17), we have 2 4 = l(mod 17). Raising each member of the
congruence to the seventh power, we obtain 2 28 = l(mod 17). But

Examples.

1.

and therefore 2 30 = -4(mod 17), or 2 30 = 13(mod 17).


2. We know that 10 = l(mod3).
Accordingly, a (10) n + a^lO)"- +
+ a n = a Q + ai +
+ a n (mod 3). Thus a number written in
the scale of 10 is divisible by 3 if and only if the sum of its digits is divisible
by 3.
22

4(mod

17),

EXERCISES
1.

21 10

is

2.

Find the remainder when 7 10


divided

by

is

divided by 51;

is

divided

when

3 10

is

divided

by

51;

51.

Find the remainder when 5 21

by

127.

Do

the

same

for 5 66

when

ELEMENTARY THEORY OF NUMBERS

56
3.

Prove that 2 U

4.

If a

has the factor 23 and that 2 23 1 has the factor 47.


prove that the greatest common divisor of a and m is the
State this result in terms of the integers of a
greatest common divisor of b and m.
residue class modulo m.
5. If a + b = c(mod m) and b = d(mod m), show that a + d = c(mod m).
6. If ab = c(mod m) and b = d(mod m), show that ad = c(mod ra).
4
= l(mod 5) and 4 = 9 (mod 5), is 2 9 = l(mod 5)? Explain.
7. Since 2
8. Prove that an integer is divisible by 9 if and only if the sum of its digits is divisible

by
9.

= b (mod

ra),

9.

Prove that an integer

last three digits

is

divisible

is

by

divisible

by 8

if

and only

if

the

number formed by

its

8.

10. Prove that an integer is divisible by 1 1 if and only if the sum of the digits in the
odd-numbered places diminished by the sum of the digits in the even-numbered places
is divisible by 11.
11. If an integer N is written in the scale of r and then its digits are rearranged in
is divisible by r 1.
any way to form the integer M, the difference N

4-3. The Residue Classes.


The properties of congruences stated
above show that as far as the operations of addition, subtraction, and
multiplication are concerned the elements in any two residue classes for
the modulus ra combine to give results that are always in the residue class
designated by carrying out the very operations on any convenient repreThus if an element a of class A is added to an
sentatives of the classes.
element b of class B and the result a + b is in the class C, then if any
element of A is added to any element of B, the result will be in class C.
Because subtraction is always possible, it follows, moreover, that when
a + b is an element of class C, any element a + b + km of C can be
expressed as the sum of an element of A and one of B.
It is important to notice, however, that although the result of multiplying any element of class A by an element of class B is always in the
same class D, say, yet each element of D need not be a product of an
element from A and an element from B. Take, for instance, the residue
When any element of the class represented by 2 is
classes modulo 10.
multiplied by an element of the class of 3, the result is an element in the
Yet the particular element 16, which is conclass represented by 6.
gruent to 6 modulo 10, cannot be written as the product of two factors,
one from the class of 2 and the other from the class of 3, for if

16

an odd number would divide

(2

10fc)(3

6); that

is,

100

16.

4 (mod 6) as well as 2 2 =
the same least positive residue 2 ^ 0(mod 6) can be

It is interesting to notice also that 2

4(mod

multiplied by either one of the distinct least positive residues 2 and 5 to

produce a number of the


positive residues of

class of 4

any prime, we

modulo

6.

If

we examine

the least

find that no such thing happens

when

PROPERTIES OF CONGRUENCES

we do not choose the first factor from


To prove this statement, let p be

6(mod
(a, p) = 1, C\ = c 2 (mod p).
residue class modulo p.
6(mod

p)

and ac 2

When we

Hence,

select the integers a

integer x such that ax

the class of zero for the given prime.


a prime, and suppose that aci

b (mod

and
m),

C\

and

c2

and ask whether or not there

it is

ac 2 (mod p),

and since
must come from the same

Therefore, aci

p).

57

evident that

we

We have,

a problem in division, the inverse of multiplication.


b by a for the modulus m,

shown that when we divide

is

an

are dealing with


therefore,

have
do not belong to the same residue class for that modulus.
It may happen, of course, that all answers are in but one residue class as
But it is also posis true in the case of the congruence 5x = 1 (mod 6)
sible that there be no answer whatever, for a solution of 2x = l(mod 6)
would demand that 2x = 1 + 6/c and that 2 divide 1. Consequently, we
must proceed with care, for division modulo m is not always possible and,
when it is, need not yield a unique result.
One of the important ideas of arithmetic is that if ab = and a ^ 0,
then b must be 0. Suppose that
it is

possible to

results that

ab

0(mod m)

Is it necessary that either a or b be in the class of

When the modulus is

we

for the

modulus m?

0(mod 6) and
modulo 6. But when the modulus
that neither 2 nor 3 is congruent to
is a prime p and ab = 0(mod p), both a and b cannot come from the set
of integers 1, 2, 3,
p 1, for the product of any two of these
integers is prime to p.
Consequently, we see that in this case a product
.

is

not congruent to

6,

notice immediately that 2

unless at least one factor

is

in the class of

for the

When the modulus m is composite, however, by factorthat m = n n^ where 1 < n\ < m, it follows that ttin =

given modulus.
ing

m^Oso

0(mod m).

We call any integers ni and n 2 neither one of which is in the class of


modulo m, but whose product is congruent to
for the modulus m,
divisors of zero modulo m.
The existence of divisors of zero for a composite modulus again reminds us of the need of caution in applying the
,

idea of division to the notion of congruence.

EXERCISES
that although 2(6) = 26 (mod 14), 26 cannot be factored into integers such
in the class of 2 and the other in the class of 6 modulo 14.
2. Find numbers in the class of 10 modulo 11 that can, and some that cannot, be
expressed as a product of two integers, one from the class of 2 and the other from the
1.

Show

that one

class of 5

is

modulo

11.

ELEMENTARY THEORY OF NUMBERS

58

How many

3.

solutions do each of the following congruences have?

m
=
a
=

2x
2x
2x
Sx
4.

Find some divisors of zero modulo

6.

Compare the

the powers of

6 (mod 10)
3 (mod 4)
3 (mod 5)

6(mod

15)

12.

residue classes of the powers of

3, 5,

and 6 modulo

Can you

15.

2, 4,

find a

and 7 modulo 15 with those of


law that governs them?

Function.
Leonhard Euler (1707-1783) worked in
pure and applied mathematics. His voluminous publications were concerned with algebra, the calculus of finite differences, the
differential and integral calculus, the calculus of variations, astronomy,
and analytical mechanics besides the theory of numbers. In the latter
field he discovered the theorems which taken together make up the
4-4. Euler's

many

fields of

supplied the proof and generalization of

quadratic reciprocity law,

Fermat's theorem, showed that every prime of the form 4n + 1 is


expressible as a sum of two squares in exactly one way, as well as making
many less startling but nevertheless important discoveries, one of which
is

the

function.

an integer m ^
is the number of positive
and prime to m. Thus 0(m) is the
number of integers in a reduced residue system modulo m, and 4>(m) =
Because of this last fact, it will be sufficient to use only positive
0( ra).

The

indicator <f>(m) of

integers less than or equal to \m\

m in

integers

considering the

Examples.

0(1)

It is evident that

Theorem
4>(p

n
)

To

4-2.

= p n~Kv -

when p
p

If

function.

0(5)

1,

is

is

4,

0(6)

2.

a positive prime,

4>(p) is

a positive prime and n

1.

a positive integer,

is

i).

find 4>{p n ), consider the set of integers


1, 2,

Each of these integers is


of them are divisible by

p,

2p,

either divisible

by p

p
or

r
,

is

prime to

But p n ~

p.

n~ 1

n~ l

= p (p 1) of the
Therefore, p p
p.
through p n are prime to p.
r, is arithmetic
Any function of the variables Xi, where i = 1, 2,
if it assumes only integral values for the sets of integral values of the
The function <f>(x) is
variables Xi for which the function is defined.
integers

from

arithmetic, as are the integral polynomials.

single-valued arithmetic function f(x)

plicative

We

shall

if,

for

any a and

show that the

is

said to be regular or multi-

which are relatively prime, f(ab)

function

is

multiplicative.

f(a)f(b).

PROPERTIES OF CONGRUENCES

Theorem

4-3.

If

59

a and 6 are relatively prime, 0(a6)

0(a) 0(6).

We suppose that the integers a and b are positive and arrange the
integers from 1 through m = ab in the following array suggested by the
residue classes

modulo

a:

2a

+
+

L)o+

(6

2a

+
+

a
2a
3a

fc

ba

2a

+
+

+k

a
2a

3
3

(6-

l)a

Because an integer is prime to m if and only if it is prime to both a and b,


we shall determine first the number of integers in the above array that
are prime to a and then find how many of these are also prime to b.
We know that there are 0(a) integers prime to a in the first row.
Moreover, each integer in the column headed by an integer k, from 1
through a, is of the form sa + k. Furthermore,

sa

k(mod

a)

if the integer k at the top of a column has a divisor in common


every integer in that column has that divisor in common with a,

Therefore,

with

and

a,
if

prime to

is

a,

every integer in that column

prime to

is

are then 0(a) columns of integers that are prime to

a.

There

How many

a.

of

these integers are prime to 6?

Consider the set of b integers in any column,


k

No two

2a

of these integers are

...

(b

congruent modulo

sa
(t

s)a

=
=

ta

\)a
b,

for

/c(mod

0(mod

b)

= 0(mod

b)

if

b)

and
t

since
2,

= 1. But
1 modulo

b)

(a,
.

integers of

and

any column

to the integers

1, 2,

6,

range through the residue system

so that unless

s,

s(mod

b).

0,

The

1,

some order congruent modulo b


But then exactly 0(6) of them are prime

are, therefore, in

b.

too.
Since 0(6) integers in each of the 0(a) columns of integers prime to a
6, the number of integers from 1 through ab that are

are also prime to

prime to both a and

Theorem
.

(P.

If

6 is 0(a) 0(6).

m=

ni

p1 p2

are positive primes,

r,

1)

4-4.

'

'

(Pr

1).

U2

0(m)

Pr

Tlr
,

pi'

where the p { for i


~
~
n2 "" 1
Vr
(Vi
p2
,

il

lr

1, 2,

""!)

ELEMENTARY THEORY OF NUMBERS

60
Since

m has

been factored into powers of distinct primes,

0(m)

By

we

repeating this process,


4>(m)

from which we
Corollary.

0(pi ni )0(P2 n2

'

Vr

nr
)

find

<t>(p^)<t>(p2

n2

HPr nr )

infer the desired result.

m>

If

2, <t>(m) is

even.

Example. The number of positive integers


to 360 is 0(360) = 2 2 3 (2 - 1)(3 - 1)(5

less
1)

than 360 and prime

96.

EXERCISES

1. Show that the formulas for the number of divisors of an integer


and the sum of
the divisors are multiplicative functions.
2. Show that, for n > 1, the sum of the positive integers less than n and prime to n
is (n/2)<f>(n).

Show that the sum

3.

of the squares of the positive integers less than

n and prime

to

is

-(i-)+Sa->a-*> *-

0-3

f(i-a

where pi, Pi,


and p T are the distinct positive prime factors of n.
4. Prove that if n = p\Pip%, where the pi, with i = 1, 2, 3, are distinct primes, then
the product of all the positive integers less than n and prime to n is
.

(n

1)!

^~

[]

1)1

cp*p<

- 1)!

"

pi<r -l)(Pfc-l)

[1
i

=i

i<j

Use the method so developed to find the product


ar
prime ton = pi ai p2 a2
Pr

Set

6.

method
If

6.

up a method

for finding

to find the solutions of

G(n)

>

4>(d),

of all positive integers less

than n and

by

<j>(x)

trial all integers

x such that

<f>(x)

Use your

n.

=16.

show that G(n)

is

multiplicative.

d\n

Note that the symbol

>

^>(d) is

sum over

read "the

the divisors of n of

</>(d),"

and

d|n

we understand that we use only

Theorem 4-5.
2,

through

'

(1

r,

Urn =

the positive divisors of n.


ni

m that are prime to p h p


-

U2

pi p 2
p^ *
are distinct positive primes, the

(1/Pi)).

2,

pr

nr

where the p

number

p*ism(l

of integers

(l/pi))(l

if

from

1,

(I/P2))

PROPERTIES OF CONGRUENCES

61

sometimes important to find the number of positive integers not


m and prime to some but not all of the
prime factors of m. For instance, we may wish to know the number of
positive integers less than 360 and prime to 2 and 5.
It is

greater than the positive integer

When
from

m=

ni

pr

nr

m that

are prime to p h p 2

m
Some

of integers

that are divisible by pi is m/pi, leaving then


(1/pi)) integers that are prime to pi.

(m/pi) = ra(l
Proceeding by induction, suppose that the

through

number

evident that the

it is

through

n*

pi p 2

number

and p k

from

of integers

is

0-5)0-)-"(-s)
We

however, are divisible by pk+i.

of these integers,

wish, there-

number the number of integers from 1


by pk+i and at the same time are prime to

fore, to subtract from the above

through
Pi, P2,

from

set

that are divisible


.

To

Pk-

find this

m that

through

number,

how many

is

or

is

or

is

are

-TYl p k +i

Vk+l

not prime to

not prime to
integers of the set

as its coefficient c

They

are multiples of p k+i.

p k+h 2p k+h 3p k+ i,
Since any integer cp k+1

consider the integers of the

first

is

pi,

p2

p,

p2
.

and p k according
and p k we must ask
.

m
1, 2, 3,
'

are prime to pi,

p2

and p k

we consequently know

(1),

Pk+i

'

Referring to our inductive assumption

that

m
Vk+

pj\

vj

(2)

Pk)

of integers from 1 through m/p k+ i that are prime to p h p 2


and p k and is, therefore, the number of integers from 1 through m
divisible by p k+ i and also prime to p h p 2
Subtracting this
pk
last number (2) from the number (1) of integers prime to p h p 2
pk
we have
is

number

the

m
\

Pi)\~pJ

"

p k)

m
Pk+ii

Pi) \

\
\

Pi) \

pi)
pi)

Ph)

V ~

Pk) \

"

Pk~^)

ELEMENTARY THEORY OF NUMBERS

62
as the

number

p and
k

2,

prime factors of m.

or all of the distinct

Example.

m that are prime to p h p

through

Thus by induction we may write this formula so that


the number of integers from 1 through m that are prime to

includes

it

some

from

of integers

also p*+i.

m =

If

23

32

that are prime to 2 and 5

Theorem
n from

m is

n and

number

the

23

is

32

of integers

5 3 (1

m =

If the positive integer

4-6.

through

divisor of

53

)(1

-J)

of integers

the greatest

is

through

3600.

number

kd, the

having the property that d

from

common

<f>(k).

Consider the integers 1, 2,


There are
.
.
.
.
, d,
, 2d,
, kd.
k multiples of d in this set, but the integers id and m = kd have the greatest common divisor d if and only if t and k are relatively prime.
Since t
.

has the values

through

Theorem

m^

0,

2,

1,

4-7.

then

d h d 2j

If

0(d)

0(di)

there are exactly

k,

m the

that have with

common

greatest

integers

0(/c)

divisor

from

d.

d r are the distinct positive divisors of

0(d 2 )

4>(d r )

\m\.

d\m

Each

one and only one


divisor.
Consequently, if we pick from this set the integers n such that (n, m) = d
where \m\ = didj, there will be exactly <f>(dj) of them. As di ranges
through all the positive divisors of m, so does dj, and each integer from 1
through \m\ will thereby have been put into one and only one class
defined by the greatest common divisor it has with m.
Recalling that the
of the

integer

di,

where

in the set 1, 2,

1, 2,

has with

\m\

as greatest

r,

common

{,

symbol
of the

>

<j>(d) is

and

2.

sum

numbers indicating the

Examples. 1.
such that (n, 90)
78,

read, "the

If

m =
6

is

sizes of these classes is

90, the

0(15)

m of <(d)," the sum

over the divisors of

number
The

of integers

>

tf>(d)

n from

through 90

integers are 6, 12, 24, 42, 48, 66,

8.

84.

The

positive divisors of 70 are

1, 2, 5, 7, 10, 14,

m>

1,

and

35,

and

70.

More-

1; 0(5)
4; 0(7)
6; 0(10) = 4; 0(14) = 6;
1; 0(2)
=
=
integers is 70.
and
the
sum
of
these
24;
0(35)
24; 0(70)
4-5. Residue Systems Modulo m.
Take any integer a prime to

over, 0(1)

let
r h r 2)

rm

Form

be a complete residue system modulo m.


ar h ar 2

No two

of these

integers are congruent


ari

arj (mod

the products

ar m

modulo m,
m)

for

if i

^j

and

PKOPERTIES OF CONGRUENCES

63

then

Ti

which

Moreover,

modulo

ra.

if

n, r 2

r^m)

1,

system modulo m, for this


which are incongruent modulo

ra,

a reduced residue system modulo ra and


ar h ar 2

is

Consequently, these integers

contrary to our assumption.

is

represent the ra residue classes

is

r,-(mod ra)

(a, ra)

the set

ar^m)

also a reduced residue

set contains exactly

and each integer


prime to ra.
Example. The set 0, 5, 5 2, 5 3,
,5-11, or 0, 5, 10, 15, ...
55, is a complete residue system modulo 12, while 5, 25, 35, 55 is a reduced
residue system modulo 12.
Again if r 1} r 2
r w is a complete residue system modulo ra,
</>(ra)

integers, all of

is itself

a
for

any a

in the set,

is

and

rh

r2,

rm

another complete residue system, for there are m integers


two of them were congruent modulo m, when i ^ j,

if

+n=

ry(mod m)

then
Ti

Sometimes

ry(mod m)

convenient to use the integers of smallest numerical


value to represent the residue classes modulo m. If we write any integer
it is

a in the form

= km

<

< m

system we keep the values of r which do not exceed ra/2, that is,
through ra/2 or (ra l)/2 depending upon whether
ra is even or odd.
But those values of r which exceed ra/2 are replaced
by the negative integers of least numerical value to which they are congruent for the modulus ra. Since
for this

the integers from

ra

this

= r(mod

complete residue system modulo

19
and when

odd,

ra is

ra

when

ra is even, is

ra

it is

ra
U, 1, A,

ra,

ra)

-1

>

m -1

ra
,

3
j

2,

ELEMENTARY THEORY OF NUMBERS

64

For the modulus 14 the set 6, 5, 4,


1,0,
a complete residue system, but for the modulus 15 the
system using least numerical values is 7,-6,
1,0, 1,2,
Examples.

1, 2,

is

7.

In Theorem 4-3 we showed that the integers


k,

d,

2d,

(&

l)d

of the arithmetic progression in which (b, d) = 1 form a complete residue


system modulo b.
Furthermore, we can generate a complete residue system modulo ab
by using the form ax + y, where x takes all the values in a complete
residue system
r 2}

ri,

for the

modulus

b,

and y takes

modulo

(3)

ka

(4)

form thereby gives ab


modulo ab, for if

It is evident that the

a.

values in a complete residue system

all

kh k2

These

integers.

integers are, moreover, incongruent

ar s

rs )

fa

kj

ari

kj

A'*(mod ab)

then

Ufa

and a

But

(fa

since

kj(mod ab)

so that

kj),

no two

(mod

a)

of the integers of (4) are congruent

modulo

a,

kj.

Hence,

a(ri

rs )

0(mod

ab)

rs

0(mod

b)

and
Ti

so

that,

as

above,

n =

rs

Consequently,

two integers formed

as

described cannot be congruent modulo ab unless they are identical, and


set, therefore, forms a complete residue system modulo ab.
Again when (a, b) = 1, if we use the form ax + by, letting x have the
values of (3) and y have the values of (4), the resulting ab integers form a
complete residue system modulo ab, for if

the

ari

bkj

ar s

a(ri

rs )

b(k

bk

(raod.

ab)

then

But then a\
fj

rs

(fa

fa),

and therefore

Av)(mod ab)

fa

fa.

Also

Hence, the given ab integers are distinct

(rt

modulo

ab.

r s ), so that

PROPERTIES OF CONGRUENCES

65

It is easy to show also that if x has the values in (3) that are prime to b
while y has the values in (4) that are prime to a, then when (a, b) 1, the
by form a reduced residue system modulo ab.
integers ax

EXERCISES
Use the form ax + by with (a, b) = 1 to show that <(a&) = <t>(a)<t>{b).
Prove Theorem 4-5 by setting up the integers 1 through m = p^pf*
Pknk s
n
n
in an array of s complete residue systems modulo pi ip2
Phnk
n~ x
3. Show that a
+ y generates a complete residue system modulo a n if x has the
values in a complete residue system modulo a while y has the values in a complete
~
residue system modulo a n l
4. If f(x) is an integral polynomial and if there are \p(m) integers prime to m in the
,/(m), prove that when (a, b) = 1, xp(ab) = Ha)Hb).
set/(l),/(2),
5. Find the number of integers prime to m in the set:
1.

2.

a.
,

6.

2,

3,

1-22-3
~T' -2~'
For m >

'

'

'

set

up

m(m +
m(m +

1).

1)

2
all

the permutations

positive integers not greater than m.

at a time with repetitions allowed of the

fc

Then the number

of these sets of k integers

whose greatest common divisor is prime to m is 4>k{m). Find a formula for <}>k(p n ), and
show that this function is multiplicative.
7. Without using an enumeration according to size, show that if a, b, and c are
positive integers and a = be, there are in a complete residue system modulo a exactly
(Let ci, c 2
c c be a complete residue system
c integers that are divisible by b.
modulo c. Then consider the set be i, 6C2,
bc e .)
8. Can you find an integer the powers of which set up a complete residue system
modulo 13? Can all integers prime to 13 be used to form such a set?
9. By expanding (1 + 1 +
+ l) p prove that if p is a prime, a p = a (mod p)
and hence that when (a, p) = 1, a^ {p) = l(mod p).
.

CHAPTER

THE SOLUTION OF CONGRUENCES


and Conditional Congruences. In Sec. 4-3 the considmanner in which residue classes combine led to setting up
a congruence in which we used the symbol x to represent an integer.
For instance, when we asked whether or not there is an integer which
when multiplied by 2 would give an integer in the class of 4 modulo 6, we
were dealing with a congruence of the form 2x = 4 (mod 6). In such
congruences we shall hereafter think of x not as just a symbol for an
unknown integer but as a variable whose values are the rational integers.
By substituting such values in the congruence 2x = 4 (mod 6) it has
already been verified that both 2 and 5 are values of x that satisfy this
5-1. Identical

eration of the

a,2,
.

xn

we shall say that if the constants


a n are substituted, respectively, for the variables Xi, x 2
of whose values are integers) in the congruence
In the general case

congruence.
ai,

(all

fi(x 1} x 2 ,.

where

/i

and f2 are

If

two

ah x2

(x h x 2 ,.

,^)(modm)

integral polynomials in these variables,

fi(a h a 2 ,.

then x\

=f

,x n )

a2

,a n )

xn

/2 (ai,a 2 ,.

integral polynomials /i

an

is

and f 2

,fl)(mod

and

if

m)

a solution of the given congruence.


in the variables x h x 2

xn

are such that the coefficients of like terms are congruent to each other for

the given modulus m, then these expressions are said to be identically


congruent for the modulus m, and
fi(x h x 2 ,.
calling this

,x n )

we sometimes
f2 (x h x 2 ,.

write

,x n

)(modm)

congruence an identical congruence although very often we

use only the ordinary sign of congruence to express this relation.

Corre-

,x n ) with
spondingly, an integral rational algebraic function f(xi,x 2 ,.
if and
integral coefficients is identically congruent to zero for the modulus
.

by m. All the congruences that


involve only constants, such as a = 6 (mod m), are necessarily identical
congruences. 9x 2 2x + 5 = Sx 2 + Ax l(mod 6) is an identical
congruence in the single variable x. It is evident that an identical cononly

if all its

coefficients are divisible

66

THE SOLUTION OF CONGRUENCES

67

gruence will be satisfied regardless of the integral values that are assigned
to the variables.

On

the other hand, we shall call a congruence of the above form, but in
left- and right-hand members /i and f 2 are not identically con-

which the

gruent for the modulus m, a conditional congruence.


We shall be concerned chiefly with congruences of the form fi(x) =
We
m), where fi(x) and f 2 (x) are integral polynomials in x.
(x)(mod
2
f
the properties of congruences that when r is a solution of such
also
a congruence, every integer in the class with r for the modulus
km) (mod ra). This whole
satisfies the congruence, for fi(r) = fi(r

know from

class of integers is considered just

consequently a solution

r(mod

is itself

one solution of the congruence, and

written in the form of a congruence,

ra).

Example. The congruence 2x = 6 (mod 10) is satisfied by 3 and 8.


Hence, the complete solutions are written in the form x = 3 (mod 10) and
x

8(mod

10).

Let us recall that in algebra* two polynomials fi(x) and f2 (x) are said
to be identically equal if and only if they are equal for all values of x, and
hence if and only if corresponding terms have the same coefficients. In
particular, a polynomial vanishes identically if and only if it vanishes for all
In
values of x, which means if and only if all its coefficients are zero.
contrast, consider the congruence x 3 x = 0(mod 3), and observe that
although for the modulus 3 the polynomial x 3 x is congruent to zero for
x, yet not all its coefficients are congruent to zero modulo 3.
members of the congruence x 3 2 = x + l(mod 3) have the
same values modulo 3 for all values of x, but the members are not identically congruent modulo 3.
In other words a congruence may be
satisfied by all integers and still not be an identical congruence according
Examples of such conditional congruences are
to the above definition.

all

values of

Again, both

xb
x

Sx 2

x
2x

= 0(mod
= 0(mod

2x

4(mod

6)

x2

2(mod

5)

5)
6)

Likewise,

and

first one having two incongruent soluwhile the second has no solution whatever.

are conditional congruences, the


tions

On

modulo

6,

the other hand,

x2
*

(x

M. Bocher, "Introduction

pany,

New

York, 1931.

2)(x

2)

0(mod

4)

to Higher Algebra," Chap.

1,

The Macmillan Com-

ELEMENTARY THEORY OF NUMBERS

68

and

Qx 2

15

3(mod

6)

are identical congruences.

EXERCISES
Determine whether the following congruences are identical or conditional, and
find the solutions

2x 2
xz
x2
x4

6.

4
1

= 0(mod 5).
= (x - l)(x -

5-2. Equivalent

if

if

operation listed
4-2),

trial

+ Sx = 5(mod 7).
+ x = x - z (mod

1.
3.

5.

by

there are any.

2).

2){x

3)(x

x4

4.

2x 3

4)(mod

6).

5).

Having performed on a congruence an

Congruences.

among

+ x m 0(mod 10).
+ 3x + x = 0(mod

2.

the properties of the congruence relation (Sec.

a second one of these operations can be performed on the result so

as to restore the original congruence, the


reversible.

The

first

operation

is

said to be

following operations on a congruence can be reversed:

1. Adding to or subtracting from each member of a congruence congruent integers or other expressions that are identically congruent for the

given modulus.
2.
is

Substituting F(x) for f(x) in a term f(x)g(x) of a congruence

if

F(x)

identically congruent to f(x) for the given modulus.

or, when possible, dividing the coefficients of each


congruence by an integer that is prime to the modulus.
4. Multiplying or, when possible, dividing the coefficients of each
member of a congruence as well as the modulus by the same integer.
If any of these operations is performed a finite number of times on a
congruence fi(xi,x 2 ,.
,x n ) (mod mi) and the result,x n ) = f2(x h x 2 ,.
ing congruence is giix^x*,.
,x n ) = ^2(^1,^2,.
,n)(mod m^), then
For instance, when
the two congruences are said to be equivalent.
f(x) = F(x)(y&o& m) identically, then f(x) g (x) = k(x)(mod m) is equivalent to F{x)g(x) + m[h(x)] = k(x)(mod m).
Accordingly, any congruence
3.

Multiplying

member

of a

fi(x h x 2 ,.

,x n )

f2(xi,x 2 ,.

,x n

)(modm)

,x n )
can be reduced to an equivalent congruence of the form f(xi,x 2 ,.
= 0(mod m). For example, the congruence x 2 + 10 = 7a:(mod 6) is
4 = 0(mod 6), 5x 2
equivalent to each of the congruences x 2 x
.

5x

= 0(mod

6),

and 3x 2

Sx

12

0(mod

18).

,x n ) =
a congruence has been written in the form f(xi,x 2 ,.
0(mod m), the degree of the congruence is defined as the degree of the term

When

or terms of highest degree in f(xi,x 2 ,.

,x n )

whose

coefficient or coeffi-

THE SOLUTION OF CONGRUENCES


modulus m.

cients are not congruent to zero for the

6x 3
is

of degree three,

of

7x

0(mod

12)

Sx 2

5x

0(mod

12)

Thus

although

12z 3
is

10a;

69

only the second degree and can be written

3x 2

5x

0(mod

12)

when two conditional congruences are equivalent, any


them necessarily satisfies the other. Take,
2
for instance, the congruence x = 4 (mod 5) that has the solutions x =
The congruence 5x z + 3x 2 = 2 (mod 5)
2 (mod 5) and x = 3 (mod 5).
It is evident that

integer that satisfies one of

has the same solutions, for the two are equivalent. Again, consider the
congruence 2x = 4 (mod 6). Every integer that satisfies this congruence
also satisfies the equivalent
lies in

the fact that

all

congruence x

2 (mod 3).

The

distinction

the integers that satisfy the latter congruence are

in the class of 2 for the

modulus

3,

but these integers are separated into

The first conthe classes of the residues 2 and 5 for the modulus 6.
gruence, therefore, has two incongruent solutions modulo 6, while the
second one has but one solution modulo 3.
It is not true, however, that two congruences that have the same soluBoth 2x =
tions for a given modulus are necessarily equivalent.
4 = 0(mod 6) have the solutions x = 2 (mod 6)
4 (mod 6) and x 2 x

5 (mod 6), yet they are not equivalent.


single conditional congruence may be equivalent to a set of simul-

and x

When f(x) = 0(mod m) and m = raim 2


mr
r, and i ^ j, then the conwith i, j = 1, 2,
gruence can be broken up into the set of congruences f(x) = 0(mod mi).
Conversely, if (ra*, my) = 1, the set of congruences f(x) = 0(mod m t ) can
be combined to form f(x) = 0(mod m). We shall say in this case that
For
f(x) = 0(mod m) is equivalent to the set f(x) = 0(mod m^).
example, 5x = l(mod 12) is equivalent to the set of two congruences
5x = l(mod 3) and bx = l(mod 4). It follows that if x = (mod 12) is
Cona solution of the first congruence, then x G also satisfies the last two.
versely, any simultaneous solution of the set of two congruences implies
that the original congruence has the same solution, for the moduli 3 and 4
are relatively prime, and thus when 5x 1 is divisible by both 3 and 4,
taneous congruences.

where

(m, m/)

1,

divisible by their product.


But when two congruences are themselves not equivalent, the existence
of a solution of either one of them may often be determined by showing
the existence of a solution of the other one.
In that case we speak of the

it is

problems of the existence of the solutions as being equivalent.

Notice

ELEMENTARY THEORY OF NUMBERS

70

that if the congruence 2x = 3 (mod 9) has a solution, then 2x = l(mod 3)


has a solution, and conversely. This statement is valid, for any solution
x = (mod 9) of the first congruence would have to be a multiple of 3,

and consequently each x /3

the second congruence.

satisfies

other hand, the second congruence

is

satisfied

by

all

On

the

integers in the class

modulo 3, and none of these integers is a multiple of 3. However,


= x'(mod 3) is a solution of 2x = l(mod 3), x = 3'( m od 9) must
be a solution of 2x = 3 (mod 9). Thus the questions of the existence of
of 2

where x

solutions of these congruences are mutually dependent.

Example.
7

0(mod

To determine whether
15)

and 9x

Sx

or not the congruences 3x 2

= 0(mod

11

15) are equivalent,

we

-f-

try

modulus that will change the leading


congruence into the one we want. What value of

to find a multiplier prime to the


coefficient of the first

y will satisfy Sy

We reject

3 since

9(mod

it is

15)?

The

not prime to

solutions are 3,

15.

8,

and 13 modulo 15.

Multiplying each

member

of the

congruence by 8, we have 24# 2 8x + 56 = 0(mod 15), which


11 = 0(mod 15).
Thus the congruences are
reduces to 9x 2 Sx

first

equivalent.

EXERCISES
1.

2.

3.
4.
5.

6.

2
7.
8.

x 3 - 2 = 0(mod 3) equivalent to x z + 1 = 0(mod 3)?


Show that 2x 3 - x 2 + 2 = 0(mod 5) is equivalent to 2x 3 + 4z 2 = 3 (mod 5).
Show that x 2 - 2x + 1 = 0(mod 3) is equivalent to 2x 2 - x + 2 = 0(mod 3).
Show that 3a: 2 - 6 = 0(mod 15) is equivalent to x 2 - 2 = 0(mod 5).
Are 2x 2 + x - 4 = 0(mod 5) and x 2 + 3x - 2 = 0(mod 5) equivalent?
Is the congruence x z 2 = 0(mod 3) equivalent to the congruence 2x 3 x
= 0(mod 3)? Are the solutions the same?
Develop two congruences equivalent to x 2 9 = 0(mod 12).
Are the congruences x z x = 0(mod 3) and x 4 + 2x 2 = 0(mod 3) equivalent?
Is

Are the solutions the same?


2
9. Note that 2x = 8 (mod 10) and x
Are they equivalent?
tions.

2>x

= 0(mod

10)

have the same solu-

Can the double of an integer give the


5-3. Linear Congruences.
remainder 7 when it is divided by 52? Has 2x = 7 (mod 52) a solution?
Theorem 5-1. When a is prime to m, the congruence ax = l(mod m)
has one and only one solution modulo m and this solution is prime to m.
The congruence ax = l(mod m) is equivalent to the equation ax +
my = 1, which we have shown always has a solution in integers when
There can be but one solution modulo m, moreover, for if
(a, m) = 1.
both xi and x 2 satisfy ax = l(mod m),
axi

ss

ax 2 (mod m)

Xi

.x 2

and

(mod m)

THE SOLUTION OF CONGRUENCES


Furthermore, when ax\

71

l(mod m), it is clear that X\ is prime to m.


prime to m, the congruence ax = 6 (mod m)
has one and only one solution modulo m.
Now consider the congruence ax = b (mod m) with (a, m) = 1. We
know that ax = l(mod m) has a solution x = i(mod m). Then

Theorem

5-2.

When

is

axib

6 (mod

m)

shows that # = Xi6(mod m) satisfies the original congruence.


Again, as proved above, there can be but one solution modulo m, but
notice that it is not necessarily prime to m.
Theorem 5-3. If d is the greatest common divisor of a and m, the
congruence ax = b (mod m) has a solution if and only if d divides b.
When d does divide b, there are exactly d incongruent solutions modulo m.
Let (a, m) = d, a = a d, and m = m d. If ax = b (mod m) has a solud divides

tion, it is evident that

cd,

On

b.

the other hand,

if

d divides

b,

let

and reduce the congruence to the equivalent congruence

a x

c(mod

m ) = 1, and there is but one solution x = #i(mod m ).


km and
Consider this class of integers all of which are of the form Xi
obviously satisfy the given congruence. We wish to know whether these
In this case (a

integers constitute one or


like to

know

for

modulo m.

class

We

and only

solutions

modulo m; that

of k these integers are in the

is,

we should

same residue

see that
Xi

if

more

which values

kmo

Xi

0(mod m)

sm (mod m)

if

(k

s)

and only if k
Consequently, when k ranges
s = 0(mod d).
through d 1, the integers xi + kmo represent exactly d solutions
that are incongruent for the modulus m and all solutions of the given
congruence lie in one of these d classes modulo m.
Example. Solve: 15x = 12(mod 36).
Since (15, 36) = 3 and 3 12, we reduce the congruence to hx =
4(mod 12) of which there is one solution x = 8(mod 12). Hence, the
solutions of the original congruence are x = 8, 20, 32 (mod 36).
that

is, if

from

EXERCISES
State with reasons the

number

of distinct solutions of the following congruences,

find the solutions.


1.

3.
5.

3x m 5(mod 9).
6z = 3(mod 18).
12x s 36 (mod 56).

2.

4.

5x = 3(mod 27).
49z = 23(mod 125).

and

ELEMENTARY THEORY OF NUMBERS

72

5-4. Division of Polynomials.

and f2 (x) are

If fi(x)

+m

integral polyno-

where g(x) is
an integral polynomial, by f 2 (x), obtaining integral polynomials q(x) and
mials and

possible to divide /i(x) or/i(x)

if it is

g(x),

r(x) so that

fi(x)

} 2 (x)q(x)

an identical congruence, and

(mod m)

r(a;)

is continued until r{x) is


congruent
to zero modulo m,
f
then q(x) is said to be the quotient and r(x) the remainder in the division
modulo m of fi(x) by f 2 (x). When r(x) = 0(mod m) identically, the
division is said to be exact and both f 2 (x) and q(x) are factors modulo m
Moreover, fi(x) is a multiple modulo
offi(x) or divisors modulo m oifi(x).

is

either lower in degree than

of

we

ordinary long division,


a divisor

As

modulo

2a;

l(mod

x2

there

On

6)

no value of a that

is

divide

modulus

6,

but

it is

2x

is

we

by

a;

3 using
is,

and therefore we say that x

of

b that

will satisfy this congruence.


2

x by 2x

2x

4a;

modulo 6

is

not exact, for

5\

\x 2

\x 2

lOx

4x
4x

l(mod

10
11

If

divide x 2

lOz

Hence, 4z 2

a remainder 12 which

3.

the other hand, the division of

possible,

2a;

1 by Sx 2 modulo 6, for if
would make (Sx 2) (ax -f- b) +
an identical congruence, then 3a = l(mod 6). But

there were a quotient ax

is

find that there

we cannot

stands,

it

6 of

we

if

for the

course, in the class of

or

(x)

f 2 (x).

Notice, for example, that

is

the division

if

is

(2x

try to divide

4a;

5) (2x

+x+

2)

6)

5(mod

6)

5 (mod 6).

by 2x

modulo

6,

we

find

we cannot

carry out the division far enough to obtain a remainder of the required
form, for

2x

5[

4x 2
4x 2

10a;
11a;

But 2y

5 (mod 6) has

identical congruence

However,
instead of

no
2

solution,

2x

5a;

l(mod

6)

and the best we can do

we change the form


5, we have

if

2a;

4a;

(2x

of the

5)(2x)

5x

is

to write the

l(mod

6).

above divisor using 4a;

THE SOLUTION OF CONGRUENCES

4x

5| 4a;

+
+

2
2

4a;

\-x +

4x

4a;

0(mod

6 ==

Hence,

4a;

+ +
a;

We could

5a;

73

6)

= (-4x - 5)(-x +

obtain a like result by

first

l)(mod 6).
adding Qx 2 to 4a; 2

+x+

for

we

find that

2a

10z 2

10x 2

x .+

5s

25a;
26a;

2a;

l(mod

2a;

We,

therefore,

have

4a;

Notice, furthermore, that

by

3a;

1,

(2x

5) (5a;

when the modulus

6)

= 0(mod

is 6,

6)

l)(mod

we can

6).

divide

3a;

getting three distinct quotients and three distinct remainders,

for
3a;

3a;

+
+

=
=

(3a;
(3a;

2
2

l)(x)

+ x + l(mod 6)
+ 3a; + l(mod 6)

l)(3a;)

and
3a;

When

the modulus

is

(3a;

l)(5x)

5x

l(mod

6)

a prime and the polynomials are not constants,

it

easy to show that the division modulo p of fi(x) by fz(x) can always be
accomplished, for any term present in either one of these polynomials has

is

is prime to the modulus and the congruence ay =


has
exactly
one solution when (a,p) = 1. The remainder r(x)
p)
will, therefore, be congruent either to zero modulo p or to an expression
that is at least one degree lower than the degree of the divisor.
In this
case, moreover, both q(x) and r(x) are unique, for if

a coefficient that

6(mod

fi(x) =J2{x)qi{x)

ri(aO(mod p)

r 2 (x)

and
fi(x)

= f2(x)q

(x)

(mod

p)

then
f2(x)[qi(x)
If q\{x)

q 2 (x) f

0(mod

q 2 (x)]

r 2 (x)

ri(x)(mod p)

p), let its leading coefficient

be

0(mod

p),

the leading coefficient of f 2 (x) be a ^ 0(mod p).


Then the leading coefficient of f2 (x)[qi(x) q 2 (x)] is a 6o ^ 0(mod p), and the degree

and

let

of this expression is at least that of


r 2 (x)

ri(x).

identically

This

is

impossible,

and likewise that

7*1(0;)

f2 (x), thereby exceeding the degree

and we

infer that qi(x)

r 2 (o;)(mod p).

q-ii-v)

(mod

of

p)

ELEMENTARY THEORY OF NUMBERS

74

EXERCISES
1.

why

Explain

division

modulo

x2

+3

cannot be divided by

4a;

modulo

Carry out the

8.

5.

Divide x 2 - 2x + 5 by 2x - 3 modulo 7.
Divide 3x 2 - 2x + 4 by 2x - 1 modulo 15.
2
4. Divide x 3 - 2x + 5x - 1 by 2x - 3 modulo 11.
5. Divide 2x 2 2x + 5 by 2x 3 modulo 6, and then change the divisor to the
form 4x 3 and carry out the division modulo 6.
2x
1 by 2>x - 1 modulo 11.
6. Divide Ax z - 3z 2
n
and g(x) = b Q x + friz'" 1 +
7. If fix) = a x
ai^- 1
+b
are integral polynomials with t < n, and if (b m) = 1, do polynomials g(x) and r(x)
exist so that /(a:) h= g(x)q(x) +r(a;)(mod m) with r{x) lower in degree than g{x)l
If so, are these polynomials unique modulo m?
2.

3.

++

Theorem 5-4. If x = r(mod m) is a solution of the congruence f(x) =


0(mod m), where the polynomial f(x) = a Q x n + aix n ~ +
+ an
with a ^ 0(mod m), then x r is a factor of /(#) for the modulus m, and
l

conversely.

According to the remainder theorem of algebra,


is divided by x r.
Consequently,

remainder

f(r) is the

when f(x)

(x

r)q(x)

- f(r) =

(x

r)q(x)

f(x)

+ f(r)

or
f(x)
identically,

But

f(r) is

and q(x) is a polynomial


an integer, and furthermore

n-1

/(r)

b 1x n

~2

= 0(mod

Therefore, the coefficients of f(x)

the given congruence.

&_i.

m), for r satisfies

f(r)

are

Moreover, it is evident from a consideration of the process of


long division or from the following argument that the coefficients of q(x)
Because the leading coefficient of f(x) is an integer, the
are integers.
product (x r)q(x) shows that 6 = a is an integer. If bi were not an
where rb Q is an integer, would not
integer, the coefficient a\ = b\ rb
be an integer. In like manner the fact that 6 -_i and bi r6 -_i, where
i = 1, 2,
n, are integers implies that bi is also an integer.
Thus
Hence,
q(x) is an integral polynomial.
integers.

f( x )

f( r)

and so
f(x)
identically,

=
=

(x

r)q(x)

(x

r)q(x)(mod m)

(mod m)

r is a factor of f(x) for the

f(x)

(x

f(r)

= 0(mod

showing that x

Conversely,

if

r)g(a:)(mod m)

then

and x

r(mod m)

is

m)

a solution oi fix)

0(mod m).

modulus m.

THE SOLUTION OF CONGRUENCES


It is easy to

quotient
5-5.

is

show that when x

r is

75

a factor modulo

of f(x), the

unique.

The Number and

Multiplicity of the Solutions of a Congruence.

We have shown that the congruence 2x 4 = 0(mod 6) has the solutions


x = 2 (mod 6) and x = 5 (mod 6). Therefore, Theorem 5-4 shows that
x 2 and x 5 are factors modulo 6 of 2x 4. Thus 2x 4 =
2(x 2) (mod 6), and 2x 4 = 2(x 5) (mod 6). Notice, however,
that the product (x 2)(x 5) is not a factor modulo 6 of 2x 4. On
if the modulus is a prime, the proof of the following
theorem brings out the fact that when ri, r 2
r s are incongruent
integers modulo p that satisfy /(#) = 0(mod p), the product (x ri)(x

the other hand,

(x r s ) is a factor modulo p of f(x)


The eminent mathematician Lagrange (1736-1813) improved the work
of his teacher Euler in the calculus of variations, did extensive work in the
r 2)

solution of algebraic equations,

and expanded the theory

of differential

In the theory of numbers he was the first to prove Wilson's


theorem and the first to prove that every integer is a sum of at most four
equations.

He gave a

complete proof of the method of solving the equation


Again, he made important contributions to
the theory of quadratic residues and binary quadratic forms. The next
theorem is credited to him and reflects his interest in the solution of
squares.

x2

by 2

in integers.

equations as well as congruences.


Theorem 5-5 (Lagrange's Theorem).

If

is

a prime and f(x)

+.+ o in which a ^

integral polynomial a x n

ai^ n_1

then the congruence j(x)

0(mod

p) has at

is

an

0(mod

p),

most n incongruent solutions

modulo p.
We have observed that the congruence f(x)

0(mod p) need have no


ri(mod p), it follows from Theorem
If it should happen
ri is a factor of f(x) for the modulus p.
that (x ri) B1 where 1 < rii < n, is a factor modulo p of f(x) and if this
power is the highest power of x ri contained as a factor in f(x), then
x = ri (mod p) is said to be a solution of multiplicity n h and
but
5-4 that x

solution,

if

there

is

a solution x

f(x)

(x

ri)

ni

gi(x)(mod p)

with qi(x) of degree n n\ and leading coefficient b = a (mod p).


If rii < n and if the original congruence has another solution x
r 2 (mod p) with r 2 incongruent to n modulo p, then
/(r 2 )

But since /(r 2 )


0(mod p) and,

= 0(mod p)

(r 2

and

rx

ri)

ni

gi(r 2 )(mod p)

r 2 (mod p), it is

as above,
qi(x)

(x

r 2 ) m q2(x)(mod p)

evident that gi(r 2 )

ELEMENTARY THEORY OF NUMBERS

76
so that

f(x)

(x

ri)

ni

(x

r 2 ) n2 g 2 (V)(mod p)

identically.

= O(mod

p) has one or more other distinct solutions for the


we continue in this manner until either all the solutions which
are fewer than n in number have been found or we have at most n linear
In the latter case we find the identical
factors modulo p of f(x).
If f(x)

modulus

p,

congruence

f(x)

+n +

a (x

rtl

ri)

(x

r 2 ) n2

(x

r k ) nk (mod p)

(1)

n k = n, and hence there are n solutions, for a


where i = 1, 2,
k, is counted ni times.
If we now substitute for xm (1) any integer s not congruent to any r^
where i = 1, 2,
k, for the modulus p, we find
where n\

solution of multiplicity

/()

But s
0(mod

Ti

p),

rii,

- r^is -

a Q (s

r 2 ) n2

(s

r k ) n *(mod p)

(2)

^ 0(mod p), and a ^ 0(mod p). Consequently,


= s(mod p) is not a solution of f(x) = 0(mod p).

and x

f(s)

There-

can be no more than n solutions.


show, furthermore, that the solutions are the same regardless of the order in which they are found.
Moreover, the multiplicity of each solution is unique regardless of the
order in which the factors are obtained, for if

fore, there

It is easy to

f(x)

(x

rxYq^x)

(x

r 1 ) v q 2 (x)(mod p)

where neither qi(x) nor q 2 (x) is divisible modulo p by x


u > v, we have the identical congruence
(x

But
is

if

ri) [(x

ri)

u- v

qi(x)

q 2 (x)]

= 0(mod

p)

u~v

the leading coefficient of the expansion of (x

not congruent to zero modulo

p,

ri)

rh

qi(x)

and

if

qi(x)

the leading coefficient of the last con-

gruence written in the expanded form cannot be congruent to zero modulo


The congruence states, however, that when it is written in the form
p.
~
a n ss 0(mod p), all its coefficients are multiples
a xn
aix n l

Consequently, the leading coefficient and, in like manner, each


~
of the other coefficients of the expansion of (x ri) u v qi(x) q%{x) are
congruent to zero modulo p. Therefore, we have the identical congruence

of p.

(x

Substituting

r\

for x,

we

(ri

ri)

w- y

giO)

q 2 (x)(mod p)

gi(ri)

# 2 (ri)(mod p)

find
ri)

w- y

THE SOLUTION OF CONGRUENCES


As a

= 0(mod

result q^ri)

which

a factor

r\ is

when n >

obvious, of course, that

It is

modulo p

of #2(2),

contrary to our assumption.

is

0(mod

and x

p),

77

have no more than p

p) can

Again,

us observe that

let

we

if

the congruence f(x)

p,

distinct solutions

modulo

p.

place no condition on the a

0(mod p) and assume that the congruence has an (n


= s(mod p) that is distinct from each r where i = 1,

of f(x)

l)st solution

2,

4-,

k,

for

the modulus p, the congruence (2) requires that a Q be congruent to zero


modulo p. Consequently, the identical congruence (1) implies that

every coefficient of f(x)


conclude:

congruent to zero modulo

is

Hence, we

p.

Theorem 5-6. If the congruence a x n + a\x n ~ x +


0(mod p), with p a prime, has more than n solutions (a solution

an

of multi-

n, is
m being counted m times), each aiy where i = 0, 1,
congruent to zero modulo p and the congruence is an identical congruence.
Example. Find by trial the solutions of x*
x2 x
2 = 0(mod 5).
4
2
If f(x) = x
Hence, x
1 is a factor of
x x
2, /( 1) =5.
3
By using synthetic division we find f(x) = (x
f(x) modulo 5.
1) (x
plicity

+
+

Then/i(-3) =
-45, and therefore f(x) = (x -f l)(x + S)(x 2 - 4x + 4) (mod 5). It is
now evident that f(x) = (x + l)(x + 3) (a; 2) 2 (mod 5) and that
besides the solutions x = l(mod 5), x = 3 (mod 5), there is a double
solution re = 2 (mod 5).
Theorem 5-7. If p is a prime, the congruence f(x) = 0(mod p) of
degree n < p has a solution # = a (mod p) of multiplicity r < n if and
only if /(a) = 0(mod p), /'(a) = 0(mod p),
/^(a) = 0(mod p),
and/^(a) ^ 0(mod p).
We recall that x = a (mod p) is a solution of multiplicity r of /(z) =
0(mod p) if and only if (x a) r is a factor modulo p of the polynomial
r+1 is not
Furthermore, we
a factor modulo p of /(x).
f(x), but (# a)
x2

2x

3)

(mod

5).

Let/iO) =

x*

x2

2x

3.

= a xn
~
n~ 2

a n as f(x) = atfix n l
l)x
a n _i,
i(^
the application of Taylor's theorem to the polynomial f(x) sets up the
notice that

ai# n-1

we

if

/(a)

If /(a)

but / (r) (a)

identity
f(x)

define the derivative with respect to x of f(x)

+ (x-

a)f(a)

0(mod p),/'(a)
0(mod p) for

+
=
r

(x

a)

O(modp),

<

n, then, the

+..-+.(*.

and/^a) =

{i)

(a)/i\

a)

(a;

- aY J^- + +(*-

/(x)

Or

and
a) r Q(x)(mod p)

a)

-^

O(modp),

being integers,

have
/(*)

-^p

(mod

p)

we

ELEMENTARY THEORY OF NUMBERS

78

If (x

a) r+1

were a factor modulo p

(x

and the

a) r+1 q(x)

then

of f(x),

(x

a) r Q(x)(mod p)

identical congruence

(x

a) r [(x

a)q(x)

Q(x)]

0(mod

p)

implies that

(x

a)q(x)

Q(x)(mod

p)

n -r

Hence, [f (r) (a)/r\]


(x - a)
[f^(a)/n\] has the factor x a modulo p, and so/ (r) (a) = 0(mod p), which is contrary to the hypothesis.
To prove the converse of the theorem, first call to mind the rule for

differentiating a product of two functions, and remember that when


polynomial has been factored into two polynomials, this rule enables us
to set up an identity between two forms of f'(x), for if
>

f(x)

a Qx n

ciiX"-

+- +

a*

(b Q x

xs

b r )(c

'

+C

'

8)

then
f'(x)

a n^ n_1

kXcowr-

ai(n
1

+"+ &n-i
+ c _i) + (b rx ~ +

l)x n
"

~2

(b

xr

& r_i)(co^

+
On

this basis the

method

of induction

shows that

it is

are polynomials in

d k (uv)

dk u

~ ~
~dx~

dx~k+

Consequently,

if

we may,

x,

f(x)

dv d k

~l

c.)

If

u and

therefore, write

u
+
dx dx ^
1

valid to apply

Leibnitz's rule for the kih derivative of a product to this case.


v

k(k

1)

d 2 v dk

~2

2!

+
dx~ d^F
2

'

'

dkv
"

dx~k

a) r q(x) (mod p), then the formula verifies


0(mod p) for k < r, because clearly each
a when s < r. But (x a) r+l is not a
and so we infer from q(a) ^ 0(mod p) and

(x

the statement that f (k) (a) =


d s (x a) r /dx s has a factor x
factor

modulo p

^ [(X

X)]

~dx^
that/ (r) (a)

To make

of f(x),

^ ^+
ir)

'

'

'

0(mod

it

plain that the restriction which

r ( r!)(

^ ~

WW +

( r!)

^W

p).

Theorem

5-7 places on the

degree of f(x) = 0(mod p) is a necessary one, consider the congruence


10
a;
x b = 0(mod 5).
Its only solutions are x = 0(mod 5) of multi-

and the simple solution x = l(mod 5). Nevertheless, f (k) (0)


and f (l) are congruent to modulo 5 for all positive values of k.
When we are solving a congruence by trial, It is often helpful to make
use of the following two theorems to eliminate some of the possible
plicity 5
(k)

solutions

'

THE SOLUTION OF CONGRUENCES

79

*Theorem 5-8. If r satisfies the congruence a Q x n


a n = 0(mod m), then r is a factor modulo m of a n

a\X n

~x

Since r

is

a solution of the congruence, a x n

r)Q(^)(mod
= a (mod m).

(ic

modulo m of a n
*Theorem 5-9.

m), where Q(x)

Hence, a n

n~ 1

= r6 n _i(mod

aix n

++ =
m) and

6 n _i(mod

m), and thus r

is

a factor

the congruence f(x)

If r satisfies

0(mod m), then

a divides f(a) modulo m.


The hypothesis implies that f(x) = (x r)Q(rc)(mod m).
tuting a for x, we derive f(a) = (a r)Q(a)(mod m).
r

Substi-

Example. Solve /(x) = ^ 3 - 4x 2 - 11a;


6 = 0(mod 12) by trial.
Applying Theorem 5-8, the possible solutions are obtained by consider-

ing the congruences rx


r

6(mod

12) for r

1, 2,

The values

,11.

4 and 8 are immediately ruled out, for the corresponding linear con-

gruences have no solutiom-

Then we

values r

(r

\)y

rowed to

= 8, and we

apply Theorem 5-9. The


7 and 10 are thereby eliminated, for there is no y such that
find that /fl)

= 8 (mod

The

12).

2, 3, 5, 6, 9,

and

possible solutions are, therefore,

modulo

11

values in f(x) shows that each one

12,

and the substitution

nar-

of these

a solution of the given congruence.

is

The Chinese Remainder Theorem. The problem of finding an


integer that yields certain remainders upon being divided by given
integers was familiar to the Chinese as early as the first century.
The
solution is now easily effected by using congruences.
When the integers
mh m2
m n are relatively prime in pairs, we wish to find an integer
5-6.

x such that
x

=
=

ai(mod mi)
a 2 (mod mi)

a n (mod

mn

Let

\\
t=i

rrti

and Mi =

M/rrii,

where

1, 2,

n.

Then

set

up

the n congruences

Mix
In each case (M{, mi) =
of each congruence (4).

1,

l(mod

and there

Now

mi)

(4)

exactly one solution x

is

.x\(mod

X = M iXidi + M2X2CL2 +
+ M nx n a (mod M)
and substitute X for x in x = ai(mod mi). Since M and each M

Mi

every integer of

and MiXi is congruent to


the form X + kM satisfies x =

are congruent to

0,

z)

consider
n

for the

except

modulus mi,

a! (mod mi).

In like

ELEMENTARY THEORY OF NUMBERS

80

manner the

integers in the residue class of

modulo

M satisfy

all

the

given congruences.

But

this class of integers

congruences, for

and Xi

if

is

the only simultaneous solution of the set of

in the given congruences (3)

X=
and since the

shows that

Xi(mod

prime in

ra z are relatively
-

X=

pairs, the

m,-)

pairs,

Xi(mod M)

Hence, we have shown that


Theorem 5-10. If the im, where

prime in

there were a second solution Xi, the substitution of

congruences x

2,

1,

a; (mod

n, are relatively

have one and only one

m)

M=

simultaneous solution modulo

55a:

S5x

=
=
=

6,

when

Hence,

X=
385).

M* = 55
x = 77
3 = 35
2x = l(mod 5) has the solution x = 3 (mod 5)
7) or Qx = l(mod 7) has the solution x = 6 (mod 7)
11) or 2x = l(mod 11) has the solution x = 6 (mod 11)

l(mod
l(mod
l(mod

27(mod
5-7.

2,

5, 7,

M
77x

m^

Find all integers that give the remainders


and 11, respectively.

Example.
divided by

\\

385

5) or

(77) (3) (2)

(55) (6) (6)

(35) (6) (5)

Other Simultaneous Linear Congruences.

a method for finding a solution,

when

(mod

385),

We shall

or

Xm

demonstrate

of certain linear simul-

it exists,

taneous congruences whose moduli are not relatively prime in pairs by


proving the following theorem by induction:
Theorem 5-11. The set of n linear congruences x = a;(mod mi) has
if and only if the greatest common
and j having the values 1, 2,

divisor of

a solution

m^

mj,

corresponding a
of the set,t all

least

common

a,j.

common

When

the integer

n,

satisfies

solutions take the form

multiple of the

m,-

and

is

any

any pair

with

^ j,

of moduli,

divides the

each congruence
where L is the

X + Lt,

integer.

Taking the two congruences


x
x

=
=

ai(mod mi)
a 2 (mod m 2 )

f Oystein Ore gave the general form of the solution in


6, pp. 365-370, 1952.

No.

Am. Math. Monthly,

Vol. 59,

THE SOLUTION OF CONGRUENCES

with d\2

(mi,

2 ),

let

81

us suppose that x satisfies both of them.

Then

since

=
=

x
Xq

we

ai(mod
a 2 (mod

m
m

x)

2)

infer that

=
=

ai(mod

di 2 )

a 2 (mod

c? i2 )

a-i

a 2 (mod d i2 )

Xq

and that

if d i2 divides a\ a 2 we can show that there is a solution


congruence
that satisfies the second one.
Every solution of
of the
and
if
any
of these integers
the first congruence is of the form a\
nay,
satisfy the second congruence, the values of y are determined by the

Conversely,

first

congruence
cti

miy

a 2 (mod

miy

a2

2)

or

But

since

dn

(a 2

i),

there

is

ai(mod

2)

at least one value y of y that produces

miy of the two congruences.


Moreover, if there are two integers x and x\ that satisfy the given
congruences (5), substituting them in these congruences shows that

a simultaneous solution a\

x1

=
=

x (mod mi)
x (mod
2)

Xi

^ (mod L)

X\

and hence that

where

is

the least

integer of the

common

multiple of mi and

+ Lt is a

form x

common

Furthermore, any

2.

if

Xo

both the moduli mi and m 2


Suppose now that the theorem is true for a set of k 1 congruences of
for Lt is congruent to

is,

the given form.

Then

for

if

there

is

common

the least
If

tainly
dij

i t* j.

is

dji

common multiple of mi,

2,

X
X +L

solution

simultaneous solutions of the set are of the form


is

solution of the congruences

k -it,

m^-i,

and

and only
where L k -i

all

the parameter.

is

a solution of a set of k congruences of the required form, cersatisfies

the

first

(mi, mj) divides a*

congruences, and thus


a,-

for

t,

1,

2,

it is
.

But

X=

ai(mod m*)

X=

and
fc

(mod m&)

1, 2,

true that

1,

and

ELEMENTARY THEORY OF NUMBERS

82

Hence,

X=
X=

a k (mod d ik )

a (mod d ik )

(mod dik )

a*

and therefore
di

Consequently,
Conversely,

dij

divides a*

if

dy divides

solutions of the

where

fc

first

for

aj

di

i,

for

aj

1, 2,

i,

where

k,

2,

1,

k,

^ j.

common

congruences exist and have the form

X +

moreover, possible to
determine a value for the parameter t so that this expression will produce
To prove this statement, consider the
a solution of x = a (mod m k ).
congruence

Lk-it,

is

a simultaneous solution.

It

is,

fc

X + Lk-it =
in the

Lk-it

We

a k (mod

k)

form

X (mod m k

ak

can show that this congruence has a solution

ing that the greatest


If

is

common

divisor of

a prime factor of any of the

L k -i and

=
rrik

(mod

k)

divides ak

by prov-

w!i be the exponent of the

ra 4-, let

The highest power of this


power of p that is in any one of m h m 2
m k -i. Suppose it is p m/ the power of p that occurs in m r where 1 < r <
Then the exponent of the highest power of the prime p that is
h 1.
Let this integer
contained in D = (m k L k -i) is the smaller of m'k and m!r
But
be m's
highest power of that prime contained in m*.

in Lk-i is the highest

ar

= 0(mod m

X -

ar

= 0(mod

r)

and hence

m/
)

is divisible by the greatest common divisor of m k and m r it


by that power of p determined by the smaller of the two
But from the above congruences
exponents m'h and raj., that is, by m's
X a r is divisible by the power of p designated by the smaller of the
exponents m!k and raj.. Hence,

Since a k
is

ar

divisible

X -

ar

= 0(mod

ar

X -

ak

- 0(mod

m ')

and
ak

0(mod p

vls ')

Therefore,

Furthermore, since this congruence

(m k L k -i), the integer


,

ak

is

is

m>)

any prime factor of D =


by the product of the very

true for

divisible

THE SOLUTION OF CONGRUENCES

83

a k is divisible
powers of the primes that are contained in D that is,
by D. Thus there is a value of t that forces a solution of the first k 1
congruences to satisfy the kih one, x = a (mod m&).
Again, any two solutions of the set of k congruences x = a* (mod mi)
;

fc

must be congruent modulo the least common multiple


m k for two solutions X and Xi are such that

of mi,

2,

X =
X =

Xi(mod L -i)
Xi(mod m k )

X =

Xi(mod Lk)

fc

and hence

Lk

where

2,

is
,

the least

common

Moreover,

k.

congruence of the given set


Example. Solve

Let d!
evident

(18,

that

dx

15)
\

(7

3,

L k -i and m k and
form X + L k
common solution.

multiple of

integers of the

all
if

x
x
x

=
=
=

7(mod
10(mod
l(mod

d2

(18,

d2

10),

is

(7

14)

hence of m h
satisfy each

18)
15)
14)

1),

dz

2,

d3

(10

14)

(15,

1.

It is

Therefore,

substitute 7

-f-

1).

solution exists.

Substituting 7

second congruence,

18 in the

18*

3(mod

15)

l(mod

15)

we

find

so that

Since 90
18

is

the least

common

multiple of 18 and 15,

we

90s in the third congruence and have

= -24(mod

90s

14)

and therefore

Hence, the

common

solution

is

3 (mod 14)

X=

295 (mod 630).

EXERCISES
1.
2.

3.
a.
6.

Find by trial all the solutions of 3z 4 - 3z 3 - 2z 2 + 3z + 6


0(mod 7).
Find the solutions of x + 10x 5 + 4.x 4 - x 3 + x + 6 = 0(mod 11).
Decide whether or not the following congruences have multiple solutions.
x3

x2

2z 3

+3 =
+1 =

0(mod
0(mod

5)

3)

ELEMENTARY THEORY OF NUMBERS

84
Find the

4.

common

solutions of the following sets of congruences.

m 2(mod
= 4(mod
= 9 (mod

x
x
x

= 11 (mod 21)
= 2 (mod 12)
s 4(mod 10)

a
=
=

x
x

a.

b.

c.

Find a multiple

6.

respectively,

5-8.
If

by

of 7 that

2, 3, 4, 5,

The Number

and

14)

12 (mod 46)
l(mod 31)
16 (mod 28)

has the remainders

1, 2, 3, 4,

and 5 when

it is

divided,

6.

of Solutions of the

Congruence

f(x)

r, are distinct primes and


the p^ where i = 1, 2,
nr
p r there is a solution of the congruence
.

11)
15)

0(mod m).

m =

ni

pi p 2

n*

J{x)

where /(#)

is

0(mod w)

an integral polynomial,

if

and only

(6)
if

there

is

a simultaneous

solution of the equivalent set of congruences

Six)

=
=

0(mod pi ni )
0(mod p 2 )

/(x)

0(mod p r nr )

S{x)

if there is a solution of each of the individual congruences of (7), we


can build up a simultaneous solution of the set by means of the Chinese
remainder theorem. Suppose that integers Xi satisfy /(x) = 0(mod Pi ni ),
Then find the common solution of the
where i 1, 2,
r.
congruences
x = i(mod pi ni )
(8)

But

Let this solution be x


set (7)

and the

= Xi(mod

m).

The

integer

X\

satisfies

original congruence (6) because for each

Xi

x z (mod pi ni )

and therefore
SiX,)

=f(xi)(mo&pf)

But

= 0(mod

pi**)

x)

0(mod

p^-i)

SiX,)

0(mod m)

Sixi)

so that

SiX
and

both the

THE SOLUTION OF CONGRUENCES

85

the set of congruences (8) we replace the solution of just one of the
congruences of (7), say the first one, by a solution x[ distinct from X\
If in

modulo pi ni the solution x


,

x
x

=X

(mod m)

= xi(mod pi ni
= ^(mod pfi)

of the resulting set,

be distinct modulo
were the same,
will

2, 3,

m from the solution

(mod m)

=X

(mod

Xi =

Xi

of (8), for

if

the solutions

would imply that

Xi

pi

ni

1, 2,

Then
xi

xJ(mod pi ni )

whereas we assumed that these integers are incongruent solutions of


= 0(mod pi ni ). Hence, if each congruence of (7) has kt solutions, by
inserting them in (8), we see that there are kik 2
k r solutions modulo

fix)

m of f(x) =

0(mod m).

It is evident too that

there

no solution

is

Theorem

5-12.

if

If

one congruence of

(7) fails to

have a

solution,

0(mod m).

Thus we have shown that:


the congruences f(x) = 0(mod Pi ni ), where i =

of f(x)

1,

2,

r,

have

fc

>

solutions, respectively, there are exactly

]
i

k{

=l

incongruent solutions modulo

of f(x)

= 0(mod

m), where

m=

J[ pi
=i

ni

and the

pi are distinct primes.

We have, therefore, reduced the


f(x) = 0(mod m) to that of solving
power
5-9.
f(x)

problem

of solving a

congruence

a congruence whose modulus

is

of a prime.

The Solution of f{x) = 0(mod p ). Any integer that satisfies


0(mod p s ), where p is a prime and f(x) is an integral polynomial,
s

evidently satisfies the congruence


f(x)

= 0(mod

p*- 1 )

The

converse, however, is not true, but it is obvious that if the second


congruence fails to have a solution, f(x) = 0(mod p s ) can have no solution.

Suppose that f(x) = 0(mod p 8-1 ) has a solution x = a;' (mod p*~ ).
Under what conditions will one of these integers, x' + kp 5-1 be a solution
of f(x) = 0(mod p s )?
We must determine which values of k, if any, will
l

ELEMENTARY THEORY OF NUMBERS

86

satisfy the congruence

kp 8 '

fix'

n~ l

= 0(mod

When/(x) = a x + a\X
+
+ a n is a rational integral function
we have defined the derivative of fix) with respect to x as a Q nx n ~ 1 +
n~ 2
+
+ a n -\. The expansion of f(x + h) according to
diin l)x
Taylor's theorem is finite and is of necessity valid for integral values of x.
n

of x,

Consequently,
fix'

kp 8 -^)

f(x')

k V 8 -y{x')

fc

2 *- 2

0^
+

_+_

frn

f
n S -n J

(n)

(x')
\_>_

nl

mQ( J p s\

an identical congruence, the expressions (r) (re') /r! having been shown
~
Moreover, if s > 2, then p rs r > p 8 f or r > 2 and hence
to be integers.
all except the first two terms of the expansion are congruent to
for the
modulus p s so that

is

But

+ kp
+

8-1

that fix')

if

x'

kp 8- 1 )

fix'

= fix') + kp - f'ix')imod p
satisfy fix) = 0(mod p
this congruence
)

),

by p s and

kp 8 xf'ix') must be divisible


that fix')
chosen to satisfy the congruence fix')

know

to the congruence

When

tp
t

-1
,

to

is

and therefore the

kf'ix')

common

0(mod

kp s

-l

last

therefore k

f'ix

shows

must be

0(mod p 8 ).

We

congruence can be reduced

p).

and p is 1, the congruence


has exactly one solution k = /ci(mod p). This
s_1
(mod p s ) of fix) =
value of k yields exactly one solution x = x'
A)ip
kf'ix')

the greatest

= (mod

divisor of fix')

p)

0(mod p 8 ).

When
divide

t,

the greatest

common

the solution x

divisor of fix')

= a/ (mod p ~
= 0(mod p
8

and p

of fix)

But

is p,

and p does not

0(mod p ~
s

does not

p does divide t, fix') is a


multiple of p s and when k has the values 0,1,
p 1, each of the
8
8- 1
s
is a distinct solution modulo p of fix) = 0(mod p ).
p integers x' + kp
We have therefore proved:
'
+a and a/ satisfies
Theorem 5-13. If fix) = a x n + aix 1 +
s_1
and (1) if ifix'),p) = 1, there is
the congruence /(a?) = 0(mod p
)
exactly one value of k such that x = x' -\- &p s_1 (mod p s ) is a solution of
8
8
/(re) = 0(mod p ), but (2) if ifix'),p) = p, no solution of fix) = 0(mod p )
s
can be derived from x' unless x' itself satisfies fix) = 0(mod p ), in which
s
case x' + /cp s_1 yields exactly p incongruent solutions modulo p by letting
k have all the values in a complete residue system modulo p.
According to this theorem, to solve fix) = 0(mod p 8 ), we first solve
fx) = 0(mod p) and then determine by means of linear congruences
yield a solution of fix)

).

if

71

THE SOLUTION OF CONGRUENCES


modulo p the solutions,
= 0(mod p 3 ), ....
Example.
2x 2 - 3x -

To
1

Since /(4)

=
19,

if

solve 2x 2

0(mod
t

19)

Sx

and

13ft

0(mod

= O(mod

19 2 ),

first

find the solutions x

Also f'(x)

1.

Hence, we must solve


= 4 (3) (19)

that x

there are any, of f(x)

87

0(mod

308 (mod

4x

19 2 )

3,

19).

4,

),

f(x)

take f(x)

7(mod

19).

and therefore /'(4) = 13.


But k = 3 (mod 19), so

a solution

is

of

the

original

congruence.

Let the student show that x = 235 (mod 19 2 ) is the solution derived
from x = 7 (mod 19).
After showing that x = 3 (mod 4) is the solution of f(x) = 0(mod 4),
apply the Chinese remainder theorem to find the solutions of f(x) =

0(mod 2 2

19 2 ).

EXERCISES
Solve the following congruences.
1. 3a: 2
3.
5.

7.
9.

2x

17a:

+3 =
-

0(mod

72).

= 0(mod 500).
- x + 20a: + 4 = 0(mod 1089).
2a:
- 2a; - 2 = 0(mod 2000).
x x -2x -8x - Q = 0(mod 357).
6a:

a:

20

+ 7a: + 16a: - 2 = 0(mod 45).


- 19a; + 32a: + 34 = 0(mod 75).
- 24a: - 9 s 0(mod 1350).
5a:
2a:
+ - 6a: - 13 = 0(mod 340).
- 5a: 2 - 12s + 6 = 0(mod 1700).

2.

4a: 3

4.

a:

6.

8.

10.

a;

a:

CHAPTER

THE THEOREMS OF FERMAT AND WILSON AND THE


MOBIUS FUNCTION
6-1. Fermat's Theorem.
Pierre de Fermat (1601-1665) was a profound scholar who was not especially attracted to mathematics until a
translation of the work of Diophantus excited his interest.
Once having
embarked on the study of mathematics, he influenced its development in
all the branches known at the time.
With Pascal he originated basic
ideas in the theory of probability, and independent of Descartes he
developed the analytical geometry. He also helped to lay the foundaBut he is renowned for his work in the theory of
tions for the calculus.
numbers. Unfortunately he failed to publish the many theorems he
discovered about the integers, and when he announced his results in
letters to other mathematicians, he usually concealed his methods of

proof.

as early as 500 b.c. that 2 P 2 is divisible by p if p


remained for Fermat in 1640 to state that if p is a prime
~
and (a, p) = 1, then a p l = l(mod p). We do not have his demonstration of this fact, but by 1761 both this theorem and the more general one
stated below had been proved by Euler.
The Chinese also believed that if n is not a prime, 2 n 2 is not divisible
by n. Even Leibnitz (1646-1716) thought this statement to be true.
Not until the latter part of the eighteenth century did mathematicians

The Chinese knew

is

a prime, but

it

The conjecture was finally dissigns of resolving the problem.


proved in 1819 when Sarrus found that 341, which is not a prime, is a
Since then it has been shown that there is an infinite
factor of 2 341 2.*
number of composites n that will divide 2 n 2.
Theorem 6-1. If the integer a is prime to m, a 0(m) = l(mod m).
r 0(M) is
We showed in Chap. 4 that when (a, m) = 1 and r h r 2
a reduced residue system modulo ra, the set ar h ar 2
ar^o) is also a
reduced residue system modulo ra. The integers in the second set are,
Hence,
therefore, in some order congruent to those in the first set.
show

*L. E. Dickson, " History of the Theory of Numbers," Vol.


Lehmer, Am. Math. Monthly, Vol. 43, No. 6, p. 347, 1936.
88

1,

p.

92.

D. H.

THE THEOREMS OF FERMAT AND WILSON

ar 2

rn(mod m)
r 2 (mod m)

ar^m)

n>(m)(mod m)

ari 53

89

Therefore,

(t>(-

m)

r 1r 2

= nr

r^ (m)

r^ (ro)

(mod m)

and

,<Kro)

Corollary

1.

If

Corollary 2.

If

56

Examples.

p
p

l(mod m)

is

a prime and a

is

a prime and a

48
7); 2

l(mod

prime to

is

any
l(mod

p,

av

~l

integer, a p

is

= l(mod p).
= a (mod p).

105).

EXERCISES
1.
2.

7?
3.

4.
5.
6.

for

Find the remainder when 7 48 is divided by 180; when ll 50 is divided by 180.


What do you notice about the least positive residues of the powers of 3 modulo
Is the same fact true of the powers of 2 modulo 7?
Find the remainder when 2 100 is divided by 11 and when 2 105 is divided by 11.
Show that n n 1 is divisible by 7 when n is prime to 7.
Find the solutions of the congruence x A 1 = 0(mod 12).
Prove that n 37 n is divisible by the product of the primes 2, 3, 5, 7, 13, and 37

any

positive n.

7.

Prove that a n

8.

Can you

b ls is divisible

find integers all of

by 133

whose

if

a and

b are

prime to 133.

digits are 9 that are divisible

by 7?

By

other

primes?

Fermafs Theorem
The solution of ax = b (mod m), where
6a^ (w)-1 (mod m).

6-2. Applications of

Theorem
is

6-2.

(a,

m)

1,

According to Fermat's theorem


a <t>(m)

i(

a^ m) b

6(mod m)

mo d m)

Hence,

and therefore x

Theorem

6-3.

greater than

2,

6a^ (w)_1 (mod

m)

is

If f(x)g(x)

~
xp l

x p-i

the solution of ax

l(mod

b (mod m).

where p

is a prime
each of the congruences f(x) = 0(mod p) and g(x) =
0(mod p) has the maximum number of incongruent solutions modulo p
permitted by its degree.
Fermat's theorem shows that the congruence

has exactly p

distinct solutions

0(mod

modulo

p),

(1)

p)

p.

When

>

2, if

we

factor

ELEMENTARY THEORY OF NUMBERS

90
x p-i

modulo p into

tively, the

and

f(x)

g(x) of degrees r

and p

r,

respec-

congruence
f(x)

= 0(mod

p)

(2)

p)

(3)

has no more than r distinct solutions, and


g(x)

has at most p

f(x)g(x)

0(mod

^ 0(mod

r incongruent

p) has exactly p

1 ==

l)(a;P-2

p.

But

since

distinct solutions, neither of the

congruences (2) and (3) can have fewer than


incongruent solutions modulo p.
For example, if p > 2,
X V-1

modulo

solutions
1

maximum number

its

3P-I

l ==

0(mod

of

1)

Hence, the congruence


xP -2

has exactly p
.

_j_

^p-3

-{-

2 incongruent solutions

p)

modulo p and they are

2, 3,

P -i.
If p is a prime greater than 2, each of the congruences
0(mod p) andx^- /2 + 1 = 0(modp) has exactly (p - l)/2
that are incongruent modulo p.

Corollary

x (p-d/2

>

2,

solutions

For p

1.

x p-i

and therefore each


x (p-i)/2 4-

modulo

p.

0(mod

(a^-D/ 2

of the congruences x

p) has exactly (p

l)(x^-' 2

(p ~ 1)/2

1)
1

0(mod

p),

and

l)/2 solutions that are distinct

Furthermore, since
(p

a)^- 1)/2

= (-^-^(mod

p)

p is of the form 4fc + 1 and (p, a) = 1, both a and p a satisfy the


same congruence, but if p is of the form 4k 1, a satisfies one of the
congruences while p a satisfies the other.
Corollary 2. If p is a prime greater than 2 and d divides p 1, the
congruence x d 1 = 0(mod p) has exactly d solutions that are incongruent modulo p.

if

EXERCISES
1.

Write the solution of Sx

modulo 35.
8
2. Find the solutions of x +
x* + 1 = 0(mod 19) and x - 1

20 (mod 35), and reduce

= 0(mod 17) and


= 0(mod 19).

x8

it

to a least positive residue

= 0(mod

17),

and

also of

How many solutions has the congruence x 3 1 = 0(mod 13)? Find them.
Prove that the congruence x 2 + 1 = 0(mod p) in which p is a prime of the form
4n + 1 has two distinct solutions modulo p.
3.

4.

THE THEOREMS OF FERMAT AND WILSON

91

Corresponding to any conditional congruence f(x) =


an 0(mod p), where p is a prime, a ^
a x + ai.x
p
>
0(mod p),n
p, saidf(x) is not a multiple of x x modulo p, there is a
and
in
degree
has the same distinct
than
lower
that
is
congruence
p
congruence.
original
the
as
solutions modulo p

*Theorem

6-4.

n- 1

Using Fermat's theorem, we showed that

xp

has

all

0(mod

distinct solutions permitted

by x p

p)

by the modulus.

Moreover,

we have a remainder whose degree

if

we

than
the
remainder
Q(x)
and
R(x)
are
both
the
quotient
that
we
observe
p,
integral polynomials and that
divide f(x)

x until

f(x)
is

(x p

x)Q(x)

R(x)(mod

an identical congruence. Consequently, every


= 0(mod p) must satisfy

is less

p)
distinct solution of

}{x)

R(x)

and conversely.
Example. 2x 4

0(mod

p)

x 2 l(mod 3), and therex 2 1 = 2x(x z x)


2
1 = 0(mod 3) has the same distinct solutions
fore the congruence x
x = l(mod 3) and x = 2 (mod 3) as the congruence 2x A x 2 1 =
0(mod 3). Although these integers are simple solutions of the second
congruence, they are double solutions of 2# 4 x 2 1 = 0(mod 3).
Notice that if f(x) = 0(mod p) has p distinct solutions modulo p,
R(x) == 0(mod p) is an identical congruence, for it is lower than p in
degree and yet has p incongruent solutions modulo p. Hence, f(x) is a
multiple of x p x modulo p.
Conversely, if f(x) is a multiple of x p
x modulo p, f(x) = 0(mod p) has p distinct solutions modulo p. Thus
we have:
Corollary.
The congruence f(x) = 0(mod p) with p a prime has p
distinct solutions modulo p if and only if fix) is a multiple of x p x

modulo p.
*Theorem
a n = 0(mod
gruence b Q x n

The

6-5.

p) with a
n~ l

+ bix

congruence

0(mod

a xn

and p a prime

p)

f(x)

bn

0(mod

is

p) in

a\x n

~x

equivalent to a con-

which

l(mod

p).

Let x satisfy the congruence


a x

and multiply
x Q a Qx n

+ Xodtf"- +
1

Obviously, x f(x)
(x Q , p)

by

f(x)

1.

s=

l(mod

p)

Xo so that

0(mod

x an

p)

is

xn

bix n

equivalent to fix)

6 n (mod p)

0(mod

p),

for

ELEMENTARY THEORY OF NUMBERS

92

Theorem 6-6. The congruence /(V) = a Q x + a-^x " +


0(mod p) with p a prime, a f 0(mod p), and n < p has
rl

71

'

"

exactly n

modulo p if and only if the remainder R{x) obtained


upon dividing x p x by f(x) modulo p is identically congruent to zero
for the modulus p.
Dividing x p x by f(x) modulo p, suppose that we find the identical
distinct solutions

congruence

xp

f(x)Q(x)

R(x)(mod

p)

which R(x) is an integral polynomial of degree less than n. But then


every solution of f(x) = 0(mod p) must satisfy R(x) = 0(mod p). Consequently, if f(x) = 0(mod p) has n distinct solutions modulo p, R(x) is
identically congruent to zero modulo p.
If, conversely, R(x) is identically congruent to zero for the modulus p,
the congruence
in

xp
is

identical

f(x)Q(x) (mod p)

and from Theorem 6-3 we


modulo p.

= 0(mod

infer that f(x)

p) has

exactly n distinct solutions


6-3.

Theorem

Wilson's

Theorem

6-7.

If

Since the integers

is

a positive prime, (p
2,

1,

+1=

1)!

modulo p constitute the solutions of the congruence x v


-1
there are exactly p 1 linear factors modulo p of o^

x p-i
is

i)( x

an identical congruence.

It

2)

(z

p).

l(mod

by x

p),

Hence,

1.

l)(mod

therefore, satisfied

is,

0(mod

of a reduced residue system

p)

= 0(mod

p)

with the result that

-1 =
If

it is

follows that (p 1)!


evident that the theorem holds.
is

odd,

it

Corollary.

sum

1, 2,

Because

If

is

l)!(mod p)
1

= 0(mod

a positive prime and r

1,

p),

2,

of all possible products of distinct integers selected

the set

(_i)P-i(p

1)

~
xp l

modulo

1 is

1 is

p, the coefficients of like

powers

exception of the coefficient of x p


2,

except for

1+2+

of integers selected

l)(x

powers of x

nomials are in the same residue class modulo

when p >
sum

rata

if

p =

2,

2, the
time from

a multiple of p.

identically congruent to (#

cients of all the positive

and

p.

2)

in these

(#

two poly-

Therefore, the coeffi-

of x occurring in the

are congruent to

product with the

modulo

p.

But

~
the coefficient of x p 2 in this product is the
~
the coefficient of x p z is the sum of products

its sign,

two

at a time in all possible

ways without

repetition

THE THEOREMS OF FERMAT AND WILSON


from

1,

X P-r-i

2,

for r

2,

1,

Likewise, except for sign, the coefficient of

1.
.

is

2,

a time from the same

selected r at

93

sum

the

of products of integers

All these

set.

sums

are, therefore,

Equating the absolute terms would, of course, give

multiples of p.

Wilson's theorem.

Theorem

6-8.

If (n

Suppose that n

>

1 is

are factors of (n

Hence, n

<

0(mod

n),

then n

is

a prime.

a composite and that

(n

Then n = n\n 2 where

1)!

1)!

<

n2

rii,

n,

0(mod

and consequently both

But neither

1)!.

n)

can divide

of these integers

a prime.
Theoretically Wilson's theorem and

and n 2

ri\

1.

is

when n

prime, but

that the test

is

large, the

amount

converse afford a test for a

its

of calculating involved is so great

entirely impracticable.

is

EXERCISES
Use Wilson's theorem to show that 23 is a prime.
Show that, for p > 5, (p 1) + 1 has a prime factor different from the prime p.
3. If p is a prime of the form 4.n + 1, prove that (2n)! is a solution of the congruence x 2 = l(mod p).
4. If p is a prime of the form 4n 1, show that (2n 1)! is a solution of the congruence x 2 = l(mod p).
p_1 is
5. If p is a prime, prove that each of the coefficients of the expansion of (1 z)
one greater than some multiple of p.
k p are both complete residue systems for
6. If r\, r 2
r p and h\, k 2
r p k p form a complete residue system
the modulus p, a prime, can rjci, r 2 k 2
modulo p?
r p _i is any reduced residue system modulo p, a prime,
7. Show that if ri, r 2
1.

2.

p-1

1 rt

= l(mod

p).

i=l
r p _i is a reduced residue system modulo p, an odd prime, then p
any integral rational symmetric function of the n, where i = 1, 2,
p 1, whose degree is less than p 1.
9. Develop another proof of Wilson's theorem by making use of the solutions of
x 2 = l(mod p) and ax = l(mod p), where (a, p) = 1 and p is an odd prime.
Notice
that of the integers 1, 2, 3,
p 1 only 1 and p 1 satisfy the first congruence
and that when a is selected from the set 2, 3,
p 2, there is a solution of the
second congruence that is in this very set and is distinct from a.
8.

If

n, r 2

divides

If the p
where i = 1, 2,
r, are
nr
and if m = pi ni p 2 n2
we saj that
pr
if any exponent n > 1
ju(m) =
that m(^) = ( l) r if each w< = 1 and
that p(m) = 1 if each n = 0, which means that /*( + 1) = 1.
When it is
so defined, /x(m) is called the Mobius function.

6-4.

The Mobius

Function.

i}

distinct positive primes

ELEMENTARY THEORY OF NUMBERS

94

*Theorem
Take (a,

The function n(m) is multiplicative.


n
ni
nr
1, and let a = pi p 2
Pr

6-9.

b = qi si q 2 *
powers
of
distinct
into
positive primes.
factorizations
are
the
where
q
=
=
where
where
or
S/,
.
.
r,
.
If any n iy
i
1, 2,
1, 2,
j
,
, t, is
But then /*(a&) = 0.
greater than 1, jn(a)/*(b) = 0.
r
If all rii and s,- are 1, then /*(a) = ( l) and /*(&) = (l 1)*, so that
r+f
r+t
=
(~l)
=
(i-l)
But
M (a)/*(6)
If either a = 1, or a = 1 and & = 1, then ju(a&) = p(a)n(b).
b)

St

mW

*Theorem

6-10.

or

> ii{d) is

according as

greater than or

\m\ is

d\m

equal to
If

1.

m-

1,

J mM

m(1)

1.

rf|i

m=

= for any divisor d of m that


has a factor p* where i = 1, 2,
r, we need consider only the
divisors of pip 2
But these divisors are found by combining
prfactors chosen in all possible ways from these r primes.
Thus we find
If

+pi ni p 2 W2

n
Pr % since p(d)

'

'

,Ci(

Co -M(l)

-1)

-2>

,c 2 (--I) 2

But r Co-KCi(-l)
hence p(di)

n{d 2 )

'

viViVi)

rC r (-l) r

C 2 (-l)

"(Pi)

H{pip 2

++ n(d

'

'

Pr)

+rCr(-l) r = (1-

'

s)

where

0,

di,

d2

1)'
.

0,

and

d s are the

positive divisors of m.

*Theorem

6-11.

If

is

a positive integer,

fi(n)

1.

n=l

The preceding theorem shows that

mWi) + /ift) +
di|l

But

will

ju(l) will

d 2 |2

+ J
dm|m

"W) =

be a divisor of each integer of the set

occur

1,

2,

m, so that

m times in the above sum; 2 will be a divisor of


[1YI

of the

times.

Generally, d will be a divisor

THE THEOREMS OF FERMAT AND WILSON


of

of the integers

-r

-r

times in the sum.

from

through m, and therefore

95

fi(d) will

occur

Hence,

n=

d\n

and
m

=l

^Theorem 6-12 (The Mobius Inversion Formula). If, for m


f(m) is an arithmetic function and if an arithmetic function g(m)

>

0,

is

so

defined that

g(m)

f(d)

d\m

then

f{m)

^ "to (f)

(4)

We shall build up the right-hand member of the equation (4) to be


proved by first observing that as d ranges through all the positive divisors*
According to the hypothesis, it
of m, the integer m/d does likewise.
follows that for each positive divisor m/d of m

a\m/d

and

Kd)g

(j)

mW

/(a)

a|m/d

Hence,

2^
d\m

)?

fe)

M(rf)

d\m

XX

d\m a\m/d

/(a)

a\m/d

M(rf)/(a)

ELEMENTARY THEORY OF NUMBERS

96

Reversing the order of summation, we have

d\m

a\m/d d\m

But to say that a ranges through the positive divisors of m/d while d takes
on the values of the positive divisors of m is the same as saying that a
ranges through the positive divisors of m while d is a positive divisor of
m/a. Consequently,

d\m

a\m

=
But

y(d)

>

unless a

d\m/a

/(a)

m(0

d\m/a

m, so that

d\m

An

6-5.

shown that

if

m>

m =

0,

>

We

Mobius Inversion Formula.

Application of the

4>{d).

have

Consequently,

d\m

</>(ra)

5>3
d\m

d\m

Thus

if

0(m)

ra

7?i
/?l

=
I
(

1,

then

<j>(m)

1,

but

Pi

if

m=
h

H
Pr

ni

pi p 2

"

"

n2

pr

nr
,

then

+
Pr-l??r

PlZ>2

P1P2P3

+(-1)'

PlP2

'

'

)
Pr)

and

^..(i-l^i-i)..

.(1-1)

EXERCISES
1.

Is it necessary for the truth of

functions?

Theorem 6-12 that

/(ra)

and g(m) be arithmetic

THE THEOREMS OF FERMAT AND WILSON


2.

If F(ri)

f] f{d) and no f(d)

is 0,

then/(n)

Prove

this state-

d\n

din

ment by using a method analogous


logarithm of each

d
[] F(n/d)^ K

97

member

to that of Sec. 6-5,

and then prove

it

by taking the

of the given equation.

m
3.

Prove that

for

any positive

integer m,

m
of

V
n=

(- - T-l)
l

together with

v(n)/n

>

Theorem 6-11.1

<

1.

Consider the value

CHAPTER

ON BELONGING TO AN EXPONENT
The

7-1.

X Function.

We

have proved that

for

any integer a prime

to

a 4>(m)

In solving congruences, moreover,


a positive power, smaller than

l(

mo d m)

we have

exhibited

some

cases in which

a particular integer a

<f>(m), of

is

sufficient

modulo m even when a ^ 1. Take, for example, the congruence x 2 ss l(mod 5), which has the solution 4, as well as 1, modulo 5,
and the congruence x z = l(mod 14), with solutions 9, 11, and 1 modulo
to produce

It

14.

is,

therefore, important to ask

whether there

is

a positive integer

and yet such that when any integer prime to m is raised


We shall
to that integral power, the result is congruent to 1 modulo ra.
show that when m takes any form except 2 n for n = 0, 1, or 2, andp n or
2p n for p an odd prime and n > 0, there is such a positive integer. For
example, consider the case where m = 15. Here <f>(m) = 8, and x 8 =
l(mod 15) is, of course, satisfied by all integers prime to 15. But each
one of these integers also satisfies the congruence x A = l(mod 15).
Now take any integer a prime to 2. Then a is odd and has the form
smaller than

2k

-r-

1.

<f>(m)

Hence,
(2k

l)

4fc(fc

1)

or

a2

= l(mod2

3
)

But
(

a 2)2

(l

a 22

a 22

l(mod

2 4)

2t

l(mod

2k)

2 3 s) 2

or

2 4s

+ 2V

so that

In like manner,

if

a
it

follows that

or

a2

"' 1

m l(mod2 A:+1

ON BELONGING TO AN EXPONENT
Hence, we conclude that

>

if

2n ' 2

99

2,

l(mod 2 n )

which means that


*<2)/2

>

Consequently, for n

power

this integral

modulus 2 n

of

an integer smaller than <j>(2 n ) such that


any integer prime to 2 yields the residue 1 for the
2 there

is

we proceed

Accordingly,

= l(mod2 w

name

to give a

to this

number

n
0(2 )/2 as well as to other numbers closely related to <f>(m).
It was R. Carmichael who used the symbol X(ra) to designate the arith-

metic function which E. Lucas had defined as follows:


1.

2.
3.

4.

= 2 n and n = 0, 1, or 2, X(ra) = <f>(m).


= 2 n and n > 2, X(ra) = 0(ra)/2.
= p n p being an odd prime, X(p n ) = <(p n ).
nr the
= 2 npiWl2>2n2
Pr
p where i = 1,
odd primes, then X(m) is the least common

m
If m
li m
If m
If

distinct

X(pi0,

X(Pr

'

4-,

2,

r,

being

multiple of X(2 n ),

n ').

m has the form 2 n for n =

n
or 2p n for
0, 1, or 2, the form p
and p an odd prime, the X function has the same value as the
function, but when m has the factor 2 n with n > 2, or 2 2 and an odd
prime factor, or two factors that are powers of distinct odd primes, the
X function is at most half of the
function.
n
n2
=
When the p^ where i
r, are odd primes, if m = 2 pi ni p 2
1, 2,
nr
=
know,
therefore,
that
1, we
p r and (a, m)

Thus, when

>

<f>

a X(2)
ni
au P
i

But X(m)
X(ra)/X(2

=
=

i( mo d2)
l(mod pi ni )

a multiple of each of the functions X(2 n ), \(pi ni ), and thus


and \(m) /\(pi ni ) are integers. Consequently,

is

n
)

a xC2))x<)/x(2.)

i(

mo d2

a X(p^))X(m)/X( Pi ")

l(

mo d p

TC

and
(

Finally, since 2

n
,

pi ni

pr

nr

a x(m)

..)

are relatively prime in pairs,

mo d m)
for n = 0,
i(

Therefore, if m is not of the form 2


1, or 2, and not of the form
n
n
and p an odd prime, then the X function gives a better
p or 2p f or n >
result than does the
function.
It is on this account often advantageous
to have:
n

cf>

For (a, m) = 1, a Mm) = l(mod m).


Example. Although 0(2800) = 0(2 4 )0(5 2 )0(7) = 960, X(2800) is the
least common multiple of 4, 20, and 6 and is only 60.
Hence, for (a, 2800)

Theorem

1,

a 60

7-1.

(mod 2800).

ELEMENTARY THEORY OF NUMBERS

100

The new formula

is useful in finding the remainder in the division by


power of an integer prime to m whenever the exponent of the
power lies between X(ra) and <f>(m). Thus, to find the remainder when
7 14 is divided by 180, we start with 7 12 = l(mod 180), for X(180) = 12.
Then 7 2 = 49(mod 180), and 7 14 = 49 (mod 180).
7-2.
Belonging to an Exponent Modulo m. Since there is always at
least one positive power of a particular integer a prime to m that is congruent to 1 modulo m, there must be a least positive integer d such that
ad = l(mod ra). We call this integer d the exponent to which a belongs
modulo m, or we say that a belongs to d modulo m. For example, 4 3 =
l(mod 7), while 4 2 = 2 (mod 7), so that 4 belongs to 3 modulo 7. Again,
3 4 = l(mod 5), and there is no smaller positive power of 3 which is congruent to 1 modulo 5.
Hence, 3 belongs to </>(5) modulo 5.
Theorem 7-2. If an integer a, prime to m, belongs to d modulo m, and
k
= l(mod m), then d divides k.
if a
< r < d, then
Suppose that k = qd + r, where

of the

that

ak

(a d ) 3

ar

l(mod m)

a r (mod m)

is

But d

is

the least positive exponent such that a d

l(mod

ra),

and there-

Consequently, d k.
Corollary.
The exponent d to which an integer a, prime to m, belongs
is a divisor of 4>(m) and of X(m).
modulo
This corollary shows that we need try only divisors of X(m) to find the
exponent to which an integer belongs modulo m. For instance, to find
the exponent to which 7 belongs modulo 55, we try only the exponents
fore r

0.

2,

4,

5,

36(mod

10,

and

55), 7

20,

for X(55)

32(mod

55), 7

Thus 7 2 = -6(mod 55), 7 4 =


34(mod 55), and 7 20 = l(mod 55).

20.

10

Hence, 7 belongs to X(55) modulo 55.


In 1844 A. L. Crelle gave a device for finding the exponent to which an
To employ this method, first set up the
integer a belongs modulo m.
m 1 in a row, and under 1 put r h the least positive
integers 1,2,
residue modulo m of the integer a under 2 put the least positive residue
Ti of n + a = 2ri(mod m); under 3 put the least positive residue of
Then the resulting table
r 2 + a = r<t + ri(mod m)
.

r2

r3

r4

gives in order in the second

...
...

m-

row the residues

r h 2ri, 3fi,

(m

r m -i

of

l)ri

ON BELONGING TO AN EXPONENT

101

modulo m. According to this scheme the integer r\ congruent to a


modulo m is under 1 the integer congruent to a 2 = r x ri(mod m) is
under t\\ and likewise the integer congruent to a 8 = t ri(mod m) is

under t.
Thus,

m=

if

modulo

7,

7 and

we form the

we wish

12

14

Then

3 (mod 7),

to find the exponent to which 3 belongs

table

and so we move to 3

in the first row.

We

find 2

under 3, and hence 3 2 = 2 (mod 7). Moving to 2 in the first row, we find
Continuing in this manner, we find
6 under it, and have 3 3 = 6 (mod 7).

35

modulo

7.

34
6

4,

powers

5,

and

36

l(mod

The

7).

integer

Moreover, the residues of the

of 3 are in order 3, 2, 6, 4, 5,

repeated as the exponent of 3

1,

and

3,

first

it is

therefore, belongs to
six positive integral

evident that this cycle

is

increased beyond 6 through the positive

is

integers.

an integer a prime to m belongs to d modulo m, the least positive


a d of a taken in order constitute the
residues of the powers a, a 2 a 3
These residues are distinct modulo m, for if
period of a modulo m.
~ =
l(mod m). But since s and t
a s = a* (mod m) with s > t, then a s
d, the difference s t is less than d and
have only the values 1,2,
cannot be divisible by d. Hence, we have proved
Theorem 7-3. If an integer a belongs to d modulo m, the integers a,
a d are distinct modulo m.
a2 a3
When (a, m) = 1, s > 0, and a s = b (mod m), then b is said to be a
power residue of a modulo m. Thus Theorem 7-3 shows that if a belongs
to d modulo m, the first d power residues of a modulo m are incongruent
modulo m. Clearly, they constitute the power residues of a modulo m.
We say, then, that there are exactly d incongruent integers that are power
a
residues of a modulo m, omitting modulo m" after "incongruent integers/'
for there can be no confusion about the required modulus.
If

EXERCISES
Find the exponents to which 5 and 7 belong modulo 11.
Find the remainder when 7 182 is divided by 675.
3. Prove that if a and b are prime to 1729, then a 36 6 36 is divisible by 1729.
4. If p is a prime, (a, p) = 1, and a d = 6 d (mod p), where d is the least positive
exponent for which the congruence is true, then d is a divisor of p 1.
5. If a belongs to d modulo p an odd prime, and if d is even, then a d/2 = 1 (mod p).
6. If p is an odd prime, and if a k = l(mod p), where k is the least positive
integer for which the congruence is true, then 2k is the exponent to which a belongs
1.

2.

modulo

p.

ELEMENTARY THEORY OF NUMBERS

102

a, where
< a < p 2, belongs to the exponent 3
modulo p.
belongs
to
6
p,
8. If the integer a belongs to d modulo p, a prime, show that the product of all the
distinct residues of the powers of a is congruent to 1 or 1 according as d is odd or even.
K(m) ~ (mod m) is a solution of ax = b (mod m) if
9. Show that x = ba
(a, m) = 1.

7.

Prove that

modulo

the integer

if

a prime, then a

Compare the fact that the powers of 2 will generate all the solutions of x 4
= l(mod 5) with the corresponding property of the root i of the equation x 4 1 = 0.
What do you notice about the other solutions?
10.

Theorem

7-4.

If

an integer a prime to p belongs to d modulo

prime,

there are exactly

modulo

p.

When p =

p,

incongruent integers that belong to d

<f>(d)

2, d has only the value 1 and then the


modulo 2.
When p is an odd prime, consider the congruence

xd

l(mod

integer

belongs to

p)

Then each integer

and suppose that the integer a belongs to d modulo p.


of the set
a,
is

prime to p and

satisfies

a2 az
,

ad

the congruence, for

(a 8 )*

(a d ) s

l(mod

p)

According to Theorem 7-3, furthermore, no two of these integers are conConsequently, these powers of a give all the solutions
p.
of x d = 1 (mod p) for the modulus is a prime and there are, therefore, no
more than d solutions. Hence, any integer that belongs to d is congruent
modulo p to an integer of the set a, a 2 ... a d and none of these integers
belongs to an exponent greater than d.
However, if (s, d) = 1, a s belongs to d modulo p, for if we assume that
a 8 belongs to k < d,
gruent modulo

(a 8 ) k ss

l(mod

p)

== l( mo(l

p)

and
a sk

But

since a belongs to d

than

On

modulo

p,

the other hand,

if (s,

= n ^

d)

and a 8 does not belong to d modulo


Since there are
of the

d modulo

p.

so that s

1,

(a 8 ) do ss a Sod 3=

<j>(d)

Hence, d

sk.

k,

and k

is

not

less

d.

l(mod
d

p, for

<f>{d)
,

1, 2,

is less

ns

= nd

then

p)

positive integers less than d

powers a 8 where

d,

than

d.

and prime to

d,

exactly

belong to the exponent

ON BELONGING TO AN EXPONENT

103

d is a divisor of p 1 and an integer a belongs to d


modulo p, a prime, the solutions of x d = l(mod p) are congruent to
2
a, a
... a d modulo p.
Corollary

If

1.

d is a divisor of p 1 and an integer a belongs to d


modulo p, a prime, then a s belongs to d modulo p if and only if the exponent s is prime to d.
If d is a divisor of p 1 and an integer a belongs to d
Corollary 3.
modulo p, a prime, then a s where (s, d) = n ^ 1, belongs to the exponent
Corollary

If

2.

d/n modulo p.
To prove Corollary 3, notice that if p = 2, d can be only
In the case of an odd prime, if d = d n, we saw that

Now

(a s ) d ==

l(mod

p)

l(mod

p)

<

with

<

Then d

do.

follows that do

Theorem

7-5.

This

t.

and a s belongs to

do

if s

impossible

modulo

When

But

st.

is

(s,

then

s n,

when

<

(s

is

odd.

(ab)
if

1, if

(a') '(&')'

modulo m,

a6 belongs to k

st

and k

<

ks, so

kt,

so that s

it

do,

a belongs to

and

s,

belongs to

so that

l(mod m)

l(mod m)

k.

kt

Since

b ks

l(mod m)

In like manner,

that t\k.
(ab)

Moreover,

st.

(ab) ks

and therefore

and

1,

so that

(ab) k

then k

do)

p.
t)

st

Therefore,

do.

modulo m, then ab belongs to st modulo m.


We know that a s = l(mod m) and = l(mod m),

and

for a

suppose that
(a s Y

But

1,

(s,

kt

l(mod m)

1, it

follows that

st

and

<

fc.

Consequently, k = st.
Theorem 7-6 (H. G. Erlerus, 1841). When pi and p 2 are odd primes,
if m = ai(mod pi) and m = a 2 (mod p 2 ), and if in addition ai belongs to
di

modulo

common
Since

pi

and a 2 belongs

to d 2

modulo p 2 then
,

multiple of d\ and d 2 for the modulus pip 2

m =
dl

l(mod

pi)

m<* 2

l(mod p 2),

(m dl) L/di

l(mod

(m d *) L/d2

l(mod p 2)

and

multiple of di and d 2 then


,

pi)

and

if

belongs to the least

is

the least

common

ELEMENTARY THEORY OF NUMBERS

104
Therefore,

mL =
But

if

m belongs to

modulo

l(mod

P1P2)

P1P2, the last

congruence implies that k

L.

Again, from

m =

l(mod

P1P2)

m =

l(mod

pi)

we

infer that
k

1,

k, d 2
k, and L
k.
Hence, k = L.
Examples. Because 3 belongs to 5 modulo 11 and 10 belongs to 2 for
the same modulus, and since the exponents 5 and 2 are relatively prime,
it is evident from Theorem 7-5 that 30, and hence 8, belongs to the exponent 10 modulo 11.
Again, 7 belongs to 10 for the modulus 11, and 5 belongs to 4 modulo 13.
Thus, according to Theorem 7-6, the integer 18 belongs to 20 modulo 143.

Therefore, di

EXERCISES
1. Find an integer that belongs to 2 modulo 19 and one that belongs to 3 modulo 19.
Using these results, find an integer that belongs to 6 modulo 19.
2. Set up the least positive residues of the powers of 2, 3, and 6 modulo 17.
3. Find all the integers that belong to 16 modulo 17.
10
= l(mod 31).
4. Solve the congruences x 3 = l(mod 7) and x
5. Show that 2 belongs to 12 modulo 13, and thus find the exponent to which 8
belongs modulo 13. Do any other integers belong to this exponent modulo 13?
Then determine
6. Find the integer to which 7 belongs modulo 5 and modulo 11.
the integer to which 7 belongs modulo 55.
n
7. When p is a prime, if a and b are prime to p, and if a = b (mod p ), show that
pr
pr
n+r
n+1
p
=
=
induction
and
hence
by
that
a
6
(mod
(mod
6
a?
).
),
p
p
8. When the modulus m is composite, prove theorems analogous to Corollaries 2 and

3 of

Theorem
If pi

9.

7-4.

and p 2

is

an odd prime, does Theorem 7-6 hold?

Generalize the

theorem.

7-3.

Another Test for a Prime. If we can find one integer a prime to


m and satisfying the condition

the integer

am
is it

true that

6
6, and so a
6 l(mod
2

21

is

m is a prime?

~l

l(mod m)

This question

is

easily answered, for X (21)

l(mod 21) for all integers a that are prime to 21. Thus
2
Hence, 8 20 = l(mod21), and yet
21), and 8 = l(mod 21).

not a prime.

Is it

even true that

m is a

prime

a m-i

if,

i(

for all a that are

prime to m,

mo d m)

Again we can answer negatively by showing a case

in

which the hypothesis

ON BELONGING TO AN EXPONENT
but where m is a composite.
3(11) (17) satisfies the congruence

Any

is fulfilled

a 80

because X(561)

80.

105

integer a prime to 561

(mod 561)

Consequently,
a 56o

i(

mo d

561)

Thus the exact converse

of Fermat's theorem is not true.


important test for a prime can, nevertheless, be derived from these
The following theorem was first proved by Lucas* in 1876, and
ideas.
from it powerful methods for deciding the primality of integers having
certain forms have been developed
Theorem 7-7. If an integer a is prime to an integer m greater than 1,
~
and if a m l = l(mod m) although there is no positive integer k less than
m 1 and such that a k = l(mod m), then m is a prime.

An

Assuming that

But 0(m)

m is

< m

m>
1

1 is

composite, since

because

(a,

m)

m has a factor between

1,

and m.

Therefore,

a prime.

Actually, by virtue of Theorem 7-2, in applying this test for a prime we


need evaluate only those powers a k for which k is a divisor of m 1.
Example. To test 47 for a prime, we can make use of the fact that 2
belongs to 23 and 46 belongs to 2 modulo 47 and determine by Theorem
7-5 that 2 46 = 45 (mod 47) belongs to 23 2 = 46 for the modulus 47.
Or we may reason that since the divisors of 46 are only 1, 2, 23, and 46,
and because 45 23 = (47 - 2) 23 = (-2) 23 = -l(mod 47), so that 45 does
not belong to 1, 2, or 23, then the integer 45 belongs to 46 modulo 47.
Hence, by virtue of Theorem 7-7, 47 is a prime.
7-4. Primitive Roots.
Is there a positive integer k smaller than X(m)
and satisfying the condition that, for any integer a prime to m, a k =
l(mod m)? The answer has been completely determined because Gauss
showed that exactly <(</>(m)) integers belong to </>(m) if m is 2 n with
n = 0, 1, or 2, or if m is p n or 2p n where n > and p is an odd prime, and
R. Carmichael showed that for all other moduli there is at least one integer
that belongs to X(m).
Consequently, there is no positive integer k
smaller than X(m) and such that, for all integers prime to m, a k =
l(mod m). We shall proceed to develop these ideas.
We call an integer that belongs to 4>{m) modulo m a primitive root of m
or a primitive root modulo m.
It is evident that 1 is a primitive root of 1
and 2 and that 3 is a primitive root of 2 2
There are no other primitive

roots of these moduli.


*

E. Lucas,

Am.

J. Math., Vol.

1,

p. 301, 1878.

ELEMENTARY THEORY OF NUMBERS

106

There are exactly 0(p 1) incongruent integers that


modulo p, an odd prime.
Of course when d is a divisor of p 1, as far as we have proved, no
integer need belong to d modulo p, but we have shown that if one integer
does belong to d for the modulus p, exactly <f>(d) incongruent integers

Theorem

7-8.

are primitive roots

modulo p belong
integers from

to

Therefore,

d.

through p

if

we

represent the

let \p{d)

number

of

that belong to d modulo p,

m)

<

0(d)

Besides, each integer from 1 through p that is prime to p belongs to one


and only one exponent for the modulus p, and this exponent must be a
divisor of

It is

1.

0(<
where the

with

di,

But we have

1.

4>(di)

thus evident that

0(d 2 )

1, 2,

also

+
.

r,

Hdr)

= V -

are the distinct positive divisors of

shown that

<f>(d 2 )

= p -

<f>(d r )

Because no yp{d ) can exceed the corresponding 0(d/), if any \p(di) were less
than the corresponding 0((&), these statements could not both be true.
z

Therefore, for

all

i,

f(di)

In particular
cf)(p

1)

0(cfc)

the divisor d is p 1 itself, there are exactly


incongruent integers that belong top 1 modulo p.

when

4>(cf>(p))

p is an odd prime and d is a divisor of p 1, 0(d) of the


through p 1 belong to d modulo p.
Example. We shall find the primitive roots of 17 and the integers
Using Crelle's method, we see
that belong to the divisors of 0(17) = 16.
that for the modulus 17 the powers of 3 give the residues
Corollary.

If

integers from

3, 9, 10, 13, 5, 15, 11, 16, 14, 8, 7, 4, 12, 2, 6, 1

It is clear, then, that the primitive roots of 17

of 3

having exponents prime to 16 are

reduce to

3,

9(mod

33

determined by the powers


35

37

39

3 11

3 13

3 15

modulus
belongs to the exponent 8 modulo 17,

10, 5, 11, 14, 7, 12,

Notice that 3 2

and

3,

17)

respectively, for the

6,

and
17.

for

Moreover, the other integers that belong to 8


(2, 16) = 2 and ^- = 8.
modulo 17 are of the form 3 s where (s, 16) = 2. Hence, s = 6, 10, and
14.
The integers are, therefore, 3 6 3 10 and 3 14 and they reduce to 15,
In like manner we can find the integers that belong
8, and 2 modulo 17.
Thus 3 4 and 3 12 belong to
to 4 modulo 17, for in this case (s, 16) = 4.
There is just one integer that belongs to 2, and it is
4 modulo 17.
3 8 = 16(mod 17).
,

ON BELONGING TO AN EXPONENT

107

EXERCISES
Find all primitive roots of p = 5, 7, 11, and 13.
Prove that the product of all the integers that belong to a particular exponent
d > 2 modulo p, an odd prime, is congruent to 1 modulo p.
341
2 is divisible by 341 even though 341 is not a prime.
3. Show that 2
4. Find by trial composites m other than 561 such that a m_1 = l(mod m) for all
integers prime to m.
1.

2.

7-5. Gauss'

Method

Root Modulo

for Finding a Primitive

p.

To

find

a primitive root of a prime p, first choose any integer a\ prime to p, and


If d\ is not p 1,
find the exponent di to which a\ belongs modulo p.
find the least positive residues of
oi, i

None

modulo

p.

satisfies

the congruence

select

z
,

a\ dx

of these integers is a primitive root of

x dl

Now

ai

l(mod

any positive integer a 2

less

p since each one

p)

than p and not one of the residues

powers of a. Then if a 2 is not a primitive root of p, a 2 belongs to


some d 2 modulo p.
The exponent d 2 cannot be a divisor of d\, for if d\ = kd 2
of the

hd %

l(

mo d

p)

a 2 (mod p) would be a solution of x dl = l(mod p), which is


impossible because the powers of a\ determine all the solutions of this

and

a:

congruence.
If d 2 is a multiple of d h but not p 1, we have found an integer that
belongs to an exponent modulo p that is greater than d\.

d 2 ) = I, then a x a 2 belongs to d\d 2 modulo p.


lib = (di, d 2 ) and b is neither 1 nor di, factor b into powers of distinct
nr
Then separate b into two relaprimes so that b = pi ni p 2 n
pr
tively prime factors bi and b 2 by taking pi ni as a factor of b i or b 2 according
If the power of Pi is the same
as di or d 2 contains the lower power of p^
in both di and d 2 take pi ni as a factor of either bi or b 2
If (di,

Then according

Theorem

belongs to di/bi, and


However, ((di/bi), (d 2 /b 2 )) = 1, for if

to Corollary 3 of

a 2h2 belongs to d 2 /b 2 modulo p.


di = bdoi and d 2 = bd 02 then (d 0h d 02 ) =
and d 2 /b 2 = bid 02 and we know that (b 1} b 2 )
,

for

if

p that
(b 2

1.

Moreover, di/bi
1.

But

(6i,

i)

= bd
= 1 also,
2

i,

the highest power of any prime in b h it is the highest power of


In like manner,
a factor of d\ and thus p does not divide d i.
= 1. Consequently, the product ai bl a 2bi belongs to did 2 /bib 2 =

is

is

d 02 )

7-4, ai bl

modulo
d
and
d\
2

d\d 2 /b,

p,

and

this

exponent

is

the least

common

multiple of

ELEMENTARY THEORY OF NUMBERS

108

Thus under any circumstances we have found an integer that belongs


After setting up the power
to an exponent modulo p larger than d\.
residues of this integer, we continue as before by choosing a positive
integer less than p but not among any of the power residues thus far
determined. After proceeding for a finite number of steps, we must find
an integer that belongs to p 1 modulo p.
Example. To find a primitive root of 41, first find the power residues
These residues of 2, 2 2
2 10 are in order 2, 4, 8,
of 2 modulo 41.
10
=
Since
2
l(mod
the remaining residues
40.
10,
20,
41),
16, 32, 23, 5,
are the negatives of these integers, and 2, therefore, belongs to 20 modulo
.

41.

Because the integer 3 does not occur among the power residues of 2, we
determine the power residues of 3 modulo 41. They are 3, 9, 27, 40, 3,
9, 27, 40. Consequently, 3 belongs to 8 modulo 41.
We know
Since (20, 8) = 4, we use the factors 4 and 1 as &i and b 2
Consequently,
that 2 4 belongs to 5 and 3 belongs to 8 modulo 41.
.

7 (mod 41) belongs to the least

16

is,

therefore, a primitive root of 41.

The power

residues of 7
7,

common

multiple of 5 and 8 and

modulo 41 are

8, 15, 23, 38, 20, 17, 37, 13,

35,

40

22, 31, 12,

2, 14, 16, 30,

5,

of the above integers taken in order.


Roots Modulo p n and 2p n
Theorem 7-9. If p is an odd prime, there are just

and the negatives


7-6. Primitive

gruent primitive roots

modulo p n

n
<f>(<j>(p

))

incon-

Suppose that the integer a is a primitive root modulo p. This statement means, of course, that every integer in the class with a belongs to
We shall show that we can choose
the exponent p 1 for the modulus p.
Specifically,
primitive
root of p n
is
a
class
that
residue
this
in
an integer
.

if

a p-i

we

shall

prove that a

is

shall

mo d

2
)

a primitive root modulo p n but


,

aP- 1

we

= i(

l(mod

p'2

if

prove that k can be so chosen that the integer a

kp

satisfies

the condition
(a

kpY~

l(mod p 2 )

this integer is a primitive root of

and that

First, let

l(modp

).

us suppose that

Then

when a belongs

n
.

to

modulo

p,

av

ON BELONGING TO AN EXPONENT

(a

kp) p

~l

=
=

and consequently
is divisible by p.

a?- 1

ap

(a

+~(p 2

kp)

there

l(mod p

r*

= p n~

l(mod

divides

(fcp^-^mod p 2 )

modulo p 2

if

and only

if

/cp will

ftp)*'-

l(mod p 2 )

kp of p such that

p_1

).

an exponent

4>(p

congruent to

is

It is true that since

to

always a primitive root

is

modulo p but

(a
is,

kp

we, therefore, choose k prime to p, then a

If

not only belong to p

that

~2

(mod p

/cp

p~

l)a p

109

But

congruence

if s

r*

n)

But does

1,

More than
p

1).

that, since

it is

so,

is

belong

a divisor of

necessarily true that

that p 1
has the form p s (p 1) with s = 0, 1, 2,
or
did not exceed n 2, we could raise each member of the
l(mod p n ) to the p n ~ 2 ~ s power and obtain

and

Hence,

if.

1.

r<^ = l(mod p n ).
smaller than 4>(p n )?
If

p)

modulo p

(p

p)

(r,

belongs to

modulo

p, it is clear

pn-2(p-l)

l( m()( J pn)

We shall show, however, that the last congruence cannot be true and
hence that r cannot belong to an exponent less than </>(p n ) modulo p n
To do so, use the fact that
.

r v-i == i(

in the
(r p

-i

form

rp

(1

n -*

~l

cp,

where

mo d
p)

(c,

<p)

+ cp) pn_2 (niod p")


n-2 _ ^
ii
+ p^Cp + ^ ^_

1.

Then

cp )2

+
+

The (m

l)st

term
p

n-2(

of this

n-2

expansion

is

j)

n-2

- m+

1/

m!

obviously a multiple of p n

is

it

n-2

1)

(m

1,

that

is,

(yn-2
^T-=

_m+

j)

if

m>

is

an

integer.

;,n_2

(mod p n )

1)

and

(cp)

and

p
if

(m, p)

But n

m =

fcp'

1,

for

with

1):

p ^' >
>
>
kp
n.
But
fcp*
t + 2.
Each
term
p
after the second of the expansion is, therefore, a multiple of p n
Hence, f or n > 3
(k,
n

p)

the expression will not be a multiple of p" unless p-'2 -'


unless n

-{-

r p-2(p-l)

_j_

pn-l c

mo(J p n)

ELEMENTARY THEORY OF NUMBERS

110

and because

(c,

p)

1,

rp-HP -i) = i(

n =

If

2,

we know

mo d

n
)

that
rp

l(mod p 2 )

i(

whereas
r p( P

Consequently,

Now

-i)

r is a primitive root

2
)

>

modulo p n where n
,

1.

consider the congruence


3>-i(p-i)

Each

mo d

l(mod p n )

==

of the integers
y

yP n_1 (p 1)

y2

congruence, and each of them


incongruent
modulo p n for if
moreover,

satisfies this

prime to

is

They

p.

are,

assuming u

s
>

r v(

mo d

pn)

w, u

1, 2,

that r w_ "

we conclude

n~ 1

(p

1)

l(mod p n ).

This result is
than p
Hence, these </>(p n )
(p 1).
integers are distinct solutions modulo p n of the conditional congruence.
But only integers prime to p can be solutions of this congruence, and since
there are exactly <t>{p n ) integers from 1 through p n that are prime to p, we
have found all the solutions.
Furthermore, the integers that belong to 4>{p n ) modulo p n must be
v,

impossible because u

n~ 1

v is less

among the solutions of the given congruence. By arguing just as we did


Theorem 7-4, we can show that r belongs to <i>{p n ) modulo p n if and
s

in

only

if

s is

prime to p

n~ 1

(p

1).

There

are,

then, exactly

n
<f>(4>(p ))

incongruent integers that are primitive roots modulo p


Example. We have already shown that 3 is a primitive root of 17.
But 3 16 = 171 (mod 289). Accordingly, 3 is a primitive root of 17 2 since
.

3 16

l(mod

Furthermore, the powers of 3 having exponents


complete set of distinct primiThere are exactly 0(272) = 128 of them.
tive roots of 17 2
The theorem shows, moreover, that because 3 16 ^ l(mod 289), 3 is a
289).

prime to 0(17 2 )

(17) (16) constitute the

primitive root of 17 3

17 4

....
EXERCISES

Find all the primitive roots of 5 2 and 5 3


Find the primitive roots of 49. Find also all the integers that belong to the
exponent 6 modulo 49. Find a primitive root of 343.
3. If p is an odd prime, prove that any primitive root of p n is a primitive root of p.
1.

2.

ON BELONGING TO AN EXPONENT
4. Prove that
d modulo p, and
n ~h

if
if

is
is

111

a prime and an integer a prime to p belongs to the exponent


the highest power of p that divides a d \ then a belongs to the
,

modulo p n for n > h.


exponent dp
n
5. If p is an odd prime, prove that the product of two primitive roots modulo p is
not a primitive root modulo p n
n
n
n
n
8
6. If r belongs to <j>(p ) modulo p and (s, <t>(p )) = d ?* 1, does r belong to <f>(p )/d
.

modulo p n ?

Theorem
roots

7-10.

modulo 2p n

Any

There are exactly

cf>(<j>(2p ))

integer that satisfies the congruence

l(mod 2p n )

.<f>(2pn)

necessarily odd, and so a primitive root


~
odd integer a belongs to 4>{2p n ) = p n l (p

of

is

tive root of

n
,

if

2p n must be odd.
n
it
1) modulo 2p
,

pn-i( P -i)

i(

mo d

a p--i(p-D

i(

mo d p n

implies that

But
is

if

an

a primi-

for

and

incongruent primitive

a belonged to d

l(mod 2p n ).

The

n~ 1

n
then since a is odd,
(p 1) modulo p
congruence
is,
of
course,
impossible, for a is
last
for
the primitive roots
We must, therefore, look

<

a
a primitive root of 2p n
of 2p n among the primitive roots of p n
.

2p n )

an odd primitive root of p n it is a primitive root of 2p n for


(pn)
n

and if r belonged to an exponent


1 is divisible by 2 as well as by p
r+
n
n
it would belong to that exponent
smaller than 4>(2p ) modulo 2p
modulo p n
Moreover, if r is an even primitive root of p n the integer r + p n which

But

if r is

is

also a primitive root of

because

it is

in the

same residue

class as r

modulo p n is odd and is of necessity a primitive root of 2p n


We have shown, therefore, that a primitive root of p n is a primitive
root of 2p n if and only if it is an odd integer.
It is evident, furthermore, that two odd primitive roots of p n that are
in the same residue class modulo p n are congruent modulo 2p n
On the
other hand, if two of the <f>(<f>(p n )) odd primitive roots modulo p n selected
one from each of the residue classes modulo p n were congruent modulo
There are, therefore, exactly
2p n they would be congruent modulo p n
.

incongruent primitive roots of 2p n


Example. We have shown that 3 is a primitive root of 17 2
n

(f>(<l>(2p ))

It is also

a primitive root of 2(17 2 ) = 578, for it is odd.


In like manner 3 3 and 3 5 are primitive roots of 578. But 3 7 =
166(mod 289) and is, therefore, an even primitive root of 289. It is not a
primitive root of 578, but the odd number 166 + 289 = 455, which is in
the same class as 166 modulo 289, is a primitive root of 578.
Again, 3 9 =

ELEMENTARY THEORY OF NUMBERS

112

a primitive root of 578, and although 3 11 = 152(mod 289)


is not a primitive root of 578, it yields 152
289 = 441, which is. There
are in all 0(272) = 128 incongruent primitive roots of 578.

49(mod 289)

is

EXERCISES
Find all the primitive roots of 50 and 250.
Find the primitive roots of 98. Determine the integers that belong to the
exponent 3 modulo 98. Find a primitive root of 686.
3. Prove that the congruence x^ 2 ?") = l(mod 2p n ) has exactly 4>{2p n ) solutions
modulo 2p n if p is an odd prime.
4. If r is a primitive root of 2p n p being an odd prime, show that r 8 belongs to
1.

2.

Prove, furthermore, that if (s,(j>(2p n )) = d, then


belongs to <p(2p n )/d modulo 2p n
5. Show that if p is an odd prime, the product of two primitive roots modulo 2p n is
not a primitive root of 2p n
<f>(2p

if

and only

if (s,<j>(2p ))

1.

rs

R. Carmichael called integers that belong to

7-7. Primitive X Roots.

X(m) for the modulus

When m =
2 n-2

modulo

2n

"primitive X roots of

>

where n

for

to be congruent to

if

m.*

the integer 3 always belongs to X(2 n )

2,

3 belonged to a smaller exponent, 3

modulo 2 n

That

2 "" 3

would have

not true is evident


from the following argument: According to the binomial expansion,

(22

I)*-

so that, for

=
n

>

3,

2n

~3

and hence
it is

in this case 3

2*- 4 (2"- 3

2n- 3

2n " 3

Because a primitive root

is

pk

*,

2n - 2

(mod

2")

3,

X(2 3 )

2 and

necessarily a primitive X root,

we have now

a primitive X root for every modulus of the form p n


On this basis R. Carmichael proved by induction that

is

mi =

where the p

2 -i(mod 2 n )

with p a prime.
there is always a primitive X root of m.
tive X root of

1)2 4

is

l(mod 2 n ). When n
2 modulo 2 3

obvious that 3 belongs to

shown that there

this relation

22

i}

ni

pi p2

with

n2

Pk-i

2,

1,

He showed

nk - 1
.

and

that

if

is

a primi-

r 2 is a primitive X root of

are distinct primes, then an

k,

integer r that satisfies both the congruences

si r 2 (mod

ri(mod mi)

and

is

a primitive X root of

suppose that

m =

belongs to

mip k nk

s for

R. Carmichael, Bull

")

To show

that this statement

the modulus m.

r s ss
*

pk

is

true,

Then

l(mod mi)

Am. Math. Soc,

Vol. 16, No. 2, pp. 232-238, 1909-1910.

ON BELONGING TO AN EXPONENT

113

and
rs

But

can be

is

the least

exactly A(m).

is

l(mod p k Uk )

modulo mi and
and \(pk nk ) divide

r belongs to A (mi)

Therefore, both A (mi)


s

m) =

to \{pk nk ) for the


s.

modulus p& n *.

This means that the smallest

common

multiple of A (mi) and \(pk nk ).


This integer
true, moreover, that r X(m) = l(mod m) since

It is

is a primitive A root modulo m.


Carmichael also showed that when r is a primitive A root of m, the
powers of r whose exponents are prime to A(m) give </>(A(m)) incongruent
primitive A roots of m, and the product of these A roots is congruent to
These powers of r do not necessarily yield all the primitive
I modulo m.
A roots of m, but the same powers of another primitive A root will either
repeat in some order the results obtained from r or give </>(A(m)) different
primitive A roots of m distinct from those generated by r.
Although the theory of numbers is a branch of mathematics that we
evaluate on the basis of the profundity of its truths and the variety and
simplicity of its methods rather than on its applicability to practical
problems, yet it is interesting to observe that in 1935 H. P. Lawther
showed how the theory of primitive roots and primitive A roots can be
applied to the problem of splicing telephone cables.*
Example. To find a primitive A root of 21, we first find a primitive
root of 7 and also of 3.
It can be easily verified that 3 belongs to 6
modulo 7 and that 2 belongs to 2 modulo 3. We then find the common
solution of the congruences
x = 3 (mod 7)
x = 2 (mod 3)
(r,

The
If

Therefore, r

1.

solution

is

17 (mod 21), and this integer

we now find the powers

we have a set of
17 5 = 5(mod 21).

0(6)

=2

of 17 that

is

a primitive A root of 21.

have exponents prime to

primitive A roots of 21.

They

A (21)

6,

are 17 and

There are but two incongruent primitive roots of 7, and they are 3 and
When we use the integer 5 with the only primitive root of 3 to form
the set of congruences
x = 5 (mod 7)
x = 2(mod 3)

5.

is x = 5 (mod 21).
But the set of powers, 5 and
two primitive A roots of 21 already found. This situation,
however, does not mean that there are no other primitive A roots of 21,
for the number 2 belongs to 6 modulo 21.
Moreover, 2 and 2 5 =
II (mod 21) form a new set of two primitive A roots of 21.

we

find that the solution

5 5 repeat the
,

H. P. Lawther,

Jr.,

Am. Math. Monthly,

Vol. 42, No. 2, pp. 81-91, 1935.

ELEMENTARY THEORY OF NUMBERS

114

EXERCISES
Prove that

a primitive X root of m, the powers of r having exponents prime


m.
2. Prove that if X(m) > 2, the product of all the incongruent primitive X roots of
congruent to 1 modulo m.
1.

if r is

to X(ra) are primitive X roots of

is

7-8. Integers Belonging to a Divisor of X(2 n )

*Theorem

7-11.

If

>

and

not

d,

divides 2

2,

2n

Modulo
n~ 2

then there are

modulo

exactly d incongruent integers that belong to d

2 n but
,

if

2,

modulo 2\
We have shown that the integer 3 is a primitive X root of 2 n if n > 3.
On this basis we shall show that for the modulus 2 n any integer having
the form 8/c + 3 cannot belong to an exponent smaller than 2 n_2
If
there are just three incongruent integers that belong to d

>

3,

(8/c

3)

2 " -3

(3

8/c)

2 "- 3

2n ~ 3

2 "- - 1
3
2*- 3
(2 0
(3)
~
W 3
2- -1
3
3

3(2

/c)

(2

/c)

- (mod
3

2")

Hence,
(8k

But

since 3

2n " 3

l(mod 2 n ),

2 "- 3

3)

8/c

32

"~ 3

(mod

2")

3 belongs to 2 M

"2

modulo 2 n

if

>

3.

Consequently, in this case there are at least 2 n_2 integers belonging to


X(2 n ) modulo 2 n for, in the expression 8/c
3, k can have the values
n~ 3 2"- 3 thereby
8/c
1
and,
in
k
can
be
2
3,
1, 2, ...
0, 1, 2,

yielding

all

form that are

positive integers of the required

less

than 2\

If n = 3, it is obvious that 3 and 5 belong to X(2 3 ) = 2 modulo 2 3


But besides these two integers the integer 7 = 2 3 1 is a primitive
.

X root of 2 3

modulo 2 3

Consequently, three incongruent integers belong to X(2 3 )

Again, if n >
having the form

3,
8/c

we can prove that

1,

in

which k

2"- 3 (2 3 /c)

is

for the

prime to

modulus 2 n

2,

integers

all

belong to the exponent

2"~ 3 for
,

(8/c

On
(8/c

l)

2 "" 3

the other hand,

I)

2"

-4

=
=
if

l(mod 2

n >

(2

2 "- 3

/c)

2")

4,

2"- 4 (2 3 /c)

2"- 5 (2 4

3
2
1)(2 A0

+
=

(mod

(2

2n_4
A-)

(mod

2 n)

2"" /c(mod 2 n
)
1

Hence, if (/c, 2) = 1 and n > 4, the integers 8k 1 belong to the expoMoreover, in this case values of k that are prime
nent 2 n_3 modulo 2 n
~
2 n_3 in 4>(2 n s ) ways,
can
from
the integers 1,2,3
2
be
chosen
to
.

ON BELONGING TO AN EXPONENT

and thus the form 8k

and 7 belong to

~4

(2V

also 2 4

l)

2n " 4

if

2 n_3 integers from

2r with

l(mod

1 through
not only the integers 9
15 belongs to 2 modulo 2 4

4,

2)

(r,

1,

2n)

must, therefore, belong to an exponent which

is

for this modulus.

we

Similarly,

But

if

(8Jfe

divisor of 2 n

observe, moreover, that

and that 2 4 r

yields 20(2 n_3 )

modulo 2
2 modulo 2 4 but

2" that belong to

We

2 n_3

115

find that, for


2n_s

l)

>

n~a

= 1 + 2 (2
= l(mod2 n

>

s
s

r)

3,

8
(2 r)

2n

~'(mod 2 n )

If,

in addition,

s
(2 r

l)

2 "" s_1

2)

(r,

>

and n

2-- s - 1

s
(2 r)

1,

n ~ s- 2

{2

n- s~ l

l)(2 s r) 2

(2Y)

2n ~ s-1

(niod 2 n )

2 w -V(mod 2 n )

so that in this case 2 s r

belongs to 2 n

~s

modulo 2 n

There are then

n~ s

ways of choosing r prime to 2 so that the integers 2 s r 1 are


Thus at least 2</>(2 n ~ s ) = 2 n ~ s incongruent integers
between 1 and 2 n
belong to 2 n_s modulo 2 n for n > s + 1 > 4.
~
But if n = s + 1 > 4, the integers 2 n
1 belong to 2 modulo 2 n and
n
n
1 belongs to 2 modulo 2
Consequently, for
it is also evident that 2
n > 4, 20(2) + 1=3 incongruent integers belong to 2 modulo 2 n
It is, furthermore, apparent that 1 belongs to 1 modulo 2 n for n > 3.
~
Consequently, if n > 3, we have shown that, of the 2 n 1 integers 1
)

<f>(2

through 2 n that are prime to


2

n~ 2

of

=
=

~
to 2 n 2 modulo 2 n
~
2 n 3 belong to 2"~ 3
~
~
2 n 4 belong to 2 W 4

2n

them belong

n- 3
2</>(2
)
n~ 4
)
2<K2

20(2 n

2,

~s
)

~s

+ 1=3

20(2)
1 belongs to

But

22

23

accounted for

all

Therefore, the

number

the 2

n~ 1

ft

When
to

>
ft

~s

belong to 2

modulo 2 n

2n

~2

2 n ~\

and we have thereby


and prime to 2.

positive integers less than 2 n

each case is exactly the number


belong to the specified exponent modulo 2"

of integers given in

of incongruent integers that

when

belong to 2 n

3.

3,

modulo 2 3

three incongruent integers belong to 2 and one belongs

ELEMENTARY THEORY OF NUMBERS

116

The congruence x 2k

Corollary.

2 k+1 solutions

'2 n

l(mod

<

where

),

<n

2,

n > 2.
Theorem 7-11 shows that the congruence x 2 = l(mod 2 n ), for n > 2,
has 2 2 solutions modulo 2 n since the solutions must be prime to 2 and
2k
belong to the divisors of 2. For a like reason x = l(mod 2 n ), with
2
3
has 1 + 3 + 2 + 2 +
1 < k < n
2,
+ 2 k = 2 k+l solutions
n
modulo 2 if n > 2.
*Theorem 7-12. If d is a divisor of X(2 n ) and n = 0, 1, or 2, there is
exactly one positive integer less than 2 n that belongs to d modulo 2 n
has

if

7-9. Integers Belonging to a Divisor of

(f>(p

Modulo p n

p is an odd prime and d is a divisor of 4>{p n ),


where n > 1, there is an integer that belongs to d modulo p n
n
u where k is
< u < n 1.
If d
a divisor of p 1 and
<f>(p ), d = kp
k
Take an integer a that belongs to k modulo p. Then a = l(mod p).
If a k = l(mod p 2 ), there is an integer r that is congruent to a modulo p
and is such that r k ^ l(mod p 2 ), for

*Theorem

7-13.

If

(a

rap^

a*

Hence,

if

(m, p)

(a

(mp) (mod p 2 )
fc

1,

mp)*

l(mod p 2 )

1.

mp. Then r belongs to k modulo p, and r k =


Keeping in mind that the exponent to which r
+
p)
belongs modulo p n has the factor k, we see that for n > 2 and (w, p) = 1,
Therefore, let r

cp with

3= 1

+ ka - mp +
+ ka ~ mp(mo&

(c,

(r

&),p-

(1

cp)

wpn

and
(r*)^""

~\mod p n )

-l

wcp n (mo& p n )
l(mod p n )

=z

But
(^p--!
Therefore, r belongs to kp

Furthermore,

if

== i(

n~ l

mo d

n
)

modulo p when n
ft modulo p and

>

1.

a belongs to

fc

ss

l(mod p s_1 )

l(mod p s )

but
a*

there

is

an

a(mod

p*),

where

r k ss

for since a*

(a

+ mp

2p
s

s_1

with
k

ss 1

(,

1, 2,

1,

such that

l(mod p s ),
p)

-\-

=
=

1,

ft_1

fca

s_1

mp*~ 1 (mod p s )
+ ka k ~ mp ~ (mod p
l

ON BELONGING TO AN EXPONENT

But an integer

117

prime to p can be so chosen that


ka k

~l

mp

~l

tp s

~x

{mod p s )

for this congruence is equivalent to

ka k
Hence,

+ mp ~
s

{a

Let r
i

1,2,

rap s_1

Then

~l

m=
k

(mod p)

l(mod p s )

ss

belongs to the exponent

/c

for each

p*,

where

s.

In like manner if r k = l(mod p s+1 ), we can find an integer


with (g, p) = 1 such that
(r

gp

gp

l(mod p s+1 )

as

each of the moduli p% where i = 1, 2,


Furthermore,
s, and hence v belongs to k for each of these moduli.
cp s with (c, p) = 1, if (w, p) = 1 and w > s,
since v k = 1
This

v is in

the class with

r for

(v

=
=
^
=

a) WP ---i

but
(^)p

n_s

~s

+ cp wpn ~\mod
+ wcp^^mod p w
s

n
)

l(mod p n )
l(mod p n )

~s

for n > s > 0.


This result
always an integer that belongs to a divisor of 4>(p n )

Therefore, v belongs to kp n
implies that there

(1

is

modulo p n

modulo p n
*Theorem 7-14.
.

If d is a divisor of <f>(p n ), there are exactly <f>(d)


incongruent integers that belong to d modulo p n
We have proved that there is an integer a that belongs to d modulo p n
As a result it is clear that the integers a, a 2 ... a d satisfy
.

Moreover, a
if

(s,

d)

modulo p n

where

1,2,

Therefore,

1.

<j>(d)

Consequently,

l(mod p

n
)

belongs to d modulo p n if and only


of the above powers of a belong to d
.

d,

if \j/(d) is

the

number

of incongruent integers

that belong to d modulo p n \J/(d) > <f>(d).


However, every integer from 1
through p n that is prime to p belongs to just one divisor of 4>{p n ) modulo
,

n
,

and so
f(di)

where the

di,

with

+
i

ffa)

1, 2,

Hdm) = v n~\v -

m, are the divisors of

l)

4>{p

over,
<f>(d 1 )

and hence each

\f/(di)

4>(d 2 )

<f>(di).

<t>(d

m)

= p-\p -

1)

).

More-

ELEMENTARY THEORY OF NUMBERS

118

7-10. Integers Belonging to a Divisor of 4>(2p n ) modulo 2p n


7-15.
There are exactly <f>{d) incongruent integers

*Theorem

2p

belongs to

If r

<t>(2p

modulo

modulo 2p n the incongruent

integers

modulo

that satisfy the congruence


*(2p)

are

modulo 2p n

of (f>(2p n )

2p n that belong to any divisor d

r,

r2,

r*

(2pn)
.

These are

l(mod 2p n )
the integers from

all

through 2p n

that are prime to 2p n


In the manner previously employed we can show
that r s is a primitive root of 2p n if and only if (s, <f>(2p n )) = 1, and that
.

if

4>{2p

(s,

))

1,

rs

belongs to

n
<f>(2p

)/d modulo 2p n

then, always at least one integer r s that belongs to

modulo 2p n
d

n
<j>(2p ))

(s,

But

for as s takes the values

if

ranges over

belongs to

d,

all

<f>(2p

and so does

n
<f>(2p

the integer

<f>(2p ),

is,

n
<j>(2p )/d.

a divisor of 4>(2p n ), modulo 2p n then


,

(5<f)M2 P )/<i

and

divisors of

There

divisor of
n

...

2,

1,

any

&

*(2p)

l(

m0 d

2p

(2pn)

n
)

== l(mod 2p ) and is, therefore, con:r>


modulo 2p n
Consequently, all integers that belong
to d modulo 2p n are congruent modulo 2p n to just one integer of the set
2
r, r
r3
r^ 2pn)
By choosing s so that (s, <t>{2p n )) = <f>(2p n )/d, r s
will belong to d modulo 2p n
But there are exactly cf>(d) integers s in the
n
n
set 1, 2, 3, ...
<j)(2p ) that have with 4>{2p ) the greatest common

the congruence

b satisfies

gruent to a power of

Hence, exactly 4>(d) incongruent integers belong to


)/d.
d modulo 2p n
7-11. Integers Belonging to a Divisor of X(m) Modulo m.
One of the

divisor

<j>(2p

author's students, Bernard Sussman, and the author have developed the
following proof of a
of

method

for finding not only all the primitive X roots

but also

It

has been shown thus far that

all

the integers that belong to any divisor of X(m) modulo

if

m =

n
]

J pj

>,

a primitive X root

a,-

can

common

be determined for each of the moduli pf* and the


congruences

solution of the

set of

= ^(mod p/0
,r
j = 0, 1,
root of m.
We have seen, moreover, that
x

is

a primitive X

solution

generates

by means

of its

powers

v
,

(1)

with

this

common

prime to X(w),

exactly <f>(\(m)) incongruent primitive X roots of m.


If there is a primiX
tive
root of
distinct from those already found, that too will generate

<f>(\(m))

incongruent primitive X roots of

*R. Carmichael, Quart.

none

of

J. Math., Vol. 44, pp. 94-104, 1913.

which

is in

a pre-

ON BELONGING TO AN EXPONENT
ceding

Thus the number

set.

multiple of 0(X(ra)), but

119

of incongruent primitive X roots of

m is

our problem to find this multiple and to


the primitive X roots modulo m.

it is

show how to determine all


Let \l/(d) (mod 2 n ) be the number of incongruent integers that belong to
n
n
Then if we understand that
d, a divisor of X(2 ), for the modulus 2
p = 2, the number of a that can be used in the congruences (1) is
r, is
^(X(2 n ))(mod 2 no ) and the number of aj} where j = 1, 2,
.

<t>(k(pj

nj

))

Consequently, there are

^(X(2"))(mod2 w

<>)

Y[
y-i

cf>(\(pj

0)

each set having a single solution modulo m, and


each of these solutions is a distinct primitive X root modulo m.
But the primitive X roots so determined are not necessarily all that
ni
exist.
Let dij, where i = 1, 2,
,q3; represent the <& divisors of \(pj ).
ni
=
1 divisors dy of the \(pj ), where j
Choose any set of r
0, 1, 2,
nj
r, that contains exactly one divisor of each \(pj ) and such that the least
common multiple of the dy is the number X(m). Then find integers Uj
that belong to the dij modulo pj n >, and find the common solution Y
modulo m of the set of congruences
sets of

congruences

(1),

Y is

s ^(mod

This integer

pfi)

0, 1, 2,

... ,r

a primitive X root modulo m, for

YHm)

i(

mo d

YHm)

l(

mo d m

and that

py

(2)

evident that

it is

w ')

But if F belonged to an exponent u < X(m) modulo m, then F w =


l(mod m) and F w = l(mod Pj ni ), where j = 0, 1, 2,
r.
Thus m
would be divisible by each d ih and hence by their least common multiple,
which is X(m). Therefore, u is not less than X(m), and F belongs to X(m)
modulo m. It is evident also that if there are h3 integers tq that belong
.

to da

modulo

pj

nj
,

there will be J] kq congruences (2) for one choice of


3

=1
r

Consequently, there are exactly

the d^.

\l/(di

) (mod

2 n )

<f>(da)

=1
determined by one choice of the

incon-

gruent primitive X roots of


j
is

0, 1,

r,

having least

obviously a multiple of

common

dy,

multiple X(m), and this

where

number

<f>(\(m)).
r

Each

set of

\l/(d i0 )

(mod 2 n )

\\ 4>(dn) incongruent primitive X roots of


3

=1

ELEMENTARY THEORY OF NUMBERS

120

separates without repetition

an element into subsets

of

of

</>(X(m))

Each such subset is generated by the powers, with exponents


prime to X(ra), of any member of the subset, for if gi and g 2 are primitive
X roots of m determined by one selection of the d and if g 2 ^ <7i (mod m),
where t is prime to X(ra) and
< t < X(m), and if
integers.

i3

gi

where

Si

and

s2

Sl

gi

(mod m)

s<l

are prime to X(ra), then


g-f*

S2t

g2

(mod m)

But because the powers of g 2 repeat the


by g 2 for a certain t, say ti,
S2

original 4>(\(m)) roots generated

1*1

g2

**i

g 2 (mod

This conclusion implies that our assumption


be exactly

m)

is false.

There

will,

there-

fore,

*(<fco)(mod2-) II *(*/)

0(X(m))

such sets developed from each of g distinct choices of r + 1 divisors di3


where i = 1, 2,
r, having the least common
.
.
q3 j = 1, 2,
multiple X(m). No primitive X root of m generated by the powers of a
primitive X root (3 that has been determined by one choice di l3 of the di3
can be found among the primitive X roots of m determined by a distinct
,

and dij differ by at least one divisor


corresponding to a X function of a power of a particular prime. Further-

set of divisors di 2 j, for the sets dij

more, assuming that d^h is distinct from di2h and that /3 belongs to d^h
modulo ph nh and 7 belongs to d^n modulo ph nh let us suppose that (3 V =
7 (mod m) with v and w prime to X(m). Then /3 U = 7 w (mod p^**). But
,

i>

and

w are prime to X(ph nh and hence to the divisors of \(ph nh


)

(pv)*i x *

d
((3

hh) v

l(mod

p^

However,

nA
)

Hence,

7 >)<V

= l(mod prt

wd^.

Therefore, d^h divides d^.

and thus

d,-,*

d it h divides
If

divides

d^h,

and

finally d^h

there are q sets of divisors

dij,

d;^,

which

In like manner,

contrary to our assumption.

is

the primitive X roots of

m determined by

them are, therefore, distinct modulo m.


But each integer which belongs to X(m) modulo

m and which is, thereprime to each of the p3 ni belongs to exactly one exponent that is a
Hence, from all possible choices of sets of
divisor of \(p3 nj ) modulo p3 nj
r,
r + 1 positive integers d i3 where i = 1, 2,
q3 j = 0, 1, 2,

fore,

ON BELONGING TO AN EXPONENT

121

which the least common multiple of the da in a set is X(m), we find all
the incongruent primitive X roots modulo m, for if a belongs to X(ra)
for

modulo m, then
a\(pfi)

i(

mo d

py

and hence a belongs to an exponent

dij

0, 1,

modulo pf that divides


1'

\(pj

ni

).

If, however, the least common multiple of these dq were u < X(m), a
would belong to u modulo m. Thus when \f/(X(m)) (mod m) is the number
of incongruent integers that belong to X(m) for the modulus m, we have:

*Theorem

the pj} where j


primes, there are exactly
7-16.

If

0,

1,

2,

r,

are distinct

^(X(m))(modm) = V

i(dU)(mod

2") [] <K<fe)

y=i

9
r

incongruent primitive X roots modulo


is
i

m=

]| p/', where the


i=o

taken over the number q of distinct sets of

1, 2,

qj,

of the X(py nj )

whose

least

common

summation

divisors d#, with

multiple

is

X(m)

and where each of the q sets contains just one divisor of each of the
ni
These primitive X roots of m can be separated into subsets, of
\(pj )>
0(X(m)) integers generated by any member of the subset.
It is, furthermore, obvious that the method with an analogous proof
holds for finding the integers that belong to any divisor of X(m) for the
modulus m.
Examples. At the end of Sec. 7-7 we showed that the primitive roots
of 7 and 3 yield exactly two distinct primitive X roots of 21.
But it is
evident that X(21)

6 can be built up, not only as the least

common

=6

multiple of 0(7)
and <(3) = 2, but also as the least common multiple
of the factors 6 of 0(7) and 1 of 0(3), and again as the least common multiple of the factors 3 of 0(7) and 2 of 0(3), and in no other way from
factors of 0(7)

and

0(3).

Using the fact that 3 and 5 belong to 6 modulo 7 and that


modulo 3, the sets of congruences
x
x

= 3(mod
= l(mod

7)

3)

x
x

=
=

show that 10 and 19 are primitive X roots


of 10 yield 0(X(21))

10 5

The

19(mod

5(mod
l(mod

of 21.

belongs to

7)
3)

Notice that the powers

2 primitive X roots of 21, and they are 10 and

21).

integers 2

and 4 belong to 3 modulo

7,

and 2 belongs

Therefore, the sets of congruences to be solved are

x
x

=
s

2(mod
2(mod

7)

3)

=
=

4(mod
2(mod

7)

3)

to 2

modulo

3.

ELEMENTARY THEORY OF NUMBERS

122

= 2, x = 11 (mod 21), respectively, and again we


(mod 21). There are then but three sets of two
21, and therefore exactly six incongruent integers that

Their solutions are x

observe that 2 5

11

primitive X roots of

belong to 6 modulo 21.

As a second example consider the problem


X roots of 168

least

common

factor of X(7).

of finding the primitive

= 2, and X(7) = 6, we
2,
which X(168) = 6 can be set up as the
multiple of one factor of X(2 3 ), one factor of X(3), and one
These sets of factors are listed in the following table.

must determine

23

all

Since X(2 3 )

7.

possible

ways

X(3)

in

Number
Case

Factors of A(3)

Factors of X(2 3 )

Factors of A (7)

of incongruent

primitive X roots of

168 determined

(1)

(2)

(3)

(4)

(5)

(6)

2
2

2
2
6
2
6

(7)

Case

1.

The

sets of congruences to

x
x
x

x
x
x
x
x
x

The

=
=
=
=
=
=
=
=
=

3 (mod 8)

be satisfied are

=
=
=
=
=
=
=
=
=

x
x
x

2 (mod 3)
3 (mod 7)

5 (mod 8)

x
x
x

2 (mod 3)
3 (mod 7)
7 (mod 8)
2 (mod 3)

x
x
x

3 (mod 7)

3 (mod 8)
2 (mod 3)
5 (mod 7)
5 (mod 8)

2 (mod 3)
5 (mod 7)
7 (mod
2(mod
5 (mod

8)

3)
7)

primitive X roots of 168 so determined are 59, 131, 101,

5,

143,

and 47, respectively, and they occur in sets of 0(6) = 2, which are
5 and 5 5 = 101 (mod 168); 47 and 47 5 = 143 (mod 168); and 59 and
59 5 = 131(mod 168).
Case

The

2.

The congruences

solutions are x

are

x
x
x

= l(mod
= l(mod
= 3(mod

73 and x

x
x
x

8)
3)
7)

73 5

=
=
=

l(mod
l(mod
5(mod

145(mod

8)
3)
7)
168).

ON BELONGING TO AN EXPONENT
Case

3.

The congruences
x
a;

The

solutions are x

Case

4.

ss

l(mod

2 (mod 3)
7)

17 and x

a;

ss

=
=

x
x
x

a:

3=

a;

s=

3=

x
x
x

8)

3(mod

x
a;

are

s
=

The congruences

17 5

3(mod
l(mod
3(mod
5(mod
l(mod
3(mod
7(mod
l(mod
3(mod

The congruences
x
x
x

The

solutions are x

Case

6.

x
x

=
=

7)

a;

s=

8)

a:

3)

x
x

7)

3)

x
x

7)

a;

8)

x
x
x

a;

3e

3=

a;

3s

=
=

3(mod
l(mod
5(mod

3=

5(mod
l(mod
5(mod

=
=
=

7(mod
l(mod
5(mod

157, 61, 31,

8)
3)
7)

8)

3)
7)

8)
3)
7)

and

103, respectively,

115 (mod 168); 31 and 31 5

168).

=
=
=

x
x
x

8)

65 and x

168).

65

l(mod

8)

2 (mod 3)

4(mod

137(mod

7)

168).

are

3(mod
l(mod
4(mod

x
x
x

=
=
=
=
=
=

8)

a;

3e

3)

a;

7)

a;

7(mod
l(mod
4(mod

3(mod
l(mod
2(mod

8)

5(mod
l(mod
2(mod

8)

7(mod
l(mod
2(mod

3)
7)

3)
7)

x
x
x

=
=

5(mod
l(mod
4(mod

8)

3)
7)

8)
3)
7)

8)

3)
7)

modulo 168 are 163, 67, 37, 109, 79, and 151.
= 109(mod 168); 67 and 67 5 = 163(mod
151(mod 168).

solutions

the sets 37 and 37 5

79 6

l(mod

7)

3=

7)

are

2(mod

=
=
=
=

8)

5(mod

89(mod

3)

2 (mod 3)

The congruences
x
x
x

The

=
=
=

l(mod

2 (mod 3)

8)

solutions modulo 168 are 115, 19,


and they form the sets 19 and 19 5
103(mod 168); 61 and 61 5 = 157(mod
5.

3=

=
=

are

The

Case

123

They form
168); 79

and

ELEMENTARY THEORY OF NUMBERS

124

Case

The congruences

7.

x
x
x
x
x

x
x
x
x

The

are

= 3(mod
= 2 (mod
= 2(mod
= 5(mod
= 2(mod
= 2(mod
= 7 (mod
= 2 (mod
= 2 (mod

8)

hh

3 (mod 8)

3)

7)

=
=

2 (mod 3)
4 (mod 7)

8)

3)

s=

7)

5 (mod
2(mod
4(mod

=
= 7 (mod
= 2(mod
= 4 (mod

8)

3)

7)

8)
3)
7)

8)

3)
7)

modulo 168 are 107, 11, 149, 53, 23, and 95, and they form
= 107 (mod 168); 23 and 23 5 = 95(mod 168); 53 and
149(mod 168).

solutions

the sets 11 and ll 5

53 5

EXERCISES
1.

2.
3.

4.
5.

Find
Find
Find
Find
Find

the primitive X roots of 32.


the integers that belong to 4 modulo 32.
the integers that belong to 6 and to 9 modulo 27.

the integers that belong to 6 and to 9 modulo 54.


the primitive X roots of 72.

CHAPTER

INDICES

8-1. Indices for a

When p

Prime Modulus.

we have shown that

primitive root of p,

r,

is

2
.

a prime and r is a
~l
are incongruent

rp

Hence, the power residues of r modulo p are in some order the


p 1 and form a reduced residue system modulo p.
It is evident, then, that any integer n that is prime to p is congruent to
one of the above powers of r for the modulus p. Thus

modulo

p.

integers

1, 2,

n
Gauss

To

called the

exponent

express this idea,

we

s of r

(mod

p)

the index of n modulo p relative to the base r.


= ind r n, but we usually omit the base r

write s

when

there is no danger of confusion as is true in the case of the congruence r indn = ft (mod p).
As thus defined, the index of n modulo p is unique for the modulus

and

1,

if

for

>

if

t,

-*

l(mod

2(mod p

(mod

p)

then
p)

and

It

is,

1)

therefore, convenient to use the least positive exponent s such that

s
Obviously the index of n
r (mod p) as the index of n modulo p.
n
modulo 2 is useless.
Of course, the index of n determined by the primitive root r may be
For
different from that determined by another primitive root of p.
instance, for the modulus 7, ind 3 2 = 2(mod 6) but inds 2 = 4(mod 6).

Theorem

8-1.

If

m=

n(mod

p), their indices relative to

a particular

primitive root of a prime p are the same modulo p 1, and conversely.


The proof follows immediately from the fact that if r is a primitive root
of p, the congruences r indm = r indn (mod p), and ind r m = ind r /t(mod p 1)
imply each other.
Theorem 8-2. If p is a prime, and m and n are prime to p, then

md mn =
r

ind r

m+

ind r

n(mod p

1).

125

ELEMENTARY THEORY OF

126
Since

r indn (mod p)

and

m
it

53 r indm

(mod

p)

follows that

mn =

indm+indn (mod

mn =

indmn (mod

mn =

ind r

p)

But
p)

Therefore,
ind r

Theorem 8-3.
n(mod p

k ind r

If

m+

ind r

a prime and n

is

w(mod p

\)

prime to

is

p,

then ind r n k

1).

If

r indn (mod

nk

r fcindn (mod p)

nk

r indn^ m()CJ p)

ind r n k

k ind r

p)

then
Also

Hence,

n(mod p

1)

It is evident from these laws that the index of an integer plays a role
which is analogous to that played by the logarithm of a number. This
analogy is further emphasized by the following formula for changing the
base of a system of indices from one primitive root of p to another

Theorem
ind r2 n ind ri

Let

ri

8-4.

If

r 2 (mod

and

r2

a prime and n

is

is

prime to

p,

then ind ri n

1).

be distinct primitive roots modulo

Hence, taking indices to the base

Then

p.

rh

ri

ind r2 n ind n

1)

ind ri n

ind r2 n ind ri r 2 (mod p

1)

ind ri n ind ri

r 2 (mod

or

Theorem
ind n

r2

ind r2

8-5.
ri

If ri and r 2 are primitive


l(mod p 1).
ri

ind ri

r2

ind ri r2

ind r2

r x ss

roots of p, a prime,

then

r 2 (mod p)

ind r2

r2

(mod p

1)

and
ind r r 2 ind r2
,

If

we

r\

l(mod p

1)

construct a table of power residues of a primitive root

r of p,

we

127

INDICES

can use indices in the solution of any congruences of the form ax n


b (mod p), with (a, p) = 1, for the theorems given above show that
ind a

+ n ind x =

ind 6(mod p

1)

Therefore,

n ind x
and unless d

satisfies the last


b (mod p).
ax n

(n,

ind 6

divides ind 6

1)

a(mod p

ind

ind

1)

no value of ind x
is no solution of

a,

congruence, and consequently there

But

if

(ind b

ind

a),

there are exactly d incon-

gruent values modulo p 1 of ind x that satisfy n ind x = ind 6


ind a (mod p 1). By letting (p l)/d = mo we can express these

incongruent solutions modulo p


,

ra

2ra

as

(d

l)ra

Therefore,
j.

r i+A;mo(

mo ^

p)

0, 1,

modulo p of the given congruence.


power residues of r, the d values of x are easily

gives exactly d incongruent solutions

By

referring to a table of

determined.

congruence requires that we have


is used as a modulus.
In 1839
Jacobi* constructed such tables of power residues for each prime and
power of a prime less than 1000. Since then men like Goldberg, Wertheim, and Cunningham have contributed to the task of finding the power
residues of the least positive primitive root of every prime less than
M. Kraitchikf has listed a primitive root of each prime less than
10,160.
25,000, but many errors have been found in his tables.
It is quite evident that, instead of defining the index of an integer only
in the case of a prime modulus, we might have used any other modulus m
for which primitive roots exist, for in these cases the residues of the powers
of a primitive root likewise form a reduced residue system modulo m.
However, tables for such indices are less frequently available than are
They are, moreover, not essential
those with modulus p, a prime.
because, as we have shown in Chap. 5, we can reduce the solution of any
congruence to the problem of solving congruences with prime moduli.
Examples. 1. Solve: 5x = 7 (mod 11).
Using the primitive root 2 of 11, we set up the following table of

Of course,

this

method

of solving a

a table of indices for each prime that

indices:
ind

10

10

*L. E. Dickson, ''History of the Theory of Numbers," Vol.


t Ibid., Vol. 1, p.

202.

1,

p. 185.

ELEMENTARY THEORY OF NUMBE

128

Then

ind 5

ind x

ind 7 (mod 10)

ind x

7(mod

ind

a;

3 (mod 10)

= 8(mod

or
10)

and
Therefore,

2.

Solve: 7x*

= 3(mod

ind 7

11)

11).

3 ind x

=
=

ind 3 (mod 10)


8 - 7(mod 10)

ind x

7 (mod 10)

7(mod

3 ind x

Hence,

and
3.

Solve:

3a:

2(mod

ind 3

4 ind x

4 ind x

But

(4,

10)

and 2

2,

11)

11).

3,

Jf

=
=

ind 2 (mod 10)


3 (mod 10)

so that there

is

no solution

of the given

congruence.
4.

Solve: bx 2

3(mod

11).

ind 5

=
=

2 ind x
2 ind x

There are two solutions since

(2,

10)

ind 3 (mod 10)


4 (mod 10)

2 and 2

4.

ind x

2(mod

10)

4(mod

11)

ind x

7(mod

10)

7(mod

11)

and

5.

Solve: 7x

Any

4(mod

121).

solution of this congruence

ind 7

ind x
ind x

Hence, x

the form x

10(mod

10

11),

and

11/c.

7(10

all

must

=
=

satisfy 7x

4 (mod 11).

But

ind 4 (mod 10)


5 (mod 10)

solutions of the original congruence have

Therefore,

11/b)

4(mod

77k

55(mod

7k

5(mod

121)

or

121)

Hence,
11)

129

INDICES

and

ind 7

ind k

ind k

= 7(mod

10)

7(mod

11)

87(mod

ind 5 (mod 10)

so that

and
Therefore,

8-2. Euler's

moduli

Solvability of x n

for the

Criterion

121)

c(mod m).

For

we can determine a convenient

that have primitive roots

for the solvability of a congruence of the

test

= c(mod m) with
= b (mod m) with a

form x n

m) =

1.
Because any binomial congruence ax
prime to m can be reduced to this form by multiplying each member
of the congruence by the solution of ax = l(mod m), the problem is also
(c,

and

solved in the latter case.

Theorem 8-6. If m is any modulus for which there is a primitive root


and (c, m) 1, the congruence x n = c(mod m) has a solution if and only
m)/d =
l(mod ra), where d = (n,4>{m)). Furthermore, when there
if c^
is one solution, there are exactly d solutions modulo m of the given
congruence.

Suppose that r is a primitive root of m and that c = r s (mod m). If


x = c(mod m) has a solution x = r (mod m), it follows that r kn =
s
Since k satisfies this linear conr (mod m) and kn = s(mod 0(m)).
Hence,
gruence, d = (n,<f>(m)) must divide s.
n

fc

Conversely,

<j>(m)/d

s4>(m)/d

<}>(m)\s/d

(mod

Til)

if

c <Km)/d

i(mod m)

r s<t>(m)/d

i(

then

Therefore, scf)(m)/d
result,

is

values modulo

cf>(m)

s(mod

of k.

exactly d incongruent values


solutions of x n

and s/d

is

4>{m)) is satisfied

by

a multiple of

the congruence nk

mo d m)

<t>(m),

an

integer.

As a

just d incongruent

Corresponding to these integers, there are


m of x that form the complete set of

modulo

c(mod m).
If p is a prime and d = (n,p 1), there are (p l)/d
incongruent values modulo p of c, prime to p, such that x n = c(mod p)

Theorem

8-7.

has a solution.
According to Theorem 8-6, the congruence x n = c(mod p) has a solution
~ 1)/d =
if and only if c (p
l(mod p) where d = (n, p 1). But the con~ 1)/d
ip
= l(mod p) has a solution. There are, thus, exactly
gruence x

ELEMENTARY THEORY OF NUMBERS

130

(p \)/d incongruent solutions


are the values of c for which the
It is evident also that

integer for a

same

c is

modulus

if

modulo p
one

first

an integer

c is

and these

of 'this congruence,

solvable.

is

a residue of the nth power of an

m having a primitive root,

and

if

(n,<(m)), the

a residue of the dth power of an integer for that modulus, for

^m)/d == i( mo d

if

the congruence x d

c(mod m) has a solution.


Hence, if d ^ n, a residue of an nth power modulo m is always a residue
It
of a power that is smaller than n and is a divisor of both n and 4>(m).
is thus clear that when p is a prime of the form 5k + 2, 5k + 3, or 5k + 4,
the test for a solution of x 5 = c(mod p) is the same as the test for a soluSince the last congruence is always solvable, an
tion of x = c(mod p).
integer c, prime to p, is always a residue of a fifth power for prime moduli
But if p = 5k + 1, c is a
of the form 5k + 2, 5k + 3, and 5k + 4.
residue of a fifth power modulo p if and only if c k = 1 (mod p)
If p is a
prime of the form 4A; 1, the very test for a residue of a fourth power
modulo p, c 2fc_1 = l(mod p), is the same as that for a second power and
hence in this case the set of residues of fourth powers modulo p is identical
with the set of residues of second powers. If p = 4k + 1, then 4 =
Again, if p is of the form
(4, 4Jc) and no such statement can be made.
3k + 2, every integer not a multiple of 3 is a cubic residue modulo p, but
= l(mod p).
if p is of the form dk + 1, c is a cubic residue if and only ifc
Finally, if the modulus is an odd prime p = 2k + 1, c is a residue of a
second power if and only if c = l(mod p). It is to the study of these
c

fc

fc

quadratic residues that

we turn

in the next chapter.

EXERCISES
2
Prove that the least positive residues of l 2 2 2
(p l) modulo p, where
p is an odd prime, repeat themselves exactly twice.
2. If p is a prime and n is prime to p 1, prove that the integers l n 2 n 3 n
n
Thus show that if p is a prime of
(p l) form a reduced residue system modulo p.
3
the form 3n + 2, the integers l 3 2 3 3 3
(p l) form a reduced residue system

1.

modulo

p.

Prove that the odd prime divisors of x A + 1 are of the form Sn + 1.


4. If p is a prime, determine when the existence of a solution of x 6 = c(mod p)
dependent upon the existence of a solution of x a = c(mod p) with n < 6.
6. Determine whether or not there is a solution and, if so, solve the congruences:
3.

is

a.

x3

b.

x*

6.
if

(a,

7.

a.
b.

= 5(mod
= 7(mod

13)
13)

if r is a primitive root of p, then r^' 1 ^ 2 = l(mod p), and thus that


ind
a) = ind a [(p l)/2] (mod p 1).
1,
p)
(p
Set up a table of indices for the prime 13, and solve the following congruences:

Show

that

5x
5x 2

m 4 (mod
= 6 (mod

13)
13)

INDICES
8.
9.

10.

131

Find the index of 5 for each of the primitive roots of 13.


Find the index of 5 modulo 13 relative to the base 6 by using a table to the base 2.
Use the following table of power residues of the primitive root 5 of 193 to solve

the congruences:
a.
b.
c.

d.

Sx
3x
7x
x3

=
es

2 (mod 193)
191 (mod 193)
157 (mod 193)

=
= 64(mod

193)

ELEMENTARY THEORY OF NUMBERS

132

Table of Indices for the Prime 193


n
ind

192

34

84

4
68

118

104

8
102

168

10
35

11

12

17

152

14
138

16

183

13
141

15

ind

85

136

31

18
10

145

20
69

21
188

22
25

23
162

24

25

186

26
175

27
60

28
172

29
123

30
119

31

82

32
170

33
75

34
65

35
105

36
44

37

ind

38
179

39
33

40
103

41
151

42
30

43
24

44
59

45
169

46
4

47
29

48
28

49
16

50
36

51
115

52

53
77

54
94

55
184

56

17

14

57
37

58
157

59
148

60
153

61

63
80

12

65
142

66
109

67
18

68
99

69

47

62
116

64

ind

54

70
139

71
177

72
78

73
91

74
39

75
86

76
21

77
95

78
67

79
167

80
137

81
144

82
185

83
122

84
64

85
32

86
58

87

88
93

89
147

90

15

91
53

92

38

93
166

94
63

95
146

96
62

97
158

98
50

99
159

100
70

ind

n
ind

n
ind

n
ind

n
ind

n
ind

19

11

101

103
107

104
51

105
189

111

107
154

108
128

109
160

110

134

102
149

106

ind

111
89

112
48

113
41

114
71

115
163

116
191

117
117

118
182

119
135

120
187

121
174

122
81

123
43

124
150

125

ind

126
114

127
13

128
46

129
108

130
176

131

132
143

133
57

134
52

135
61

136
133

137
110

138
88

139
190

140
173

143
132

144
112

145
124

146
125

147
100

148
73

149
155

150
120

ind

ind

20

26

141
113

142

ind

151

155
83

156
101

157
140

159
161

160

154
129

158

126

152
55

153

ind

161

19

171

ind

74

162
178

163
23

164
27

165
76

166
156

167
79

168
98

169
90

170
66

n
ind

171
121

172
92

173
165

174
49

175
106

176
127

177
40

178
181

179
42

180
45

181

182
87

183
131

184
72

185
6

186
8

187
22

188
97

189
164

190
180

ind

56

191

ind

130

192
96

INDICES

133

Table of Indices for the Prime 193


ind

2
25

125

4
46
14

56

{Continued)

37

185

153

8
186

158

15

16

87

49

17
52

18
67

142

20
131

10
18

ind

11

12

90

64

13
127

ind

21

76

22
187

23
163

24

43

25
22

26
110

27
164

28
48

29
47

30
42

ind

31
17

32
85

33
39

34

35

10

36
50

37
57

38
92

39
74

40
177

41
113

42
179

43
123

44
36

45
180

46
128

47
61

48
112

49
174

50
98

51
104

52
134

53
91

54
69

55
152

56
181

57
133

58
86

59
44

60
27

61
135

62
96

63

94

64
84

34

66
170

67
78

68
4

69
20

70
100

71

72
184

73
148

161

75
33

76
165

77
53

78
72

79
167

80
63

83
155

84

85

15

86
75

87
182

88
138

89
111

90
169

n
ind

n
ind

n
ind

n
ind

74

65

19

114

ind

81
122

82

91
73

92
172

93

88

94
54

95
77

96
192

97
188

98
168

99
68

100
147

101
156

102
8

103

104

40

105
35

106
175

107
103

108
129

109
66

110
137

111
106

112
144

113
141

114
126

115
51

116
62

117
117

118
6

119
30

120
150

121
171

122
83

123
29

124
145

125
146

126
151

127
176

128
108

129
154

130
191

131
183

132
143

133
136

134
101

135
119

136
16

137
80

138
14

139
70

140
157

141
13

142
65

143
132

144
81

145
19

146
95

147
89

148
59

149
102

150
124

151
41

152
12

153
60

154
107

155
149

156
166

157
58

158
97

159
99

160
109

161
159

162
23

163
115

164
189

165
173

166
93

167
79

168
9

169
45

170
32

ind

171

160

172
28

173
140

174
121

175
26

176
130

177

71

178
162

179
38

180
190

ind

181
178

182
118

183

184
55

185
82

186

187
120

188
21

189
105

190
139

191
116

192

n
ind

n
ind

n
ind

n
ind

n
ind

n
ind

n
ind

n
ind

n
ind

31

11

24

CHAPTER

QUADRATIC RESIDUES
9-1. The General Quadratic Congruence
Theorem 9-1. A solvable quadratic congruence a y 2 + a y + a 2
0(mod ri), where a ^ 0(mod n), can be reduced to the form x 2
a(mod m) in which (a, m) 1.
By multiplying the modulus and each member of the congruence
x

by 4a

we

?/

dry

a2

0(mod

=
=

n)

obtain the equivalent congruence

4a

y + 4a

aii/

4a a 2

0(mod 4a

n)

which, upon completing the square, becomes

2a y

ai

4a n

z(mod m)

4a a 2

6(mod m)

(2a y

Now let

ai)

4a a 2 (mod 4a n)

and
i

The

original congruence is thereby reduced to the


z

form

b(mod m)

Suppose that (b, m) = d = e k, where e 2 is the largest square contained


Then ek divides z. Therefore, let
in d, and that m = m d, b = bod.
2

ekw(mod m)

and the congruence takes the form


e

k 2w 2

b (mod

kw 2

m)

or

If (k,

m =
)

s,

member

is

of the last

s
6 there is no solution.
no solution unless s = 1.
congruence by k, and let

unless

sequently, there

(mod

= kw (mod m
134

But

(6

If s

ra

1,

1.

Con-

multiply each

QUADRATIC RESIDUES

135

Then
x2

and

if

we

s= b

k(mod

set
b k ss

a(mod

we have attained the required form x 2 = a (mod m ) with (a, ra ) = 1.


The problem of solving any quadratic congruence is, therefore, reduced
to that of solving binomial quadratic congruences

and

linear congruences.

Examples. 1. Solve: x 2 = 6 (mod 15).


Let x = 3z(mod 15). Then 3z 2 = 2(mod 5). Multiplying by 3, which
2
is prime to 5, and letting z = 3w(mod 5), we have w = 6 (mod 5), or
2
=
=
=
4(mod
l(mod
Hence,
w
(mod
2
w
5).
1,
3, 2
5),
5), and finally,
=
6(mod
x
15).
9,
2
2. Solve: x = 24(mod 60).
Since (24, 60) = 12, let x = 6z(mod 60). Then Sz 2 = 2(mod 5). Let
z
z

= 3^ (mod 5), so that w = l(mod 5).


= 3, 2(mod 5), and finally, x = 18, 48,
2

Therefore,
12,

42(mod

w =

1,

4 (mod

5),

60).

EXERCISES
Solve the congruences:
a.

x2

b.

x2

9-2. Quadratic Residues.

=
=

28 (mod 84)

64(mod420)

When

(a,

a (mod m) has a solution, the integer a

m)

is

and the congruence x 2

a quadratic residue modulo m, or

a quadratic residue of m, but if the congruence has no solution, a is a


quadratic nonresidue modulo m, or a quadratic nonresidue of m.
For

example, 2

is

a quadratic residue of 7 because 3

satisfies

x2

2 (mod

7),

is no solution of
but 2 is a quadratic nonresidue modulo
x 2 = 2 (mod 5). Can you find a number whose square gives the remainder 4 when it is divided by 15?
If an integer a is prime to m > 0, its quality of being a quadratic
residue or nonresidue modulo m is called its quadratic character with
respect to m.
Obviously all integers in the class with a modulo m have the
same quadratic character with respect to m.
The problem of determining the quadratic character of a is, therefore,
equivalent to that of testing the solvability of the congruence x 2 =
a (mod m). We have already shown that by factoring m into powers of
primes we can reduce the discussion to the question of solving the congruence x 2 ss a (mod p n ) with p a prime, and finally to the case x 2 =

5 because there

a(mod p). Theorem 5-13 shows that when p is an odd prime, these last
two congruences either are both insolvable or have the same number of
solutions,

and therefore

in this case

only the quadratic residues of p.

it will

be necessary to study in detail

ELEMENTARY THEORY OF NUMBERS

136

In the case of the prime 2, any odd integer is a quadratic residue of 2,


and the even integers are excluded from the discussion. But for f(x) =
x 2 a, f'(x) = 2x, and thus d = (2x',2) is always 2. Hence, Theorem
5-13 shows that either a solution of x 2 = a(mod 2 n_1 ) satisfies x 2 =
a (mod 2 n ) and yields two solutions of the second congruence or no solution
of the second congruence can be developed from the particular solution x'
The problem of determining quadratic residues of powers of
of the first.
the even prime must, therefore, be considered separately from that of
powers of odd primes.
Euler (1707-1783), Lagrange (1736-1813), and Legendre (1752-1833)

were all very much interested in the theory of quadratic residues, but
Gauss (1777-1855) was the one who contributed most to this subject.
The fact is that Gauss was one of the greatest mathematicians of all
It is really no wonder that his name is connected with so much
time.
that has been produced in the theory of numbers, for it was his favorite
He considered it the " queen of mathematics." His "Disstudy.
quisitiones arithmeticae," published in 1801, is the classic of the theory of
numbers and exhibits very well the elegance of form and rigor of presentaSome of the topics to which he made great
tion for which he is noted.
contributions are quadratic forms, biquadratic residues, and the theory of

congruences.
Theorem 9-2

If p is an odd prime, the integer a


(Euler's Criterion).
~
a quadratic residue of p if and only if a (p 1)/2 = l(mod p).
This theorem is included in Theorem 8-6. Nevertheless, we shall give
an independent proof for the case when n = 2.

is

a p -i be a reduced residue system modulo p, and supLet ai, a 2


pose that a is a quadratic nonresidue modulo p. Then each congruence
,

diX

a(mod

p)

1, 2,

has just one solution x = a, (mod p) distinct from a* and prime to


Moreover, no two of these congruences have the same solution, for if
aidj

a (mod p)

a k a,j

a (mod p)

p.

and
i f^

then
di

= a^mod

p)

whereas these integers are distinct modulo p. The integers a are thereby
separated into (p l)/2 pairs, and the product of these pairs implies that
z

i2

'

cip-i

a (p_1)/2 (mod p)

(p

But from Wilson's theorem


aid?

dp-i

1)!

= l(mod

p)

QUADRATIC RESIDUES

137

Therefore,

= -l(modp)
If a is a quadratic residue modulo p and x = r(mod p) is one solution of
ss a(mod p), then x = p r(mod p) is the other solution, for (p r)
(p-i)/2

x2

s= r

(mod

p).

Hence, the congruence


diX 3= a (mod p)

a (mod p) as a solution if and only if a* = r(mod p) or a* = p


r(mod p). The remaining p 3 values of a* set up (p 3)/2 pairs of
distinct integers such that the product of each pair is congruent to a

has x

S3

modulo

p.

Consequently,
0,10,2

,'

r(p

^zia^^modp)

'

r)

But
r(p

r) s=

r = a(mod
2

p)

Therefore,

1)!

33=

a (p-D/2

(p

-tf(p-/J(modp)

and
i(

m odp)

Furthermore, if a (p_1)/2 = l(mod p), a must be a quadratic residue of


(p_1)/2 = l(mod
This condition is, therefore,
p).
p, for if it were not, a
an
odd prime and a is prime to p.
a test for a quadratic residue of p if p is
3
=
is
Examples. Since 5
a quadratic nonresidue modulo
6 (mod 7), 5
3
=
l(mod 7), 2 is a quadratic residue modulo 7.
7, and because 2
It is interesting to observe that if the modulus is a composite m, the
following theorem gives a necessary condition for a quadratic residue of m
Theorem 9-3. If a is a quadratic residue modulo m > 2, then a^ m)/2 =
l(mod m) and a X(w)/2 = l(mod m).
Suppose that r, prime to m, satisfies the congruence x 2 = a(mod m).
Then because <f>(m) is even if m > 2,
:

(r

2)*(m)/2

= a ^^ )/2 (mod

m)

But
r *()

i(

mo d m)

a <^(m)/2

i(

mo d m)

Hence,

It is

obvious that

if

m>

2, <(ra)

may

be replaced by X(m) in the above

proof.

This

result,

however, does not provide a sufficient condition for a

quadratic residue of m, for although

l(mod

48), still

7(mod

(7,

48)

1,

48) has no solution.

\(48)/2

2,

and 7 2

ELEMENTARY THEORY OF NUMBERS

138

Theorem

The quadratic

9-4.

residues of an

odd prime p coincide with

the even powers of any primitive root of p.


Consider the congruence x 2 = a(mod p) with

a primitive root of p, because the powers


residue system modulo p, either

r,

r2,

r 2k (mod p)

r 2k+1 (mod p)

(a,

p)

rp

~l

1.

Then

if r is

form a reduced

or

In the

evident that a

a quadratic residue of p, for


Applying Euler's criterion to the second case, if

first case, it is

a (mod p).

(r

is

2fc+i)(p-i)/2

i(

(r

2
)

mc.dp),

l)/2
But then (2k
the exponent of r must be a multiple of p 1.
would have to be an integer, and that is impossible. Hence, in the second

case a

is

a quadratic nonresidue of

Thus the

p.

set of quadratic residues

even powers of a primitive root of p.


Corollary 1. The odd powers of any primitive root of an odd prime p
coincide with the quadratic nonresidues of an odd prime p.
Corollary 2. There are exactly (p l)/2 incongruent quadratic residues and the same number of incongruent quadratic nonresidues of an
odd prime p.
Corollary 3. The product of two quadratic residues or two quadratic
nonresidues of an odd prime p is a quadratic residue of p, but the product
of a quadratic residue and a quadratic nonresidue of p is a quadratic

of

consists of the

nonresidue of

When

p.

is at hand, it is convenient to use the even


powers of a primitive root of p to set up the quadratic residues of p, but
if a primitive root of p must be computed, the method implied by the
following theorem is usually the more expeditious one for finding quadratic

a table of indices

residues

Theorem

9-5.

The

integers

2
,

22

M
I=

are the incon

gruent quadratic residues of the odd prime p.


Because a 2 = (p a) 2 (mod p), we need use only the integers
.

these integers

no two

of

is

them

to determine the quadratic residues

modulo

p.

2
,

Each

22

of

evidently a quadratic residue of p, but, more than that,


are congruent

modulo
di

p, for

if

a 2 2 (mod p)

then
(ai

a 2 )(i

a 2)

= 0(mod

p)

QUADRATIC RESIDUES

139

and p divides at least one of a\ a 2 and a\


a2
But since both a\ and
a 2 are positive and less than p/2, neither a x a 2 nor a\
a 2 is divisible
by p. These (p l)/2 integers, therefore, yield all the quadratic

residues of p.

Examples.

Because 2

of 13 are 2 2

4,

24

3,

is

26

a primitive root of 13, the quadratic residues

8
12, 2

Using the method of Theorem


42

ee 3, 5 2

12, 6

10(mod

9-5,

9,

2 10

they are

10,
l

and 2 12

1,

22

l(mod

4,

13).

32

9,

13).

EXERCISES
1.

Is 15 a quadratic residue of 17?

Find all quadratic residues of 29 and 31.


3. Prove that the product of the distinct quadratic residues of a prime p = 4n 1
congruent to 1 modulo p, whereas if p = 4n + 1, this product is congruent to 1
2.

is

modulo
4.

p.

If

is

is

a prime, prove that the congruence x G

+ 7x
i

36

= 0(mod

p) has a

solution.
5.

x2

If

a prime of the form 4n

1 is divisible

by

1,

prove that there

always an x such that

is

p.

a quadratic residue of 7, find all solutions of x 2 = 6 (mod 7) for each 6.


a quadratic residue of 7, find all solutions of x 2 = b (mod 7 2 ) for each 6.
8. Determine whether or not there are solutions, and if so, solve the congruences
= 9 (mod 13 2 ) and x 2 = 5 (mod 13 2 ).
9. Prove that if the prime p = 2 n
1, every quadratic nonresidue of p is a primi6. If b is
7.

x2

If b is

tive root

modulo

p.

p,

Make use of Fermat's theorem to show that if a is a quadratic residue of a prime


then a(p-D/2 = l(mod p).
11. If p is a prime greater than 3, prove that the sum of the quadratic residues of p

is

divisible

10.

9-3.
tic

by

p.

The Legendre Symbol.

Legendre was chiefly interested in

ellip-

functions and the theory of numbers, but he also wrote a book on

geometry which was so well received that at the time it rivaled Euclid's
" Elements" in popularity.
In 1830 he published two volumes on the
theory of numbers that organized his own researches and those of his
predecessors in this subject. In this work he partly proved the remarkable law of quadratic reciprocity.
If

is

an odd prime and

according as a

is

(a,

p)

1,

by

letting

(-j = -f-lor

a quadratic residue or a quadratic nonresidue of p,

Legendre introduced a symbol well fitted for expressing the quadratic


character of a with respect to p.
This symbol enables us to express
succinctly some important facts with which we are already familiar.
1.

1.

It is evident that

if

is

an odd prime and

(a,

p)

1,

then

=
J

ELEMENTARY THEORY OF NUMBERS

140
2.

If d\

a 2 (mod p), a\ and a 2 being prime to the odd prime

p,

then

1,

then

(?) - (?)
3.

Euler's criterion shows that

J
4.

a (p 1)/2 (mod

1,

where

is

an odd prime and

(a,

p)

p).

Corollary 3 of

(ai} p)

if

Theorem

1, 2,

9-4 implies that


.

n,

then

if

is

an odd prime and

^\

\^\

(?)
5.

If ai

and a 2 are prime to

p,

) (

expresses the fact that &i and a 2 have the


respect to the odd prime p.

same quadratic character with

Furthermore,

-(?) indicate

as well as

1,

= 1 and

=
J

that ai and a 2 have opposite quadratic characters with

respect to p.
9-4. The Prime Moduli of Which an Integer Is a Quadratic Residue.
Having solved the problem of determining the quadratic residues of a

prime,

we now ask

if

we can

find the

a quadratic residue.

prime moduli of which a given

the integer

is odd, it is, of course, a


quadratic residue of the prime 2 and so the question must be settled only

integer

is

odd primes.
Suppose that a

If

for

Then because

= k
)

b,

^=

with k 2 the largest square in a and b


) (

)>

>

0.

the quadratic character of a with

respect to an odd prime p is determined by the quadratic character of 1


and the positive prime factors of a that occur in it to an odd power. Let

these primes be q h q 2

qn

~ \ v

Then

)\v)\v)

\v)

and therefore our question about the prime moduli of which a


ratic residue

where q

can be answered by studying the symbols


is

is

a quad-

J,

and

an odd prime.

V,

Taking these symbols


for every

prime

p.

in order, it is first of all

evident that

= +1

QUADRATIC RESIDUES

Theorem

the form 4n

An

The

9-6.
1

integer

141

a quadratic residue of

is

and a quadratic nonresidue

of all

all primes of
primes of the form

3.

The congruence x 2 = 1 (mod p) has a solution if and only if ( l) (p-d/2


= l(mod p). If p = 4w + 1, then (p - l)/2 = 2n, but if p = 4n + 3,

Hence, 1 is a quadratic residue


of the first set of primes, and it is a quadratic nonresidue of the second set.
Example. There is no solution of x 2 = l(mod 31), but there are
two solutions of x 2 = l(mod 29), and they are x = 12 and x =
clear that (p

it is

= 2n

l)/2

-12(mod29).
Theorem 9-7 (The Lemma
prime to
q,

2q,

Find the

p.

[(p

The

Take p an odd prime and q


modulo p of the integers
the number of these residues that are

of Gauss).

least positive residues

l)/2]q.

greater than p/2, then

1.

If

is

(-) = (-!)"

integers
q, 2J, 3q,

^q

(1)

p.

Their least positive residues

and incongruent modulo

are prime to p

modulo p

are, therefore, distinct integers of the set


1, 2,

(2)

Let
ai,

(Li,

au

represent the least positive residues greater than p/2 of the integers in

while

(1),

bi,

b2

bv

denote those least positive residues which are

The

(p

less

Then

than p/2.

l)/2.

integers of the set

ai,

a2

au

are prime to p, less than p/2, and are incongruent


these integers are distinct from the bi, for if
bi

a/(mod p)

a,j

1, 2,

v;

modulo

1, 2,

Moreover,

p.

then
bi

However, both
therefore sq
set

1, 2,

+
.

h and

p)

a3 are congruent modulo p to integers of


-

= 0(mod
(p l)/2.

tq

= 0(mod

(1), and
where s and 2 are distinct integers of the
Hence, s + t = 0(mod p). But since both

p),

ELEMENTARY THEORY OF NUMBERS

142

and
by p.

6t

a,-

61, b 2 ,

form a

less than p/2, the sum s + t cannot be divisible


cannot be divisible by p. Consequently, the integers

and

are positive

Thus

set of (p

positive

and

integers

1, 2,

less
.

bv ,

(p

b v (p

616.

ah p

a2

au

l)/2 incongruent integers modulo p all of which are


than p/2. They are, therefore, in some order the

As a

l)/2.

di)(p

a 2)

result,

(p

au )

au

^^

(mod

p)

(mod

p)

and
(-l) u bA

But the

b v aia 2

and the a; are the residues

bi

6162

b v a\a 2

au

'

of the

2q

products in

(1).

Therefore,

g(mod

p)

P- h ^-^(mod
niv
p)
!

and
(-1) U ^-7T^^ (P

By

multiplying by

1) M

~ 1)/2

= ^-o-^!(modp)
[(p

= l) M (mod

p)

and dividing by

f(p-l)/2

l)/2]!,

we have

But

g( p

- 1)/2

(mod

p)

Hence,

according to Euler's criterion.

(j)-(-l)(modp)
but since both

and

l) u have only the values + 1

and

1,

it

follows

that(j) = (-l).

Theorem

9-8.

-[?H

Let (p
q, 2a,

...

If

l)/2

s(?

s.

is

an odd prime and q


V

+
Also

q
)

r2

odd and prime to

then

p,

and

if

(-1)*.

p\

the least positive residues modulo p of

let

be in order n,

is

rs

Then

QUADRATIC RESIDUES

= v

2q

= p

M+"
_P

sq

= p

sq

_P_

rs

Adding these equations and using the


2
[(p - l)/2] = (p - l)/8, we have
p

But these
i

1, 2,

Let

a*

u,

bj

in

1, 2,

l)/2, are the a z

v,

of

where

Theorem

9-7.

pM + A + B

(3)

Theorem 9-7 we also showed that the p a together with the


some order the integers 1, 2,
Hence,
(p l)/2.
?

fey

= pu A

subtracting Eq. (4) from

v2

1
(q

(3),

l)

we

2).

+B

(4)

find

p (M

u)

2A

(5)

u is even; that is,


if both p and q are odd,
Hence, when q is odd and prime to the odd prime

Consequently,

u(mod

(p

Then

B.

p-

By

+r

r2

that

fact

y-i

l__l 9 =
But

fry,

= A and

=i

are in

ri

where k = 1, 2,
where j
and the

integers r k
.

pM +

143

applying Theorem 9-7

M=
p,

by

we have

= (-!)- (-1)"
On

the

hand,

other

if

2,

then

2q
0,

0,

V
(P

l)g/2 l

P
J
since p = 2& +

p-

LP
[

0.

Hence,

0,

and Eq.

1,

p<

= -(2k + l)M(mod
u = w(mod 2)

2)

(5)

shows that

ELEMENTARY THEORY OF NUMBERS

144
Therefore,

by Theorem

9-7,

(_1)-

The

Corollary.

form Sn

when p = Sn

3, (p

then (p 2

1,

l)/8

l)/8

of all

= Sn
2

= Sn Qn
2

(_ 1 )(22)(24)/8 = +lj

()-

all primes of the


primes of the form Sn 3.

a quadratic residue of

is

and a quadratic nonresidue

When p = Sn

Examples

integer 2

(-1)(p D/8

and

2n,

and

1,

but

= +1,
-

(I) -

but

<- 1) (28)(30)/8

-1.

Theorem 9-9 (The Quadratic Reciprocity Law).


-

tinct

odd primes, (

^J

C?) = (-l)^

If

p and q are

dis-

'^.

We shall present a proof of this theorem that is based upon a geometric


demonstration given by F. G. Eisenstein (1823-1852).
y

v^f

^<;

Taking rectangular coordinate axes and a convenient unit, mark


units from
along the x axis to represent the integers 1, 2, ...
(p l)/2, and in like manner along the y axis to represent 1, 2, ...
Then OB = (p - l)/2, and OD = (q - l)/2. Let OA =
(q - l)/2.
p/2 and OC = q/2. We then call all points both of whose coordinates
are integers lattice points.
Within the rectangle OAEC, but not on its
off

boundary, there

The equation

are, therefore,

of the line

Iff
2

OE is py =

parallel to the y axis in the point

integer,

is

the

number

and on or below OE.

lattice points.

qx,

k,

and
)

it

intersects

Therefore,

of lattice points

on x

if

any

line

a positive

is

k above the x axis

However, when k takes the values

1,

2,

...

145

QUADRATIC RESIDUES
(p

i)/2, since (q,p)

lattice points

number

on

1,

kq/p

~ l)/2, we
OEC is

(<7

triangle

not an integer and so there will be no


Consequently, the

of lattice points within the triangle

In like manner by taking py

is

OE and within the rectangle OAEC.

find that the

[?H?] +

OAE

is

qx and the lines y

number

"

t}

for

have shown that \S\

1, 2,

[ViH

Hence, the number of lattice points within the rectangle

We

of lattice points within the

= (-1) M and

that

(^J

OAEC

(-1)*.

is

There-

fore,

d) (,)
and consequently when p and

_<_,,

g are distinct

odd primes,

This famous theorem was discovered at different times by Euler,


He accomfirst one to prove it.

Legendre, and Gauss, but Gauss was the

He
plished this feat in 1796, when he was but eighteen years of age.
appraised the theorem so highly as to call it the "gem of higher arithmetic " and developed six different proofs of it. Among the leading
mathematicians who have also proved the theorem are Cauchy, EisenIndeed, the
stein, Jacobi, Kronecker, Kummer, Liouville, and Zeller.
interest that it has continued to arouse is evidenced by the fact that it was
proved in about fifty ways* during the nineteenth century. More than
that, the number of proofs keeps growing, but, of course, not all of them
are essentially different.

Because

of the

importance of the quadratic reciprocity law, it is worth


it that does not depend upon the geometric
The following proof is a modification of one of Gauss'

while giving a second proof of

meaning

of

proofs:
* P.

Bachmann, " Grundlehren der neueren Zahlentheorie."

ELEMENTARY THEORY OF NUMBERS

146

Taking p and q as odd primes with

M -[
N
we wish

&

(p

than the prime

p.

course,

if

+r+
most s + 1.
=

sp

M + 2V =
no

+p
2p
because p q
p

<

2p.

Assuming that

for

the expression for

sp

at

is

ft

be

<

M whose value

of the series in terms of p,

q,

We

last

<

with

and

s.

at

is

term

of

<

M which

[**-'

most

if

less

Of

1.

]
p,

then

^+

Therefore,

1.

l)/2 the integer


is s,

observe that

both k and g are

integer, for

most

written

(p

q.

can

Iff
an

- =0, and
LPJ
[P

so that kq

ff

/bg/p is

q]
P.

2p

Furthermore, the value of the

pq

Moreover,

s,

p and

L q J

l)/2,

But

g.

-fe]

to prove that

1, 2,

2q

<

l)g

1)g

(P

is

is

at

Dffl

2p

2p

(k

(2

D/2,

is

the last term of

we shall find the number k of this term

Since

1,

Hence,

k< (lVP <k +

and therefore
k

is

number

the

where

term
all

<

of the last

<

(q

-[*>]

term

l)/2.

of the expression for

of this series that has the value s

nonnegative

<

(q

M having the value

It follows then that the

l)/2, the

1 is

number

of

number

s,

of the last

Consequently, for

terms of

M that have the

QUADRATIC RESIDUES

>

p^i - [f

that have the value

M-

2g

B]

(q

Moreover, the number of terms of

is

(p

l)/2

Therefore,

-I^f]

Hi

P.

Oyg
2

([?]

LQ

L 2 J

1
J

["

[^!]+^^

[|]-[f]
N+p 1 q

+ JV =

2p

+
+

ikf

3p

[?])

Hence,

l)/2

147

^^

^^

>

and the quadratic reciprocity law

follows.

Corollary

If at least

1.

one of the primes p and q

of the

is

-(J)--*Ms)-primes
both
and
Corollary

the

If

2.

q are of the

form 4n

3,

-ry

) (

form 4^

1,

then

6)- (!)-
=
Examples.
Since 15

Also

=-)
2.

1.

= 2(mod

^) =

(-1) 8

= +1, and

17),

we factor 2 and have =(

=
= +1, and
(~J

there

is

(-l)tt>U>/8

+L

77

)*

Hence,

a solution of the congruence.

Is 67 a quadratic residue of 89?

Since

67

S -22(mod

Furthermore,

for

15 (mod 17) for a solution.

Test z 2

89

is

of the

-oq-)

89),

= +1,

form 8n

we

for 89

find

is

(^) = (^) (|) (j{).

of the

and (oq)(tt)

form 4n

+1

+ l;(^j=+l

according to Corol-

ELEMENTARY THEORY OF NUMBERS

148

lary

L^J =

Thus

above.

I J = +

1.

Factoring immediately

= +1, and

x2

= 67 (mod 89).
is a solution of x
33 a quadratic residue of 89?

Is

we have

(g)

(|) Qjj

[~
y) =

(3)

= +1.

Consequently, (oq)

above,

Therefore, there
3.

However,

= !

Q0 (|)

(g^j = -1, and, from

Therefore,

33 (mod 89) has no solution.


The quadratic reciprocity law

But

= 1, and

the congruence

s=

problem

also enables us to solve the

previously stated of determining the odd primes of which a given integer


It is apparent that if we wish to
which a composite is a quadratic residue or nonresidue,
the composite must be factored into primes and the conclusions drawn by
is

a quadratic residue or nonresidue.

find the primes of

means

Theorem

of Corollary 3 of

If q is of

+ 1,

the form 4n

5,

then

1,

Hence,

if

of q as well as being odd,


of

q.

and

to be

is

if I

For example,

is

if

l(mod

1,

2)

of

(-) = +1.

quadratic residue of
) is

and one

Thus p

q.

must be an odd quadratic nonresidue

in order that

shall, therefore, consider first

an odd prime

the prime p must satisfy the congruence

and one

if (

is

p must be a quadratic residue

to be 1,7?
q

We

9-4.

the case where the given number

to be

1,

all

4(mod

Hence, p

primes of the form

5)

1,

9(mod

10A;

10); that

1.

On

is,

is

the other hand,

then p must satisfy


x

l(mod

2,

2)

of the congruences

the form

3,

7 (mod 10),

10/c

If the given

and
and 10k +

prime

is

is

3 (mod 5)

a quadratic nonresidue of

all

primes of

7.

of the

form 4n

3,

then l^J

yH

(-i)l*-/i

149

QUADRATIC RESIDUES
and so (^) = (-l)^-

1 )' 2

( Y

In this case

if

(\

is

to be

l(mod4)

and

(^) = +1

= 3(mod4)

and

1^1 = -1

1,

then either

+1,

either

or

If

is

to be

= 3(mod4)

and

(^

and

{-) =

= +1

or

Accordingly,

if

l(mod4)

7 and

+1, then p must

to be

and one

is

l(mod

of the congruences

and one

satisfy

4)

xsl,2, 4(mod
giving

-1

s L

9,

25 (mod 28), or p

the congruence

satisfies

3 (mod 4)

3, 5,

7)

of

6(mod

7)

with the result that p = 3, 19, 27(mod 28). Hence, 7 is a quadratic


residue of all primes of the form 28/c
1, 28/c
3, 28k
9, 28/c
19,
27.
In like manner we find that 7 is a quadratic
28k
25, and 28k
nonresidue of all primes of the form 28k
11, 28k
13, 28k
5, 28k

15, 28fc

17,

and 28k

suppose that the given integer

+L

Then

(|)

a quadratic residue of p,

23.

Now
4n

=
it

(?) (j)

of the

is

form 2q with the prime

(_l)(f-/

(j).

follows that either

= l(mod

8)

and

= 3(mod8)

and

(-]= ~

?J

= +1

Ox'

If

2g

is

to be

ELEMENTARY THEORY OF NUMBERS

150
If either

m l(mod8)

and

m 3(mod

and

(?

or

then 2g

is

When
is

even

or

a quadratic nonresidue of

the given integer

evident that

f^J =

so that

(^J

is

of the

1,

'

fl

p.

But \S\

( j.

P\

The exponent

3 (mod 8).

Hence,

==

(p

will

be

and

(-) =

and

(-) =

-1

= 4n

(_i)(p-d/2

+
+

4p
1

3, it

5)/8

when

is

either

when
p

The

conditions for

5,

7(mod

XP/

to be

8)

are

now

obvious.

Finally, let us suppose that the given integer

primes

(!)

form 2q with the prime

= (-1)^-^

(-1)(p +4 P -5)/8

and only if p

if

8)

and

qi

q2

with q 1

By combining

= 4n
the

first

and

q2

two cases

qi and
by the following statements:
They satisfy x = l(mod 2).

determined by those of which both

is

4s

it is

the product of two odd

3.

Then

i^\ =

clear that the primes

q 2 are quadratic residues are

characterized
1.

2.

They
They

are quadratic residues of

q\.

l(mod 4) and are quadratic residues


satisfy x = 3 (mod 4) and are quadratic nonresidues of q 2
There are also primes p described by the conditions:
1. They satisfy x = l(mod 2).
3.

satisfy x

of q 2

or they

2.
3.

They
They

are quadratic nonresidues of


satisfy x

l(mod

3 (mod 4)

q\.

and are quadratic residues

of q 2 or they
,

and are quadratic nonresidues of q 2


Examples. 1. Find the odd primes of which 14 is a quadratic residue.
If 14 is to be a quadratic residue of the odd prime p, then p must satisfy
two congruences selected in the manner already exhibited from each one

satisfy x

4)

QUADRATIC RESIDUES

151

of the following sets:

a
=

a;

ss 5, 7 (mod 8)

sa 3, 5,

a?

1,

1,

3(mod 8)
2, 4(mod

7)

and

From

the

first set

we

find that

6(mod

7)

1,9, 11, 25, 43,

51(mod

and from

56),

the second, p = 5, 13, 31, 45, 47, 55(mod 56).


2. Find the odd primes of which 35 is a quadratic residue.
(

to be

= (-)(-)> an d both symbols must

+1.

and one

giving p

Hence, p

satisfies

be

+1

or both

for

one of the congruences

= +l(mod

10)

of

1, 3, 9, 19,

25,

27(mod

28)

1,9, 19, 29, 31, 59, 81, 109, 111, 121, 131,

satisfies

one of the congruences

and one

of

3,

5, 11, 13, 15, 17,

with the result that p


127 (mod 140).

7(mod

13,

139(mod

140), or p

10)

23(mod

28)

17, 23, 33, 43, 67, 73, 97,

107, 117, 123,

EXERCISES
1.

Evaluate:

2.

Is there

3.

Find the values of

4.

Find the primes of which 11 is a quadratic residue.


Find the primes of which 6 is a quadratic nonresidue.
Prove that 10 is a quadratic residue of all primes p =

5.
6.

(^), (^), (|), (|)-

a solution of x 2
q for

21 (mod 41)?

which

(A) = +

1.

1, 3, 9,

13, 27, 31, 37,

39 (mod 40).
7.

Prove that

is

a quadratic residue of

all

primes of the form 6n

and a

quadratic nonresidue of primes of the form 6n 1.


8. Find the primes of which 15 is a quadratic residue.

Show that a quadratic residue of an odd prime p is also a quadratic residue of p n


Prove that there are infinitely many primes of the form An + 1.
(Assume
the number of these primes is finite and use them to construct an integer 4 2 + 1.
Consider the form of the prime factors of this integer.)
11. Show that there is an infinite number of primes of the form Sn + 1.
12. Prove that 3 is a primitive root of every prime of the form 2 2 " + 1 by considering
the quadratic character of 3 with respect to such a prime.
9.

10.

ELEMENTARY THEORY OF NUMBERS

152

The Jacobi Symbol.

9-5.

if

1,2,

m is

,r,

P =

Let

pip 2

p r where the

with

pi,

Then

are positive odd primes, not necessarily distinct.

any integer prime to P, the Jacobi symbol

following manner:

\p) ~ xpJ

771

-p

is

defined in the

'

where the symbols to the right of the equality sign are Legendre symbols.
When P = pip 2
p r and Q = qiq 2
q s with the pi and qj,
s, positive odd primes, the properties of the Jacobi
where j = 1, 2,
symbol are expressed by the following theorems:
Theorem 9-10. If m is prime to both the positive odd integers P and

'

'

Applying the definition given above,

("pj^l )( )

-(?) - fe)
0) h(?)(s)'=
(!) (f) " d "*"*" (?) (l) - fe)

Theorem

9-11.

/mn\ _ (m\
-

If

'

'

'

i)

fe)

and n are prime to the positive odd integer P,

n\

yv)

\p) \pf
(mn\
(mn\ (mrb\

- (?)

if

m=
.

r,

9-12.

n(mod

Because
.

H- (")

fe>

Theorem

(mn\

If

,.

- fe) fe)

(s)

(mn\

fe) fe)

m and n are prime to the positive odd integer P and

P), then

m=

_,

(p-J

n(mod P)

p)*

m=

implies that

n(mod p ), where
%

1,

Jacobi symbol.

Theorem

9-13.

If

is

a positive odd integer,

?
-=-

According

to

the

definition

=r-

1) (P-D/2
(

V[( Pi -l)/2]
(

1)

2,

the theorem follows immediately from the definition of the

*
,

where

1,

2,

r.

But

P =

p xp 2

"

pr

QUADRATIC RESIDUES

(pi

(P2-

'

1)}

{1

(Pr-

J= (-l)+ J=
i,k

P =

and thus

1)},

1)}{1

153

(pi-1)(p-1)+

+fl (P.-D- Butpi-l

i<k

- O(mod

so that

2),

P=

>
i

(p.-

l)(mod

P-

Hence,

4).

=l

V ^^ (mod
i

Therefore,

2).

(^j\ = (-l)^' 2

Theorem

9-14.

If

a positive odd integer,

is

pi |j = (- l)<

1 >' 8
.

1)J{1

(?>2

1)}

{1

(p,*

1)}

+ 2

"

1)

^-

(Pi

=l

r
2

(Pi

i)fe

1)

+"

+ n

0(mod

follows that

8), it

P =
2

!)

l)(mod

But

since

>

Pi2

(mod

Theorem

8).

9-15.

If

Hence,

P and Q

Y"\

fe

z=i

i,&=i

fe

and

64),

=1

(^\ =

(-1)Cp*-u/8.

are positive, relatively prime odd integers,

(0--^-(s)te)---(^"factoring

p)

in like

manner and forming the

pairs

where

r we find

) (

1, 2,

and

1,3

1, 2,

For a

fixed

*.

j,

(p*

l)(

a -

1)

i=l

fe

1)

(p<

1).

But we

i=l

saw that \
i

(p
l

1)

= P

l(mod

4),

and because

qj

1 is

even,

it is

ELEMENTARY THEORY OF NUMBERS

154
evident that

fe

(lk

1)

(P

i)(*

i)

J {(

1)

1)(

l)(mod

8)

=i

Therefore,

(^

X(

1)

(p<

p " !)fe-

i)}

l)(mod8)

- (PBecause

P -

1 is

even, (P

1)

fe

l)(mod8)

Jfo-

1)

1)

(P

1)(Q

l)(mod

8).

Hence,

Therefore,

-<-

According to the definition of the Jacobi symbol,

w
)

= +1

or

when an even number

1.

are

(^
(?)
)

is

In the

+1 when

first

all

case the

congruences
x2

have a solution

ra(mod

for each

p,-)

1, 2,

= m(mod

But

in the second case the congruences (6) fail to


pi,

(7)

has no solution.

However,

if

-=5

is

(6)

a solution of
(7)

have a solution

Hence,

we have a necessary but not a

a quadratic residue of P.

P)

tain

p)

p i} and consequently there


x2

and therefore

if

for cer-

the Jacobi symbol

sufficient condition that

= 1,

it is

m be

evident that con-

gruence (7) has no solution.


Let us take some examples to illustrate the differences in the use of the
Consider the congruence x 2 =
Jacobi and the Legendre symbols.
Using
135 (mod 173) in which 135 and 173 are odd and relatively prime.

155

QUADRATIC RESIDUES

Jacobi symbols,

'

zr=~ )

find

(773

-'

- (I) -

(w)

Therefore,

we

= +*

is

a prime,

Since 173

Legendre symbols.

we

+1

and

"' (iS) = +1

and we can conclude that there


Since 173

(735

is

is

a prime, this

(g|)

\j35j

- +1

* (I)

'

a Legendre symbol

is

a solution of the congruence.

can, moreover, solve the

Thus

(jjjlj )

-QL

problem by using only

But

j (jfg) (jfg

(AX?) -
and (-3-

r)

= 1.

= 1.

Hence, (770)

+1.

(A)(t)But

(?)

= (I) " - 1 and

so

'

- -1

(A)

and therefore the given congruence has a

Now

consider the congruence x 2

In this case

prime.

/2l\ =
+1?
)

Hence, \kfo

Qj {^fj
but this

is

Furthermore,

Hence
-

solution.

21 (mod 253), where 253

a Jacobi symbol, and

tion of

() (i)
x = 21 (mod
2

and
11).

since

(it) =

-1
(tt) -

Hence, there

is

'

is

not a

Qj =

= +1, and
=
(^fj

+1.

we can reach no
However,

conclusion as to the existence of a solution of the congruence.

(S)

+1,

(m)

'

there

no solution

is

of

no solu -

the given

congruence.

EXERCISES
1.

Apply both Jacobi and Legendre symbols


S3 35 (mod 71) has a solution.

to determine

whether or not the con-

gruence x 2
2.
3.

Evaluate the following symbols and interpret the results

Use Legendre symbols

q=

>

r^ry

to determine all the quadratic residues of 41.

>

^rz

ELEMENTARY THEORY OF NUMBERS

156

The

9-6.

the congruence x
(a, 2)

ss

o(

= a(mod

2)

It is evident that if (a, 2) =


has the solution x = l(mod 2), but
= a (mod 4) has a solution if and only

the congruence x 2

1,

l(mod
Theorem
a ss l(mod
a

Solution of x 2

mod

2 n ).

1,
if
if

which case there are two solutions 1 and 3 modulo 4.


2
9-16.
If n > 3 and x = a(mod 2 n ) has a solution, then

4), in

8).

Suppose x

satisfies

Then x

the congruence.

a(mod

2 n ),

and there-

a(mod 8)
But x is odd, and its square is, therefore, congruent
Hence, a = l(mod 8).
to 1 modulo 8.
Theorem 9-17. If a = l(mod 8), there are exactly four distinct solutions modulo 2 n where n > 3, of the congruence x 2 = a(mod 2 n ).
We shall first show by induction that the congruence x 2 = a(mod 2 n )
with a s= 1 (mod 8) has a solution. We know that under the given condiAssuming that, for a given k, x 2 =
tion x 2 s= a(mod 8) has a solution.
We, therefore,
a (mod 2*) is satisfied by x we infer that x 2 a = 2 k h.
wish to determine t so that #o + 2 k ~H satisfies x 2 = a(mod 2 k+1 ), that is,
fore x

ss

so that
(x

2*x

+
+

2
2

-1

2A;

2 (h

and

A;

~2

s=

a (mod2 k+l )

=
=

0(mod
0(mod

a;

2 k+l )
2 k+1 )

finally

/i

Because
which x

this

= 0(mod

Xo t

2)

congruence always has a solution, there

2 fc-1 satisfies x 2

= a(mod

2 k+l ).

is

a value of

Thus the congruence x 2

for

a(mod 2 n ) has a solution if a s= l(mod 8).


But whenever x 2 = a(mod 2 n ), where n

> 3, has one solution x =


has exactly four solutions, for suppose that x\ and x 2 satisfy
Then
the congruence.

a:i(mod 2 n ),

it

Xi

a; 2

0(mod

(mod

2 n)

and
(xi

and because both

x\

[(#i

x 2 )(xi

x 2)

2n)

and x 2 are odd,


xi

However,

x 2 )/2]

x2

Xl

rr 2

[(^i

a; 2

se

)/2]

0(mod 2 W ~ 2 )

iCi,

and

therefore

one

of

(iCi + x 2 )/2
~
Hence, one of the congruences (xi x 2 )/2 = 0(mod 2 n 2 ) holds.
~
But when x\
Therefore, x 2 = ^i(mod 2 n l ), or x 2 = Xi(mod 2 n_1 ).
2
n

=
Consequently,
all
four integers
satisfies x
a(mod 2 ),
X\ does also.
2
n
n~ l
=
a(mod
incongruent
and
they
are
2
satisfy x
X\, xi + 2
),

(iCi

2 n_2

x 2 )/2 and

modulo

2n

is

odd.

As a

result, the other is divisible

by

QUADRATIC RESIDUES

157

= a (mod 2 n ), for a must be


modulo 2 3 and thus a has just 2 n ~ 3 distinct values modulo
~
odd positive integers less than 2 n separate into
Therefore, the 2 n
2n
2 n_3 sets of four such that all four integers in a set satisfy one and only one
~
of the 2 n 3 congruences x 2 = a (mod 2 n ) determined by the permissible
But there

congruent to

are exactly four solutions of x 2


1

values of

a.

Example. In the case of x 2 = a(mod 16), a can have only the values
1 and 9 modulo 16.
The solutions of x 2 = l(mod 16) are 1, 7, 9, and 15
modulo 16, and those of x 2 = 9 (mod 16) are 3, 5, 11, and 13 modulo 16.

EXERCISE
First find the values that a can
64),

and then

have

in order that there

find all the solutions of these congruences.

be a solution of x 2

= a (mod

CHAPTER

10

SOME FAMOUS PROBLEMS


10-1.

The Waring Problem.

that every positive integer

is

In 1770 Waring published the statement


of not more than 4 squares, not more

sum

than 9 cubes, not more than 19 fourth powers. He gave no proof of his
assertion and may have had only calculations to support it, but the
problem implied by his statement has ever since challenged the best
mathematicians and has been only recently solved. It is generally
agreed that Waring meant to imply that for every positive integer k there
exists a smallest positive integer g(k) such that any positive integer n can
be expressed as a sum of at most g(k) positive kth. powers.*
Certain results connected with this problem of representing a positive
integer as a sum of like powers of integers had long been conjectured even
though not much progress in proving them was made until the eighteenth
Fermat, for instance, was much interested in the theorem that
century.
every prime of the form 4n + 1 can be expressed as a sum of two squares
and, barring the use of negative integers, in but one way.
Thus 5 = l 2 +
2
2
2
It remained for Euler, however, to demonstrate
2 and 13 = 2 + 3
Moreover, that any integer n is a sum of two
the theorem satisfactorily.
squares if and only if it has the form n = 2 a 2 P, with t >
and P a
product of different primes of the form 4s + 1, had been determined in
the seventeenth century. Again, mathematicians had asserted that any
integer not of the form 4 r (8s + 7) is expressible as a sum of three squares
and that integers of this form fail to be expressible as such a sum. Furthermore, by 1770 Lagrange had proved that every integer is a sum of at
.

most four squares.

From the time Waring enunciated his theorem, it took 139 years to
prove that every integer is a sum of at most nine cubes. Although
Liouville proved in 1859 that there exists a smallest integer #(4) such that
every n is a sum of at most #(4) fourth powers, still it has not yet been
proved that in this case #(4) actually is 19. In 1909 Hilbert proved the
general theorem that for each k there exists a positive integer g(k), independent of n, such that every integer n is a sum of at most g(k) kth. powers,
but his proof merely shows the existence of algebraic identities for deter*

G. H. Hardy,

"Some Famous Problems


158

of the

Theory

of

Numbers."

SOME FAMOUS PROBLEMS

159

mining g(k) and sheds no light on the actual value of g(k). Since then
Hardy and Littlewood have developed by analytical means a formula
that determines an upper bound for g(k) for every k.
From these few remarks we can obtain some idea of the magnitude of
this problem, and certainly a perusal of a few of the original proofs will
give an appreciation of the ingenious adaptation of the tools of the theory

complex variable to the problems of the integers. We


are not concerned here with the presentation of any of these powerful
methods, but we shall give two of Euler's* proofs that every prime of the
form 4n + 1 can be represented uniquely as a sum of two squares and then
reproduce a proof, due to Euler and Lagrange, f that uses only the ideas
of the classical theory of numbers to show that every integer can be
of functions of a

sum

expressed as a

Let us recognize

that the identity

first

(a 2

most four squares.

of at

b 2 )(c 2

For instance,

(2

ever, that (2 2

)(3

1)(2

1)

52

(ac

two sums

expresses the product of


2

d2)

bd) 2

of squares as a

32

(ad

be) 2

sum
7

2
.

two squares.
We notice, howof

4 2 and so in this case the


,

formula gives but one representation of the product as a sum of two positive squares.
Does the formula ever fail to give at least one solution
when (a, b) = 1 and (c, d) 1? In this case ac = bd, and ad = be.
But if ac = bd, then a = d and b = c, and so the two given sums are
2
2
Hence, in the single
identical.
If ad = be as well, then a = b = 1.
2
case (1 + 1)(1 + 1) = 2 -f-0, the formula fails to give a sum of two
positive squares.
It is also

apparent that when

(a, b)

and

d)

(c,

1,

the squares in

the expression for the result of the product need not be relatively prime,
for example,
(ac

or

bd,

if (c,

d)

Euler's

ad

(8

be)

1 )(9

1,

2 2)

then

k, it is clear

first

(a, b)

70 2

+
1

25 2

and

On

(c,

d)

that k divides both ac

the other hand,

if

k,

1,

for

if (a, b)

bd and ad

proof of the fact that a prime of the form 4n

represented as a

sum

instructive to study

it

be.
1

can be

two squares is a little cumbersome, but it is


and to compare it with the second, more elegant

of

proof which Euler published about 25 years later.

The second

proof

enormous improvement in the directness of the presentation that a mathematician often attains when the initial proof is reviewed.
Lemma 10-la. If a prime p = c 2 + d 2 and if there is a q > 1 such
that pq = a 2 + b 2 with (a, b) = 1, then q is a sum of two relatively prime

exemplifies the

squares.
*

L. E. Dickson, "History of the

t Ibid.,

Vol. 2, p. 281.

Theory

of

Numbers,"

Vol. 2, pp. 230-231.

ELEMENTARY THEORY OF NUMBERS

160
If

the prime p

c (a

d 2 then
)

d2)

b 2c 2

2
fr

d)

(c,

(c

and

1,

if

pg

pq

a 2d 2

(be

a2
2

a p

52

we have

= mp

But
2

c {a

2
)

a 2 (c 2

ad) (be

ad)

Consequently, the prime p divides at least one of be ad and be + ad.


Moreover, be ad 7^ 0, for if be = ad, then a = c and b = d. Under
these conditions p and pq would not be distinct.
If be ad = tp, let

+r

= td-\-s

tc

and

Then
cr

be

ds

ad

- ds

be

tc

and
id 2

so that
cr

ad

d2)

en

k(c 2

d 2)

t(c

Hence,

= ds
= dn

cr
r

But

if

be

ad

/cp,

and

the equations
6

kc

kd

cr

be

kc 2

ds

ad

kd 2

ds

be

ad

cr

= ds

and
give

and
Hence,
cr

and
In this case
r

In the

first

pq

and

= dn

and

= en

case

a2

=
=
=

td-\-

en) + (tc +
+ n )(c + d
p(t + n
(

(r2

in the second

pq

=
=
=

en) +
+ n )(c +
p(fc + n
2

(fed

(k 2

(fcc

d 2)

dn) 2

dn) 2

SOME FAMOUS PROBLEMS


Therefore, q
tively

prime

is

sum

two positive squares.

of

if (a, 6)

1,

for

These squares are

in the first case

if

161

n)

(t,

u,

rela-

the equations

+ dn, a = td-\-cn show that u divides both a and b. Likewise,


= 1 in the second case.
Lemma 10-2a. If PQ is a sum of two relatively prime squares and Q

is

tc

n)

(A;,

not a sum of two relatively prime squares, then


is not a sum of two squares.

has a prime factor

that

Consider Lemma 10-la, and let P = pip 2


Pk, where each prime
=
Then
sum
of
two
squares.
with
h,
is
i
a
1,2,
pi(p 2
PkQ)
Pi,
= PQ is a sum of two relatively prime squares, and it follows immediately
that P2
PkQ is a sum of two relatively prime squares. By repeating
this process, we find that Q is a sum of two relatively prime squares.
We must conclude, then, that if PQ is a sum of two relatively prime
squares and Q is not, P must have a prime factor that is not a sum of two
'

'

'

'

'

squares.

Lemma
is

sum

10-3a.

of

If

a prime p divides a 2

2
,

where

(a, b)

then p

1,

two squares.

b 2 with
Let the prime p divide a 2
not a sum of two squares. Set

(a, b)

and suppose that p

1,

= mp ri

< n <

= np

r2

<

is

and
r2

<

Then
2
7"i

?*2

a2

= Qp <

/cp

~2

Any common divisor of ri and r must divide Q, and thus the last equation
can be reduced to ai 2 + bi = Pp, with (a h hi) = 1. According to
Lemma 10-2a, it is now evident that P has a prime factor pi that is not a
sum of two squares, and furthermore, pi < p/2. Using the fact that pi
2

we can repeat this process. The method, therefore,


always produces a sum of two relatively prime squares, a; 2 + b { 2 <
2
(pi-i )/2, which has a prime factor p < p;_i that is not a sum of two
squares.
But this statement is contrary to fact, for the prime factors of
all sums of two sufficiently small relatively prime squares are themselves
divides a\ 2

bi

a
l

sum

of

two squares.
2.)

sum of two
Theorem

(3

22

13,

32

Consequently, the prime factor p of a

22

10,
2

5,

must be a

squares.
10-1.

Every prime

squares in just one way.

of the

form An

is

sum

of

two

ELEMENTARY THEORY OF NUMBERS

162

The integer 1 is a quadratic residue of all primes of the form 4n


1.
Hence, there is an integer a such that a 2 = l(mod p), where p = A.n
+ 1. It is immediately evident that p divides a 2 + 1, and accordingly

is

expressible as a

Now

sum

each of the pairs a and

two squares.

of

suppose that p

a2

and

b, c

b2
d,

d 2 where it is evident that, of


one integer is even while the other is
c

Then

odd.

d2

h2

c)(a

+c) =

\d

b)(d

so

that a

n(d

a2

and

(a

Let

(a

(m, n)

c,
= 1.

b)

r,

if

b)

= rm and

with

rn,

Therefore,

m(a
Hence,

we

let (a

c,

b)

c)

s,

b)

we have

-\-

= ms

ns

and

If

a and

But

if

case both
(r

both even or both odd, it is clear that r is even, and so is s.


In the latter
c is even, then r is odd, and so is s.
and n are also odd. Moreover,

c are

only one of a and

m
s

)(m 2

n 2) =

mr +ms +nr +ns


(a - c) + (d + 6) + (d 2

6)

(a

c)

Hence, the integer


(r

)(m 2

a2

+
2

62

cP

= p
and s are even, p has been factored into the integers (r 2 + s 2 )/4
and m + n 2 both of which are greater than 1. But if r and s are odd,
r and s cannot both be 1, nor can both m and n be 1, for in either case
a = d and b = c. Consequently, when r and s are odd, p is equal to the
product of the integers (r 2 + s 2 )/2 and (m 2 + ^ 2 )/2, neither of which is 1.
Since such a factorization is impossible, we must conclude that the prime
p = \n + 1 has a unique representation as a sum of two squares.
Let us start the second proof of Theorem 10-1 with the statement that
since 1 is a quadratic residue of every prime of the form 4*1 + 1, there
are integers a and m that satisfy the equation a 2 + 1 = mp.
The fact
that a is a quadratic residue of p means that a can be chosen positive and
not greater than {p l)/2.
Consequently, a 2 + 1 < (p 2 /4) + 1, But
Thus,

if r
2

SOME FAMOUS PROBLEMS


2

(p /4)

<

Thus mp < p 2 and m < p. Hence,


a and b, with (a, b) = 1 and
< a,

2
.

which satisfy the equation a


1

< m <

Set a

m/2.

= qim

As a
a2

< m
and

ri

m>

If

p.

mi

positive integer

we

1,

such that
b

q2

= mp,

<

(p

l)/2,

being an integer in the

show that we can produce a


sum of two squares.
with |ri| and \r 2 not greater than

shall

rri\p is

m+

true that

it is

there are integers

interval

163

r2

result

= n +

b2

+m

r22

( qi

g2

2
)

2m(r l9l

r 2q 2)

(1)

and

mp =

ri

+ mK

r22

so that
fi

r22

= mim

r22

<

But
ri

for not

both

|ri|

and

\r 2

feY

can be m/2 because

(a, b)

1.

Hence,

mim <
and

<m

mi

Lemma

Applying the identity exhibited just before


(ri

r 2 )fei

g2

?2

(r iqi

r 2q 2 )

10-la,

(nq 2

we have
r 2qi )

or

mmiqi 2

(2)

where
s

ngi

+ r<#

r x qi

and

Recalling Eq.

(1),

we observe

that

mp = mim

+m

(qi

r 2 qi

<?2 )

2ms

and
p

= mi

= mi

m(qi 2

q2

2s

Therefore,

m
and, according to

mim(qi 2

g2

(2),

mp =
x

mi 2

or

mip = (mi

2
-f s)

2mis

2miS

ELEMENTARY THEORY OF NUMBERS

164

Hence,

upon the assumption that m >


rrti < m such that mip is a sum

clear that

it is

structed another integer

We

we have

of

con-

two squares.

must conclude, therefore, that m


1.
The unicity of this representation of the prime p = ^n -f- 1 was proved
at the end of the first proof of Theorem 10-1.
Recalling that the even prime 2 = l 2 + l 2 we shall now proceed to the
second problem stated above by showing in the following steps that any
,

odd prime can be expressed as a sum

of four squares or fewer:

Lemma 10-16 (Euler's Identity). (xi + x -r-z + Z4 )G/i + 2/2 2 +


= {xyx + x y + x y + x y + (xiy x y\ + x y x y
+
2/3

x y
x y x y
+ (xiy
+ (xiy* x y + x y x y
If i has the usual meaning, \J 1, this identity can be proved by find2

2/4 )

4)

-f-

4)

2)

ing the following product of two determinants whose values are X\ 2

x2

Xi

Xz

xz2

+ ix
+ ixi

x 4 2 and

+ v*

y*

x3

+ 1x4

Vi

Xi

y* - iy*

ix 2

--

z)

W2

y^
-2/3

iy*

y\

iyi

A - %B C -iD
-C -- iD A +iB
A + B + C + D'
-

where

Lemma
1

< <
t

Let
lie

Xi,

p,

10-26.

If

A =
B =

xiy 2

C =

x xy z

D =

xiy 4

is

such that tp

where

x{

xzyi

x 4 yi

an odd prime, there

0, 1, 2,

<

in the interval

+ xzyz + x y
+ x y xyz
+xy xy
xzyi
+xy

x 2y 2
x 2 yi

xiyi

<

Xi

(p

x 22
,

Xz

(p

exists

x42

an integer

and no two of these values are congruent modulo


^ 2 (mod p), where i 9^ j and j = 0, 1, 2,
(p - l)/2,
of x^,

(xi

Xi

Xj)(xi + Xj) = 0(mod p).


+ xj would be divisible by p,

than

where

l)/2, represent the integers that

There are then (p

l)/2.

t,

l)/2 values

p, for if
it

x?

follows that

Hence, at least one of Xi x3 and


is impossible because each is less
-

which

p.

same interval and form the


These integers are also incongruent modulo p, for
2
2
y^ = 0(mod p),
if
yj (mod p), where i 7* j, then yf
and we have seen that this congruence is impossible.
Because the Xi 2 and 1 y^ taken together form a set of p + 1
Therefore, some
integers, two of them must be congruent modulo p.
Calling these integers
x^ must be congruent to a particular 1 yj 2
x 2 and 1 y 2 respectively, we have
Again,

let yi

represent the integers in the

1 y
1 yi = 1

numbers

x' as

2
?/

(mod

p)

SOME FAMOUS PROBLEMS

165

and

x2
so that x

>

and

tp,

<

Moreover, x 2

2p > p2 + 2 and
which shows that p
,

Lemma

10-36.

such that tp

xi

= 0(mod

where

tp,

a positive integer.

is

p)

2
2
2
p /4. Therefore, (p /4) + (p /4) +
2
However, since p > 2, it is evident that
1 > tp.
2
2
2
2
p > (p /2) + 1. Hence, p > (p /2) + 1 > tp,

>

If

<

and y 2

/^,

-\-

(p /2)

As a result, 1 < t < p.


an odd prime and t is the

t.

is

+ x% +

x 22

x 2 then
,

is

least positive integer

odd.

Suppose that t is even and that Xi 2 + x 2 2 + #3 2 + x 2 = p. Then the


xi} where t = 1, 2, 3, 4, are (1) all even, (2) all odd, or (3) two are even
and two are odd. In any of these cases the xi can be grouped in pairs so
Hence, {x\ + x 2 )/2
that x\ + x 2 = 0(mod 2) and x% + x = 0(mod 2).
and (xz + Xi)/2 are integers, and so are (xi x 2 )/2 and (# 3 Xa)/2.
Therefore,

( xi +
2
\

a? 2

S2Y

/ a?i

""

/ ffs

"*"

gj

(x3_-_Xi\

"*"

_ xi

x 22

'

#3

Thus there

Lemma
less

t and such that tp/2 is a sum of


must be odd.
an odd prime and if the least positive integer

Consequently,

10-46.

than

If

p, satisfying

is

2/3*

Choose

Xi

than

s less

x 22

:r 3

+ X4

and such that

st

is

not

yi

1,

2/4

?/,-,

Then y^

the condition tp

then there exists a positive integer


2/2

an integer t/2 smaller than

is

four squares.

t,

2
Xi

where
2

a;*

(mod

=
t),

1, 2, 3, 4,

so that y t

Xi(mod

t),

and let

\yt

<

t/2.

and
2

Vi

X ^ m d
2

Hence,
4

V
Therefore, y x 2

2/2

y%

2
?/,

?A

tp

0(mod

The

s.

integer

s is

not

or each

In this case t 2
2/ would be 0, and then each Xi would be divisible by t.
would divide tp, and t would divide p. Hence, t would be 1. Moreover,
4

since

\y {

<

t/2,

it

follows

that

yi

<

/4 and

V
i=l

<

2
,

and

<

t.

Consequently,

<

<

t.

y- 1

<

2
.

Hence,

ELEMENTARY THEORY OF NUMBERS

166

Theorem

Every odd prime

10-2.

is

sum

most, four positive

of at

squares.

p =
p >

If
If

3,

observe that 3

3,

multiply corresponding members of the equations


xi
yi

+
+

+
+

x22
yi

+x =
+ yi =

x, 2
yz

tp

<t <

st

<

Remember

developed in the preceding lemmas.

We

tive integer satisfying the first equation.

<

that

find

is

the least posi-

upon applying

Euler's

identity that
t

sp

(xtfji

{xiyz

But

since yi

Xiyi

+x

x 2y 2
Xzyi

+ x y + x y^) + (x y - x yi + x y x yz)
+ xy x y^) + {x y x^yi + x yz x y
2

= ^(mod

(3)

2)

t),

+ x y% + xy = Xi + x +

xz2

+ Xzyt

y2

x 2

tp

= 0(mod

t)

Also,

xiy 2

x 2 yi

xy z

Xix 2

It is apparent, therefore, that

right-hand

But

member

of (3)

2
t

Xix 2

x d Xi

sp,

with

<

this conclusion contradicts the fact that

tive integer such that tp

theorem

sum

t),

divides each of the four squares in the

and that

is

x&i = 0(mod

t,

is

sum

of four squares.

was chosen the

of four squares.

Hence,

least posi1,

and the

proved.

is

Theorem

10-3.

Every integer

is

sum

most four positive

of at

squares.

Upon

factoring the given integer into primes, the theorem follows

immediately from Euler's identity.


It may also be added that we must use at least four positive squares to
express some integers as a sum of squares, for we shall show that no integer
that is congruent to 7 for the modulus 8 can be a sum of three squares.
x 2 2 + x z 2 = n. Not all the x i} where i = 1, 2, 3,
Suppose that Xi 2
can be even, nor can just one be, for n = 8k + 7 is odd. But if all the
2
2
2
2
Xi are odd so that Xi = l(mod 8), then xi + x 2 + 3 = 3 (mod 8).
2
are
even
and
one
is
odd,
x 2 2 + Xz 2 =
Finally, if two of the x
Xi
2
2
2
=
Consequently,
sum
of three
x
5(mod
a
8).
l(mod 8) or Xi + x 2 + z
integer
that
modulo
8.
equal
any
is
congruent
7
to
to
squares cannot be

EXERCISES
1.

as a

Prove that integers of the form 4 r (8n

sum

7) with r

and n

>

cannot be expressed

of three squares.

2. Write
prove?

(xi

x22

x 32

rc 4 )

as a

sum

of three squares.

What

does the result

SOME FAMOUS PROBLEMS

The Equation x 2

10-2.

From

2
.

167

the point of view of the

theory of numbers the solution of the Pythagorean triangle means the


determining of formulas for expressing all triplets of positive integral
2
2
2
When x, y, z is a solution
values that satisfy the equation x
y = z
We shall,
of this equation, it is evident that kx, ky, kz is also a solution.

therefore, confine ourselves to the solutions, called primitive solutions, in

which the values x, y, z are relatively prime. This restriction together


with the equation implies that x, y, z are relatively prime in pairs, for a
common divisor of any two of them divides the third. We infer, then,
that two of these integers cannot be even. But neither can both the
and y be odd, for the square of an odd integer has the form

integers x

and thus the sum

two odd squares is divisible by 2 but not by 4.


is even, and the other is odd.
Let x = 2u.
= \u 2 = z 2 y 2 = (z + y)(z y). However, (z + y) + (z y) = 2z, and therefore any common divisor of z + y
and z y divides 2z. But a divisor greater than 1 of ^ cannot divide
Hence, 2 is the greatest common divisor of z + y and z y.
z + y>
Then
Therefore, let z + y = 2v 2 and z y = 2w 2 where (v, w) = 1.
4u 2 = (2v 2 )(2w 2 ), and x = 2u 2vw. By adding the members of
2
2
2
z + y = 2v 2 and z y = 2w we find, furthermore, that z = v + w and
Sn

1,

of

Consequently, one of x and y


Then y and z are odd, and x 2

2
2
Moreover, because (y, z) = 1, one of the integers v, w is
y = v w
even, while the other is odd.
If (v, w) = 1 and one is even, while the other is odd, and k is an arbi.

trary integer, the substitution of

= 2kvw

k(v 2

2
)

k(v 2

+w

2
)

makes it clear that the equation is actually satisfied


They, therefore, form the general solution of x 2 + y 2 =
2
z except for the fact that the values of x and y may be interchanged.
Hence, we have proved that:
Theorem 10-4. If k is an arbitrary integer, the solutions of x 2

in the given equation

by these

values.

and

2kvw, y = k(v 2 w 2 ), and z = k(v 2


w 2 ) for all integers
so chosen that (v, w) = 1 and one is even, while the other is odd.

are x

EXERCISES

2.

Express 21, 31, and 39 as a sum of squares.


Solve each of the equations x 2 + y 2 = 169, x 2

3.

Is there

1.

an

isosceles right triangle

whose three

+y =
2

625,

and x 2

+y

2704.

sides are integers?

4. Find expressions for the sides of all integral right triangles whose hypotenuse is
one greater than a side.
5. Show that if x 2 + y 2 = 2z 2
then x = k(v 2 + 2vw w 2 ), y = (r 2 - 2vw
w 2 ), z = k(v 2 + w 2 ), where k is an arbitrary integer, (v, w) = 1 and one of v and iv
,

is

even, while the other

is

odd.

ELEMENTARY THEORY OF NUMBERS

168

10-3.
Fermat's Last Theorem. About 1637 Fermat stated that there
no solution in positive integers of the equation x n + y n = z n if n > 2.
This theorem is known as Fermat's last theorem, and about it he wrote,
"I have discovered a truly remarkable proof but this margin is too small
To this day mathematicians have been baffled by the
to contain it."
statement, for they have been able neither to prove nor to disprove the
The equations (x m ) 4 + (y m ) 4 = (z m ) 4 and (x m ) p +
general theorem.
m p = (z m p show that the proof can be broken up into the cases in
(y )
)
which n = 4 and n is an odd prime. In 1747 Euler published a proof,
which we shall reproduce below, that there is no solution in the first case.
No proof for every odd prime has been discovered although by 1857
is

Kummer had shown


was Kummer's

It

this

the impossibility of solving the equation

reflection

on

his

own

error

made

if

n <

100.

in attempting to prove

theorem, as well as the misconceptions of Cauchy and Lame, that led


With this new tool he and other

to his invention of the theory of ideals.

mathematicians were able to set up various conditions for the insolvability of the equation.
H. S. Vandiver* has given a complete account of
the present status of the problem, including his own recent contributions
"toward its solution

Theorem

tion x 4

10-5.

and his conjectures as to its truth.


There is no solution in positive integers

of the

equa-

2
.

The method we

shall use in

Fermat's method of

proving this theorem

infinite descent.

is a neat example of
assume that there are
show that under this condition

We

shall

and shall
having a smaller z. It is evident that if
there is a solution of the equation in which the integers x, y, z are not relatively prime in pairs, then there is another in which the restriction holds.
We shall assume, therefore, that x, y, and z are prime each to each. Then
2 2
2
2
2
(x 2 ) 2 + (y ) = z so that according to Theorem 10-4 we have x = a
2
2
2
2
b y = 2ab, and z = a + b with (a, b) = 1, and where we may choose
a odd and b even. Because y 2 = a(2b), it follows that a = u 2 and
Therefore, a = r 2 + s 2 and b = 2rs with
2b = v 2
But a 2 = x 2 + b 2
Hence, 26 = 4rs = v 2 and r = Xi 2 s = yi 2
Thus xi A +
(r, s) = 1.
A
2
and, furthermore, 1 < u < a < z.
Thus there is a set of
yi = u
It is imposintegers with a smaller z that satisfies the given equation.
sible that this always be so, and consequently there is no solution of
integers that satisfy the equation

there

must always be another

set

xA

y = z
Corollary.

x4

2
.

There

is

no solution

in positive integers of the equation

4
.

10-4. The Area


Theorem 10-6.

of
If

an Integral Right Triangle


the sides of a right triangle are integers, the area

cannot be a perfect square.


*

Am. Math. Monthly,

pp. 164-167, 1953.

Vol. 53, No. 10, pp. 555-578, 1946; ibid., Vol. 60, No. 3,

SOME FAMOUS PROBLEMS

169

We shall develop the proof of this theorem as another example of


Fermat's method of infinite descent, using basically the very method he
outlined in the marginal notes of his copy of Bachet's edition of Diophantus's "Arithmetica."*
If x, y, and z are the sides of a right triangle, again restricting ourselves
to the case where these integers are relatively prime in pairs, let x = 2ab,
2
2
2
b 2 where a and b are relatively prime and one is
y = a b z = a
Then the area of this triangle, which we assume is a
even, the other odd.
Since (a, b) = 1, the integers
perfect square, is A = ab(a 2 b 2 ) = r 2
2
2
a, b, and a b are relatively prime in pairs, and each is, therefore, a
perfect square.
Let a = m 2 b = n 2 a 2 b 2 = k 2
But a
b and
a b are also relatively prime; so let

= m

= m n2 =

n2

u2

and

As a

result

2m = u
2

and
2n 2

Thus

(u, v)

and the

1,

even integers.

= u
last

Hence,

(u

equation shows that

and 2n =
2

even,

is

- -2
y

Therefore, one of the integers

-^ =

2s 2

8q

and u

(u

v)(u

are

+ v).

1_ p

<

even.

is

>

either

+ v)

v){u

and

Accordingly,

t*

^1

2s<

2s 2

let

or

^1 =

and

Then
2n 2

SsH'

n2

4sH'

and

Furthermore, in the

and

is

2s

2s 2

case

and

and

2s 2

m =
2

n2 =

t*

4sH 2

4s 4

4s 2 2

the hypotenuse of a right triangle in which


*

in the second

But

first

Dickson, op.

cit.,

Vol. 2, p. 615.

Thus m
and 2s are the arms. But
2

(t )

(2s 2 ) 2

ELEMENTARY THEORY OF NUMBERS

170

notice that since z

a2

b2

that the hypotenuse of the


(u

new

Moreover, the area

original.
2

and a

and the area

v )/S,

(g.

of the

follows that z

it

triangle

new

>

>

m, so

smaller than that of the

is

triangle

the integer

is

2 2

of the original triangle is

A = a H a* But

6-)

p .)

(**)

>

^^

(^)

(V)

for

>

The assumption of the existence of a triangle whose sides are integers


and whose area is a perfect square has led to the conclusion that a triangle
having these properties but of smaller area and shorter hypotenuse must
Thus there would always be a smaller triangle of this kind,
also exist.
and that is impossible. We must conclude that such a triangle cannot
exist.

On

the basis of the last theorem

statement

Theorem
x2

-\-

If

x2

both p 2

whose

easy to show that the following

There are no integers that

10-7.
,

it is

true:

is

sides are

= w

2p q

and p 2 q 2 = n 2
4
A
p q and p + q*.

consider the right triangle

Hence, the area

p q (p

But we have shown that


perfect square.

satisfy the set of equations

if

= p

is

the sides are integers, the area cannot be a

Consequently, there

is

no solution

in integers of the

given set of equations.


10-5.
The Generalized Wilson Theorem
Theorem 10-8. The product of the positive

integers less than m and


prime to m is congruent to 1 modulo m if m = 4, p n or 2p n with p an
odd prime, but the product is congruent to + 1 modulo m for all other
,

moduli.

product 1 3 = l(mod 4).


t be a quadratic nonresidue of the odd prime p, and let
p
n
=
where
i
1,
2,
Oi,
(f>(p ), be the least positive integers forming a
Then, for each a,-, the congruence
reduced residue system modulo p n
n
n
ctiX = (mod p ) has a solution x = a,- (mod p ) from the set of the a,, and
each integer a is thus paired with an ay distinct from the a^ modulo p n
The integers a are, therefore, separated into 4>(p n )/2
for cti 2 f (mod p).
pairs, and if P is the product of these pairs,
If ra

If

m=

4, the
n
,

let

p =

^(P)/2( mo( J pn)

SOME FAMOUS PROBLEMS

m l(mod

But t^~ 1)/2

and hence

p),

(J(p-l)/2)p.-i

and
t

171

(_]_

- _X

P-Hp-l)/2

k p )p-*

_|_

-f

Mpn

Therefore,
f*(p-)/2 ==

-l(mod p n )

and

P = -l(mod

m=

2p n

n
)

be a quadratic nonresidue modulo p, and


both of the congruences
x = s(mod p)
x = l(mod 2)
If

let s

let

satisfy

an odd quadratic nonresidue of 2p n for if x 2 = f (mod 2p n )


had a solution, then t = s(mod p) would be a quadratic residue of p. The
congruences ctiX = (mod 2p n ) now pair the positive integers a,-, where
n
n
If P
i = 1, 2,
4>{2p ), that are less than 2p and prime to 2p\
Therefore,

is

represents the product of these pairs,

P=
But

is

(p

~ 1)/2

= l(mod

odd, and

m =

(j>(2p

n
)

n >/ 2

we

find that

(mod 2p n )

= l(mod
P = l(mod

and thus t^ pn)/2

p),
n

Therefore,

<t>{p ).

n
p j. However,
2p n ).

> 2, then 1 is a quadratic nonresidue of 2 U


Hence, the congruences a# = l(mod 2 U ), where the a range through
the positive integers less than 2 U and prime to 2, separate these integers
~
In this case, therefore, if P again represents the product
into 2 U 2 pairs.
If

2U

where u

P = (-iy

of these pairs,

u ~2

= +l(mod

2 U ).

When m =

2, moreover, the above congruence is obviously true.


Finally, suppose that
contains at least two distinct odd primes as
factors or at least one odd prime and the factor 2 U with u > 1.
Let
n
m = 2 u p 1 n ip 2 n
p r *. Let s be a quadratic nonresidue modulo pi,
and let t satisfy both the congruences

x
x

=
=

s(mod pi)
l(mod 2p 2 p 3

'

p r)

'

'

a quadratic nonresidue of m. Again, if the a i} where i = 1, 2,


are the positive integers less than
and prime to m, then the
congruences a x = i(mod m) pair the a* and, as before, the product P of

Then
.

is

4>(m)

the

di is

such that

P =
But
since

i(pi-D/2
ni

(f>{p i

= -l(mod
is

pi),

even and 0(ra)


pc-o/i

*<

and

m>' 2 (mod m)
$*&>i*i>/* ==

<t>(pi'

n
)<f>(p2

l(mod
*)

= +i(modpi0

'

pi ni )"

<f>{p r

),

However,

ELEMENTARY THEORY OF NUMBERS

172

m)/2 =
(1 + 2p 2 ps
p r k, so that t^
2u ~
n2
n3
nr
k)4>(m)/2
anc
j t<i,(m)/2 = -f l (mod p 2
Furthermore,
t
r
)
P2
Vr
p
2
U
M
2
= +l(mod 2 ), and thus t+' = +l(mod 2 ). Therefore, t*' =
+ l(mod m), and P = +l(mod m).
10-6. The Pellian Equation.
The equation x 2 by 2 = 1, in which b

Moreover,

2p 2 p 3

"

'

'

'

a positive integer that is not a square, is known as the Pellian equation,


but it should really be called Fermat's equation, for it was he who proposed the problem of finding its integral solutions. As a matter of fact
the problem is a very old one, having been solved in the Middle Ages by
the Hindus.
We have but an outline of Fermat's proof showing that the
equation is satisfied by an infinite number of pairs of integers all of which
can be obtained from a particular pair, but a proof was also found conBoth
jointly by Wallis and Lord Brouncker and was published in 1658.
Euler and Lagrange contributed to the further development of the
problem. The following argument is based upon that devised by
is

Dirichlet

Lemma

10-lc.

If

is

any

and

< s < m.
Let x have the values

<

such that

m>

number and

real, irrational

integer, then there exist integers r

\r

sa\

is

an

< 1/m

and

0, 1, 2,

There

m+

are, then,

<

integral values of y so that

values of y

m, and determine corresponding


xa < 1 by taking y = [xa] + 1.
xa that lie in the interval from to
,

but including 1. Separate this interval into m equal parts,


up to and including
the first one extending from, but not including,
1/m; the second, extending from, but not including, 1/m up to and
At least two of the m
1 values determined for
including 2/ra; ....
Suppose that these values are
y xa lie in one of these m intervals.
Then
yx X\a and yi x^a with x<i > x\.
1,

excluding

{y x

(x 2

Xi)a\

difference cannot be 0, for x\

x2

1(2/2

x 2 a)

Xia)\

<
ni

or
|(?/2

But the
s

x2

Xi,

we conclude

<
Lemma
an

infinite

inequality

\r

2/i)

sa\

<

a positive integer that

If b is

of pairs of integers r

s b\

<

and

number
\r

Hence,

if

y%

y\

and

that

10-2c.

<

< m

<

2 \/b.

and

is

with

< m

not a square, there


s

>

is

that satisfy the

SOME FAMOUS PROBLEMS

Lemma
exist

m is a positive integer, integers r

when

10-lc shows that

and

S\

such that

<

In

Vb\ <

si

'

Now

173

<

< m

si

choose a positive integer mi sufficiently large so that

< |fl-lV^I
mi
Then

r2

and

s2

can be determined so that

<

\r 2

s2

<
'mi

<

s/b\

< mi

s2

Hence,

\r 2

By

Vb\ <

s2

continuing to choose

1, 2, 3,

<

|ri+ i

\n

we obtain

\/b\

Si

This means

we can

<

\/b\

si+1

\A| <

Si

sufficiently large,

m,:

<
mi
for

\n

find integers r -+i, s,+i that give


t

<

s i+1

<

rrii

Tfli

Thus

\ri+1

and

in this

way we can

satisfying the

But

for

y/b\

s i+1

set up an
above condition.

any pair

<

\fi

y/b\

Si

number

infinite

of pairs of integers

r, Si

ri} s i}

<

\n

Si

Vb\ <

< -

rrii-i

Si

Vb

Hence,

<

\n

8i

Vb\ < -

2si

Si

and

<

\n

Therefore, there are infinitely


s

> 0, such that


Lemma 10-3c.

exists

an

|r

an integer k

infinite

number

many

s b\ lies

If 6 is

< + 2-v 5<l+2v

Si b\

/6

pairs of integral values of r

between

and

a positive integer that

such that the equation x 2

of pairs of integers x

and

and

with

1+2 y/b.

y.

is

not a square, there

by 2

is

satisfied

by

ELEMENTARY THEORY OF NUMBERS

174

We have seen in lemma


r,

Since b

most

is

2[1

not a square,

pairs of integers

of pairs of integers

s b\ that lie between and 1+2 s/b.


b ^ 0, and thus the expression can have at

2 s/b] values so determined.

Consequently, at least one of


determined by an infinite number of the
and these are the values of x, y that satisfy x 2

these integral values, k

by 2

\r

number

10-2c that an infinite

give integral values for

r,

s,

0, is

k.

Theorem

10-9.

is not a perfect square,


has a solution distinct from x = 1, y 0.
Select k ^
so that the equation x 2 by 2 = k is satisfied by an infinite
number of pairs of values of x, y. Now separate the values of x, and in

the equation x 2

manner

a positive integer that

If b is

by 2

\k\ residue classes modulo k.


There are, theremodulo k into which the solutions x, y can fit.
Having excluded the finite number of solutions with either x or y zero, we
recognize that the equation shows that for any solution in which either
or both x and y are negative there is one in which both are positive.
Hence, there is an infinite number of solutions having both x and y posi-

like

of y, into the

fore, k 2 pairs of classes

tive.

Accordingly,

if

these positive solutions are distributed

k 2 pairs of residue classes modulo

=
=

X\
2/i

Now

Xi

2/2(mod k)

2/i
2

x2

^
^

x2

Xi,

x2

2/2

2/i,

2/2

=
=

- by, 2
- by 2 2

>
>

k
k

consider the quotient


Xi

x2

From

2 (mod k)
Xi

y/b

2/1

x x x 2 --

2/12/26

O12/2

x*2

Vb

2/2

\/b

X2IJ1)

y* 2h

the above congruences

^1^2

2/i2/2?>

Xi

x 2y x

Xiiji

byi

ss

0(mod

k)

and
xiy 2

xiiji

= 0(mod

k)

Therefore, let
XiX 2

2/12/26

_ u

the

Consequently, two pairs

must contain at least two of these solutions.


2/2 can be so selected that
2/1 and x 2

#i,

among

at least one of these pairs of classes

k,

ano

Xiy 2

x 2 yi

and thus
xi

2/1

Vb =

(u

s/b)(x 2

2/2

y/b)

2/1

V6 =

{u

\A)(>2

2/2

\/b)

Likewise,

SOME FAMOUS PROBLEMS


Hence,
Xi

by i 2

(u 2

k(u 2

bv 2

bv 2 )(x 2 2

175

by 2 2 )

or

v b)

so that

u2

and the integers u and v satisfy the equation x 2 by 2 = 1.


If v = 0, then u = 1 and then x\ 2/1 y/b = (x 2 y 2 y/b).
Thus Xi = x 2 yi = y 2 But since x h x 2 yi, y 2 are positive, x x = x 2
and yi = y 2j whereas we chose x h 2/1 and x 2 y 2 as distinct solutions of
x 2 by 2 = k. We have, therefore, found a solution x = u, y = v oi the
equation # 2 &2/ 2 = 1 that is distinct from the solutions x = 1, y = 0.
Theorem 10-10. If b is a positive integer that is not a square and if
2
2
Xi, 2/1 is the solution of x by = 1 for which Xi and 2/1 are positive and
#i + 2/i V^> has the least positive value, then any solution x, y of the
equation is determined by the formula x + y s/b = (x + 2/1 y/b) n
for n = 0, 1, 2, ...
Since x 2 by 2 = 1 has a solution in which 2/^0, there must be one,
Xi, 2/1, with Xi and ?/i positive integers, for which x\ + 2/1 V^> is a minimum. Then Xi 2 byi 2 = 1, and if x 2 2 by 2 2 = 1, let
.

and

(xi

2/1

VS)(^2

2/2

V^) =

2/3

V&

Oi

2/1

V&)(#2

2/2

y/b)

^3

2/3

V&

also

Consequently, x 3

mined

(xi

fo/3

1,

and the pair

a solution of the given equation.

is

y/b) n determines a solution of x 2

2/1

of integers z 3

by 2

2/3

so deter-

by induction, that

It follows,
1

for each positive

integral n.

Moreover,
/

Oi
and
X4

x2

if xi, 2/1, is

2/4

fo/

Again,

y/b

1,

2/1

v7rT
fr)

<

Xl

~ ^

)n

a solution of the given equation, then


(xi

2/1

y/b) n for n

2/1

1,

2,

x*, y
is

determined by

also a solution of

1-

n =

if
2/

0,

we

find

(xi

-\A)

= Oi

2/1

*\A)

and

0.

#, 2/ is a solution, x, 2/ and x, y, as well as .t,


Consequently, for n = 0, +1, 2,
all pairs of
.
determined by x
are solutions
2/ -\A =
(#i
2/1 V^)

Furthermore, when

y,

are solutions.

integers x,
of

x2

by 2

2/

71

1.

But the

pairs of integers x, y determined by the formula constitute all


the solutions of x 2
by 2 = 1, for if X, Y with both
and
positive is

ELEMENTARY THEORY OF NUMBERS

176

any solution that cannot be developed by the formula, then X + Y y/b


lies between two consecutive powers of the positive number X\ + y\ Vb',
that

is,

(*i

By

member

multiplying each

using the fact that Xi 2

if

we

yi b

we

1,

2/1

Vb) n+1
(xi

y1

Vb

y\

Vb) n and

see that

Vb) n

Vl

(xi

statement by

of this

Y Vb <

< (X + Y Vb)(x -

But

X+

Vh) n <

2/i

<x +
1

let

(X

+ Y Vb)(xi ~

Vi

Vb) n =

x'

+ y'Vb

- Y Vb)(x +

Vl

Vb) n =

x'

-y'Vb

necessarily giving

(X
then x n

by' 2

and

<

But

x'

y'

Vb =

(x

x'

y'

Vb)~ and
l

<
Adding

<

(4)

and

shows that

(5)

Vb <

y'

+ y\ Vb
X + Y Vb

Xi

Vb

Vb <

x'

>

0,

and subtracting

y'

>

y'

(4)

therefore

y'

impossible that x'

was

Vl

2y Vb, which implies that


it is

x'

however,

x1

(5)

(5)

from

(4) gives

Under these circumstances,

0.

Vb

be

less

than X\

chosen as the smallest of these numbers.

y\

Vb,

for

Therefore,

each solution, not x = 1,


2
2
y = 0, of x by = 1 in which one or both the integers x and y are negative must correspond a solution in which both are positive, we conclude
that all values of x and y that satisfy the equation can be obtained from

the formula x

(xi

Vb) n

2/1

+ y Vb

Since

= (#i

y\

to

Vb) n

EXERCISES
1.

2.

X2

_
3.

Show that all solutions of x 2 2y 2 = 1 can be developed from x = 3, y = 2.


Can you discover a method for developing solutions of both x 2 2y 2 = 1 and
2y 2

= -1

Show

V3 =

from x

1,

1?

that the formula for developing

(2

+ V3)

n
.

all

solutions of x 2

3y 2

is

CHAPTER

11

POLYNOMIALS

11-1. Integral

Domains and

Fields.

Let us

recall that the set

of

rational integers has certain salient properties with respect to the oper-

ation of addition which can be summarized in the following manner:

The sum

1.

the

of

two elements

in a certain order is a

unique element of

set.

Addition is commutative.
Addition is associative.
4. Each element has an inverse with respect to addition.
= a for any a.
such that a
It follows then that there is an element
There is a second law of combination for the set of rational integers
which we called multiplication, and it has the following properties.
1. Multiplication is unique, and the product is in the set.
2. Multiplication is commutative.
2.
3.

3.

Multiplication

is

associative.

4.

Multiplication

is

distributive with respect to addition.

5.

There

6.

an element 1, called the unity element, or unity, such that


= a for any a.
The elements obey the cancellation law, so that if ab = ac and

0,

Any

then

is

c.

set of elements that fulfills these 10 conditions is said to

integral

When

be an

domain.
the set has at least two elements and in addition to the above

properties each element of the set except zero has an inverse with respect
is called a field.
Thus, in a field, ax = 1 with
can be solved for x, and the value is unique. Hence, division by
= 1, then a(bx ) = b and a divides b. The
a t^
is possible, for if ax
rational integers fail to form a field, for division of an integer b by a ^
is not always possible, but the set of the rational numbers (ratios a/b of
two rational integers with b t^ 0) is a field. The real numbers as well as
the complex numbers also form fields.
Now consider the set of all polynomials J(x) a x n + aixtt-1 -j-
n, are selected from
+ a n where the coefficients a with i = 0, 1,
This set includes the field of the coefficients itself, and consea field.

to multiplication, the set

a^O

t-,

177

ELEMENTARY THEORY OF NUMBERS

178

and 1, which are called the identity


and multiplication, respectively. Conare polynomials of degree zero, whereas
stants not
is said to have no
The laws of elementary algebra show very easily that this set of
degree.
polynomials f(x) has the first nine characteristics enumerated above, but
we must clear up another idea before showing that the cancellation law
quently

it

contains the numbers

elements with respect to addition

also holds.

Two polynomials in x are said to be identically equal if and only if they


have equal values for all values of the variable x. But a polynomial in x
is not reduced to zero by more than n values
of the nth degree with n >
of x, and therefore f(x) vanishes identically if and only if all of its coeffiIf, then, the product of two polynomials with coefficients
cients are zero.
in a field F is identically zero, at least one factor must vanish identically,
for otherwise the product would be a polynomial of at least degree zero
and could not vanish identically. In short, there are no divisors of zero
in the domain of these polynomials, and that is equivalent to saying that
the cancellation law is observed. The polynomials with coefficients in a
field F, therefore, form an integral domain.
After recalling the early definitions and theorems that pertain to the
elements of the integral domain of the rational integers, it is easy to set
up the following analogous definitions and theorems concerning the elements of the domain of the polynomials f(x) with coefficients in a field F:
If two polynomials /(a;) and g(x) have coefficients in a field F,f(x) is said
to divide g(x)
g(x)

if

is

a polynomial q(x) with coefficients in

Then

f(x)q(x) identically.

quotient of g{x)

most that

A
A

there

by f(x).

f(x)

Furthermore,

is
if

such that

a factor of g{x) and q{x)

g(x)

0,

is

the degree of /(re)

the

is

at

of g(x).

polynomial that divides only itself is a null polynomial.


polynomial that divides every polynomial with coefficients in

is

unit polynomial, or a unit.

Theorem

11-1.

If g(x)

mials have coefficients in a

f(x)q(x),

field F,

where

f(x)

the quotient q(x)

and the polynois

unique.

If

g(x)

f(x)qi(x)

f(x)q 2 (x)

then
f(x)[ qi (x)

q 2 (x)}

Hence,
qi(x)

Theorem

q 2 (x)

and

q x (x)

q 2 (x)

11-2.
Zero is the null polynomial of the set of polynomials
with
coefficients
in F.
f(x)
The equation
shows that the quotient of zero by zero exists
f(x) =
but is indeterminate. It also shows that zero divides only itself. Fur-

POLYNOMIALS

179

thermore, every polynomial f(x) divides zero, so that there can be but one
null polynomial.
Theorem 11-3. All the elements except zero of a field F are unit poly-

nomials of the set of polynomials with coefficients in F.


It is evident that a constant not zero of F divides every polynomial
whose coefficients are in this field. But a polynomial of degree n >

cannot divide any constant except zero.


A polynomial with coefficients in a field F whose leading coefficient is
unity is a monic polynomial.
The associates of a polynomial with coefficients in a field F are the products of that polynomial by the unit polynomials of the set of polynomials.
A polynomial with coefficients in F that is not a unit and that is divisible only by its associates and the units is a prime polynomial.
A polynomial with coefficients in F that is not zero, a unit, or a prime
polynomial is a composite polynomial.
A common divisor of two or more polynomials with coefficients in F is a
polynomial of the set that divides each of the given polynomials.
A greatest common divisor of two or more polynomials, not all zero, with
coefficients in F is a common divisor that is divisible by every common
When the coefficients of the given polydivisor of the given polynomials.
nomials are in a field F, the monic polynomial that is an associate of a

common

greatest
If

the greatest

cients in a field

Theorem

divisor

is 1,

11-4.

coefficients in

If f(x)

kb

divisor of the set.


coeffi-

and

g(x) are polynomials with coefficients

a unique pair of polynomials q(x) and r(x) with

that satisfy the identity g(x)

f(x)q(x)

r(x)

with

or of lower degree than fix).

Do

is satisfied.

likewise

if

g(x)

is

of lower degree

=
=

0.

and

r(x)

than f(x)

g{x)

and the

~
not of lower degree than f(x), take qi(x) = kx n m where
~
m
n
Then ri(x) = g(x) kx f(x) is lower in degree than g(x)

If g(x)

common

two or more polynomials with

~
a xn
an
aix n 1
~l
m
++&, take q(x)
bix

theorem
a

If g(x)

b xm

called the greatest

divisor of

the polynomials are relatively prime.

in a field F, there exists

either r(x)

is

common

is

and
g(x)

f(x)q 1 {x)

n(x)

or if its degree is lower than that of f(x) } the existence of the


pair of polynomials has been demonstrated, but if neither is the case,

If ri(x)

repeat the operation, using f{x) and r(x).


7*iO)

f(x)q 2 (x)

g(x)

f(x)[q!(x)

Thus we obtain

r 2 (x)

and

Again,

if

r 2 (x)

or

if its

degree

is

q*(x)]

r 2 (x)

lower than that of f(x), the required

ELEMENTARY THEORY OF NUMBERS

180

polynomials are qi(x)

and

#2(2)

number

until after a finite

r 2 (x),

r s _i(z)

f(x)q 8 (x)

g(x)

f(x)[qi(x)

if

not, the process

is

repeated

r s (x)

Hence,

and

but

we obtain

of steps

++

q 2 (x)

q.(x)]

r a (x)

= 0, or it is lower in degree than /(re).


suppose that there are two pairs of polynomials that satisfy the

either rs (x)

Now

Then

stated conditions.

g(x)

f(x)q(x)

r(x)

f(x)Q(x)

R(x)

and

f(x)[q(x)

Q(x)]

r(x)

R(x)

s=

Consequently, q(x) = Q(x), or the degree of the above expression would


be at least that of f(x). Accordingly, r(x) = R{x).

Theorem

The

11-5.

greatest

common

divisor D(x) of

two polyno-

mials f(x) and g(x), not both zero, with coefficients in a field F exists and
can be expressed in the form D(x) = F(x)f{x)
G(x)g(x), where the

polynomials F(x) and G(x) have coefficients in F.


Using Theorem 11-4 we apply the analogue of the Euclidean algorithm
to the polynomials f(x) and g(x) of degrees m and n, respectively, with

<m<

Then

n.

g(x)
f(x)

Ri{x)
Rt-i(x)

= f(x)Qi(x) + Ri(x)
= Ri(x)Q (x) + R (x)
= R (x)Q (x) + R${x)
2

= R

Ri(x)

is

of degree

(x) is of

Rz{x)

(x)Qt+i(x)

is

< m
m < mi
m <m

m\

degree

of degree

+ R t+1

We must finally arrive at a step in which R t+ i is a constant, for the polynomials Ri(x), where i = 1, 2,
Then
t
1, decrease in degree.
by making use of an argument that parallels that in the proof of the
.

Euclidean algorithm, we see that f(x) and g(x) have a greatest common
It is also
divisor R (x) different from a constant if and only if R t+ i = 0.
evident that a necessary and sufficient condition that f(x) and g(x) be
relatively prime is that R +i be a constant different from zero.
If Ri(x) f^ 0, solve for each Ri(x) that is not zero, and substitute the
expression in the succeeding equation of the algorithm.
Thus when
t

R t+1 = 0, we find that


R {x) = g{x) -f(x)Q (x)
l

+ Qi(x)Q

Rz(x)

=
=

= F 1 (x)f(x)

R.{x)

(x)

[1
[1

2 (x)]f(x)

Q2(x)Q 3 (x)]g(x)

G!(x)g(x)

- Q {x)g{x)
- [Q (x)Q 2 (x)Q
2

z (x)

+ Q

1 (x)

Q*(x)]f(x)

POLYNOMIALS

Hence

if

and

f(x)

D(x)

However,

f(x)

if

and

+G

(x)f(x)

(x) is

not a monic

we have

G,(x)g(x)

g(x) are relatively prime,

if

leading coefficient,

its

F,(x)f(x)

R t+1 = F
and dividing by

prime and

g(x) are not relatively

polynomial, by dividing through by

181

we

find

(x)g(x)

we obtain

Rt+i,

F(x)f(x)

+ G(x)g(x)

In the last case the term of highest degree of F(x) comes from the
product Qi(x)Q 2 (x)
Q +i(x). The degree of Qi(x) is n m, of
Q 2 (x) is m mi, and the degree of each Qj(x), where j = 3, 4,
Therefore, when m > 1, the degree of their
t
1, is m/_ 2 W/_i.
(m mi) +
product is less than n, the degree of #(#), for n m
In like manner, when
(m _i m ) = n m
(mi m 2 )
m > 1, the degree of G(x) is determined by the degree of Q 2 (x)Q z (x)
Q t+ i(x) and is less than m, the degree of f(x).
In the special case where R\(x) = 0, fix) is a greatest common divisor,
and then f(x) = f(x)
g(x) and the theorem holds.
Notice that although the method is applicable when the polynomial
f(x) is a constant not zero, the statement about the degrees of F(x) and
G(x) does not hold. For example, if g(x) = 4x
3 and f(x) = 2, we
write 1 = 2 J
If f(x) = 0, the result is obvious.
(4#
3).

'

'

'

t.

The following theorem is now evident:


Theorem 11-6. The polynomials f(x) and
field

are relatively prime

G(x) with coefficients in

Theorem
and
If

Di(x) and
\

1,

= cD

2 (x)

D (x)
D (x).
2

(x).

common

Also

11-8.

is

+ G(x)g(x)

2 (x)

1.

divisor of the polynomials f(x)

unique.

two greatest common

and g(x),
than or equal to the
Hence, di = d 2
d\.

divisors of f(x)

d\ of Di(:r) is less

Di(x), so that d 2

<

(x).

If fi(x)

with coefficients in a
/i(z) divides

g(x) with coefficients in a

there exist polynomials F{x) and

and Z>2(^) can differ only by a constant factor; that is,


But each one is a monic polynomial. Therefore,

and Di(x) =

Theorem

are

if

such that F(x)f(x)

greatest

and the degree

result Di(x)

Di(x)

and only

g(x) with coefficients in a field

then Di(x)
degree d 2 of

As a

The

11-7.

if

field

and f 2 (x) are

F and if /i(x)

relatively

(x).

Since (fi(x),f 2 (x))

1,

fi(x)F 1 (x)

+f

prime polynomials

divides the product f 2 (x )fz(x), then

(x)F 2 (x)

ELEMENTARY THEORY OF NUMBERS

182

Then

MiWW +

Applying the distributive law,

Theorem

11-9.

-/,(*)

evident that f\ (x) divides /3 (x).


g(x) are relatively prime polynomials of

it is

and

If f(x)

f*(x)f t (x)F t (x)

first degree with coefficients in a field F, there exists one and


only one pair of polynomials F(x) and G(x) with coefficients in F satisfying

at least the

and such that the degree of F(x)


than that of /(x).
That the required polynomials F{x) and G(x) exist has been proved in
Theorem 11-5, but if there is a second pair F\(x) and Gi(x) of such polythe condition F(x)f(x)

is less

than that

of g(x)

G(x)g{x)

and the degree

of G(x) is less

nomials, then
F(x)f(x)

G(x)g(x)

= F 1 {x)f{x)

{x)g{x)

Hence,
f(x)[F(x)

But

and

since f(x)

Unless F(x)
F{x)

Fi(x)

F,(x)]

g{x)[G 1 {x)

G(x)]

g(x) are relatively prime, g(x) divides F(x)

F\(x)

is less

this division

than that

would be impossible,

of g(x).

It is

Fi(x).

for the degree of

then obvious that G(x)

It is important to observe the conditions set by the last theorem.


We
admit that when the given polynomials are the constants a and 6, there are

infinitely

many

Theorem

11-9 requires /(x)

solutions of ax

and

by

But

1.

and

places a restriction on the degree of both F(x)

condition

is

it is

to be noticed that

g(x) to be of at least the first degree

removed, we can find

many

G(x).

If

pairs of polynomials F(x)

+ G(x)g(x) =
F(x) + k(x)g(x)

G(x) that will satisfy the equation F(x)f{x)

and G(x)

form
Are there any others?

do, then all pairs of the

k(x)f(x) will also.

nomials

On

is

When

1,

and

the second
for

if

and
Fix)

and G{x)

one of the given poly-

now be obvious.
common divisor of

a constant, the results should

the other hand

when

the greatest

the given poly-

even so simple a case as expressing the greatest common


divisor of x 2 4x + 3 and 2x 6 shows the lack of unicity in the pair of
polynomials F(x) and G(x) having the restriction on degree stated in
nomials

is

Theorem

not

1,

11-9, for
(x 2

4x

3)(

+ l) +

(2.r

6)

(-

lj

= x -

and
(x 2

When

the

field

4x

3)(-l)

(2x

6)

containing the coefficients of f(x)

numbers, on the basis of the fundamental theorem

is

the set of complex

of algebra,

we know

POLYNOMIALS

183

that, except for the order of the factors, f(x) can be factored into linear
factors,

each with leading coefficient unity and absolute term in F, and a


Hence, the identity

constant factor, in exactly one way.

fix)

a xn

where the

aix n

with

Vi,

factorization of f(x)

'

'

1 7 2,

a>n

The reader

tion of f(x) does not exist in

+
+

'

cto(x

r l )(x

r 2)

(x

r)

unique
however, that such a factorizaIn the field of the real numbers

n, are in F, expresses this

realizes,

all fields.

cannot be so factored, but in the field of the complex numbers


Although x 2 - 2 = (x - y/2)(x + y/2) in
i = (x - i)(x + {),
X2
the field of the real numbers, it cannot be factored into linear factors in the
field of the rational numbers.
If a polynomial f(x) of degree n with coefficients in a domain F cannot
be factored into two polynomials of at least the first degree with coefficients in F, then f(x) is said to be irreducible in F.
Otherwise f(x) is
x2

Thus x s 5 is irreducible in the integral domain of the


integers and also in the field of the rational numbers, but it is

reducible in F.
rational

reducible in the field of the real numbers.

The

field of

the rational numbers

tains the rational integers,

and

so

is

we

the smallest infinite

shall consider a

field

that con-

few important char-

polynomials with coefficients in this field. We are especially


concerned with being able to classify the coefficients of the factors of an
integral polynomial.
acteristics of

primitive polynomial

is

an integral polynomial whose

coefficients are

relatively prime.

The primary associate of an integral polynomial is that associate of the


polynomial whose coefficients are relatively prime integers and whose
leading coefficient

Theorem

positive.

is

11-10.

If fi(x)

and f 2 (x) are

integral polynomials, a neces-

sary and sufficient condition that their product be a primitive polynomial


is

that both fi(x) and f 2 (x) be primitive polynomials.


Suppose that
n
aix 1
/iO) = a Q x

++

71

and
f 2 (x)

xm

b x x- 1

++&.

with n > m, have integral coefficients that are relatively prime. Their
product necessarily has integral coefficients, but suppose that a prime p
divides each of these coefficients.
Then there is a first a;, say a r and a
,

first bj,

say

a r + s bo

6S

that

is

not divisible by

a r +ib s -i

a rb s

p.

Now
a r-ib s+ i

consider the coefficient of

+ a r+s -m b m

ELEMENTARY THEORY OF NUMBERS

184

of this expression is divisible by p, and thus it is


the coefficients of the product be divisible by p.
Hence, the product is a primitive polynomial.

Each term except a r b s


impossible that

all

On the other hand,


and p

is

if

fi(x)

pg(x),

a prime, then fi(x)f2 (x)

where g(x)
p[g(x)f 2 (x)]

an integral polynomial
and the product is not

is

primitive.

Theorem

11-11.

If f(x) is

a polynomial with integral coefficients and

leading coefficient unity, fix) is factorable into the product of two monic
polynomials in the field of the rational numbers if and only if it is factor-

domain

able in the

Let f(x)

of the rational integers.

where fi(x) and/2 (z) are monic polynomials with


and suppose that not all the coefficients of the
Reduce all fractional coefficients to their lowest

fi(x)f2 (x),

rational coefficients,
factors are integers.

and d 2 be the least common multiples of the denominators


and 2 (#), respectively. Then the coefficients
= difi(x) and h(x) = d 2f2 (x) are relatively prime integers.

terms, and let d\

of the coefficients of fi(x)

of

both g(x)

Consequently, the product g(x)h(x)


nomial.
But then f(x) fi(x)f2 (x)
coefficients unless d\d 2

= did fi(x)f (x) is a primitive poly= g(x)h(x)/did cannot have integral


2

In short, the coefficients of both fiix) and

1.

f2 ix) are integers.


the domain of the integers,
and so the converse is obvious.

If f{x) is factorable in

able rationally

it is,

of course, factor-

a polynomial fix) with coefficients in the field R


is irreducible in R, and if f(x) divides the product
of the polynomials g(x) and h(x) with coefficients in R, then f(x) divides

Theorem

11-12.

of the rational

If

numbers

at least one of g(x)

and

h(x).

Because f(x) is irreducible in R, the greatest common divisor of f(x)


and g(x) either is the monic polynomial that is an associate oif(x), or is 1.
In the first case f(x) g(x). In the second, we have shown that /(a;) h(x).
Theorem 11-13. Any polynomial of at least the first degree with
rational coefficients can be resolved into a product of a rational constant
and one or more monic irreducible polynomials of at least the first degree
with coefficients that are rational. Except for the order of the factors
|

this factorization is unique.


If f(x) is either of

in the field

the

first

monic polynomial, and

c is

degree or of higher degree and irreducible

numbers, then f(x)


a rational number.

of the rational

cg(x),

where g(x)

is

If f(x) is reducible in R, let f{x) = fi(x)f 2 (x).


Each of the new polynomials is of lower degree than f(x). Either fi(x) is irreducible in R, or
it has a factor fz(x) which is lower in degree than fi(x) and is in turn a
Continuing in this manner, we observe that the degree
factor of f{x).
of each factor is lower than that of its predecessor and so the process must
end; that is, there must be an irreducible factor, say p(x),oi f(x). Then

POLYNOMIALS

f(x)

finite

185

We now

operate on q(x) in the same


that
determine
number of steps
p(x)q(x).

f{x)

Cpi(x)p 2 (x)

'

way and

after a

p r (x)

'

where c is a constant and the pj(x) are monic irreducible polynomials.


Then
Suppose that there are two such factorizations of f(x)
.

cpi(x)p 2 (x)

Clearly, c

k, for

p r (x) = kq 1 (x)q 2 (x)

q s (x)

the other factors are monic polynomials.

Pi(x) divides the product of the qi(x),

where

1, 2,

Moreover,
Hence,

s.

But qi(x) is irreducible in R.


and since each is monic, qi(x) = pi(x). Canceling
factors and repeating the argument, supposing that s > r,

Pi(x) divides one of the qi(x), say qi(x).

Thus

qi(x)

the identical

tpi(x),

we have

q r +i(x)

Consequently, each of these factors

is 1,

q s (x)

and the

original factorization

is

unique.

Theorem 11-14. If fi(x) and f2 (x) are integral polynomials, not both
we can choose a greatest common divisor of them so that it is an

zero,

integral polynomial.

Since the coefficients of fi(x) and f 2 (x) are rational, their greatest
divisor D(x) exists and can be written

common

D(x)
Let

and h be the

d, g,

common

least

g(x)/g,

and

2 (x)

h(x)/h.

fl{x)

(x)F 2 (x)

multiples of the denominators of the

and F 2 (x), respectively.

coefficients of D(x), Fi(x),

Fxix)

+f

fi{x)Fi(x)

and

h.

d(x)/d,

common

multiple of

Thus
k,d(x)

where kid(x)

m+ Mx) m

Multiply both members of this equation by the least


d, g,

Let D(x)

Then

is

fi(x)[k 2 g(x)]

an associate

of the

+f (x)[kzh(x)]
2

monic polynomial D(x) and has integral

coefficients.

Very often we use the primary associate of kid(x) in place of the greatest
divisor of fi(x) and f 2 (x) even though we may not be able to
write it in the above form with k 2 g(x) and k z h(x) integral polynomials.
Example. The greatest common divisor x of 3a; 3 2x 2 3x + 2
and 3a; 2 8a; + 4 can be expressed in the form

common

-#=

i(3a;

2a;

3a;

2)

(a

2)(3a; 2

Sx

+ 4)

ELEMENTARY THEORY OF NUMBERS

186
Its associate

9x
6

Instead of 9x

9x

3a;

6 can be written

(3x z

2x 2

Sx

however, we

6,

+ 2) -

may

(3x 2

Sx

4)0

2)

prefer to use its primary associate

2.

EXERCISES
Can

1.

the primary associate of the greatest

2x
5x + 3 be expressed in
polynomials?
2

common

the form developed

in

divisor of 2x 2

Theorem 11-14 that

and

uses integral

Find the greatest common divisor of 6x 3 + I3x 2 + 4z 3 and 2a; 3 + 9x 2 + 13x


and express it in terms of the given polynomials. Write its primary associate.
3. Do the rational integers modulo p, sl prime, form a field?
4. A number r is said to be an algebraic integer if it satisfies a rational integral equa~
tion x n + aix n 1 +
an = 0, where the coefficients a*, for i = 1, 2, .
, n,
are rational integers.
If a is a rational integer, apply this definition to the roots of
the equation x m = a and consider the problem of factoring a.
2.

+ 6,

11-2. Polynomials with Respect to a Prime Modulus.


When the
modulus is a prime p, we pointed out in Chap. 5 that the division of fi(x)
by f2 (x) 7^ 0(mod p), where these are integral polynomials, exists. To
carry out the division, we may use the method of choosing k so that the
leading coefficient of kf 2 {x) is congruent to 1 modulo p, and then dividing
fi(x) by kf2 (x) according to the process of ordinary long division, so that
/i(z)

where r(x)
Hence,

is

kf2 (x)g(x)

r(x)

or an integral polynomial lower in degree than f2 (x).

= f2(x)[kg(x)] +

fi(x)

and

r(x)(mod p)

is the remainder in the division modulo p


This division has already been shown to be unique.
Definitions analogous to those in the first paragraph of this chapter
show that the set of integral polynomials modulo p, a prime, forms an
integral domain.
The unit polynomials, or units, modulo p are the
rational integers that are prime to p, for when (a, p) = 1, the congruence

kg{x)

of fi(x)

is

the quotient while r(x)

by f 2 (x).

ax = b (mod p) has a solution and we can infer that a divides any integral
polynomial modulo p. There can be no other units modulo p, for 1 is not
divisible modulo p by a multiple of p or by any polynomial of the first
degree or higher. Since r is identically congruent to r + kp modulo p,
1, 2,
p 1 represent all the units modulo p. Moreany integer congruent to
modulo p represents the null element.
In like manner, the rational integers congruent to 1 modulo p denote the
unity element of the set of integral polynomials modulo p. The definition
of an identical congruence stated in Chap. 5 is the basis for the statement

the integers
over,

POLYNOMIALS
that

if

f(x)g(x)

0(mod

187

p) identically, at least one of the polynomials

modulo p. There are, theref(x) and g(x) is identically congruent to


modulo p in this set of polynomials.
fore, no divisors of
A monic or primary polynomial modulo p, a prime, is an integral polynomial whose leading coefficient is congruent to 1 modulo p.
The primary polynomial modulo p in a set of associates of f(x) modulo
is
called the primary associate of f(x) modulo p.
p
A prime polynomial modulo p is an integral polynomial that is not a unit
modulo p and which is divisible modulo p by only its associates and the
units modulo p.
An integral polynomial that is not congruent modulo p to zero, a unit,
or a prime polynomial modulo p is a composite polynomial modulo p.
Example. The integers 1, 2, 3, and 4 represent the unit polynomials
modulo 5. The primary polynomials modulo 5 of the first and second
degree can be reduced modulo 5 to one of the following polynomials:
x
x
x
x

+1
+2
+3
+4

x2
x2
x2
x2
z

x2
x2
x2
x2
2

+l
+2
+3
+4

+x
+x
+x
+x
+z

x2
x2
z2
x2
z2

+1
+2
+3
+4

+ 2x
+ 2x
+ 2z
+ 2x
+ 2z

x2

+
+
+
+

z2

x2

2
a;

+ Sx
+ Sx + 1
+ 3x + 2
+ 3x + 3
+ 3z + 4

Of these the following are prime polynomials modulo

The

+3
+4
+2

x
x
z2

z-fl
2

z2

x2

x
x2
z2

+
+ +
-f-

+ 2^+3
+ 2^ + 4
+ 3z + 4

modulo

ic

z2
z2
z2

+ 4z
+ 4z
+ 4x
+ 4z
+ 4z

+1
+2
+3
+4

5:
2

+ 4x +

associates of this set of primary prime polynomials

sent the incongruent prime polynomials

x2

5 of the

modulo 5 reprefirst and second

degree.

common

divisor modulo p, a prime, of a set of integral polycongruent to zero modulo p, is a common divisor of the
set that is divisible modulo p by every common divisor of the set.
We
refer to the primary associate of a greatest common divisor modulo p as
the greatest common divisor modulo p.
greatest

nomials, not

Theorem

all

and f 2 (x) are integral polynomials, not both


modulo p, a prime, then D(x), the greatest common divisor modulo p of fi(x) and fi(x), exists and there are
integral polynomials gi(x) and gi(x) such that D(x) = fi(x)gi(x) +
11-15.

If fi(x)

identically congruent to zero

f 2 (x)g 2 (x)(mod p).


If there is

any

difference in degree,

assume that the degree of fi(x) is


is evident unless both polyno-

higher than that of f 2 (x), for the theorem


mials are nonconstants.
Then
fi(x)

=f

(x)q!(x)

riO)(mod

p)

ELEMENTARY THEORY OF NUMBERS

188

= 0(mod p) or ri(x) is of lower degree than/2 (x). Repeat


by dividing the remainder into the previous divisor whenever
k.
Vi(x) ^ 0(mod p), where i = 1, 2,
After a finite number of
steps we shall arrive at a remainder which is congruent to
modulo p,
for the degree of the remainder continually decreases.
Thus
and

either r\(x)

this process

/2O)
n(x)
r k - 2 (x)
r k -i(x)

Then every common

=
=

r 2 (x)q 3 (x)

+r
+r
+

r k -i(x)q k (x)

2
3

(x)(mod p)
(x)(mod p)
r k (x)(mod p)

r k (x)q k+1 (x)(mod p)

divisor

modulo p

of fi(x)

and/2 (V)

divides r k (x),

common divisor modulo p of these polynomials.


is a greatest common divisor modulo p offi(x) and
Or).

r k (x) is
r k (x)

s= ri(x)q 2 (x)

successively for the n{x) in terms of fi(x)

nix)

= fi(x)hi(x) + f

and f 2 (x), we

and

Therefore,

By solving

find

(x)h 2 (x)(mod p)

the leading coefficient c of r k (x) is not congruent to 1 modulo p, we


determine d so that cd = 1 (mod p) and multiply each member of the congruence by d, thereby obtaining
If

D(x)

^f^g^x) + f

(x)g 2 (x)(modp)

Consider the problem of determining when the degree of g 2 (x) will be


than the degree of fi(x) and that of gi(x) will be less than the degree

less

oif2 (x).
It will now be easy for the reader to prove the following theorems:
Theorem 11-16. If the integral polynomials fi(x) and f 2 (x) are relatively prime modulo p, a prime, and if fi(x) divides f 2 (x)fz(x) modulo p,
then fi(x) divides f^(x) modulo p.
Theorem 11-17. If p is a prime, the integral polynomials fi(x) and
f2 (x) are relatively prime modulo p if and only if there exist integral polynomials gi(x) and g 2 (x) such that fi(x)gi(x) + f2 (x)g 2 (x) = l(mod p).

Consider the problem of the unicity of #1(2) and g 2 (x).


11-18.
A composite integral polynomial modulo p, a prime,
can be factored into prime polynomials modulo p, and except for the
order of the factors and associated polynomials modulo p the factorization

Theorem

is

unique for the modulus

A Method

p.

Congruence Modulo p, a Prime. If p


modulo p of f(x) = 0(mod p) are among
the solutions of x p x = 0(mod p). Therefore, to solve f(x) = 0(mod p),
find D(x), the greatest common divisor modulo p of f(x) and x p x.
Then the solutions of D(x) = 0(mod p) are the distinct solutions of
Of course,
f(x) = 0(mod p), and their number is the degree of D(x).
11-3.

is

a prime,

all

for Solving a

distinct solutions

POLYNOMIALS
f(x)

0(mod

p)

may have

189

a repeated solution, but the existence of a

r(mod p) can be determined by removing the


factor x r modulo p from fix) and substituting r for x in the quotient.
Example. We can exhibit the usefulness of this device by finding the
2
The application of the
solutions of x 5 + x 3 + x x + 3 = 0(mod 5).
5
x and a; 5 + x z + x 2 x + 3 shows that D(x) = x 2
algorithm to a;
3x + 2 (mod 5) and therefore that the only distinct solutions of the given
congruence are x = 1, x = 2(mod 5). But x b + x z + a; 2 x + 3 =
2
3
2 The congruence z 3 + 3a; 2
3a; + 2)(x + 3a; + Sx + 4) (mod 5).
(a;
+ 3a; + 4 = 0(mod 5) has the solution x = 2 (mod 5), and a; 3 + 3a; 2 +
2
- 2) (mod 5). However, a; 2 - 2 = 0(mod 5) is
3a; + 4 = (a; - 2) (a;
Hence, the solutions of the
satisfied by neither x = 1 nor x = 2 (mod 5).
original congruence are x = 1, x = 2, x = 2 (mod 5).
multiple solution x

EXERCISES
Write the primary prime polynomials modulo 3 of degrees 0, 1, and 2. Then
all the prime polynomials modulo 3 of degree 2 that are incongruent modulo 3.
2. Factor 2x 5 + x 3 + 2z 2 + 2x + 2 into prime factors modulo 3.
2
4
3. Find the solutions of x - 2x - 3 = 0(mod 5).
4. Find the solutions of x 5 4x 3
Sx = 0(mod 7).
5. Find the solutions of x 4 x
1 m 0(mod 7).
4
6. Find the solutions of 2x - 10z - 27 = 0(mod 35).
7. If f(x) is an integral polynomial and p is a prime, develop a method for solving
the congruence /(x) = 0(mod p) by using the derivatives oif(x) with respect to x and
1.

write

certain greatest

common

divisors

modulo

p.

CHAPTER

12

PARTITIONS

12-1.

The Additive Theory

Numbers.

of

Leibnitz (1646-1716) was

mathematicians who paid particular attention to developing the theory concerned with the separation of an integer into all possible
summands selected from a given set, for example, the representation of 4
by 4, 3 + 1, 2 + 2, 2 + 1 + 1, 1 + 1 + 1 + 1, where selections are
made from 1, 2, 3, and 4. To Euler, however, is due a large part of the
This additive theory of numbers is a difficult subject. We
basic theory.
The student can refer to the
shall develop only the fundamental ideas.
work of G. H. Hardy, one of the modern experts in this field, for an
extensive treatment of this topic.
If from any set of positive integers a, where i = 1, 2, 3, . . . , finite

among

the

or infinite,

first

we

select

numbers

representation, whether or not


integer n.
of

in

it

so that

Thus the representation

which the selection

this chapter

we

is

n = ax

of

n as a sum

made from

a2

1,

2,

q or

is

In
addends from the

the set of positive primes.

shall confine ourselves to selections of

set of positive integers

a m the
a partition of the
of primes is a partition

contains repetitions,

from

all

the positive integers,

considering both the case where repetitions are permitted and where they
are prohibited,

the order of the

summands

in each situation

being

irrelevant.

We shall represent the number of partitions of n containing m selections


with repetitions allowed by P(n, m, <g).
shall use the symbol Q(n, m, <q).
If the
representations are to have at most m parts selected without repetition
from 1, 2,
q, their number will be expressed by Q(n, <m, <g).

from the integers 1,2,


If repetitions

When

are prohibited,

we

made from the set of all positive integers, we


employ P(n, m) and Q(n, m) for the number of partitions of n, with
repetitions and without repetitions, respectively, that have exactly m
the selections are

shall

parts.

If

the selections are unrestricted as to the

number

of parts,

we

<q) to mean the number of partitions of n, with


repetitions permitted, into any number of parts all of which are less than
or equal to q, and Q(n, U) to mean the number of partitions of n into any
number of parts selected without repetition from the positive integers.

shall write P(n,

U,

190

PARTITIONS
If

the selection of the unrestricted

1,

2,

Q(n, U,

and

191

number of parts is to be from among


q, we shall write P(n, U, q) and

always to include

is

q).

remaining n

Thus when n

separate n into m parts with


one unit, and then distribute the

To

12-2. Partitions with Repetitions.


repetitions let each of the

m parts have

m units to
> m and the

one part, to two parts,

from the positive

selections are

to

parts.

we

integers,

have

= P(n - m,

P(n, m)

1)

+ P(n -

m, 2)

+
+

P(n

m, m)

But then
P(n

1,

m-

= P(n -

1)

m,

1)

P(n

m,

2)

+
+

P(n

m,

1)

Hence,

= P(n

P(n, m)

1,

1)

P(n

m, m)

and we have proved:

Theorem
equal to

When

12-1.

integers, the

P(n

the addends are selected from the positive

number

of partitions of

P(n
the number

1,

To

Example.
find P(7, 3)

find

P(6, 2)

recursion formula of

1)

P(4, 3)
P(3, 2)

=
=
=
=

P(5,

1)
1)

P(3, 2)
P(2, 1)

into

parts with repetitions

of partitions of 7 into three parts,

12-1,

P(3,

is

m, m).

Repeating the application

P(4, 3).

Theorem

P(6, 2)
P(4, 2)

we

we

of the

obtain

+ P(4,
+ P(2,
+ P(l,
+ P(l,

2)
2)

3)
2)

=
=
=
=

1
1

+
+

P(4, 2)
1

P(3, 2)
1

Hence,
P(7, 3)

= P(n 1, m 1).
and P(n m, m) = 0.
Corollary 2.
P(2n, 2) = n, and P(2n + 1, 2) = n.
The partitions of an even integer 2n into two parts are

Corollary
If

m>

If

1.

n/

2,

m > n/2,
m < m

P(n, m)

(2w

2)

(2n

n)

an odd integer 2n

+
+

-f-

The
are

partitions of

(2n

1)

greater than

into

two parts

ELEMENTARY THEORY OF NUMBERS

192

+
+

2n

(n

By making

1,

(2n

1)

1)

use of the formulas P(n, n)

1,

P(n, n

P(n,

1)

P(n - 3, 2)
+ P(n - 3,

3)

1)

1,

as well as

P(n, 2)
P(w, 3)

= P(n = P(w -

=
P(n, k)

1, 1)

1,

2)

+ P(n -

+ P(n - 2, 2) =
+ P(n - 3, 3) =
3, 2)

= P(n - 1, k = 1 + P(n - *,

P(n

+ P(w + P(w -

1)

2)

+ P( -

P(n

2, 2)

2, 1)

3, 3)

ft)

fc,

*, 3)

P(n

we can set up a table of the number of partitions of n into


from the positive integers with repetitions permitted.

k, k)

m parts selected

Values of n

m, the

number
of parts

10

12

11

15

10

13

11

2
3

5
6
7
8
9

10

11

12

P(n 1) = 1. The formulas P(n, n) 1


account for the two diagonals of l's. Passing to
the second row, to find P(3, 2), we merely add the numbers in the column
= 2,
under
To find P(4, 2), add the numbers under
etc.
To write the third row, sum the numbers under 4 3 = 1 for
P(4, 3), the numbers under 5 3 = 2 for P(5, 3), the numbers in the
first three rows under 6 3 = 3 for P(6, 3), the numbers in the first three
rows under 7 3 = 4 for P(7, 3), etc.
From the way the table has been set up it is evident that we can find
P(n, <m) by merely looking up P(n + m, m).

The

row

first

and P(n, n

of the table uses

1)

4-2

3-2=1.

12-3.

exactly

Diagrams

of Partitions.

parts selected from

If

1, 2,

we
.

set
.

all the partitions of n into


with repetitions permitted,

up
q,

193

PARTITIONS

and always employ at


partitions,

least

one

and then remove one

q,

from each

of the

partitions with repetitions permitted of

we obviously have the

P(n, m, q) =
m 1 parts selected from 1,2,
q; that
_ q m i <g). If repetitions are prohibited, Q(n, m, q) =
q, m 1, <q 1).
We can diagram a partition of n into m parts that include q as a greatest

n
P( n
Q(n

q into

is,

integer in the following

thus graphically exhibit the statement

way and

made above:
1

1
...
... 1

(q units)

(m rows)

Moreover,

we read

if

the diagram by columns,

we have a

partition of

Such partitions are said to be


into q parts of which the greatest is m.
The diagram shows that the following statement is valid:
conjugate.
There are as many partitions of n into m parts selected
and always including q as there are partitions of n into
parts such that one is m and the others are less than or equal to m, repe-

Theorem

from

1, 2,

12-2.
.

q
titions being permitted in each case.

Similarly the diagrams

Theorem
of

12-3.

n into at most

parts

repetitions permitted of

P(n,

<m) =

P(n,

<m) =

show the following theorem, due to Euler:

The number
n

is

of partitions

the same as the

into parts

P(n, U, <m).
Furthermore, by subtracting P(n,

The diagrams also make it clear


Theorem 12-4. The number of
n into

repetitions

which do not exceed m; that

<m

1)

P(n, U,

<m

1)

is,

from

P(n, U, <m), we have:


P(n, m) = P(n, U, m).

Corollary.

of

with repetitions permitted


number of partitions with

that:

partitions with repetitions permitted

more parts is the same as the number of partitions with


permitted of n into parts containing an element that is greater
or

than or equal to m.
12-4. Generating Functions for the Number of Partitions.
Consider
the addends that are summed to determine the exponents of x in the
product (1
z 2 )(l + x*) = 1
x 1+2 + x 3 + x 1+ *
x)(l
x + x2
i+2+3
j j s evident that these exponents are the results arising
a-2+3 _[_ C
from all possible selections of one, two, and three distinct summands from
the set 1, 2, 3.
Consequently, the coefficient 2 of x 3 gives the number of
ways 3 can be produced by adding together distinct integers selected from
Similarly the coefficient of x n in the expansion of (1 +
1, 2, and 3.
x)(l -f- x 2 )
(1 + x q ) is the number of partitions of n into dis-

<

ELEMENTARY THEORY OF NUMBERS

194

from the

tinct integers

set

Q(n, U, <q).
Now take the product

2,

1,

+ zx){\ +

(1

and

zx 2 )

therefore, the value of

is,

(1

zx q ).

The

pres-

ence of the z in each factor enables us to count the number of addends


used to produce the exponent of x. Thus the coefficient of z m x n is the
number of ways in which n can be represented by exactly m distinct

addends from among


mine Q(n, m, <q).

The

1, 2, 3,

effect of multiplying

~
z qiq 1)/2 is

(1

therefore, enables us to deter-

It,

q.

zx){\

zx 2 )

(1

zx q )

to collect the terms representing the

by 1 +
number

ways n can be produced by one, two,


m distinct addends, for
m ~ l to produce z mx n z 2x n by z m ~ 2 etc. Thus the
is multiplied by z
coefficient of z mx n is the number of partitions of n that can be obtained by
choosing at most m distinct integers from the set 1, 2,
It is the
, q.
of

zx n

<m,

value of Q(n,

<q).
The fact that the series 1
xm
x 2m
developed from the
m

quotient 1/(1
x ), is absolutely convergent for
< x < 1 enabled
Kronecker* to prove that the coefficients of the expansion of the generating function 1/(1 x)(l x 2 )(l x z )
give the number of partitions of n with repetitions permitted.
The discovery of this theorem is
due to Euler. We shall merely indicate the truth of the statement by the

),

first
,

To produce any integer n, we need at most n addends,

following argument:

and hence but the

of the factors (1

+x +x
n

(1

2n
-f-

+x+x +
2

determined by

),

(1

x2

the generating

term of the (n + l)st factor in the product of the


would merely reproduce the product of the first n
factors, and the next term would add n + 1 to each of the exponents of x
already produced so that the resulting exponents would exceed n. It is
evident also that all succeeding exponents so derived would exceed n.
Moreover, any term developed from the product of the first n factors is
the result of selecting exactly one term from each of these factors. The

The

function.
first

first

1 factors

choice can be represented as the selection of one of each of the factors


x a x 2b x 3c
x nk where the values of the integers a, 26, Be, . . . , rik
are among 0, 1,
n, and a is to be interpreted as the sum of a units,
2b as the sum of b 2 s, 3c as the sum of c 3's, etc. Each time the sum of
,

the exponents,

a, 26, 3c,

...

the coefficient of x n gives the

nk,

is n,

number

we have

a partition of n.

of partitions of

n with

Thus

repetitions

permitted.

Let us illustrate the use of the generating function by finding the partiof 5.
We need but the factors (1 x + x 2 x 3 + x 4 x b ),
2
4
x
x
x 3 ), (1
x 4 ), and (1
z 5 ). The product is to be
+
(1
), (1

tions

*L. E. Dickson, " History of the Theory of Numbers," Vol.

2, p. 104.

PARTITIONS

195

interpreted in the form


(1

x l+l

x l+l+1

x 1+1+1+1

a;i+i+i+i+i)(l

+
+

+
+

1+1+1

1+2

+
+
+
+

x 1+1+1+1
z 1+1 + 2

partitions of

1, 2, 3, 4,

_|_

^ 1+1+ l+i+l

^1+1+1+2

x 2+ 2

_J_

x l+2+2

1+3

_|_

^1+1+3

+
The

Z 5)

is

1+1

(1

Then the expansion

+ x + x 2+2
+ x )(l + z )(l +

+
+
+

x*

as well as

5,

X 2+ 3

Z 1+4
5

+
+
+
+
+
+
+

are thereby enumerated,

and the

coefficient 7 of x 5 is the value of P(5, C/).

enumerates
Similarly we can see that 1/(1 x)(l x 3 )(l x h )
the partitions of n into odd integers with repetitions permitted and that

1/(1

x 2 )(l

x A )(l

x 6)

does the same

when the

parts are even.

EXERCISES
1.

2.
3.

4.

Show
Show

that P(n,

<m,

q)

P(n,

<

q,

in).

that P(n, U, <q) = P(n


q, q).
Find the number of partitions of n into parts selected from 1, 2, 2 2 2 3
Show that the number of partitions of n in terms of odd integers with repetitions

equal to Q(n, U).


5. Write a generating function which will enumerate the partitions of n into parts
that are odd and unequal.
6. Show that x r /(l x 2 )(l x 4 )
(1 x 2q) enumerates the partitions of
n r into even parts that do not exceed 2q with repetitions permitted. Show also
that when n r is even, the same function enumerates the partitions of (n r)/2
into parts not larger than
with repetitions.
7. Find a method for listing all the partitions of n into m parts by starting with
1 units and the integer n
1.
is

m+

BIBLIOGRAPHY
P., "Die Lehre von der Kreistheilung," B. G. Teubner, Leipzig, 1921.
"Grundlehren der neueren Zahlentheorie," Walter De Gruyter & Com-

Bachmann,
,

pany, Berlin, 1931.


Cahen, E., "The*orie des nombres," Gauthier-Villars & Cie, Paris, 1900.
Cajori, F., "A History of Mathematics,' Macmillan & Co., Ltd., London, 1906.
Carmichael, R. D., "The Theory of Numbers," John Wiley & Sons, Inc., New
'

York, 1914.
Chrystal, G., "Algebra," A.

&

C. Black, Ltd., London, Vol.

I,

1931, Vol. II,

1932.

Dickson, L. E., "History of the Theory of Numbers," Carnegie Institution of


Washington, Washington, D.C., 1920.
,

"Introduction to the Theory of Numbers," University of Chicago Press,

Chicago, 1929.
,

"Studies in the Theory of Numbers," University of Chicago Press,

Chicago, 1930.
,

"Modern Elementary Theory

of

Numbers," University

of

Chicago

Press, Chicago, 1939.

Hancock, H., "Foundations of the Theory of Algebraic Numbers," The Macmillan Company, New York, Vol. I, 1931, Vol. II, 1932.
Hardy, G. H., "Some Famous Problems of the Theory of Numbers," Oxford
University Press, New York, 1920.
and E. M. Wright, "The Theory of Numbers," Oxford University Press,
New York, 1938.
Hecke, E., "Theorie der algebraischen Zahlen," Akademische Verlagsgesellschaft m.b.H., Leipzig, 1923.

Kraitchik, M., "Theorie des nombres," Gauthier-Villars

&

Cie, Paris, Vol.

I,

1922, Vol. II, 1926.

Landau, E., "Vorlesungen iiber Zahlentheorie," S. Hirzel, Leipzig, 1927.


Mathews, G. B., "Theory of Numbers," G. E. Stechert & Company, New York,
1927.

Nagell, T., "Introduction to

Number Theory," John Wiley &

Sons, Inc.,

New

York, 1951.
Ore, Oystein,

"Number Theory and

Its History,"

New

McGraw-Hill Book Company,

York, 1948.
Reid, L. W., "The Elements of the Theory of Algebraic Numbers," The Macmillan Company, New York, 1910.
Smith, D. E., "History of Mathematics," Ginn & Company, Boston, Vol. I,
Inc.,

1923, Vol. II, 1925.


197

ELEMENTARY THEORY OF NUMBERS

198

"A Source Book


New York, 1929.
,

Stewart, N. M.,

in

"Theory

of

Mathematics," McGraw-Hill Book Company,

Numbers," The Macmillan Company,

New

Inc.,

York,

1952.
J. V., and M. A. Heaslet, "Elementary Number Theory," McGrawBook Company, Inc., New York, 1939.

Uspensky,
Hill

Wright, H. N., "First Course in the Theory of Numbers," John Wiley


Inc.,

New

York, 1939.

&

Sons,

INDEX
Chrystal, G., 197

Abacus, 39
Absolute value, 7
Addition, 3, 54, 177
Additive theory of numbers, 190
Ahmes papyrus, 1
Algebra, 1, 16, 67
Algorithm, 31, 180
Amicable integers, 37
Archibald, R. C, 37n.
Archimedes, 9
principle of, 9, 12, 28

an integral right
Arithmetic function, 58

Area

of

Closure,

3,

Commutative

Composite,

179, 187

Conditional congruence, 67
Congruence, 53
conditional, 67

triangle,

168

degree

of,

68

identical, 66

properties
solution

of,

54-55
67

of, 66,

Congruences,

integer, 8

of a polynomial, 179

Associative law, for addition,

177

25

9,

Composite polynomial,

"Arithmetica," 169

an

3,

Complementary factors, 7
Complex numbers, 47, 182

Arithmetica, 2
Associates, of

law, for addition,

for multiplication, 3, 177

54jf.

equivalent, 68-70, 91
3,

linear, 70-71,

177

89
simultaneous, 79-83

for multiplication, 3, 177

operations on, 68
quadratic, 134-135

Bachet,

C, 169

Bachmann,

solution

P., 145n.,

of, 66,

67

Congruent

197

integers, 53ff.
Consecutive integers, 3, 6

Base, 38, 125

Belonging to an exponent, 100


Bernhard, H. A., 36n.
Bibliography, 197-198
Binary scale, 39
Bocher, M., 67n.

Consecutive squares, 51
Crelle, A. L., 100, 106
Criterion for solvability, of ax

&(mod m), 71
of x n = c(mod m), 129
Cunningham, A., 127

Brauer, A., 36n., 50n.

Brouncker, W., 172


Buck, R. C, 46ri.

by induction, 3, 4
Denary system of notation, 39

Definition

Cahen, R, 197

Derivative of f(x) with respect to

Cajori, F., 2n., 197

Descartes, R.,

Calculating machines, 39
Cancellation law, 3, 177

Dickson, L. E., 30n., 36, 88n.,


159n., 194n., 197

Carmichael, R.

Cauchy,

C,

A., 145,

99, 105, 112,

197

168

Chinese, 88

Chinese remainder theorem, 79-80

2,

2, 39-40
Diophantine equations, 16
linear, 17, 19-23
simultaneous, 23-24

Digits,

199

x, 77,

86

88
127/i.,

ELEMENTAKY THEORY OF NUMBERS

200

Diophantine equations, solutions


17, 19,

of,

16,

21

Fermat, P., 30, 37, 88,


last theorem, 168

method of descent,
Fermat numbers, 32

Diophantus, 1, 16, 88
"Arithmetica," 169
Dirichlet, L., 27, 172

Field, 177

Discrete set, 3
" Disquisitiones arithmeticae," 136

Form, 14

Finite induction,

degree

Distribution of primes, 50, 51


Distributive law, 3, 177
Division,

30,

168

10-11

14

linear, 14r-16

quadratic, 46
Franqui, B., 37n.

178

7,

of,

4,

89, 105

by 3, 55
by 8, 9, and 11, 56
modulo ra, 55, 57, 72

Fundamental theorem

of arithmetic, 29

Divisor, 7

common, 7

Garcia, M., 37n.

greatest, 7, 14-15, 18, 62, 179, 180,


185, 187, 188

an

Divisors, of

number

integer,

34

34-35
sum of, 34-35
of zero, 57, 178

Egyptians,

Goldbach, C., 51
Goldberg, B., 127
Greater than, 3
Greatest common divisor,

of,

1,

14-15, 18,

188
used for solving congruences, 188
Greeks, 1, 16
Gupta, H., 37n.

39
9,

7,

62, 179, 180, 185, 187,

Eisenstein, R. G., 144

"Elements,"

Gauss, C., 50, 53, 107, 136


law of quadratic reciprocity, 145-147
lemma of, 141

139

Equals, 4

Equivalent congruences, 68-70, 91


Eratosthenes, 25
Erdos, P., 27, 50
Erlerus, H. G., 103
Euclid, 9, 36
"Elements," 9, 139
formula for perfect numbers, 36
theorem, 9, 14
Euclidean algorithm, 31

Hancock, H., 197


Hardy, G. H., 158n., 190, 197
Heaslet, M., 198

Hecke, E., 197


Hilbert, D., 158
Hindu- Arabic system, 38
Hindus, 1, 172

Euler, L., 36, 46, 58, 159


criterion for solvability of x n sb

c(mod m),

Ideals, 168

129, 136

Identical congruence, 66

identity, 164
<t>

Identically equal polynomials, 67, 178

function, 58-60, 96, 106

Even

Identity element, 178

integer, 10

Exponent, of a prime contained in


40-43
to which an integer belongs, 100

178
common, 7
greatest, 7

Factor,

7,

(See also Divisor)


of a polynomial, 74, 178

Factorization, 28-30, 183-185

n!,

Incongruent integers, 53
Index of n, 125
Indicator, 58
Indices, 125-131
used in solving congruences, 127-129
Advanced Study, 40

Institute for

Integer, associate of, 8


divisors of, 34-35

expressed as a sum, 190


of 4 squares, 158,
in

164-166

terms of a base, 37

INDEX
Mathematical induction,
Mathews, G., 197

Integer, indicator of, 58

unique factorization

of,

201

28-29

4,

10-11

Meissel, E., 49

Integers, algebraic, 8n.

amicable, 37

Mersenne, M., 37

belonging to a divisor of X(2 n ) modulo


2, 114-115

Method, for finding the exponent to


which a belongs, 100

belonging to an exponent modulo


103, 106
congruent, 53
consecutive,

3, 6,

p,

for finding a primitive root of p, 107

for finding a quadratic residue of p, 138

of infinite descent, 30, 168


for solving congruences

51

W.

by

indices, 127

H., 46n.

even, 10

Mills,

negative, 5

Mobius function, 93
Mobius inversion formula, 95-96

odd, 10

Integral domain, 177, 186

Modul, 16
Modulo m, 53
Modulus, 53
Multinomial theorem, 44

Integral logarithm of

Multiple,

positive, 3

rational,

square, 51

x,

50

7,

common, 8

Inverse, 5

Inversion formula, 95-96


Irreducible polynomials, 183

least, 8,

33

modulo m, 72
Multiplication, 3, 54, 177

Jacobi,

C,

Multiplicative function, 58, 94


Multiplicity of solutions of

127, 145

0(mod

Jacobi symbol, 152

p), 76,

f(x)

77

Multiply perfect numbers, 37


Kraitchik, M., 127, 197

Kronecker,

L., 50, 145,

Kummer,

E., 145,

Lagrange,

J.,

194

Nagell, T., 197

Nonresidue,^quadratic, 135
Null element, 8, 186

168

Null polynomial, 178

Lambda

75, 136,

158

function, 99, 100, 112

Number,

to d

Lattice points, 144

to d

Legendre symbol, 139


Lehmer, D. H., 37, 88n.

Lehmer, D. N., 26n.


Leibnitz, G., 190
rule for derivatives of a product, 78

Less than, 3

Linear congruences, 70-71, 79-83, 89


Liouville, J., 145, 158

Littlewood,

J.,

159

Logarithm, 50, 126


Lucas, E., 99, 105

an

integer, 34

d modulo

p,

102

Lame, G., 168


Landau, E., 197
Lawther, H. P., 113
Least common multiple, 8, 33
Legendre, A., 47, 50, 136

of divisors of

of integers that belong, to

modulo p n 117
modulo 2p n 118
,

of integers that belong to a divisor of

X(w) modulo m, 118-124


not exceeding \m\,
and prime to m, 58
and prime to factors of m, 60-62
of positive primes not exceeding n, 47
of primitive roots of p, 106
of solutions, of a linear congruence, 71
of /(re) ^O(modp), 75
of x d = l(modp), 90, 103
of/(x) = 0(modp"), 86
of f(x) m 0(mod m), 84-85
of x 2 = a(mod 2 n ), 156-157
of a; 2 " = l(mod2), 116
of positive integers

Numbers,

ELEMENTARY THEORY OF NUMBERS

202

Numbers, additive theory


complex, 47, 182
Fermat, 32
of the form, 2*> 2 2 " + 1, 32, 46
Mersenne, 37
natural, 1, 2
perfect, 36-37

of,

Polynomials, domain

190

178

of,

divisor of, 179, 180,

185, 187

37

1,

identically equal, 67, 178


relatively prime, 181-183

Position in writing numbers, 1


Postulates,

13

3,

Power residues

multiply, 37

of a

modulo m, 101

Prime, 8
Mersenne, 37

rational, 2, 177, 183


real,

common

greatest

relatively (to each other), 9

183

signed, 2

in pairs (each to each), 9

test for, 25, 93, 104

Prime

Odd

integer, 10
One-to-one reciprocal correspondence,
Ordering relation, 3
Ore, O., SOn., 197

factor, of a composite,

Prime number theorem, 50


Prime-representing function, 46-47
Primes, contained in
distribution

notation

number

for,
for,

of,

of, 50,

n\,

41-43

51

factorization into, 28-29

Partitions, 190

diagrams

25

40

of n!,
1

formula

of form, 2 n

192
190-191
for,

generating functions

191-192
193-195

for,

2 2"

An
An

1,

27, 141

1,

30, 58, 141,

number
table

not exceeding

of,

of,

n,

47-50

52

Primitive X roots, 112, 118-124


Primitive polynomial, 183
Primitive roots, of m, 105
of

n
,

108-110

of 2p

111

and quadratic

integral, 14

159-164

many, 26-27
form An - 1, 27

Peano's postulates, 13
Pellian equation, 172-176
Perfect numbers, 36-37

composite, 179, 187


factor of, 74

37

infinitely

multiply, 37
Phi function, 58, 88, 96, 100
Polynomial, 14
with coefficients in a field, 178-183

28,

46, 151

Pascal, B., 88

of

1,

1,

residues, 138

Primitive solutions, 167

not a prime-representing function, 46


irreducible, 183

Pythagorean

triangle, 167,

168

Pythagoreans, 10

monic, 179, 184, 187


null, 178

primary associate

of,

183, 187

prime, 179, 187


primitive, 183

Quadratic forms, 46

reducible, 183

with
with

183-185
prime modulus,

rational coefficients,

respect

Quadratic character, 135, 140


Quadratic congruence, 134-135

to

186-189
unique factorization
unit, 178

of,

184-185

vanishes identically, 178


Polynomials, division of, 72-73, 178
quotient in, modulo p, 186
remainder in, modulo p, 186

Quadratic nonresidue, 135

Quadratic reciprocity law, 144-147


Quadratic residue, 135
of p, test for, 137

Quadratic residues and primitive roots,


138
Quotient,
of

7,

10

two polynomials, 178


modulo p, 186

203

INDEX
Sussman, B., 118
Symbol, definition

Radix, 38
Rational integers, 2, 3, 18, 183
Rational numbers, 177, 183
Real numbers, 183
Reciprocity law, 144-147

si,

66

a\b,

Ep {m),

Reducible polynomials, 183


Reflexive property, 4, 55
Regular function, 58
Reid, L., 197
Relatively prime, 9, 179

g(k),
(a, 6)

41

158

d,

40
139

in pairs, 9

Remainder in division, of a by
of g{x) by f(x), 72, 178

b,

10

(see

A(m), 99

93
58
tt(x), 47
<r(m), 34
r(m), 34
fi(m),

Residue classes, 53, 56-57


Residue system, 54, 62-65
complete, 54
least numerical values, 63
reduced, 54
Riemann, G., 50
Roots, primitive

53

of,

<t>(m),

Symmetric property,

Primitive roots)

4,

55

Table, of indices for prime 193, 132-133


of primes, 52

Taylor's theorem, 77, 86


Tchebysheff, P., 50

Sarrus, F., 88

Scale of notation, 37-40

Telephone cables, 113

American, 40n.
Selberg, A., 27, 50
Sequence, 4
Shapiro, H. N., 27
Sieve of Eratosthenes, 25
Simultaneous congruences, 79-83
Single-valued function, 58
Smith, D. E., 197
Smith, H. J. S., 21n.

Transitivity, 4, 55

Scientific

Solution, of f(x)

= 0(mod

of

= b (mod

of x n

+ by = n,
+ yn = zn

ax
of ax

p),

85-86

Uhler, H.

Unique

S.,

37

factorization, 28-30, 183-185

8, 178, 186
Unit polynomial, 178, 179
Unity, 177
Unity element, 177
Uspensky, J., 198

Unit,

m), 89

19-20
168

Vandiver, H. S., 168


Vinogradov, I., 51

Solutions, of Diophantine equations, 16,


17, 19,

J., 172
Waring, E., 158
Wertheim, G., 127
Wilson's theorem, 92-93, 136
generalization of, 170-172
Wright, E. M., 46n., 197
Wright, H. N., 198

Wallis,

21

= 0(mod

p), 75, 91, 92, 188


multiplicity of, 76-78
2
2
of x 2
y = z 167
of x 2 - by 2 = 1, 175

of f(x)

Squares, integers that are, 12

primes between, 51
Stewart, N., 198
Substitution, 4, 55
Subtraction, 3, 5, 54
of the divisors of an integer, 34-35
over the divisors of an integer, 60, 62
of 2 squares, 159-164
of 4 squares, 158, 164-166

Sum,

Zassenhaus, H., 27
Zeller, C., 145
Zero,

1,

4-5, 178

divisors of, 57, 178

no degree, 178
as null element, 8