Number Theory Text 2012
Number Theory Text 2012
David Pierce
Mathematics Department
Mimar Sinan Fine Arts University
Istanbul
[email protected]
http://mat.msgsu.edu.tr/~dpierce/
This work is licensed under the
Creative Commons
Attribution-NonCommercial-ShareAlike .
Unported License.
To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/
or send a letter to
Creative Commons,
Castro Street, Suite ,
Mountain View, California, , USA.
Bu çalışma
Creative Commons Attribution-Gayriticari-ShareAlike .
Unported Lisansı ile lisanslı.
Lisansın bir kopyasını görebilmek için,
http://creativecommons.org/licenses/by-nc-sa/3.0/
adresini ziyaret edin ya da mektup atın:
Creative Commons,
Castro Street, Suite ,
Mountain View, California, , USA.
Matematik Bölümü
Mimar Sinan Güzel Sanatlar Üniversitesi
Bomonti, Şişli, İstanbul,
[email protected]
http://mat.msgsu.edu.tr/~dpierce/
Contents
Preface
. Numbers
.. The natural numbers . . . . . . . . . . . . . . . . . . . . . . . . . .
.. The integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. The rational numbers . . . . . . . . . . . . . . . . . . . . . . . . .
.. Other numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Divisibility
.. Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Greatest common divisors . . . . . . . . . . . . . . . . . . . . . . .
.. Least common multiples . . . . . . . . . . . . . . . . . . . . . . . .
.. The Euclidean algorithm . . . . . . . . . . . . . . . . . . . . . . . .
.. The Hundred Fowls Problem . . . . . . . . . . . . . . . . . . . . .
. Prime numbers
.. The Fundamental Theorem of Arithmetic . . . . . . . . . . . . . .
.. Irreducibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. The Sieve of Eratosthenes . . . . . . . . . . . . . . . . . . . . . . .
.. The infinity of primes . . . . . . . . . . . . . . . . . . . . . . . . .
.. Bertrand’s Postulate . . . . . . . . . . . . . . . . . . . . . . . . . .
. Powers of two
.. Perfect numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Mersenne primes . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Prime moduli
.. Fermat’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Carmichael numbers . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Wilson’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Arithmetic functions
.. Multiplicative functions . . . . . . . . . . . . . . . . . . . . . . . .
.. The Möbius function . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. Arbitrary moduli
.. The Chinese Remainder Theorem . . . . . . . . . . . . . . . . . . .
.. Euler’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Gauss’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A. Foundations
A.. Construction of the natural numbers . . . . . . . . . . . . . . . . .
A.. Why it matters . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C. Exercises
Contents
D.. In-term examination . . . . . . . . . . . . . . . . . . . . . . . . . .
D.. Final Examination . . . . . . . . . . . . . . . . . . . . . . . . . . .
Bibliography
Index
Contents
List of Figures
.. Divisors of 60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Common divisors of 12 and 30 . . . . . . . . . . . . . . . . . . . .
.. Divisors of 60, again . . . . . . . . . . . . . . . . . . . . . . . . . .
.. gcd and lcm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. The Euclidean algorithm . . . . . . . . . . . . . . . . . . . . . . . .
.. Diagonal and side . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.. Two ways of counting, for the Law of Quadratic Reciprocity . . . .
.. Example of the proof of quadratic reciprocity . . . . . . . . . . . .
List of Tables
Preface
This book started out as a record of my lectures in the course called Elementary
Number Theory I (Math ) at Middle East Technical University in Ankara in
–. When I was to teach the same course in –, I revised my lecture-
notes and made them the official text for the course. That text, dated September
, , was pages long. After the course, filled with enthusiasm, I made
many revisions and additions. The result is this book.
The standard text for Math at METU was Burton’s Elementary Number
Theory []. My lectures of – more or less followed this. The catalogue
description of the course was:
In –, without realizing that I had written the course textbook, one student
complained that it was hard to read. I am glad he felt free to criticize. But I
had not aimed to create a textbook that could replace classroom lectures. I had
written summarily, without trying to give all of the explanations that anybody
could possibly want.
Among the many changes I have made since the – course, I have:
) put proofs of theorems after their statements, and not before as is sometimes
natural in lectures (an omitted proof in the present text is left to the reader
as an exercise);
) removed the Fermat factorization method [, §.] as being out of the main
stream of the course;
) added Dirichlet convolution, which gives a streamlined way of understand-
ing Möbius inversion and of defining the phi-function;
) added forward references, to show better how everything is interconnected;
) added citations for the theorems, when I have been able to find them.
Precisely because these changes are significant, the book must still be considered
as a work in progress, a rough draft.
As I suggested, Burton’s text was the original model for this book,—but not
in style, only in arrangement of topics. Models for style, as well as sources of
content, include the sparer texts of Landau [] and Hardy and Wright []. Much
of the mathematics in the present text can be found in Gauss’s Disquisitiones
Arithmeticae [] of , written when Gauss was the age of many undergraduate
students. Some of the mathematics is two thousand years older than Gauss.
I have made some attempt to trace theorems to their origins; but this work
is not complete. I prefer to see the primary source myself before attributing a
theorem. In this case, I cite the source near the theorem itself, possibly in a
footnote, and not in some extra section at the end of the chapter. Even when I
can find the primary source, usually a secondary source has led me there. The
secondary source helps to determine what the primary source is. The best history
would arise from reading all possible primary sources; but I have not done this.
Full names and dates of mathematicians named in the text are generally taken
from the MacTutor History of Mathematics archive, or from Wikipedia.
I ask students to learn something of the logical foundations of number theory.
Section . contains an account of these foundations, namely a derivation of
basic arithmetic from the so-called Peano Axioms. This section was originally
an appendix, but I have decided that it belongs in the main body of text, even
if most number theory texts do not have such a section. Chapter is filled
out with a summary review of the constructions of the other standard number
systems, of integers, rationals, reals, and complex numbers. All of these systems
have their place in number theory. Their constructions alone could constitute a
course, and I do not expect number theory students as such to go through them
all; but students should be aware that the constructions can be done, and they
themselves can do them.
Readers will already know most of the results of Chapter . Assuming some of
these results, the preceeding Chapter is a general exploration of what can be
done with numbers and, in some cases, what has been done for over two thousand
years. The chapter begins with the visual display of certain numbers as triangles
or squares. Throughout the text, where it makes sense, I try to display the
mathematics in pictures or tables, as for example in the account of the Chinese
Remainder Theorem in §..
Appendix A begins with the construction of the natural numbers by von Neu-
mann’s method. This is a part of set theory and is beyond the scope of the
course as such, but it is good for everybody to know that the construction can be
done. The appendix continues with a discussion of common misunderstandings
of foundational matters.
I do not like to quote a theorem without either proving it or being able to
expect readers to prove it for themselves. In the original course, I did quote
theorems, some recent, without myself knowing the proofs; I have now relegated
these to Appendix B.
Appendix C consists of exercises, most of which were made available in install-
ments to the students in the / class. I have not incorporated the exercises
into the main text. One reason for this is to make it less obvious how the exercises
should be done. The position of an exercise in a text is often a hint as to how the
http://www-gap.dcs.st-and.ac.uk/~history/index.html
exercise should be done; and yet there are no such hints on examinations. The
exercises here are strung together in one numbered sequence. (So, by the way,
are the theorems in the main text.)
Appendices D and E contain the examinations given to the – and –
classes, along with my solutions and remarks on students’ solutions.
In –, I treated 0 as a natural number; in –, I did not. In the present
book, I intend to use the symbol N for the set {1, 2, 3, . . . }; if a symbol for the set
{0, 1, 2, . . . } is desired, this symbol can be ω. I have tried to update Appendix D
(as well as my original lecture-notes from –) accordingly.
Preface
. Proving and seeing
The terms increase by 2, 3, 4, and so on. A related observation is that the numbers
in the sequence can be given an appearance, a look, as shown in Figure .. In
b b b b b
b b b b b b b b
b b b b b b b b b
b b b b b b b b
b b b b b
particular, the numbers are the triangular numbers. Let us designate them by
t1 , t2 , t3 , and so on. Then they can be given recursively by the equations
t1 = 1, tn+1 = tn + n + 1.
The triangular numbers can also be given non-recursively, in closed form (so
that tn can be calculated directly):
n(n + 1)
tn = . (∗)
2
. If the claim is true when n = k, so that tk = k(k + 1)/2, then
tk+1 = tk + k + 1
k(k + 1)
= +k+1
2
k(k + 1) 2(k + 1)
= +
2 2
(k + 2)(k + 1)
=
2
(k + 1)(k + 2)
= ,
2
so the claim is true when n = k + 1.
By induction then, (∗) is true for all n.
So equation (∗) is true; but we might ask further: why is it true? One answer
can be seen in a picture. First rewrite (∗) as
b b b bc bc
b b bc bc bc
b bc bc bc bc
in Figure .. One may establish other identities in the same way. For example,
b b b b b
b b b b bc
b b b bc bc
b b bc bc bc
b bc bc bc bc
tn+1 + tn = (n + 1)2 .
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, . . .
It is the sequence of odd numbers. Also, the first n terms seem to add up to n2 .
Indeed we do have:
Theorem . For all numbers n,
n
X
(2k − 1) = n2 . (†)
k=1
bc bc bc bc b
b b b bc b
bc bc b bc b
b bc b bc b
bc bc bc bc b bc bc bc bc bc b
b b b bc b b b b b bc b
bc bc b bc b bc bc bc b bc b
bc b bc b
From figure ., we may derive two more observations. The rearrangement
shown in Figure . suggests the identity
n2 − 1 = (n + 1)(n − 1),
bc bc bc bc b
b b b bc b
bc bc b bc b
n
X
2k = n(n + 1).
k=1
Observe finally:
1, 3, 5 , 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, . . .
|{z} | {z } | {z } | {z }
8 27 64 125
Arnol′ d’s parenthetical example is apparently the following. For each number n,
we consider the number of ways to write the odd number 2n − 1 as a sum
t1 + · · · + t2k−1 ,
b b b
b b
b b b
b b
b
b b
b b
b b
b
b
Pn−1
The sum j=2 (j − 1)(n − j) can be understood as the number of ways to choose
3 points out of n points. Indeed, if the points are again numbered from 1 to n
inclusive, then for each j, there are (j − 1)(n − j) ways to choose i and k so that
i < j < k 6 n. Therefore we have
n n n
an+1 = an + n + = an + + .
3 1 3
Then by induction,
n−1 n−1 n−1 n−1 n−1
an = + + + + .
0 1 2 3 4
Here we should understand n−1 j = 0 if n − 1 < j.
For an alternative derivation of the last formula for an , we can consider the
following.
. Even if there are no points, there is 1 region.
. When a new line is drawn, one new region is created near one endpoint of
the new line; and there are n2 lines.
. In addition, whenever the new line crosses an old line, a new region is
created; and there are n4 crossings.
. Every region can be understood as arising in exactly one of the foregoing
ways.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 20 7 1
........................................................................
.. Incommensurability
A Diophantine equation is a polynomial equation with integral coefficients.
If such a solution has no integral solutions, way to prove this is the method of
infinite descent, which is attributed to Pierre de Fermat (–). A simple
application of the method is the following.
x2 = 2y 2 .
Proof. Suppose a2 = 2b2 , and a and b are positive. Then a > b. Also, a must
be even. Say a = 2c. Consequently 4c2 = 2b2 , so b2 = 2c2 . Thus we obtain a
sequence
a, b, c, . . . , k, ℓ, . . . ,
where always k 2 = 2ℓ2 . But we have also a > b > c > · · · , which is absurd; there
is no infinite descending sequence of positive integers. Therefore no positive a
and b exist such that a2 = 2b2 .
In geometric form, the theorem is that the side and diagonal of a square are
incommensurable: there is no one line segment that measures, or evenly
So called after Diophantus of Alexandria (c. –c. ), whose Arithmetica, comprising
books, treated such problems as, ‘To divide a given square number into two squares’ [,
pp.–]. Diophantus works out an example when the given square number is 16. The
aim then is to find x such that 16 − x2 is a square. We try letting this square have the form
(mx − 4)2 , presumably so that 16 will cancel from the resulting equation. In case m = 2,
we solve
16 − x2 = (2x − 4)2 16
2
16x = 5x2 , = x,
= 4x − 16x + 16, 5
he [Fermat] proved by a method that he called his “infinite descent”—a sort of inverted
mathematical induction, a process that Fermat was among the first to use.’
F d
D C
ED = BD − AB, DF = AB − ED.
The same construction can be performed with triangle DEF in place of DAB.
Since DE < DF (by I. and I.), so that 2ED < AB, there will eventually
be segments that are shorter than G (by X.), but are measured by it, which is
absurd. So such G cannot exist. √
If we consider DA as a unit, then we can
√ write DB as 2. In two ways then,
√
we have shown then the irrationality of 2. For yet another proof, suppose 2
is rational. Then there are numbers a1 and a2 such that
a1 √
= 2 + 1.
a2
Consequently
√
a2 1 2−1 √ a1 a1 − 2a2
=√ = √ √ = 2−1= −2= .
a1 2+1 ( 2 + 1)( 2 − 1) a 2 a2
.. Incommensurability
Continue recursively by defining
an+2 = an − 2an+1 .
Then by induction
an+1 a1 √
= = 2 + 1.
an+2 a2
But an = 2an+1 + an+2 , so a1 > a2 > a3 > · · · , which again is absurd.
√
The same argument, adjusted, gives us a way to approximate 2. Suppose
there are b1 and b2 such that
b1 √
= 2 − 1.
b2
Then
b2 √ b1 b1 + 2b2
= 2+1= +2= .
b1 b2 b2
If we define
bn+2 = bn + 2bn+1 , (§)
then by induction
bn+1 √
= 2 − 1.
bn+2
Now however the sequence b1 , b2 , . . . , increases, so there is no obvious contradic-
tion. But the definition (§) alone yields
b3 b1
=2+ ,
b2 b2
b4 b2 1
=2+ =2+ ,
b3 b3 b1
2+
b2
b5 b3 1 1
=2+ =2+ =2+ ,
b4 b4 b2 1
2+ 2+
b3 b1
2+
b2
and so on. If we just let b1 = 1 and b2 = 2, then by (§) we sequence of the bn is
the increasing sequence
1, 2, 5, 12, 29, 70, . . .
Then the sequence
2 5 12 29 70
, , , , ,...
1 2 5 12 29
√
of fractions converges to 2 + 1. That is, we have the following.
b1 = 1, b2 = 2, bn+2 = bn + 2bn+1 ,
then
bn+1 √
lim = 2 + 1. (¶)
n→∞ bn
By induction then,
bn+2 bn+1 (−1)n+1
− = , (k)
bn+1 bn bn bn+1
since this holds when n = 1. The sequence of products bn bn+1 is positive an
strictly increasing; so we have
b2 b3
< ,
b1 b1
b2 b4 b3
< < ,
b1 b3 b1
b2 b4 b5 b3
< < < ,
b1 b3 b4 b1
b2 b4 b6 b5 b3
< < < < ,
b1 b3 b5 b4 b1
and in general
b2 b4 b6 b7 b5 b3
< < < ··· < < < .
b1 b3 b5 b6 b4 b1
.. Incommensurability
A consequence of this and (k) is √
that the sequence of fractions bn+1 /bn must be
a Cauchy sequence. The limit is 2 + 1, since
bn+2 √ b
n+2
2
< 2 + 1 ⇐⇒ −1 <2
bn+1 bn+1
b 2
n
⇐⇒ +1 <2
bn+1
bn √
⇐⇒ < 2−1
bn+1
bn+1 √
⇐⇒ > 2 + 1.
bn
√ 1
2+1=2+ .
1
2+
1
2+
1
2+
1
2+
..
.
a)
There is a first natural number, called 1 (one).
b)
Every n in N has a unique successor, denoted (for now) by s(n).
c)
The first natural number is not a successor: if n ∈ N, then s(n) 6= 1.
d)
Distinct natural numbers have distinct successors: if n ∈ N and m ∈ N and
n 6= m, then s(n) 6= s(m).
e) Proof by induction is possible: Suppose A ⊆ N, and two conditions are
met, namely
(i) the base condition: 1 ∈ A, and
(ii) the inductive condition: if n ∈ A (the inductive hypothesis),
then s(n) ∈ A.
Then A = N.
The natural number s(1) is denoted by 2; the number s(2), by 3; &c.
Remark. Again, the five conditions satisfied by N are the Peano axioms. Parts (c),
(d) and (e) of the axiom are conditions concerning a set with a first element and
an operation of succession. For each of those conditions, there is an example
of such a set that meets that condition, but not the others. In short, the three
conditions are logically independent.
Proof. Let A be the set comprising every natural number that is either 1 or a
successor. In particular, 1 ∈ A, and if n ∈ A, then (since it is a successor)
s(n) ∈ A. Therefore, by induction, A = N.
Proof. The following is only a sketch. One must prove existence and uniqueness
of g. Assuming existence, one can prove uniqueness by induction. To prove
existence, let S be the set of subsets R of N × A such that
a) if (1, c) ∈ R, then c = b;
b) ifS(s(n), c) ∈ R, then (n, d) ∈ R for some d such that f (d) = c.
Then S is the desired function g.
Remark. In its statement (though not the proof), the Recursion Theorem as-
sumes only parts (a) and (b) of the Axiom. The other parts can be proved as
consequences of the Theorem. Recursion is a method of definition; induction is
a method of proof. There are sets (with first elements and successor-operations)
that allow proof by induction, but not definition by recursion. In short, induction
is logically weaker than recursion.
. Numbers
Definition (Addition). For each m in N, the operation x 7→ m + x on N is the
function g guaranteed by the Recursion Theorem when A is N and b is m and f
is x 7→ s(x). That is,
m · 1 = m, m · (n + 1) = m · n + m.
m1 = m, mn+1 = mn · m.
m < n ⇐⇒ ∃x m + x = n.
m 6 n.
Theorem . The binary relation leq is a linear ordering: for all n, m, and
k in N,
a) n 6 n;
b) if m 6 n and n 6 m, then n = m;
c) if k 6 m and m 6 n, then k 6 n;
d) either m 6 n or n 6 m.
n 6< n,
k < m & m < n =⇒ k < n,
m 6< n & m 6= n =⇒ n < m.
. Numbers
Then A = N.
Proof. Let B comprise the natural numbers whose predecessors belong to A.
As 1 has no predecessors, they belong to A, so 1 ∈ B. Suppose n ∈ B. Then all
predecessors of n belong to A, so by assumption, n ∈ A. Thus, by Theorem (b),
all of the predecessors of n + 1 belong to A, so n + 1 ∈ B. By induction, B = N.
In particular, if n ∈ N, then n + 1 ∈ B, so n (being a predecessor of n + 1) belongs
to A. Thus A = N.
Remark. In general, strong induction is a proof-technique that can be used with
some ordered sets. By contrast, ‘ordinary’ induction involves sets with first ele-
ments and successor-operations, but possibly without orderings. Strong induction
does not follow from ordinary induction alone; neither does ordinary induction
follow from strong induction.
Theorem . The set of natural numbers is well ordered by <: that is, every
non-empty subset of N has a least element with respect to 6.
Proof. Use strong induction. Suppose A is a subset of N with no least element.
We shall show A is empty, that is, N r A = N. Let n ∈ N. Then n is not a least
element of A. This means one of two things: either n ∈ / A, or else n ∈ A, but also
m ∈ A for some predecessor of n. Equivalently, if no predecessor of n is in A,
then n ∈
/ A. In other words, if every predecessor of n is in N r A, then n ∈ N r A.
By strong induction, we are done.
Remark. We have now shown, in effect, that if a linear order (A, 6) admits proof
by strong recursion, then it is well-ordered. The converse is also true.
Theorem (Recursion with Parameter). Suppose A is a set with an element
b, and F : N × A → A. Then there is a unique function G from N to A such that
a) G(1) = b, and
b) G(n + 1) = F (n, G(n)) for all n in N.
Proof. Let f : N × A → N × A, where f (n, x) = (n + 1, F (n, x)). By recursion,
there is a unique function g from N to N × A such that g(1) = (1, b) and g(n +
1) = f (g(n)). By induction, the first entry in g(n) is always n. The desired
function G is given by g(n) = (n, G(n)). Indeed, we now have G(1) = b; also,
g(n + 1) = f (n, G(n)) = (n + 1, F (n, G(n))), so G(n + 1) = F (n, G(n)). By
induction, G is unique.
Remark. Recursion with Parameter allows us to define the set of predecessors of
n as pred(n), where x 7→ pred(x) is the function G guaranteed by the Theorem
when A is the set of subsets of N, and b is the empty set, and F is (x, Y ) 7→ {x}∪Y .
Then we can write m < n if m ∈ pred(n) and prove the foregoing theorems about
the ordering.
1! = 1, (n + 1)! = (n + 1) · n!
which is denoted by
Z.
One may ask what these new elements 0 and −x are. In that case, one can define
Z as the quotient
N × N/∼,
where ∼ is the equivalence relation given by
(a, b) ∼ (x, y) ⇐⇒ a + y = b + x.
a − b.
a − b = 1 − (c + 1).
. If a = b, then
a − b = 1 − 1.
. If b < a, then b + c = a for some unique c, and
a − b = (c + 1) − 1.
Then N embeds in Z under the the map x 7→ (x + 1) − 1, and one can define
0 = 1 − 1, −((x + 1) − 1) = 1 − (x + 1).
One can then identify N with its image in Z. Then again Z can be understood
as in (∗).
. Numbers
We extend multiplication to Z by defining
0 · x = 0, −x · y − (x · y), −x · −y = x · y.
Here of course x and y are elements of N, and the two inequalities −x < 0 and
0 < y are taken to imply −x < y.
Now we can extend addition by defining
z,
if x < y and x + z = y
−x + −y = −(x + y), −x + y = 0, if x = y,
−z, if y < x and y + z = x.
Finally, we define
−−x = x.
Now one proves the following, where the letters range over Z. First,
a + (b + c) = (a + b) + c,
b + a = a + b,
a + 0 = a,
a + (−a) = 0,
a · (b · c) = (a · b) · c,
a · 1 = a,
1 · a = a, (†)
a · (b + c) = a · b + a · c,
(a + b) · c = a · c + b · c, (‡)
so Z is a ring. But we need not show (†) and (‡) in particular, because we have
finally
a · b = b · a,
so Z is a commutative ring. Moreover,
a < b =⇒ a + c < b + c,
0 < a & 0 < b =⇒ 0 < a · b,
N × N/≈,
(a, b) ≈ (x, y) ⇐⇒ a · y = b · x.
Q+ .
On this set, one shows that the following are valid definitions:
a x ay + bx a x ab a x
+ = , · = , < ⇐⇒ ay < bx.
b y by b y xy b y
We can also define a −1 b
= ;
b a
then Q+ is an abelian group with respect to multiplication. One shows that Z
embeds in Q+ under the map x 7→ x/1. Now we can identify N with its image in
Q+ . Letting letters stand now for positive rationals, we have, just as in N,
r < s ⇐⇒ ∃x r + x = s.
Now we can obtain the set Q of rational numbers from Q+ just as we obtained
Z from N in the last section. In particular, Q is a commutative ring; it is moreover
a field, because
a 6= 0 =⇒ ∃x ax = 1.
Since also Q is, like Z, an ordered commutative ring, Q is an ordered field.
Finally, Z is an ordered commutative sub-ring of this ordered field.
. Numbers
.. Other numbers
As a linear order, Q is dense, that is, between any two distinct elements lies a
third:
a < b =⇒ ∃x (a < x & x < b).
Moreover, Q has no endpoints, that is, no greatest or least element.
An order is called complete if every nonempty subset with an upper bound
has a supremum, namely a least upper bound. Then Q is not complete, since
the set {x : 0 < x & x2 < 2} has no supremum.
If a dense linear order without endpoints is given, and a is an element, we can
define
pred(a) = {x : x < a}.
The union of any collection of such subsets is an open subset of the order. In
particular, the whole set and the empty set are open; all other open subsets are
called cuts of the order. The set of all cuts of the order is the completion of the
order. The completion is itself linearly ordered by inclusion (⊆), and the original
order embeds in its completion under the map x 7→ pred(x). In case the original
order is Q, the completion is denoted by
R.
Then one can obtain R from the completion of Q+ , just as one obtains Z from
N, and Q from Q+ .
Given a commutative ring, we can form 2 × 2 matrices whose entries are from
the ring. These are added and multiplied by the rules
a b x y a+x b+y
+ = ,
c d z w c+z d+w
a b x y ax + bz ay + bw
· = .
c d z w cx + dz cy + dw
Theopen sets, so defined, do indeed compose a topology for the order, but it is not the usual
order topology. In the latter, the open sets are unions of sets {x : a < x & x < b}.
where x and y range over R. One shows that C is a field. We identify R with its
image in C under the map
x 0
x 7→ ,
0 x
and we define
0 1
i= .
−1 0
Then every element of C is uniquely x + yi for some x and y in R; moreover,
i2 = −1.
One shows that
√every positive√real number x has a square root, namely the
positive number x such that ( x)2 = x. Then we define
√
|x + iy| = (x2 + y 2 ).
|an − am | < ε.
for every n in N, where of course the coefficients ak range over C. But there are
other algebraically closed fields.
The field Q is countable, that is, there is a bijection between Q and N. The
same is not true for R or C: they are uncountable. If we select from C the
solutions of the equations (¶) such that the coefficients are rational, the result
is the set of algebraic numbers. This set is a countable algebraically closed
subfield of C.
Every equation a + bx = 0, where a and b are integers and b 6= 0, has a
solution in Q, namely −a/b (that is, −ab−1 ). In particular, there is a solution
when b = 1; but then the solution is just −a, an integer. More generally, if
. Numbers
the coefficients in (¶) are integers,√then a solution to the equation is called an
algebraic integer. In particular, 2 is an algebraic integer, being a solution of
x2 −2 = 0. The algebraic integers are the subject of algebraic number theory;
so we have had a taste of this in §.. The only algebraic integers in Q are the
usual integers—which in this context may be called rational integers.
The study of R and C is analysis. There is a part of number theory that
makes use of analysis; this is analytic number theory. We shall not try to
do it here, but if one does prove the Prime Number Theorem (Theorem ) for
example, then the Gamma function may be useful: this is the function Γ given
by Z ∞
Γ(x) = e−t tx−1 d x
0
when x > 1. You can show that Γ(n + 1) = nΓ(n), and Γ(1) = 1, so that
G(n + 1) = n!.
Our subject is mainly elementary number theory. This means not that the
subject is easy, but that our integers are just the rational integers, and we shall
not use analysis. However, the proof of Bertrand’s Postulate in §. gives a taste
of analysis.
For
an overview of algebraic numbers, analytic number theory, and other areas of mathe-
matics, an excellent print reference is The Princeton Companion to Mathematics, edited by
Timothy Gowers with June Barrow-Green and Imre Leader [].
.. Division
Henceforth minuscule letters will usually denote integers. If n is such, let the set
{nx : x ∈ Z} be denoted by Zn or nZ or
(n).
To give it a name, we may call (n) the ideal of Z generated by n. Note that
(−n) = (n).
Moreover,
a ∈ (n) ⇐⇒ (a) ⊆ (n).
It is not strictly necessary to introduce ideals, but they may clarify some argu-
ments. By definition, if a ∈ (n), that is, if a = nx for some integer x, then n
divides a, or n is a divisor of a; this situation is denoted by
n | a.
Then the following holds, simply because Z is a commutative ring in the sense of
§..
Theorem . In Z:
a | 0,
0 | a ⇐⇒ a = 0,
1 | a,
a | a,
a | b & b | c =⇒ a | c,
a | b & c | d =⇒ ac | bd,
a | b =⇒ a | bx, (∗)
a | b & a | c =⇒ a | b + c. (†)
In the original terminology, (n) was an ideal number.
In particular, if a | b, then both a and −a divide both b and −b. Every divisor
of an integer b is a proper divisor if it is not ±b (this notion will be useful when
we discuss prime numbers in Chapter ).
We have an additional property because Z is an ordered commutative ring in
which every positive element is 1 or greater; the following does not hold in Q or
R.
Theorem . In Z,
a | b & b 6= 0 =⇒ |a| 6 |b|.
In particular,
a | b & b | a =⇒ a = ±b.
n | n,
m | n & n | m =⇒ m = n,
k | m & m | n =⇒ k | n,
m | n =⇒ m 6 n.
.. Congruence
If a − b ∈ (n), then we may also write
.. Congruence
60
12 20 30
b b
4 6 10 15
b b
2 3 5
1
Figure .. Divisors of 60
a ≡ b.
{x ∈ Z : a − x ∈ (n)}.
without sign.’ This suggests to me the picture in which −5 is ‘really’ 5, from a special point
of view.
. Divisibility
Proof. If i and j are distinct elements of the set, then 0 < |i − j| < n, so n ∤ i − j
by Theorem .
We want now to show that every integer is congruent to some element of
{a, a + 1, . . . , a + n − 1}. To do so, we shall use the greatest integer in a rational
number. This notion applies to arbitrary real numbers as well, through the
following:
Theorem . For every real number x, there is a unique integer k such that
k 6 x < k + 1.
Proof. Assume first x > 0. By the construction in §., there is a rational
number a/b such that x < a/b; and then x < a. By the Well Ordering Principle
(Theorem ), there is a least integer m such that x < m. Then m − 1 is the
desired integer k. If x < 0, we let m be the least integer such that −x 6 m, and
then −m is the desired integer k.
In either case, the integer k is unique by Theorem (though again, cases must
be considered).
In the theorem, the integer k is the greatest integer in x and can be denoted
by
[x].
Its existence for all x in R is expressed by saying R is archimedean (as an
ordered commutative ring).
Lemma. For every positive modulus n, every integer has a unique residue in
{0, 1, . . . , n − 1}.
Proof. For any integer a, we just compute
hai a hai
6 < + 1,
n n h in
a a a
−1< 6 ,
n n n
a hai
1> − > 0,
n hna i
n>a−n > 0.
n
So a − n[a/n] belongs to the desired set; and it is an integer congruent to a.
Another way to say R is archimedean is that if a and b are positive real numbers, then for
some positive integer n, na > b. This principle is used by Archimedes (c. – bce) to
show, for example, that the surface of a sphere is equal to a circle of twice the radius [].
An example of a nonarchimedean ordered commutative ring is Z[X], defined in note on
page above. We can characterize Z as the unique archimedean ordered commutative ring
with no positive elements less than 1.
.. Congruence
The following theorem is basically a restatement of the last lemma. It is called
the Division Algorithm, though it is not really an algorithm; it is the observation
that finding a quotient (with remainder) of one integer after division by a nonzero
integer is always possible. So-called long division is an algorithm for doing this
that is learned in school.
Theorem (Division Algorithm). For every positive integer q, for every integer
a, there are unique integers k and r such that
a = kq + r, 0 6 r < q.
the latter set being {−m+1, . . . , m}, if n = 2m, and {−m, . . . , m}, if n = 2m+1.
Theorem . If a ≡ b and c ≡ d, then
a + c ≡ b + d, ac ≡ bd.
n | bd − ac.
. Divisibility
Proof. By the last theorem, if two integers are congruent, then their squares
are congruent. So it is enough to observe the following: The set {−1, 0, 1} is a
complete set of residues modulo 3, and the square of each element is congruent
to 0 or 1. The set {−1, 0, 1, 2} is a complete set of residues modulo 3, and the
square of each element is congruent to 0 or 1.
4 6 6 6 10 15
b b
2 3 2 3 2 3 5
1 1 1
Figure .. Common divisors of 12 and 30
ax + by,
That is, the common divisors of a and b are those j such that (a, b) ⊆ (j). In fact
we have not introduced any new ideals, by the following:
Lemma. For all integers a and b, for some unique non-negative integer k,
(a, b) = (k).
Proof. Immediately (0, 0) = (0). Now suppose one of a and b is not 0. Then (a, b)
has positive elements, and we may let k be the least of these. Then (k) ⊆ (a, b).
We establish the reverse inclusion by showing k divides a and b. By Theorem
(the Division Algorithm), we have a = kq + r and 0 6 r < k for some q and r.
Then
r = a − kq = a − (ax + by)q = a(1 − qx) + b(−qy)
for some x and y, so r ∈ (a, b), and hence r = 0 by minimality of k. So k | a. By
symmetry, k | b.
that is, gcd(a, b) is the unique positive integer k such that (a, b) = (k). Hence
every common divisor of a and b divides gcd(a, b).
. Divisibility
The theorem is the reason why the notation (a, b) is sometimes used in place
of gcd(a, b). The following is immediate.
Corollary (Bézout’s Lemma ). If a and b are not both 0, the diophantine equa-
tion
ax + by = gcd(a, b)
is soluble.
The following is sometimes useful:
Theorem . For all integers a, b, and c, if one of a and b is not 0, then
ax + by = 1,
acx + bcy = c,
absx + bary = c,
ab(sx + ry) = c.
Euclid proves the following in Proposition VII. of the Elements [, ],
though his statement of the theorem assumes a is prime (see p. ).
Theorem . If a | bc and gcd(a, b) = 1, then a | c.
http://en.wikipedia.org/wiki/Bezout’s_identity (accessed December , ).
ax + by = 1,
acx + bcy = c.
5 3 2
b b
15 10 6 4
b b
30 20 12
60
Figure .. Divisors of 60, again
. Divisibility
The greatest common divisor of a and b is the common divisor of a and b that is
greatest among all common divisors—greatest with respect to the linear ordering
6, but also with respect to divisibility. The least common multiple of a and b
has the corresponding property:
Theorem . If ab 6= 0, then
lcm(a, b) = (a) ∩ (b). (¶)
In particular, lcm(a, b) divides all common multiples of a and b. Moreover,
|ab|
lcm(a, b) = . (k)
gcd(a, b)
Proof. Let c and d be common multiples of a and b. Then gcd(c, d) must also be
a common multiple of a and b. That is, under the assumption (c) ⊆(a) ∩ (b) and
(d) ⊆ (a) ∩ (b), we have (c, d) ⊆ (a) ∩ (b), and therefore gcd(c, d) ⊆ (a) ∩ (b).
In particular, if d ∈
/ (c), then
(c) ⊂ (c, d) = gcd(c, d) ⊆ (a) ∩ (b),
so |c| 6= lcm(a, b). This establishes (¶) and the conclusion that lcm(a, b) divides
all common multiples of a and b.
As a special case, lcm(a, b) divides ab. By Theorem , if x is an arbitrary
divisor of ab, then x is a common multiple of a and b if and only if ab/x is a
common divisor of ab/a and ab/b, which are just b and a. Hence |ab|/ gcd(a, b)
must be the least common multiple of a and b among the divisors of ab. But
we already know that the least of all common multiples of a and b is among the
divisors of ab. Therefore we have (k).
Corollary. If ab 6= 0, and c is a common multiple of a and b, then
|c|
lcm(a, b) = .
gcd(c/a, c/b)
Proof. Theorem .
For example, since gcd(12, 30) = 6, we have that the least common multiple of
60/12 and 60/30 is 60/6, that is,
lcm(5, 2) = 10.
In general, we have a Hasse diagram as in Figure ..
Another corollary of the theorem is the following:
Corollary. If ab 6= 0, and x ≡ y modulo both a and b, then
x≡y (mod lcm(a, b)).
lcm(a, b)
a b
gcd(a, b)
63 = 23 · 2 + 17,
✁✁
✁✁✁
✁
✁✁
23 = 17 · 1 + 6,
✁✁
✁✁✁
✁
✁✁
17 = 6 · 2 + 5,
✁
✁✁✁
✁✁
✁✁
6 = 5·1 + 1,
. Divisibility
common divisors is given by Euclid in Propositions VII. and of the Elements.
In modern notation, we have the following.
Theorem (Euclidean Algorithm). Suppose a1 > a2 > 0. There are unique
sequences (an : n ∈ N) and (qn : n ∈ N) such that, if an+1 6= 0, then
an = an+1 · qn + an+2 , 0 6 an+2 < an+1 , (∗∗)
but if an+1 = 0, then an+2 = 0 = qn . Then the sequence (an : n ∈ N) is eventually
0, and if am is the last nonzero entry, then
gcd(a0 , a1 ) = am .
Proof. The given conditions amount to a definition by recursion of the function
n 7→ (an , an+1 ). In the notation of Theorem , the set A is Z×Z, and b = (a1 , a2 ),
while f is given by f (x, y) = (y, z), where z is the least nonnegative residue of
x modulo y, if y 6= 0, but z = 0 if y = 0. (The function f is well defined by
Theorem .)
We now have that, if an+1 6= 0, then an+2 < an+1 ; also, the common divisors
of an and an+1 are just the common divisors of an+1 and an+2 , so that
gcd(an , an+1 ) = gcd(an+1 , an+2 ).
In particular, if am is the least of the positive numbers an , then am+1 = 0, so
gcd(a0 , a1 ) = gcd(am , 0) = am .
In §., to establish the incommensurability of the diagonal and side of a square,
we used the variant of the Euclidean Algorithm used by Euclid himself to prove
his Proposition X..
In the notation of Theorem , two consecutive lines of computations as in
Figure . can be written as
an = an+1 · qn + an+2 ,
an+1 = an+2 · qn+1 + an+3 ;
but we can rewrite these as
an an+2
= qn + ,
an+1 an+1
an+1 an+3
= qn+1 + .
an+2 an+2
With the notation ξn for an+1 /an , we now have
1
0 6 ξn < 1, = qn + ξn+1
ξn
Then we have
1 1 1
= q1 + ξ2 = q1 + = q1 + = ...
ξ1 q2 + ξ3 1
q2 +
q3 + ξ4
63 17 23 6 17 5 6 1
=2+ , =1+ , =2+ , =1+ ,
23 23 17 17 6 6 5 5
and therefore
63 1
=2+ .
23 1
1+
1
2+
1
1+
5
But the definition (††) can be applied to any real number chosen as ξ1 . If ξn
is never 0 for any n, or equivalently if (q1 , q2 , . . . ) never ends, then by Euclid’s
Proposition X., the number ξ1 must be irrational. √
In §., we worked out the example where ξ1 = 1/ 2. Indeed, let d and s be
the diagonal and side of a square, respectively, as in Figure .. Since d2 −s2 = s2 ,
s
s
s
d
we have
d−s s
= .
s d+s
. Divisibility
From this equation, since s < d + s, we have d − s < s. Letting ξ1 = s/d, we have
1 d d−s
= , q1 = 1, ξ2 = ,
ξ1 s s
1 s d+s d−s
= = , q2 = 2, ξ3 = ,
ξ2 d−s s s
The given ‘answers’ are correct; and according to the ‘method’, the given answers
are the only ones possible (assuming at least one cock, one hen, and one chick
must be bought). But why is the method correct? Let
x + y + z = 100,
1
5x + 3y + z = 100.
3
Multiplying the second equation by 3 and subtracting the first equation yields
14x + 8y = 200 and then
7x + 4y = 100.
Since 4 | 100, one solution is (0, 25), that is, x = 0 and y = 25, and then z = 75.
Moreover, since 7 and 4 are co-prime, any increase in x must be a multiple of 4,
and then y must decrease by the same multiple of 7, so z must increase by the
Burton[, pp. –] discusses the problem, but my source for the text is the anthology edited
by Katz [, pp. –], where it is said that the Classic was probably compiled between
the years and .
x y z
4 18 78
8 11 81
12 4 84
. Divisibility
. Prime numbers
1 < a < b =⇒ a ∤ b.
Throughout this book, p and q will always stand for primes. Then
Corollary. If p | a1 · · · an , where n > 1, then p | ak for some k.
Proof. Use induction. The claim is trivially true when n = 1. Suppose it is true
when n = m. Say p | a1 · · · am+1 . By the theorem, we have that p | a1 · · · am or
p | am+1 . In the former situation, by the inductive hypothesis, p | ak for some k.
So the claim holds when n = m + 1, assuming it holds when n = m. Therefore
the claim does indeed hold for all n.
The following appears in Gauss’s Disquisitiones Arithmeticae as ¶; Hardy
and Wright [, p. ] judge that to be the first explicit statement of the theorem.
Theorem (Fundamental Theorem of Arithmetic). Every positive integer is
uniquely a product
p 1 · · · pn
of primes, where
p 1 6 · · · 6 pn .
Proof. Trivially, 1 = p1 · · · pn , where n = 0. Suppose m > 1, and let p1 be its least
prime divisor (which exists by Theorem ). If m = p1 , we are done; otherwise,
the least divisor of m/p1 that is greater than 1 is a prime, p2 . If m = p1 p2 , we
are done; otherwise, the least divisor of m/p1 p2 that is greater than 1 is a prime
p3 . Continuing thus, we get an increasing sequence p1 , p2 , p3 , . . . of primes, where
p1 · · · pk | m. Since
m m
m> > > ··· ,
p1 p1 p2
the sequence of primes must terminate by the Well Ordering Principle, and for
some n we have m = p1 · · · pn .
For uniqueness, suppose also m = q1 · · · qℓ . Then q1 | m, so q1 | pi for some i
by the corollary to Theorem , and therefore q1 = pi . Hence
p1 6 pi = q 1 .
p 1 a 1 · · · pn a n ,
that is,
n
Y
pk a k ,
k=1
where p1 < · · · < pn and the exponents ak are all positive integers. Here of course
the pk (as well as the ak ) depend on the integer. To incorporate this dependence
. Prime numbers
into the notation, we may say that, for every positive integer a, there is a unique
function p 7→ a(p) on the set of primes such that a(p) > 0 for all p, and a(p) = 0
for all but finitely many p, and
Y
a= pa(p) . (∗)
p
.. Irreducibility
What is there about N that makes the Fundamental Theorem of Arithmetic
possible?
In an arbitrary commutative ring, the elements analogous to the prime numbers
are called irreducible, and the elements that respect the analogue of Theorem
are called prime. To be precise, a nonzero element of an arbitrary commutative
ring is a unit if it has a multiplicative inverse. A nonzero element a of the ring
is irreducible if a is not a unit, but whenever a = bc, one of b and c must be a
unit. In this sense, the prime integers are just the positive irreducibles in Z. In
an arbitrary commutative ring, a nonzero nonunit π is called prime if
π | ab & π ∤ a =⇒ π | b.
In particular, √
4+ 10 | 2 · 3.
√
Also, 4 + 10 is irreducible,
√ but it divides neither 2 nor 3. To show this, we use
the operation σ on Z[ 10] given by
√ √
σ(a + b 10) = a − b 10.
.. Irreducibility
(Compare this with complex conjugation.) Since
√ √ √
(a ± b 10)(c ± d 10) = ac + 10bd ± (ad + bc) 10,
N (x) = x · σ(x),
√
so that N (a + b 10) = a2 − 10b2 , which is always an integer. Then
. Prime numbers
.. The Sieve of Eratosthenes
3 5 7 /9 11 13 /
15 17 19 /
21 23 25 /
27 29 31 /33 35 37 /39 41 43 /45 47 49 /51 53 55 /57 59 61 /63
65 67 /
69 71 73 /
75 77 79 /
81 83 85 /87 89 91 /93 95 97 /99 101 103 /105 107 109 /111 113 115 /117 119
3 5 7 /9 11 13 /
15 17 19 /
21 23 /
25 /
27 29 31 /33 /35 37 /39 41 43 /45 47 49 /51 53 /55 /57 59 61 /63
/65 67 /69 71 73 /
75 77 79 /
81 83 /
85 /87 89 91 /93 /95 97 /99 101 103 /105 107 109 /111 113 /115 /117 119
3 5 7 9/ 11 13 /15 17 19 /
21 23 /
25 /
27 29 31 /33 /35 37 /39 41 43 /45 47 /49 /51 53 /55 /57 59 61 /63
/65 67 6/9 71 73 /
75 7/7 79 /
81 83 /
85 /
87 89 /91 /93 /95 97 /99 101 103 /105 107 109 /111 113 /115 /117 119
3 5 7 /9 11 13 /
15 17 19 /
21 23 /
25 /
27 29 31 /33 /35 37 /39 41 43 /45 47 /49 /51 53 /55 /57 59 61 /63
/65 67 /
69 71 73 /
75 /
77 79 /
81 83 /85 /87 89 /91 /93 /95 97 /99 101 103 /105 107 109 /111 113 /115 /117 119
b b
b b b
b b b b
—called decem in Latin, but in English ten. There is no obvious reason, other
than our having ten fingers, why t should be ten and not be some other number.
Nonetheless, given the decimal system, we have some standard tests for divisibility
by small primes:
Theorem . Let t = 2 · 5. Every positive integer a0 + a1 t + · · · + an tn is
congruent, modulo
a) 2 and 5, to a0 ,
b) 3 (and 9), to a0 + a1 + · · · + an ,
c) 7, to a0 + 3a1 + · · · + 3n an ,
d) 11, to a0 − a1 + · · · + (−1)n an ,
e) 13, to a0 − 3a1 + · · · + (−3)n an .
Every positive integer b0 + b1 t3 + · · · + bn t3n is congruent, modulo 1001 (that is,
1 + t3 , or 7 · 11 · 13), to b0 − b1 + · · · + (−1)n bn .
Suppose n is a composite number less than 372 (that is, 1369). Then n is
divisible by one of the eleven primes
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31.
We can easily check for divisibility by 2, 3, and 5. If n = a + 10b + 100c + 1000d,
we can consider n − 1001d, that is, a + 10b + 100c − d: this is divisible by 7, 11,
or 13 if and only if n is. If a prime factor of n has not been detected so far, then
n > 172 , and n is divisible by one of 17, 19, 23, 29, and 31. In particular, n is
one of the numbers listed in Table ..
To create this table, I used a table of Burton [, Table , pp. –], which lists all odd
. Prime numbers
289 = 17 · 17 779 = 19 · 41 1121 = 19 · 59
323 = 17 · 19 799 = 17 · 47 1139 = 17 · 67
361 = 19 · 19 817 = 19 · 43 1147 = 31 · 37
391 = 17 · 23 841 = 29 · 29 1159 = 19 · 61
437 = 19 · 23 851 = 23 · 37 1189 = 29 · 41
493 = 17 · 29 893 = 19 · 47 1207 = 17 · 71
527 = 17 · 31 899 = 29 · 31 1219 = 23 · 53
529 = 23 · 23 901 = 17 · 53 1241 = 17 · 73
551 = 19 · 29 943 = 23 · 41 1247 = 29 · 43
589 = 19 · 31 961 = 31 · 31 1271 = 31 · 41
629 = 17 · 37 989 = 23 · 43 1273 = 19 · 67
667 = 23 · 29 1003 = 17 · 59 1333 = 31 · 43
697 = 17 · 41 1007 = 19 · 53 1343 = 17 · 79
703 = 19 · 37 1037 = 17 · 61 1349 = 19 · 71
713 = 23 · 31 1073 = 29 · 37 1357 = 23 · 59
731 = 17 · 43 1081 = 23 · 47 1363 = 29 · 47
Table .. Composite numbers less than 1369 with least prime factor 17 or more
Theorem (Euclid, IX.). There are more than any number of primes.
There are many proofs of this ancient theorem. A recent proof by Filip
Saidak [] is as follows. Define a0 = 2 and an+1 = an (1 + an ). Suppose k < n.
positive integers that are less than 5000 and are indivisible by 5, along with their least prime
factors. As a check, I noted that my table should contain 48 numbers, namely
• 17 times one of 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79;
• 19 times one of 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71;
• 23 times one of 23, 29, 31, 37, 41, 43, 47, 53, 59;
• 29 times one of 29, 31, 37, 41, 43, 47;
• 31 times one of 31, 37, 41, 43.
Having copied what should be these products from Burton’s table, along with their smaller
prime factors, I used a pocket calculator to find the other factors and thus verify the numbers.
I learned of the proof from Matematik Dünyası (-II [no. ], p. ). I write this book
for myself and my students; but it is on the web. A colleague of Dr Saidak’s found it and
informed Dr Saidak, who kindly sent me a copy of his original paper.
which is certainly well defined if there are only finitely many primes. Each factor
in the product is the sum of a geometric series:
∞
1 1 1 X 1
= 1 + + 2 + ··· = .
1 − 1/p p p pk
k=0
We have now
∞
Y 1 YX 1
= ,
p
1 − 1/p p
pk
k=0
where k(p) > 0. This product is 1/k for some positive integer k. Moreover, by
the Fundamental Theorem of Arithmetic as expressed in (∗), for each positive
integer k, the reciprocal 1/k arises as a product as in (†) in exactly one way.
Therefore, under the assumption that there are finitely many primes, we have
∞
Y 1 X 1
= . (‡)
p
1 − 1/p n=1 n
. Prime numbers
Therefore there are infinitely many primes.
The same computations that give (‡) yield also
∞
Y 1 X 1
s
= . (§)
p
1 − 1/p n=1
ns
The sum converges, when s > 1, to the value denoted by ζ(s); this is the Rie-
mann zeta function of s. Then the product also converges, in the sense that
Y 1
lim = ζ(s).
n→∞ 1 − 1/ps
p6n
Hardy and Wright [, p. ] describe (§) as ‘an analytical expression of the
fundamental theorem of arithmetic.’
so the claim holds when n is an even positive integer, provided it holds for lesser
positive integers n.
We now show that the claim holds when n is an odd positive integer, provided
it holds for lesser positive integers n. We have
Now, each p such that m + 1 < p 6 2m + 1 is a factor of (2m + 1)! that is not
also a factor of (m + 1)!. We also have
(2m + 1)! 2m + 1
= ,
(m + 1)! · m! m+1
which is an integer, and each p such that m + 1 < p 6 2m + 1 must be a factor
of this too. Therefore
2m + 1
ϑ(2m + 1) 6 log + ϑ(m + 1).
m+1
Now, we have also
2m + 1 2m + 1
= ,
m+1 m
and these are terms in the expansion of (1 + 1)2m+1 ; so
2m + 1
2 6 22m+1 .
m+1
Therefore
In particular, if ϑ(m + 1) < 2(m + 1) log 2, then ϑ(2m + 1) < 2(2m + 1) log 2.
Thus the claim holds when n is odd if it holds for lesser n.
We should also observe:
Erdős attributes the result to Legendre. For another proof, see Exercise .
. Prime numbers
Theorem . For all positive integers n,
∞ h
X X ni
log n! = log p ,
j=1
pj
p6n
that is, thePnumber of times that p divides n! (that is, the greatest k such that
∞
pk | n!) is j=1 [n/pj ].
Proof. The number of times that p divides n! is the sum of:
• the number of multiples ℓp such that ℓp 6 n,
• the number of multiples ℓp2 such that ℓp2 6 n,
• and so on.
That is, it is the sum over all j of those ℓpj such that ℓpj 6 n; but the number
of such multiples ℓpj is [n/pj ]. In other words, p divides n! once for each entry
in each of the lists
hni hni
p, 2p, . . . , p; p2 , 2p2 , . . . , 2 p2 ; ...
p p
Theorem (Bertrand’s Postulate). For every positive integer n there is a
prime p such that
n < p 6 2n.
Proof. Note that the claim is equivalent to the claim that the sequence 2, 3, 5,
7, 13, 23, 43, 83, 163, 317, 631 of primes, where each successive term is less than
twice the previous term, can be continued indefinitely. Suppose the claim fails for
some n. Then we must have n > 631: in particular, n > 29 . There are exponents
k(p) such that Y
2n
= pk(p) .
n
p6n
2n
By the last theorem, since log n = log (2n)! − 2 log(n!), we have
∞ h
X 2n i h n i
k(p) = −2 j . (¶)
j=1
pj p
In the series expansion (¶) for k(p), each term [2n/pj ] − 2[n/pj ] is 0 if [2n/pj ]
is even, and 1 if [2n/pj ] is odd. Also the term is 0 if pj > 2n, that is, j >
log(2n)/ log p. This then is a bound for k(p), that is,
log(2n)
k(p) 6 . (k)
log p
Therefore, if k(p) > 2, then
Therefore
2n X X
log = log p + k(p) log p
n
k(p)=1 k(p)>2
X √
6 log p + (2n) log(2n)
p|(2n
n)
4n √
6 log 2 + (2n) log(2n).
3
Also,
2n 2n−1
X
2n
X 2n 2n 2n
2 = =2+ 6 2n .
j=0
j j=1
j n
. Prime numbers
Now, log x grows more slowly than any power of x; so the last inequality should
fail if n is large enough. We complete the proof by showing that the inequality
fails when, as we have assumed, n > 29 . To this end, we define
25 − 2 −5(1+ζ)
25ζ 6 (2 + 1)(1 + ζ)
25
6 (1 − 2−4 )(1 + 2−5 )(1 + ζ)
6 1 + ζ.
Some further theorems about the distribution of primes are stated without
their proofs in Appendix B.
.. Exponentiation
Computing powers with respect to a modulus can be achieved by successively
squaring and taking residues. This is justified by Theorem on page . For
example, with respect to the modulus 43, to compute 3514 , we can first note
35 ≡ −8, so
3514 ≡ (−8)14 ≡ (−1)14 · 814 ≡ 814 .
Also, 14 = 8 + 4 + 2 = 23 + 22 + 21 , so 814 = 88 · 84 · 82 ; and
so that
3514 ≡ −8 · 11 · 21 ≡ −88 · 21 ≡ −2 · 21 ≡ −44 ≡ 1.
.. Inversion
A special case of Theorem is the implication
The converse fails, because, for example, possibly c ≡ 0 (n). Even if this case is
excluded, the converse still fails:
The reason why we cannot cancel 4 here is that 4 and 6 have a nontrivial common
divisor, in this case 2. The converse of (∗) does hold if c and n are co-prime:
Theorem . If gcd(c, n) = 1, then
ac ≡ bc mod n =⇒ a ≡ b mod n.
1 ≡ 10 (mod 3).
Theorem . For all positive moduli n, for all integers a, b, and c,
n
ac ≡ bc mod n ⇐⇒ a ≡ b mod .
gcd(c, n)
Proof. Let d = gcd(c, n). Then gcd(c/d, n/d) = 1 by Theorem . Hence
ac bc n
ac ≡ bc mod n =⇒ ≡ mod
d d d
n
=⇒ a ≡ b mod
d
by the last theorem. Conversely,
n n
a ≡ b mod =⇒ |b−a
d d
cn
=⇒ | bc − ac
d
=⇒ n | bc − ac
=⇒ ac ≡ bc mod n.
For example, 6x ≡ 6 (9) ⇐⇒ x ≡ 1 (3).
A longer problem is to solve
70x ≡ 18 (mod 134).
This reduces to
35x ≡ 9 (mod 67), (‡)
and solutions of this correspond to solutions to the Diophantine equation
35x + 67y = 9. (§)
By Bézout’s Lemma (the corollary to Theorem on page ), this is soluble if
and only if gcd(35, 67) | 9. We find gcd(35, 67) by the Euclidean algorithm:
67 = 35 · 1 + 32,
35 = 32 · 1 + 3,
32 = 3 · 10 + 2,
3 = 2 · 1 + 1,
so gcd(35, 67) = 1. To find the solutions to (§), or rather to 35x + 67y = 1, we
rearrange the computations, getting
32 = 67 − 35,
3 = 35 − 32 = 35 − (67 − 35) = 35 · 2 − 67,
2 = 32 − 3 · 10 = 67 − 35 − (35 · 2 − 67) · 10 = 67 · 11 − 35 · 21,
1 = 3 − 2 = 35 · 2 − 67 − 67 · 11 + 35 · 21 = 35 · 23 − 67 · 12.
.. Inversion
In particular,
35 · 23 ≡ 1 (mod 67), (¶)
1
23 ≡ (mod 67).
35
In particular, 35 is invertible as an element of Z67 . We have in general
Proof. The following are equivalent by Bézout’s Lemma (the corollary to Theo-
rem ):
a) a is invertible modulo n,
b) the congruence ax ≡ 1 (mod n) is soluble,
c) the diophantine equation ax + ny = 1 is soluble,
d) gcd(a, n) = 1.
x ≡ 2 · 70 + 3 · 21 + 2 · 15 (mod 105).
This is the only solution, by the corollary to Theorem on page . The key to
the solution is finding the numbers 70, 21, and 15. Note that
70 = (5 · 7) · 2, 21 = (3 · 7) · 1, 15 = (3 · 5) · 1.
So the real problem is to find the coefficients 2, 1, and 1, which are, respectively,
inverses of 5 · 7, 3 · 7, and 3 · 5, with respect to 3, 5, and 7. When they exist, such
inverses can be found by means of the Euclidean algorithm, as in the previous
section.
The general problem is now solved as follows:
Theorem . If moduli n1 , . . . , nk are given, each being prime to the rest, then
every system of congruences
has a solution, which is unique modulo the product N of the moduli. This solution
is given by
N N
x ≡ a1 · · m1 + · · · + a k · · mk (mod N ),
n1 nk
where mi is an inverse of N/ni with respect to ni .
6 = 1 + 2 + 3, 28 = 1 + 2 + 4 + 7 + 14.
Euclid gives a sufficient condition for being perfect. The proof uses that
1 + 2 + 4 + · · · + 2k−1 = 2k − 1.
1, 2, 4, ..., 2k−1 ,
2k − 1, 2 · (2k − 1), 4 · (2k − 1), ..., 2k−1 · (2k − 1).
2k m = (2k − 1) · σ(m).
According to Dickson [, p. ], Euler’s proof of this was published posthumously in .
In particular, 2k | σ(m), so σ(m) = 2k · ℓ for some ℓ. Then
m = (2k − 1) · ℓ = σ(m) − ℓ, σ(m) = m + ℓ.
Since m and ℓ are two distinct factors of m, they must be the only positive factors.
In particular, ℓ = 1, and m is prime, so n is as desired.
In his excellent textbook Elementary Number Theory [] (first published in
German in ), Edmund Landau (–) writes, before proving the fore-
going theorems:
This old-fashioned concept of perfect number, and the questions associated
with it, are not especially important; we consider them only because, in so
doing, we will encounter two questions that remain unanswered to this day:
Are there infinitely many perfect numbers? Is there an odd perfect number?
Modern mathematics has solved many (apparently) difficult problems, even in
number theory; but we stand powerless in the face of such (apparently) simple
problems as these. Of course, the fact that they have never been solved is
irrelevant to the rest of this work. We will leave no gaps; when we come to a
bypath which leads to an insurmountable barrier, we will turn around, rather
than—as is so often done—continue on beyond the barrier.
The questions that Landau cites are still unanswered. It is also the aim of the
present book to leave no gaps (except for the unproved theorems in Appendix B,
which however we shall never use).
. Powers of two
p 2p − 1 factorization 2p−1 (2p − 1)
2 3 − 6
3 7 − 28
5 31 − 496
7 127 − 8128
11 2047 23 · 89
13 8191 − 33550336
17 131071 − 8589869056
19 524287 − 137438691328
23 8388607 47 · 178481
2p ≡ 1 (mod q).
Every prime number is always a factor of one of the powers of any [geometric]
progression minus 1, and the exponent of this power is a divisor of the prime
number minus 1. After one has found the first power that satisfies the propo-
sition, all those powers of which the exponents are multiples of the exponent
of the first power also satisfy the proposition.
Example: Let the given progression be
1 2 3 4 5 6
3 9 27 81 243 729 etc.
A proof of this theorem was found among the writings of Leibniz (–
) [, p. ]. The first published proof was by Euler, in . This proof
uses the following:
Lemma. If 0 < k < p, then
p
p| .
k
Proof. If 0 < k < p, then p divides p!, but not k! or (p − k)!. Since
p
p! = · k!(p − k)!,
k
the claim follows from Theorem on page .
Theorem (Fermat). For all a,
m ≡ n mod (p − 1) =⇒ am ≡ an mod p.
Proof (Euler). We use induction. The claim (∗) holds trivially when a = 1. If it
holds when a = b, then by the lemma,
so the claim holds when a = b + 1. Therefore (∗) holds for all a. We now have (†)
by Theorem on page .
Induction normally proves something true for all positive integers. But (∗)
holds for all integers a, and Euler’s proof establishes this, since every integer is
congruent modulo p to a positive integer, and if a ≡ b (p), then ap ≡ bp (p) by
Theorem . Alternatively, we can understand the proof as establishing ap = a
for all a in Zp . Induction still works here; it just takes us around in a circle,
from 1, to 2, to 3, and so on up to p, and then back to 1. (See Figure ..) In
particular, Zp is one of the sets mentioned after the Axiom in §., in which only
part of the Axiom is satisfied. Indeed, Zp allows induction, but here 1 is the
successor of p.
Thisis stated by Gauss in the Disquisitiones Arithmeticae [, ¶] and confirmed by Dick-
son [, p. ] and Struik [, p. , n. ].
10 3
9 4
8 5
7 6
Euler later proved the more general claims of Fermat in the quotation above.
In particular, he showed that, if p ∤ a, then there is some λ such that λ > 1 and
p | aλ − 1. The least such λ is what we shall call the order of a modulo p in §..
If λ is this order, then Euler showed λ | p − 1, and then p | ap−1 − 1. He later
generalized this result, establishing what is called Euler’s Theorem (Theorem
on page ).
There is yet another proof of Fermat’s Theorem, published by James Ivory in
[]. Perhaps it is the best. If gcd(a, p) = 1, then the products a, 2a, . . . ,
(p − 1)a are all incongruent modulo p, since
ia ≡ ja mod p =⇒ i ≡ j mod p
Since (p − 1)! and p are co-prime, we can conclude (†). This implies (∗) in case
p ∤ a; but if p | a, then (∗) is obvious.
With Fermat’s Theorem, we can compute residues of large powers easily. For
example,
658 ≡ 648+10 ≡ (616 )3 · 610 ≡ 610 (mod 17).
Euler’s treatment can be read in Struik [, pp. –].
An account of this is in Dickson [, p. ].
According to Dickson [, p. ], this proof was later rediscovered and published by Dirichlet
in . Landau [, p. ] uses the proof. Hardy and Wright [, p. ] also use it, but
the historical information that they supply about Fermat’s and Euler’s theorems does not
address this proof.
. Prime moduli
We can continue the computation as in §., by analyzing the exponent 10 as a
sum of powers of 2. Since 10 = 8 + 2, we have 610 = 68 · 62 ; but 62 ≡ 36 ≡ 2
(17), so 68 ≡ (62 )4 ≡ 24 ≡ 16 ≡ −1 (17), and hence
22 = 4;
2
22 = 42 = 16;
3
22 = 162 = 256 ≡ 123 ≡ −10 (mod 133);
24 2
2 ≡ (−10) = 100 ≡ −33;
25
2 ≡ (−33)2 = 1089 ≡ 25;
6
22 ≡ 252 = 625 ≡ −40;
7
22 ≡ (−40)2 = 1600 ≡ 4. (‡)
We can now state and prove what resembles a converse to Theorem :
Theorem . If n is a pseudo-prime, then so is 2n − 1.
Proof. If n is a pseudo-prime, then it is not prime, so by Theorem , neither is
2n − 1. We also have 2n ≡ 2 (mod n) by Fermat’s Theorem; say 2n − 2 = kn.
Then n n
22 −1 − 2 = 2 · (22 −2 − 1) = 2 · (2kn − 1),
n
which has the factor 2n − 1; so 22 −1
≡ 2 (mod 2n − 1).
Pseudo-primes as we defined them can be called more precisely pseudo-primes
of base 2. Then a pseudo-prime of base a is a composite number n such that
an ≡ a (mod n). A composite number that is a pseudo-prime of every base can
be called an absolute pseudo-prime. It is also called a Carmichael number
after Robert Daniel Carmichael (–), who published the first examples of
such numbers in []. If n is a Carmichael number, then
an−1 ≡ 1 (mod n)
that is, 2 | 560, 10 | 560, and 16 | 560. We now make the following observations.
a) If 3 ∤ a, then a2 ≡ 1 (mod 3), so a560 ≡ 1 (mod 3).
b) If 11 ∤ a, then a10 ≡ 1 (mod 3), so a560 ≡ 1 (mod 11).
c) If 17 ∤ a, then a16 ≡ 1 (mod 3), so a560 ≡ 1 (mod 17).
. Prime moduli
Hence if one of 3, 11, and 17 fails to divide a, then we have a560 ≡ 1 (561) and
therefore
a561 ≡ a (mod 561). (§)
But if each of 3, 11, and 17 divides a, then 561 | a, so again we have (§).
A positive integer is squarefree if it has no divisor p2 . The proof that 561 is
an absolute pseudo-prime generalizes to establish the following:
Theorem . A number n greater than 1 is a prime or absolute pseudo-prime
if it is squarefree and p − 1 | n − 1 whenever p | n.
The sufficient condition given by the theorem for being an absolute pseudo-
prime is Korselt’s Criterion, so called after Alwin Reinhold Korselt (–
), who proved its sufficiency and necessity in , apparently without ac-
tually finding any absolute pseudo-primes. The term Korselt’s Criterion is used
by Alford et al. in their paper [], where they prove that there are infinitely
many absolute pseudo-primes.
We can prove the necessity of part of Korselt’s Criterion now; the rest will have
to wait until Theorem (p. ), when we have primitive roots of primes.
Theorem . Every absolute pseudo-prime is squarefree.
Proof. Suppose n is an absolute pseudo-prime. If p2 | n, then
pn ≡ p (mod p2 ).
But n > 1 (since it is composite), so pn ≡ 0 (mod p2 ), and therefore p ≡ 0
(mod p2 ), which is absurd.
120 120
the simplest; so the reader may wish to skip ahead.) In each triangular array
in the table, the top row is the sequence 0n , 1n , 2n , . . . ; then each successive
row consists of the differences of consecutive entries in the previous row. Let us
number the rows from the top, starting with 0. If row 0 consists of nth powers, it
appears that the entries in row n are n!, so that the entries of all further rows are
0. The appearance is the reality, by induction: First of all it is true when n = 0.
Suppose it is true when n 6 m. We consider the array whose top row consists of
powers xm+1 . We compute
m+1 m+1 m m + 1 m−1 m + 1 m−2
(x + 1) −x = (m + 1)x + x + x + ··· .
2 3
By inductive hypothesis, the only term that will have any effect, m rows later,
is (m + 1)xm . That is, as far as row m + 1 is concerned, row 1 might as well
consist of the entries (m + 1)xm . So each entry of row m + 1 is m + 1 times the
. Prime moduli
corresponding entry of row m of the array whose top row consists of powers of
m. By inductive hypothesis, every entry of this row m is m!. This completes the
induction.
This result gives us the (p − 1)! in Wilson’s Theorem; the −1 that solves (¶)
comes from a more general expression for successive differences:
Lemma. For all non-negative integers n, for all x in R,
n
n−k n
X
n! = (−1) (x + k)n .
k
k=0
Wilson’s Theorem gives a theoretical test for primality, though not a practical
one.
For an alternative proof of the hard direction of Wilson’s Theorem, we may
note that, by Theorem , each number on the list 1, 2, 3, . . . , p − 1 has an inverse
modulo p. Also, x2 ≡ 1 (mod p) has only the solutions ±1, that is, 1 and p − 1,
since if p | x2 − 1, then p | x ± 1. So each number on the list 2, 3, . . . , p − 2 has
an inverse that is also on the list and is distinct from itself. Also the inverse of
the inverse is the original number. Therefore the product of the numbers on the
list is 1 modulo p. Consequently
1 ≡ 2 · 6 ≡ 3 · 4 ≡ 5 · 9 ≡ 7 · 8,
and therefore
. Prime moduli
Since the modulus was small, the inverses here could be found by trial. With a
larger modulus, the Euclidean Algorithm can be used as in §..
We may also note that 2 has the following powers with respect to the modu-
lus 11:
k 1 2 3 4 5 6 7 8 9 10
2k 2 4 8 5 10 9 7 3 6 1 mod 11
So every number that is prime to 11 is congruent to a power of 2. In particular,
the invertible integers modulo 11 compose a multiplicative group generated by 2;
we express this by saying 2 is a primitive root of 11. We shall investigate primitive
roots in Chapter . Meanwhile, if in the last table, we write the residues that
are least in absolute value, we get
k 1 2 3 4 5 6 7 8 9 10
2k 2 4 −3 5 −1 −2 −4 3 −5 1 mod 11
In particular,
−1 ≡ 25 (mod 11).
Then the congruence −1 ≡ x2 (11) is insoluble. Indeed, any solution would be
congruent to a power 2k , and then 25 ≡ 22k , so 22k−5 ≡ 1; but this is impossible,
since all residues of 2k − 5 with respect to 10 are odd, and powers of 2 with odd
exponents 1, 3, 5, 7, or 9 are never 1. We say therefore that −1 is a quadratic
nonresidue of 11.
By contrast, from the table
k 1 2 3 4 5 6 7 8 9 10 11 12
2k 2 4 −5 3 6 −1 −2 −4 5 −3 −6 1 (mod 13)
we have
−1 ≡ 26 ≡ (±5)2 (mod 13),
so −1 is a quadratic residue of 13.
In general, if p is an odd prime not dividing a, then a is a quadratic residue
of p if the congruence a ≡ x2 (p) is soluble; otherwise, a is a quadratic non-
residue of p. We shall develop the theory of quadratic residues and nonresidues
in Chapter . Meanwhile, a preliminary result follows from Wilson’s Theorem.
For convenience in stating and proving it, we use the notation
p−1
̟ = ̟(p) = , (k)
2
where p is an odd prime.
The symbol ̟ is a variant of π; in using it here I follow Hardy and Wright [, p. ].
. p ≡ 1 (mod 4).
. −1 is a quadratic residue of p.
−1 ≡ (p − 1)! ≡ 1 · 2 · · · ̟ · (̟ + 1) · · · (p − 1)
≡ 1 · (p − 1) · 2 · (p − 2) · · · ̟ · (̟ + 1)
≡ 1 · (−1) · 2 · (−2) · · · ̟ · (−̟)
≡ (−1)̟ (̟!)2 ,
that is,
̟
Y p−1
Y ̟
Y ̟
Y
−1 ≡ k· k≡ k · (p − k) ≡ (−1)̟ · (k 2 ) ≡ (−1)̟ · (̟!)2 ,
k=1 k=̟+1 k=1 k=1
which yields (∗∗). If p ≡ 1 (mod 4), then ̟ is even, so (̟!)2 ≡ −1, and therefore
−1 is a quadratic residue of p.
Conversely, if a2 ≡ −1 (mod p), then by Fermat’s Theorem,
A related argument using quadratic residues in §. will provide yet another
proof of Wilson’s Theorem.
. Prime moduli
∆m+1 f (x)
= ∆m ∆f (x)
m
m−k m
X
= (−1) ∆f (x + k)
k
k=0
m
X m
= (−1)m−k f (x + k + 1) − f (x + k)
k
k=0
m m
m−k m m−k m
X X
= (−1) f (x + k + 1) − (−1) f (x + k)
k k
k=0 k=0
m−1
X m
= f (x + m + 1) + (−1)m−k f (x + k + 1)
k
k=0
m
m−k m
X
− (−1) f (x + k) − (−1)m f (x)
k
k=1
m
X
m+1−k m
= f (x + m + 1) + (−1) f (x + k)
k−1
k=1
m
X m
+ (−1)m+1−k f (x + k) + (−1)m+1 f (x)
k
k=1
m
m+1−k m + 1
X
= f (x + m + 1) + (−1) f (x + k) + (−1)m+1 f (x)
k
k=1
m+1
X m+1
= (−1)m+1−k f (x + k),
k
k=0
Table .. The inductive step for ∆n f (x) (see page )
Implicitly here, d ranges over the positive divisors of n. In the theorem, the
indices p range over all primes; but they need only range over
Q the primes dividing
n (since n(p) = 0 when p ∤ n). That is, we can write n as p|n pn(p) , and then
Y Y pn(p)+1 − 1
τ(n) = (n(p) + 1), σ(n) = .
p−1
p|n p|n
Q
In short, each of σ(n) and τ(n) is of the form p|n f (p) for some function f on
the set of primes.
Theorem . If gcd(m, n) = 1, then for any function f on the set of primes,
Y Y Y
f (p) = f (p) · f (q).
p|mn p|m q|n
whenever n and m are co-prime. We do not require the identity to hold for
arbitrary m and n. For example,
id, 1,
P P P P
respectively. Since σ(n) = d|n d = d|n id(d) and τ(n) = d|n 1 = d|n 1(d),
the multiplicativity of σ and τ is also a special case of the following.
Theorem . If f is multiplicative, and F is given by
X
F (n) = f (d), (†)
d|n
then F is multiplicative.
F (36)
= F (22 · 32 )
= f (1) + f (2) + f (4) + f (3) + f (6) + f (12) + f (9) + f (18) + f (36)
= f (1) · f (1) + f (2) · f (1) + f (4) · f (1) +
+ f (1) · f (3) + f (2) · f (3) + f (4) · f (3) +
+ f (1) · f (9) + f (2) · f (9) + f (4) · f (9)
= (f (1) + f (2) + f (4)) · (f (1) + f (3) + f (9))
= F (4) · F (9).
Suppose c | mn. Then every prime power that divides c divides exactly one of
m and n. Hence c and gcd(c, m) gcd(c, n) have the same prime power divisors,
so they are equal. Moreover, if c = de, where d | m and e | n, then c | mn,
d = gcd(c, m), and e = gcd(c, n). So we have (‡). Continuing, we have
XX
F (mn) = f (de)
d|m e|n
XX
= f (d) · f (e)
d|m e|n
X X
= f (d) · f (e) (§)
d|m e|n
= F (m) · F (n).
. Arithmetic functions
.. The Möbius function
Suppose again F is defined from f as in (†), so that
F (1) = f (1)
F (2) = f (1) + f (2)
F (3) = f (1) + f (3)
F (4) = f (1) + f (2) + f (4)
F (6) = f (1) + f (2) + f (3) + f (6)
F (8) = f (1) + f (2) + f (4) + f (8)
F (9) = f (1) + f (3) + f (9)
F (12) = f (1) + f (2) + f (3) + f (4) + f (6) + f (12)
F (18) = f (1) + f (2) + f (3) + f (6) + f (9) + f (18)
F (24) = f (1) + f (2) + f (3) + f (4) + f (6) + f (8) + f (12) + f (24)
f (1) = F (1)
f (2) = −F (1) + F (2)
f (3) = −F (1) + F (3)
f (4) = − F (2) + F (4)
f (6) = F (1) − F (2) − F (3) + F (6)
f (8) = − F (4) + F (8)
f (9) = − F (3) + F (9)
f (12) = F (2) − F (4) − F (6) + F (12)
f (18) = F (3) − F (6) − F (9) + F (18)
f (24) = F (4) − F (8) − F (12) + F (24)
There is some function ξ, taking integral values, such that
X
f (n) = F (d) · ξ(n, d).
d|n
A candidate for ξ that works in our examples is (n, d) 7→ µ(n/d), where µ is given
by (
0, if p2 | n for some prime p;
µ(n) =
(−1)r , if n = p1 · · · pr , where p1 < · · · < pr .
In particular, µ(1) = 1. The function µ is called the Möbius function (af-
ter August Ferdinand Möbius, –). In an alternative (but equivalent)
definition, µ(n) = 0 unless n is squarefree, but in this case
Y
µ(n) = −1. (¶)
p|n
This is easily a multiplicative function. Both the statement and the proof of the
following theorem are important.
Theorem . For all n, X
µ(d) = ε(n).
d|n
Proof. Both sides of the desired equation are multiplicative functions of n. There-
fore it is sufficient to prove the equation when n is a prime power. This is easy:
X s
X
µ(d) = µ(pk )
d|ps k=0
Now we can prove that the function ξ above is indeed (n, d) 7→ µ(n/d):
Theorem (Möbius Inversion). If f determines F by the rule (†), namely
X
F (n) = f (d),
d|n
. Arithmetic functions
then F determines f by the rule
X n
f (n) = µ · F (d),
d
d|n
and conversely.
Proof. We just start calculating:
X n X n X
µ · F (d) = µ · f (e)
d d
d|n d|n e|d
X X n
= µ · f (e).
d
d|n e|d
= f (n)
.. Convolution
We can streamline some of the foregoing results. If f and g are arithmetic func-
tions, their convolution is the function f ∗ g, given by
X n
(f ∗ g)(n) = f (d) · g .
d
d|n
.. Convolution
Theorem . For every arithmetic function f ,
X X n
f (d) = f .
d
d|n d|n
We shall use this below for an alternative proof of Theorem (p. ) and for
Theorem (p. ). Meanwhile, we have
X n
(f ∗ g)(n) = f · g(d),
d
d|n
or more simply
f ∗ g = g ∗ f. (k)
The definition (∗) of σ and τ can be written as
σ = id ∗ 1, τ = 1 ∗ 1.
µ ∗ 1 = ε, f ∗ ε = f. (∗∗)
F = f ∗ 1 ⇐⇒ f = F ∗ µ.
f ∗ 1 ∗ µ = f;
µ ∗ 1 = ε, ε ∗ µ = µ,
ε ∗ 1 = 1, 1 ∗ µ = ε,
1 ∗ 1 = τ, τ ∗ µ = 1.
. Arithmetic functions
You can read down the first column, and up the second; each row is an instance
of Möbius inversion. In short, we have a sequence
. . . , µ, ε, 1, τ, . . .
where passage to the right is by convolving with 1; and to the left, µ. Since
id ∗ 1 = σ, the corresponding sequence with σ is
. . . , id, σ, . . .
ϕ = id ∗ µ. (††)
This is precisely the size of the set {x : 0 6 x < n & gcd(x, n) = 1} when n = ps .
In general, this set can be understood as the set of invertible congruence-classes
modulo n. Recall from §. that the set of all congruence-classes modulo n can
be denoted by Zn . Then the set of invertible elements is denoted by
Zn× .
So in case n = ps , we have
ϕ(n) = |Zn× |.
We shall show in the next chapter that this holds generally.
Meanwhile, it may be of interest to note that convolution is called in particular
Dirichlet convolution (after Johann Peter Gustav Lejeune Dirichlet, –),
because analogous operations, also called convolutions, arise in other contexts.
For example, the reader may be in a position to recall that in analysis one defines
Z t
(f ∗ g)(t) = f (x)g(t − x) d x.
0
.. Convolution
Then
L{f ∗ g} = L{f } · L{g}.
Also, the transform is linear, and
so that, if
f ′′ + af ′ + bf = g,
then
f (0) · id + af (0) + f ′ (0) L{g}
L{f } = + 2
id2 + a · id + b id + a · id + b
= L{ϕ} + L{g} · L{h}
= L{ϕ} + L{g ∗ h}
. Arithmetic functions
. Arbitrary moduli
and the solution is unique modulo 36. We can find this solution by first filling
out a table diagonally as follows:
0 1 2 3 4 5 6 7 8
0 0 4 8
1 1 5
2 2 6
3 3 7
0 1 2 3 4 5 6 7 8
0 0 12 4 16 8
1 9 1 13 5 17
2 10 2 14 6
3 11 3 15 7
0 1 2 3 4 5 6 7 8
0 0 20 12 4 24 16 8
1 9 1 21 13 5 25 17
2 18 10 2 22 14 6 26
3 19 11 3 23 15 7
0 1 2 3 4 5 6 7 8
0 0 28 20 12 4 32 24 16 8
1 9 1 29 21 13 5 33 25 17
2 18 10 2 30 22 14 6 34 26
3 27 19 11 3 31 23 15 7 35
The solution to (∗) is the entry in row a, column b. For example, 14 solves
the congruences x ≡ 2 (4) and x ≡ 5 (9). Making such a table is not always
practical. Still, the general procedure has the following theoretical formulation.
Theorem (Chinese Remainder Theorem). If gcd(m, n) = 1, then the function
x 7→ (x, x) is a well-defined bijection from Zmn to Zm × Zn .
Proof. The given function is well defined, since if a ≡ b (mn), then a ≡ b modulo
m and n. The converse of this holds too, by the corollary to Theorem , since
mn = lcm(m, n); so the function is injective. Since the domain and codomain are
finite sets of the same size (namely mn), the function is a bijection.
This means, in the table above, if we delete row i and column j whenever
gcd(4, i) 6= 1 and gcd(9, j) 6= 1, then the remaining numbers are precisely those
that are prime to 36:
0 1 2 3 4 5 6 7 8
0
1 1 29 13 5 25 17
2
3 19 11 31 23 7 35
Proof. By (†), for all m and n, the function x 7→ (x, x) maps Zmn× into Zm× ×Zn× .
If gcd(m, n) = 1, then by the Chinese Remainder Theorem, every element of
Zm× × Zn× is (x, x) for some x, which must be in Zmn× .
Recall that ϕ was defined as id ∗ µ in (††) in §. (p. ). As promised, we now
have:
Proof. We follow the principle used in proving Theorem . Being the convolution
of multiplicative functions, ϕ is multiplicative. By the last theorem, the function
n 7→ |Zn× | is multiplicative. Finally, the given equation holds when n is a prime
power, as shown in §..
. Arbitrary moduli
.. Euler’s Theorem
Since ϕ(p) = p − 1, Fermat’s Theorem is that, if n is prime, and gcd(a, n) = 1,
then
aϕ(n) ≡ 1 (mod n).
We shall show that this holds for all n.
The multiplicative function ϕ is called the Euler phi-function after Leon-
hard Euler, –. Euler’s original definition apparently corresponds to The-
orem : ϕ(n) is the number of x such that 0 6 x < n and x is prime to n. For
calculating this, we now have
Q
Proof. If n = p|n pn(p) , then
Y Y
ϕ(n) = ϕ(pn(p) ) = (pn(p) − pn(p)−1 )
p|n p|n
Y Y 1 Y 1
= pn(p) 1− =n 1− .
p p
p|n p|n p|n
For example,
1 1 1 1 2 4
ϕ(30) = 30 · 1 − · 1− · 1− = 30 · · · = 8.
2 3 5 2 3 5
Since 180 has the same prime divisors as 30, we have
ϕ(180) 180
= = 6,
ϕ(30) 30
so ϕ(180) = 6ϕ(30) = 48. But 15 and 30 do not have the same prime divisors, and
we cannot expect ϕ(15)/ϕ(30) to be 15/30, or 1/2; indeed, ϕ(15) = ϕ(3)·ϕ(5) =
2 · 4 = 8 = ϕ(30).
. Arbitrary moduli
369 161
369 161
321 161
14 66
7 1
1 6 1 so 3692 ≡ 161 (1000); 9 2 1 so 3694 ≡ 1612 ≡ 921 (1000);
921
921
921
42
9
2 4 1 so 3698 ≡ 9212 ≡ 241 (1000);
36913 ≡ 3698 · 3694 · 369 ≡ 241 · 921 · 369 (1000);
241 961
921 369
241 649
82 66
9 3
961 6 0 9 so 36913 ≡ 609 (mod 1000).
The three theorems of the present section are versions of the three theorems in Burton’s
section, ‘Some properties of the phi-function’ [, §., pp. –]. I have tried to suggest
a connection between the first two theorems. In Burton, the last theorem is just what we
have expressed as ϕ = µ ∗ id; but this is also derivable from Gauss’s Theorem. Hence I have
named the section for Gauss.
Gauss proves this in the Disquisitiones Arithmeticae [, ¶], but he does not have all of
Yet another proof of Gauss’s theorem makes use of the principle of Theo-
rem . Partition the set {0, 1, . . . , n − 1} according to greatest common divisor
with n. For example, suppose n = 12. We can construct a table as follows,
where the rows are labelled with the divisors of 12. Each number x from 0 to 11
inclusive is assigned to row d, if gcd(x, 12) = d.
0 1 2 3 4 5 6 7 8 9 10 11
12 0
6 6
4 4 8
3 3 9
2 2 10
1 1 5 7 11
. Arbitrary moduli
.. Gauss’s Theorem
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 0
8 8
4 4 12
2 2 6 10 14
1 1 3 5 7 9 11 13 15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
18 0
9 9
6 6 12
3 3 15
2 2 4 8 10 14 16
1 1 5 7 11 13 17
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
21 0
7 7 14
3 3 6 9 12 15 18
1 2 4 5 8 10 11 13 16 17 19 20
then
2 X
ϕ(n) = k.
n
k∈Zn
×
Proof. Since the function x 7→ n−x permutes the indices of the given summation,
and |Zn× | = ϕ(n), we have
X X X
k= (n − k) = ϕ(n) · n − k,
k∈Zn× k∈Zn× k∈Zn×
The following relates a function of all of the divisors of n with a function of its
prime divisors.
X µ(d) Y 1
= 1− .
d p
d|n p|n
Now divide by n.
This may suggest a proof of the last theorem by direct computation. Indeed,
suppose the distinct prime factors of n are p1 , . . . , pr . Then
r
Y 1 X X (−1)j X µ(d)
1− = = .
p j=0
pk(1) · · · pk(j) d
p|n 16k(1)<···<k(j)6r d|n
.. Order
Euler’s Theorem can be improved in some cases. For example, 255 = 3 · 5 · 17, so
ϕ(255) = ϕ(3) · ϕ(5) · ϕ(17) = 2 · 4 · 16 = 128, and hence, by Euler’s Theorem,
ak ≡ 1 (mod n).
gcd(a, n) = 1.
a · ak−1 − n · ℓ = 1,
ordn (a).
For example, what is ord17 (2)? Just compute powers of 2 modulo 17:
k 1 2 3 4 5 6 7 8
2k (mod 17) 2 4 8 −1 −2 −4 −8 1
Then ord17 (2) = 8. Likewise, ord17 (3) = 16:
k 1 2 3 4 5 6 7 8
3k (mod 17) 3 −8 −7 −4 5 −2 −6 −1
k 9 10 11 12 13 14 15 16
3k (mod 17) −3 8 7 4 −5 2 6 1
Note how, in each computation, halfway through, we just change signs. From the
last table, taking every other entry, we can extract
k 1 2 3 4 5 6 7 8
k
(−8) (mod 17) −8 −4 −2 −1 8 4 2 1
which means ord17 (−8) = 8. Likewise, ord17 (−4) = 4, and ord17 (−1) = 2. So we
have
a 1 2 3 4 5 6 7 8
ord17 (a) 1 16
ord17 (−a) 2 4 8
How can we complete the table? For example, what is ord17 (−7)? Since −7 ≡ 33
(mod 17), and gcd(3, 16) = 1, we shall be able to conclude ord17 (−7) = 16.
Likewise, ord17 (5) = 16. But ord17 (−2) = 16/ gcd(6, 16) = 8, since −2 ≡ 36
(mod 17). This is by a general theorem to be proved presently. We complete the
last table thus:
a 1 2 3 4 5 6 7 8
ord17 (a) 1 8 16 4 16 16 16 8
ord17 (−a) 2 8 16 4 16 16 16 8
Proof. For (a), the reverse direction is easy. For the forward direction, suppose
ak ≡ 1 (mod n). Now use division:
k = ordn (a) · s + r
Note that ψ19 (d) = ϕ(d) here. This is no accident. Indeed, if d | 18, so 18 = dℓ
for some ℓ, we have
.. Groups
We can understand what we are doing algebraically as follows. On the set Zn
of congruence-classes modulo n, addition and multiplication are well-defined by
Theorem , and so the set, considered with these operations, is a ring. The
multiplicatively invertible elements of this ring compose the set Zn× . This set is
closed under multiplication and inversion: it is a (multiplicative) group. Suppose
k ∈ Zn× . (More precisely one might write the element as k + (n) or k̄. On the
other hand, we are free to treat Zn× as being literally a subset of Z: we did this
in Theorem . In this case, one must just remember that multiplication and
addition are not the usual operations on Z.) Then we have the function
x 7→ k x
Z18 ∼= Z19× ,
({0, 1, 2, . . . , 17}, +) ∼
= ({1, 2, 3, . . . , 18}, · ).
ψp (d) = ϕ(d).
Proof. Every number prime to p has an order modulo p, and this order divides
ϕ(p), which is p − 1; so X
ψp (d) = p − 1.
d|p−1
P
By Gauss’s Theorem (Theorem , p. ), we have d|p−1 ϕ(d) = p−1; therefore
X X
ψp (d) = ϕ(d). (†)
d|p−1 d|p−1
contradicting (†).
If ψp (d) = 0, then certainly ψp (d) 6 ϕ(d). So suppose ψp (d) 6= 0. Then
ordp (a) = d for some a. In particular, a is a solution of the congruence
log3 (xy) ≡ log3 x + log3 y (mod 16); log3 xn ≡ n log3 x (mod 16).
For example,
3k 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (mod 17)
k 0 14 1 12 5 15 11 10 2 3 7 13 4 9 6 8 (mod 16)
and therefore 11 · 14 ≡ 30 ≡ 1 (mod 17).
We can define logarithms for any modulus that has a primitive root; then the
base of the logarithms will be a primitive root. If b is a primitive root of a
modulus n, and gcd(a, n) = 1, then there is some s such that
bs ≡ a (mod n).
k 0 1 2 3 4 5 6 7 8 9 log2 ℓ (10)
2k (11) 1 2 4 −3 5 −1 −2 −4 3 −5 ℓ
We have then
d = gcd(k, ϕ(n)).
a) The congruence
xk ≡ a (mod n) (§)
is soluble.
Thus (a)⇔(c). Trivially, (b)⇒(a). Finally, assume (a), so that d | log a, as above.
Letting r be the base of the logarithms, we have
Finally, these d solutions are incongruent. Indeed, since ordn (r) = ϕ(n), the
powers (rϕ(n)/d )j are incongruent; and r(log a)/k is invertible.
2, 4, ps , 2 · ps ,
where p is an odd prime, and s > 1. We shall first show that the numbers not on
this list do not have primitive roots:
Theorem . If m and n are co-prime, both greater than 2, then mn has no
primitive root.
ϕ(m)ϕ(n)
lcm(ϕ(m), ϕ(n)) | ,
2
that is, lcm(ϕ(m), ϕ(n)) | ϕ(mn)/2. Therefore
ϕ(mn)
ordmn (a) 6 ,
2
so a is not a primitive root of mn.
Proof. Any primitive root of 22+k must be odd. Let a be odd. We shall show by
induction that
2+k
aϕ(2 )/2 ≡ 1 (mod 22+k ).
Since ϕ(22+k ) = 22+k − 21+k = 21+k , it is enough to show
k
a2 ≡ 1 (mod 22+k ).
The claim is true when k = 1, since a2 ≡ 1 (mod 8) for all odd numbers a.
Suppose the claim is true when k is some positive integer ℓ, that is,
ℓ
a2 ≡ 1 (mod 22+ℓ ).
This means
ℓ
a2 = 1 + 22+ℓ · m
for some m. Now square:
1+ℓ ℓ
a2 = (a2 )2 = (1 + 22+ℓ · m)2 =1 + 23+ℓ · m + 24+2ℓ · m2
=1 + 23+ℓ · m · (1 + 21+ℓ · m).
1+ℓ
Hence a2 ≡ 1 (mod 23+ℓ ), so our claim is true when k = ℓ + 1.
Now for the positive results. These will use the following.
ordp1+ℓ (r) = (p − 1) · pℓ .
In particular,
ℓ−1
r(p−1)·p 6≡ 1 (mod p1+ℓ ).
However, since ϕ(pℓ ) = (p − 1) · pℓ−1 , we have
ℓ−1
r(p−1)·p ≡ 1 (mod pℓ ).
k 2 3
2k (mod 9) 4 −1 ,
(−4)k (mod 9) −2 −1
k 2 3 4 5 6 7 8 9
(−13)k (mod 27) 7 −10 −5 11 −8 −4 −2 −1
(−4)k (mod 27) −11 −10 13 2 −8 5 7 −1
5k (mod 27) −2 −10 4 −7 −8 −13 −11 −1
(−7)k (mod 27) −5 8 −2 13 10 −11 4 −1
2k (mod 27) 4 8 −11 5 10 −7 13 −1
11k (mod 27) 13 8 7 −4 10 2 −5 −1
But does 18 have a primitive root? The numbers 2 and −4 cannot be primitive
roots of 18, since they are not prime to it; but ϕ(18) = 6 and we have
k 2 3
k
(−7) (mod 18) −5 −1
5k (mod 18) 7 −1
But also ord2ps (r) | ϕ(2ps ); and ϕ(ps ) = ϕ(2ps ). Hence ord2ps (r) = ϕ(2ps ).
ax + b ≡ 0 (mod p)
We cannot factorize the polynomial 2x2 − 8x + 9 over Z (or even R), since 82 −
4 · 2 · 9 = −8, which is not a square (or even positive). However, after replacing
coefficients with residues modulo 11, we may be able to factorize. Still, a better
method of solution is completing the square. We have, modulo 11,
9
2x2 − 8x + 9 ≡ 0 ⇐⇒ x2 − 4x ≡ −
2
9
⇐⇒ x2 − 4x + 4 ≡ 4 −
2
2 1 10
⇐⇒ (x − 2) ≡ − ≡ ≡ 5.
2 2
(We did not need to compute the inverse of 2 modulo 11, although we may see
easily enough that it is 6.) If 5 is a square modulo 11, then (†) has a solution; if
not, not. One way to settle the question is by hunting: we have 5 ≡ 16 ≡ 42 , so
2x2 − 8x + 9 ≡ 0 ⇐⇒ (x − 2)2 ≡ 42
⇐⇒ x − 2 ≡ ±4
⇐⇒ x ≡ 2 ± 4 ≡ 6 or 9.
Note that we have used Lagrange’s Theorem (Theorem ) to conclude that the
congruence has exactly two solutions. We now know
Possibly, with some cleverness, we might have been able to see this from the
beginning. But suppose we want to solve
We find
x2 − 4x − 3 ≡ 0 ⇐⇒ x2 − 4x + 4 ≡ 7 ⇐⇒ (x − 2)2 ≡ 7.
k 0 1 2 3 4 mod 5
22k 1 4 5 −2 3 mod 11
m + kp 6 ̟2 ,
in the notation of (k) in §. (p. ). So it is sufficient to check when 0 6 k < ̟/2.
This could still be a lot of work if p is large.
We shall develop a way to test for quadratic residues that is more practical as
well as theoretically interesting.
If we have Wilson’s Theorem (Theorem , p. ), we can conclude (¶). Con-
versely, this and (k) give us Wilson’s Theorem.
Now suppose a is a quadratic residue of p. We choose the bk as before, except
this time let b1 be the least positive solution of x2 ≡ a (mod p), and replace a/b1
with the next least positive solution, which is p − b1 . We have then
n a a o
b 1 , p − b 1 , b 2 , , . . . , b̟ , = {1, . . . , p − 1},
b2 b̟
so (50/19) = −1, which means the congruence x2 ≡ 50 (mod 19) has no solution.
We may ask whether (††) has a simpler form, owing to the existence of only
finitely many p satisfying one of the cases. This possibility fails.
Theorem . There are infinitely many primes p such that p ≡ 3 (mod 4).
Proof. Suppose (q1 , q2 , . . . , qn ) is a list of primes. We shall prove that there is a
prime p, not on this list, such that p ≡ 3 (mod 4). Let
s = 4q1 · q2 · · · qn − 1.
Then s ≡ 3 (mod 4). Then s must have a prime factor p such that p ≡ 3 (mod 4).
Indeed, if all prime factors of s are congruent to 1, then so must s be. But p is
not any of the qk .
Named for Adrien-Marie Legendre, –.
But (r/p) = −1, because r is a primitive root and therefore r̟ ≡ −1 (mod p).
Hence
p−1 p−1
X k X
= (−1)k = 0.
p
k=1 k=1
Then 0 6 |k|p < p/2, and |k|p is the least distance between k and a multiple of p.
Theorem (Gauss’s Lemma). Let p be an odd prime, and gcd(a, p) = 1. Then
a
= (−1)n ,
p
where n is the number of elements k of the set
a, 2a, 3a, . . . , ̟a
so
̟
Y ̟
Y
k= |ka|p .
k=1 k=1
Also |ka|p ≡ ±ka (p), and |ka|p ≡ −ka (p) if and only if ka has least positive
residue exceeding p/2. Therefore, with n as in the statement, we have
̟
Y ̟
Y ̟
Y
̟! · a̟ ≡ (ka) ≡ (−1)n · |ka|p ≡ (−1)n · k ≡ (−1)n · ̟! mod p,
k=1 k=1 k=1
Of these, only 12, 15, and 18 exceed 19/2, and they are three; so
3
= (−1)3 = −1.
19
We shall use Gauss’s Lemma to prove the Law of Quadratic Reciprocity, by
which we shall be able to relate (p/q) and (q/p) when both p and q are odd
primes. Meanwhile, besides the direct application of Gauss’s Lemma to comput-
ing Legendre symbols, we have the following, which we shall also need in order
to take full advantage of the Law of Quadratic Reciprocity:
Theorem . If p is an odd prime, then
(
2 1, if p ≡ ±1 (mod 8);
=
p −1, if p ≡ ±3 (mod 8).
We can also use the theorem to find some primitive roots. Given a prime q and an
integer a that q does not divide, we know that a is a primitive root of q, provided
that
ad 6≡ 1 (mod q)
whenever d is a proper divisor of q −1. Verifying this condition is easier, the fewer
proper divisors q has. If q is odd, then q − 1 has the fewest possible divisors when
it is 2p for some p. Recall from page that in this case p is called a Germain
prime, assuming p itself is odd. That is, an odd prime p is a Germain prime if
and only if 2p + 1 is also prime.
Theorem . Suppose p is a Germain prime, and let ̟ = (p−1)/2. Then 2p+1
has the primitive root (−1)̟ · 2, which is 2 if p ≡ 1 (mod 4), and is otherwise
−2.
Proof. Let r = (−1)̟ · 2, and denote 2p + 1 by q. We want to show ordq (r) is
not 1, 2, or p. But p > 3, so q > 7, and hence r1 , r2 6≡ 1 (mod q). Hence ordq (r)
is not 1 or 2. Also, from Euler’s Criterion,
r
rp ≡ r(q−1)/2 ≡ (mod q).
q
So it is enough to show (r/q) = −1. We consider two cases.
. If p ≡ 1 (mod 4), then r = 2, but also q ≡ 3 (mod 8), so
r 2
= = −1
q q
by the last theorem.
. If p ≡ 3 (mod 4), then r = −2, but also q ≡ 7 (mod 8), and
−1
= (−1)(q−1)/2 = (−1)p = −1,
q
so (r/q) = (−2/q) = (−1/q)(2/q) = −1.
It is not known whether there infinitely many Germain primes. However, some
of them give examples of Mersenne numbers that are not primes, as noted on
page :
Theorem . If p is a Germain prime, and 2p + 1 ≡ ±1 (mod 8), then 2p − 1
is not prime, because
2p ≡ 1 (mod 2p + 1).
Proof. Let q = 2p + 1. Under the given conditions, we have (2/q) = 1 by Theo-
rem , so 2q ≡ 1 (q) by Euler’s Criterion.
Another consequence of Theorem is:
Theorem . There are infinitely many primes congruent to −1 modulo 8.
Proof. Let q1 , . . . , qn be a finite list of primes. We show that there is p not on
the list such that p ≡ −1 (mod 8). Let
M = (4q1 · · · qn )2 − 2.
From the original definition (‡‡) of |k|p on page , and because −1 ≡ 1, we
have
(
p · [ka/p], if (residue of ka modulo p) < p/2,
ka + |ka|p ≡
p · [ka/p] + p, otherwise.
Therefore
̟
X h ka i
0≡ p· + np ≡ m + n.
p
k=1
kq/p
B
A k p
2
Figure .. Two ways of counting, for the Law of Quadratic Reciprocity
is [p/2] · [q/2], that is, ̟(p) · ̟(q). None of these points lie on the diagonal AC.
The number of points in the interior of triangle ABC with first coordinate k and
second coordinate integral is [kp/q]. Therefore the number of points in the inte-
P̟(p)
rior of ABC with integral coordinates is k=1 [kq/p]. A similar consideration of
triangle ACD yields the claim.
For example, suppose p = 13 and q = 7. The points that we count in the proof
are shown in Figure .. Counted in columns, the number of points inside ABC
D C
7/2
b b b b b b
b b b b b b
b b b b b b
B
A 13
2
is 0 + 1 + 1 + 2 + 2 + 3, which is
h 7 i h 14 i h 21 i h 28 i h 35 i h 42 i
+ + + + + .
13 13 13 13 13 13
It is important to remember here that both p and q are odd primes. We have not
defined the symbol (a/n) except when n is an odd prime not dividing a. In this
case, we can reduce the computation to computation of symbols (p/q) by means
of Theorems and . For example, we can compute one Legendre symbol as
365 5 73
= [factorizing]
941 941 941
941 941
= [5, 73 ≡ 1 (4)]
5 73
1 65
= [dividing]
5 73
5 13
= [factorizing]
73 73
73 73
= [5, 13 ≡ 1 (4)]
5 13
3 8
= [dividing]
5 13
5 2 3
= [5 ≡ 1 (4); factorizing]
3 13
2 2
= [(p/q)2 = 1]
3 13
= (−1)(−1) = 1 [3 ≡ 3 & 13 ≡ −3 (8)].
Proof. We have
p
3 , if p ≡ 1 (mod 4),
= 3 p
p − , if p ≡ 3 (mod 4),
( 3
p 1, if p ≡ 1 (mod 3),
=
3 −1, if p ≡ 2 (mod 3).
One could find a similar rule for (q/p) for any fixed q.
The first of these is solved by x ≡ ±4 (mod 23) (and nothing else, since 23 is
prime). For the second, note 13 ≡ 42, 71, 100 (mod 29), so x ≡ ±10 (mod 29).
So the solutions of the original congruence are the solutions of one of the following
systems:
( ) ( )
x ≡ 4 (mod 23), x ≡ 4 (mod 23),
, ,
x ≡ 10 (mod 29) x ≡ −10 (mod 29)
( ) ( )
x ≡ −4 (mod 23), x ≡ −4 (mod 23),
, .
x ≡ 10 (mod 29) x ≡ −10 (mod 29)
x2 ≡ a (mod pn(p) )
Q
are soluble, where n = p|n pn(p) .
x2 ≡ a (mod pk ) (∗)
ϕ(pk )
|{x2 : x ∈ Zpk× }| > .
2
For, if x2 = y 2 (mod pk ), then p | (x + y)(x − y), but if p divides both x + y and
x − y, then p divides 2x and therefore x, and similarly p | y. Assuming we have
neither of these conclusions, we have pk | x ± y, that is, x ≡ ±y (pk ).
Combining what we have so far yields
ϕ(pk )
|{x2 : x ∈ Zpk× }| = |{a ∈ Zpk× : (a/p) = 1}| = .
2
But we have also shown that the function x 7→ x2 from Zpk× to itself sends at
most two elements to the same element. Since Zpk× has just ϕ(pk ) elements, the
squaring function must send exactly two elements to the same element. This just
means (∗) has exactly two solutions when (a/p) = 1.
In this proof, we have used a kind of pigeonhole principle: If the ϕ(pk )-many
elements of Zpk× are pigeons, and the squares of those elements are pigeon-holes,
b2 = a + c · p k
Therefore (b + pk · y)2 ≡ a (mod pk+1 ) ⇐⇒ c + 2by ≡ 0 (mod p). But the latter
congruence is soluble, since p is odd.
We must finally consider powers of 2.
a) x2 ≡ a (mod 2) is soluble.
Proof. The only hard part is to show that, if a ≡ 1 (8), then for all positive k,
the congruence x2 ≡ a (22+k ) is soluble. We prove this by induction. It is easily
true when k = 1. Suppose it is true when k = ℓ, and in fact b2 ≡ a (mod 22+ℓ ).
Then b2 = a + 22+ℓ · c for some c. Hence
and this is congruent to a modulo 23+ℓ if and only if c + by ≡ 0 (mod 2). But
this congruence is soluble, since b is odd (since a is odd).
Now we shall show that, if n is a natural number, then the Diophantine equation
x2 + y 2 + z 2 + w 2 = n (∗)
12 + 02 + 02 + 02 = 1, 12 + 12 + 02 + 02 = 2.
We continue by showing:
) for each odd prime p, (∗) is soluble when n = mp for some m where m < p;
) for each odd prime p, (∗) is soluble when n = p;
) the set of n for which (∗) is soluble is closed under multiplication.
For the first step, the following lemma is more than enough. Note that the lemma
is nothing new when p is odd and (a/p) = 1.
Lemma. For every odd prime p, for every integer a, the congruence
x2 + y 2 ≡ a (mod p)
is soluble.
{a − y 2 : 0 6 y 6 ̟}.
But each of these sets has (p + 1)/2 elements, so one element from one of the sets
must be congruent to an element of the other, by the pigeonhole principle.
Another way to express the lemma is that, for all odd primes p, there are a, b,
and m such that
a2 + b2 + 12 + 02 = a2 + b2 + 1 = mp.
We may assume |a| and |b| are less than p/2, so a2 + b2 < p2 /2, and hence m < p.
Theorem (Euler). The product of two sums of four squares is the sum of
four squares, and indeed
(ax + by + cu + dv)2
+ (ay − bx + cv − du)2
2 2 2 2 2 2 2 2
(a + b + c + d )(x + y + u + v ) = (†)
+ (au − bv − cx + dy)2
+ (av + bu − cy − dx)2 .
One can prove this by multiplying out either side; but there is a neater way to
proceed. In C, if z = x + yi, we define
z̄ = x − yi;
this is the conjugate of z. If we think of z as the matrix in (§) on page in §.,
then z̄ is its transpose. Then z · z̄ = x2 + y 2 , an element of R. More generally,
z · w = w̄ · z̄ = z̄ · w̄.
Now we define the set H of quaternions as the set of matrices
z w
, (‡)
−w̄ z̄
where z and w range over C. Then H is still a ring, albeit not commutative.
Indeed, we identify C with its image in H under the map
z 0
z 7→ ,
0 z̄
and we define
0 1
j= .
−1 0
Then every element of H is uniquely z + wj for some z and w in C; moreover,
j2 = −1. But j · i = −i · j, by the computation
0 1 i 0 0 −i i 0 0 1
· = =− · .
−1 0 0 −i −i 0 0 −i −1 0
We may write k for i · j; then every element of H is uniquely x + yi + uj + vk for
some x, y, u, and v in R. If the matrix in (‡) is α, then we define
z̄ −w
ᾱ = ,
w̄ z
which is the transpose of the matrix resulting from taking the conjugate of every
entry. Hence if also β ∈ H, then β · α = ᾱ · β̄. Moreover,
α · ᾱ = z · z̄ + w · w̄;
β · α · β · α = β · α · ᾱ · β̄ = β · β̄ · α · ᾱ,
and therefore
(ax − by − cu − dv)2
+ (ay + bx + cv − du)2
2 2 2 2 2 2 2 2
(a + b + c + d ) · (x + y + u + v ) = ;
+ (au − bv + cx + dy)2
+ (av + bu − cy + dx)2 .
Henceforth we may assume m is odd. Then there are x, y, u, and v strictly
between −m/2 and m/2 such that, modulo m,
x ≡ a, y ≡ b, u ≡ c, v ≡ d.
Then
x2 + y 2 + u2 + v 2 ≡ 0 (mod m),
but also x2 + y 2 + u2 + v 2 < m2 , so
x2 + y 2 + u2 + v 2 = km
By Euler’s Theorem, we know the left-hand side as a sum of four squares; more-
over, each of the squared numbers in that sum is divisible by m:
ax + by + cu + dv ≡ x2 + y 2 + u2 + v 2 ≡ 0 (mod m),
ay − bx + cv − du ≡ xy − yx + uv − vu = 0,
au − bv − cx + dy ≡ xu − yv − ux + vy = 0,
av + bu − cy − dx ≡ xv + yu − uy − vx = 0.
A set is called an ordinal number, or just an ordinal, if it is transitive and
well-ordered by membership. The class of ordinals is denoted by
ON.
The Greek letters α, β, γ, . . . , will denote ordinals. A well-ordering is to be
understood in particular as a strict ordering, so that α ∈
/ α.
Lemma. ON is transitive, that is, every element of an ordinal is an ordinal.
Also every ordinal properly includes its elements.
Proof. Suppose α ∈ ON and b ∈ α. Then b ⊆ α by transitivity of α, so b, like
α, is well-ordered by membership. Suppose c ∈ b and d ∈ c. Then c ∈ α, so
c ⊆ α, and hence d ∈ α. Since d ∈ c and c ∈ b, and all are elements of α, where
membership is a transitive relation, we have d ∈ b. Thus b is transitive. Now we
know b is an ordinal. Therefore α ⊆ ON. So ON is transitive. Finally, b ⊂ α
simply because membership is a strict ordering of α.
Lemma. Every ordinal contains every ordinal that it properly includes.
Proof. Suppose β ⊂ α. Then α r β contains some γ. Then β ⊆ γ; indeed, if
δ ∈ β, then, since γ ∈/ β, we have γ ∈ / δ and γ 6= δ, so δ ∈ γ. We show that,
if γ is the least member of α r β, then γ = β. Suppose β ⊂ γ. Then γ r β
contains some δ. In particular, δ ∈ α r β. By the last lemma, δ ⊂ γ, so γ ∈
/ δ.
In particular, γ was not the least element of α r β.
Theorem (Burali-Forti Paradox []). ON is transitive and well-ordered by
membership; so it is not a set.
Proof. By the next-to-last lemma, ON is transitive. Now let α and β be two
ordinals such that β ∈ / α. We prove α ⊆ β, so that either α = β or α ∈ β by the
last lemma. If not, then α r β has a least element, γ. This means every element
of γ is an element of β; that is, γ ⊆ β. But γ 6= β (since β ∈
/ α), so γ ∈ β by the
lemma, contrary to assumption.
If a is a set of ordinals with an element β, then the least element of a is the
least element of a ∩ β, if this set is nonempty; otherwise it is β. Thus ON is
well-ordered by membership. In particular, it cannot contain itself; so it must
not be a set.
Since, on ON and hence on every ordinal, the relations of membership and
proper inclusion are the same, they can both be denoted by <. However, we have
not yet established that there are any ordinals, or even any sets at all.
We take it for granted that there is an empty set, which is generally denoted
by ∅, but which, in the present context, we denote by
0.
A. Foundations
We also assume that if x and y are sets, then so is the class whose members are
just y and the members of x; this is the class—now a set—denoted by
x ∪ {y}.
x′ .
ω.
Theorem (Dedekind ). The class ω satisfies the Peano Axioms when 0 is
considered as the first element of ω, and α′ is the successor of α.
and that all structures with these properties are isomorphic [, II: §§ , ].
m + 0 = m, m · 0 = 0, m0 = 1, 0! = 1;
m 6 n ⇐⇒ ∃x m + x = n.
A. Foundations
) every element after the first is a successor.
Like the Peano Axioms, these conditions determine the set up to isomorphism.
By referring, in the passage quoted above, to an ‘attempt to construct the
integers axiomatically’, Burton confuses two approaches to the natural numbers:
) assuming they exist so as to satisfy the Peano Axioms, as we did in §.;
) constructing them as ω, as we did in the last section.
The construction of ω is perhaps too specialized for a number theory course.
However, I will suggest that every mathematician should know the Peano Axioms
and know that they determine the natural numbers up to isomorphism. It might
prevent certain infelicities and mistakes, such as can be found, for example, in
Burton.
Before proving induction as Theorem ., Burton proves the ‘Archimedean
property’ as Theorem .. Before stating this theorem, he says,
Because this principle [of well-ordering] plays a crucial role in the proofs here
and in subsequent chapters, let us use it to show that the set of positive integers
has what is known as the Archimedean property.
This comment does not clarify why the Archimedean property should be proved.
Will it be needed later, or is is just a warming-up example of the use of well-
ordering?
Burton’s ‘Second Principle of Finite Induction’ is that a set S contains all
positive integers if
a) S contains 1, and
b) S contains k + 1 when it contains 1, . . . , k.
This statement may be useful for the writer in a hurry. Such a writer may attempt
a proof by the ‘First Principle’ of induction, only to find that the weaker inductive
hypothesis there, namely k ∈ S, is not enough. Then the writer can just assume
that 1, . . . , k are all in S. But it would be better to go back and erase the proof
that 1 ∈ S, then prove k ∈ S on the assumption that 1, . . . , k − 1 are in S,
using what I have called ‘Strong Induction’ (Theorem ). In case k = 1, one has
proved 1 ∈ S; this need not be treated separately.
Burton says presently, ‘Mathematical induction is often used as a method of
definition as well as a method of proof.’ This is a misconception that Peanso
shared, but that Landau identified in his Foundations of Analysis []. Definition
by induction should be called something else, like definition by recursion, because
it is logically stronger than proof by induction, as noted in §..
Theorem (Ben Green and Terence Tao, []). For every n, there are
a and b such that each of the numbers a, a + b, a + 2b, . . . , a + nb is prime (and
b > 0).
Is it possible that each of the numbers
a, a + b, a + 2b, a + 3b, . . .
is prime? Yes, if b = 0. What if b > 0? Then No, since a | a + ab. But what if
a = 1? Then replace a with a + b.
Two primes p and q are twin primes if |p − q| = 2. The list of all primes
begins:
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, . . .
| {z } | {z } | {z } | {z } | {z }
and there are several twins. Are there infinitely many? People think so, but
cannot prove it. We do have:
Theorem (Goldston, Pintz, Yıldırım, []). For every positive real
number ε, there are primes p and q such that 0 < q − p < ε · log p.
Theorem (Prime Number Theorem). Let π(n) be the number of primes p
such that p 6 n. Then
π(n)
lim = 1.
n→∞ n/ log n
C. Exercises
In the following exercises, if a statement is given that is not a definition, then the
exercise is to prove the statement. Minuscule letters range over Z, or sometimes
just over N; letters p, pi , and q range over the prime numbers.
Many of these exercises are inspired by exercises in [, Ch. ].
Exercise . Prove the unproved propositions in Chapter .
Exercise . An integer n is a triangular number if and only if 8n + 1 is a
square number. Solution: If n is triangular, then x = k(k + 1)/2 for some k,
and then 8n + 1 = 4k 2 + 4k + 1 = (2k + 1)2 . Conversely, if 8n + 1 is square,
then, since this number
is also odd, the square is (2k + 1)2 for some k, and then
2
n = (2k + 1) − 1) /8 = k(k + 1)/2, a triangular number.
Exercise .
a) If n is triangular, then so is 9n + 1.
b) Find infinitely many pairs (k, ℓ) such that, if n is triangular, then so is
kn + ℓ.
Exercise . If a = n(n + 3)/2, then ta + tn+1 = ta+1 .
Exercise . The pentagonal numbers are 1, 5, 12, . . . : call these p1 , p2 , &c.
a) Give a recursive definition of these numbers.
b) Find a closed expression for pn (that is, an expression not involving pn−1 ,
pn−2 , &c.).
c) Find such an expression involving triangular numbers and square numbers.
Exercise . Given a positive modulus n and an integer a, find a formula for the
unique residue in {a, . . . , a + n − 1} of an arbitrary integer x. (Gauss does this
in the Disquisitiones Arithmeticae.)
Exercise . Show that every cube is congruent to 0 or ±1 modulo 7.
Exercise .
a) 7 | 23n + 6.
b) Given a in Z and k in N, find integers b and c such that b | akn + c for all
n in N.
Exercise . gcd(a, a + 1) = 1.
Exercise . (k!)n | (kn)! for all k and n in N.
Exercise . If a and b are co-prime, and a and c are co-prime, then a and bc
are co-prime.
{(x, y) ∈ N × N : gcd(x, y) = 1}
Exercise . Give complete solutions, or show that they do not exist, for:
a) 14x − 56y = 34;
b) 10x + 11y = 12.
Exercise . I have some -TL pieces and some - and -Kr pieces: coins
in all. They make TL. How many coins of each denomination have I got?
Exercise . If n ≡ 2 (mod 3), then n has a factor p such that p ≡ 2 (mod 3).
C. Exercises
Exercise . If n is positive, then 8n + 1 is composite.
Exercise . Find all integers n such that the equation
x2 = ny 2
show
X∞ x
log[x]! = ψ .
j=1
j
a) n! is square;
b) n! + (n + 1)! + (n + 2)! is square.
Exercise . Determine whether a2 ≡ b2 (mod n) =⇒ a ≡ b (mod n).
P1001
Exercise . Compute k=1 k 365 (mod 5).
Exercise . 39 | 53103 + 10353 .
Exercise . Solve 6n+2 + 72n+1 ≡ x (mod 43).
Exercise . Determine whether a ≡ b (mod n) =⇒ ca ≡ cb (mod n).
Exercise . Solve the system
x ≡ 1 (mod 17),
x ≡ 8 (mod 19),
x ≡ 16 (mod 21).
an ≡ 1 (mod pq).
C. Exercises
Exercise . Show a13 ≡ a (mod 70).
Exercise . Assuming gcd(a, p) = 1, and 0 6 n < p, solve the congruence
an x ≡ b (mod p).
2p − 1 ≡ 1 (mod p).
2Fn ≡ 2 (mod Fn ).
Exercise . Show that 1105, 2821, and 15841 are Carmichael numbers. Solu-
tion: First, factorize: 1105 = 5 · 13 · 17, 2821 = 7 · 13 · 31, and 15841 = 7 · 31 · 73.
Exercise . Assuming p is an odd prime:
a) (p − 1)! ≡ p − 1 (mod 1 + 2 + · · · + (p − 1));
b) 1 · 3 · · · (p − 2) ≡ (−1)(p−1)/2 · (p − 1) · (p − 3) · · · 2 (mod p);
c) 1 · 3 · · · (p − 2) ≡ (−1)(p−1)/2 · 2 · 4 · · · (p − 1) (mod p);
d) 12 · 32 · · · (p − 2)2 ≡ (−1)(p+1)/2 (mod p).
√
Exercise . τ(n) 6 2 n.
Q
Exercise . d|n = nτ(n)/2 . (See Exercise .)
Exercise . {n : τ(n) = k} is infinite (when k > 1), but {n : σ(n) = k} is finite.
Carmichael did this in [].
Exercise . Let m ∈ Z. The number-theoretic function n 7→ nm is multiplica-
tive.
Exercise . Let ω(n) be the number of distinct prime divisors of n, and let m
be a non-zero integer. Then n 7→ mω(n) is multiplicative.
Exercise . Prove the other half of the Möbius Inversion Theorem (Theorem
on page ): if F and f are arithmetic functions such that
X n
f (n) = µ · F (d),
d
d|n
then X
F (n) = f (d).
d|n
X
Exercise . If ω is as in Exercise , then µ(d) · τ(d) = (−1)ω(n) .
d|n
ϕ(an )
lim = 0.
n→∞ an
C. Exercises
(If you assume that there is an answer to this problem, then it is not hard to
see what the answer must be. To actually prove that the answer is correct, recall
that, formally,
X1 Y 1
= ,
n
n p
1 − p1
n
Y 1
so lim 1 = ∞ if (pk : k ∈ N) is the list of primes.)
n→∞
k=1
1 − pk
X Y
Exercise . Prove µ(d)ϕ(d) = (2 − p). (This is a special case of Exer-
d|n p|n
cise .)
Exercise . If n is squarefree, and k > 0, show
X
σ(dk )ϕ(d) = nk+1 .
d|n
X n
Exercise . σ(d)ϕ = nτ(n).
d
d|n
X n
Exercise . τ(d)ϕ = σ(n).
d
d|n
Exercise . This is about 23:
a) Find a primitive root of least absolute value.
b) How many primitive roots are there?
c) Find these primitive roots as powers of the root found in (a).
d) Find these primitive roots as elements of [−11, 11].
Exercise . Assuming ordp (a) = 3, show:
a) a2 + a + 1 ≡ 0 (mod 3);
b) (a + 1)2 ≡ a (mod 3);
c) ordp (a + 1) = 6.
Exercise . Find all elements of [−30, 30] having order 4 modulo 61.
Exercise . f (x) ≡ 0 (mod n) may have more than deg(f ) solutions:
a) Find four solutions to x2 − 1 ≡ 0 (mod 35).
b) Find conditions on a such that the congruence x2 − a2 ≡ 0 (mod 35) has
four distinct solutions, and find these solutions.
c) If p and q are odd primes, find conditions on a such that the congruence
x2 − a2 ≡ 0 (mod pq) has four distinct solutions, and find these solutions.
Exercise . If ordn (a) = n − 1, then n is prime.
Exercise . If a > 1, show n | ϕ(an − 1).
Exercise . If 2 ∤ p and p | n2 + 1, show p ≡ 1 (mod 4).
Exercise .
a) Find conditions on p such that, if r is a primitive root of p, then so is −r.
b) If p does not meet these conditions, then what is ordp (−r)?
Exercise . For (Z/(17))× :
a) construct a table of logarithms using 5 as the base;
b) using this (or some other table, with a different base), solve:
(i) x15 ≡ 14 (mod 17);
(ii) x4095 ≡ 14 (mod 17);
(iii) x4 ≡ 4 (mod 17);
(iv) 11x4 ≡ 7 (mod 17).
Exercise . If n has primitive roots r and s, and gcd(a, n) = 1, prove
logr a
logs a ≡ (mod ϕ(n)).
logr s
C. Exercises
Exercise . Solve 4x ≡ 13 (mod 17).
Exercise . a) If ordr (a) and ordr (b) are relatively prime, show
b) Show that this may fail if ordr (a) and ordr (b) are not relatively prime.
Exercise . How many primitive roots has 22? Find them.
Exercise . Find a primitive root of 1250.
Exercise . Define the function λ by the rules
(
ϕ(2k ), if 0 < k < 3;
λ(2k ) = k
ϕ(2 )/2, if k > 3;
λ(2k · p1 ℓ(1) · · · pm ℓ(m) ) = lcm(λ(2k ), ϕ(p1 ℓ(1) ), . . . , ϕ(pm ℓ(m) )).
Exercise . Compute all of the Legendre symbols (n/17) and (m/19) by
means of Gauss’s Lemma.
Exercise . Find all primes of the form 5 · 2n + 1 that have 2 as a primitive
root.
Exercise . For every prime p, show that there is an integer n such that
p | (3 − n2 )(7 − n2 )(21 − n2 ).
Exercise .
a) If an − 1 is prime, show that a = 2 and n is prime.
b) Primes of the form 2p − 1 are called Mersenne primes. Examples are
3, 7, and 31. Show that, if p ≡ 3 (mod 4), and 2p + 1 is a prime q, then
q | 2p − 1, and therefore 2p − 1 is not prime. (Hint: Compute (2/q).)
Exercise . Assuming p is an odd prime, and 2p + 1 is a prime q, show that
−4 is a primitive root of q. (Hint: Show ordq (−4) ∈
/ {1, 2, p}.)
Exercise . Compute the Legendre symbols (91/167) and (111/941).
Exercise . Find (5/p) in terms of the class of p modulo 5.
Exercise . Find (7/p) in terms of the class of p modulo 28.
n
Exercise . The nth Fermat number, or Fn , is 22 + 1. A Fermat prime
is a Fermat number that is prime.
a) Show that every prime number of the form 2m + 1 is a Fermat prime.
b) Show 4k ≡ 4 (mod 12) for all positive k.
c) If p is a Fermat prime, show (3/p) = −1.
d) Show that 3 is a primitive root of every Fermat prime.
e) Find a prime p less than 100 such that (3/p) = −1, but 3 is not a primitive
root of p.
Exercise . Solve the congruence x2 ≡ 11 (mod 35).
Exercise . We have so far defined the Legendre symbol (a/p) only when
p ∤ a; but if p | a, then we can define (a/p) = 0. We can now define (a/n)
for arbitrary a and arbitrary odd n: the result is the Jacobi symbol, and the
definition is a Y a k(p) Y
= , where n = pk(p) .
n p
p p
C. Exercises
b) If gcd(a, n) = 1, and the congruence x2 ≡ a (mod n) is soluble, show
(a/n) = 1.
c) Find an example where (a/n) = 1, and gcd(a, n) = 1, but x2 ≡ a (mod n)
is insoluble.
d) If m and n are co-prime, show
m n m−1 n−1
· = (−1)k , where k= · .
n m 2 2
D. – examinations
k! | n · (n + 1) · · · (n + k − 1).
Solution.
n+k−1
, if n > 0;
k
n · (n + 1) · · · (n + k − 1)
= 0, if n 6 0 < n + k;
k!
−n
(−1)k ·
, if n + k 6 0.
k
Remark. Every binomial coefficient ji is an integer for the reason implied by
its name: it is one of the coefficients in the expansion of (x + y)j . (It is pretty
obvious that those coefficients in this expansion must be integers, but one can
prove it by induction on j.)
Remark. In the set {n, n + 1, . . . , n + k − 1}, one of the elements is divisible by
k, one by k − 1, one by k − 2, and so forth. This observation is not enough to
solve the problem, since for example, in the set {3, 4, 5}, one of the elements is
divisible by 4, one by 3, and one by 2, but 4! ∤ 3 · 4 · 5.
Remark. For similar reasons, proving the claim by induction is difficult. It is
therefore not recommended. However, one way to proceed is as follows. The claim
is trivially true (for all n) when k = 0, since 0! = 1, which divides everything.
(When k = 0, then the product n · (n + 1) · · · (n + k − 1) is the ‘empty product’, so
it should be understood as the neutral element for multiplication, namely 1.) As
a first inductive hypothesis, we suppose the claim is true (for all n) when k = ℓ.
We want to show
(ℓ + 1)! | n · (n + 1) · · · (n + ℓ) (∗)
for all n. We first prove it when n > −ℓ by entering a second induction. The
relation (∗) is true when n = −ℓ, since then n · (n + 1) · · · (n + ℓ) = 0. As a second
inductive hypothesis, we suppose the relation is true when n = m, so that
(ℓ + 1)! | m · (m + 1) · · · (m + ℓ). (†)
By the first inductive hypothesis, we have
ℓ! | (m + 1) · · · (m + ℓ).
Since also ℓ + 1 | m + ℓ + 1 − m, we have
(ℓ + 1)! | (m + 1) · · · (m + ℓ)(m + ℓ + 1 − m).
Distributing, we have
(ℓ + 1)! | (m + 1) · · · (m + ℓ)(m + ℓ + 1) − m · (m + 1) · · · (m + ℓ).
By the second inductive hypothesis, (†), we conclude
(ℓ + 1)! | (m + 1) · · · (m + ℓ)(m + ℓ + 1).
So the second induction is complete, and (∗) holds when n > −ℓ. It therefore
holds for all n, since
n · (n + 1) · · · (n + ℓ) = (−1)ℓ+1 (−n − ℓ) · (−n − ℓ + 1) · · · (−n).
Hence the first induction is now complete.
Problem .. Find the least natural number x such that
x ≡ 1
(mod 5),
x≡3 (mod 6),
x≡5 (mod 7).
Solution. We have
6 · 7 ≡ 1 · 2 ≡ 2 (mod 5), 2·3≡1 (mod 5);
5 · 7 ≡ −1 · 1 ≡ −1 (mod 5), −1 · 5 ≡ 1 (mod 6);
5 · 6 ≡ −1 · (−2) ≡ 2 (mod 7), 2·4≡1 (mod 7).
Therefore, modulo 5 · 6 · 7 (which is 210), we conclude
x≡1·6·7·3+3·5·7·5+5·5·6·4
≡ 126 + 525 + 600
≡ 1251
≡ 201.
x≡6·7·3+5·7·3+5·6·6
(that is, one doesn’t use as coefficients the numbers 1, 3, and 5 respectively,
because they are already incorporated in the yi ).
Remark. Some people noticed, in effect, that the original system is equivalent to
x + 9 ≡ 10 ≡ 0 (mod 5),
x + 9 ≡ 12 ≡ 0 (mod 6),
x + 9 ≡ 14 ≡ 0 (mod 7),
which in turn means x + 9 ≡ 0 (mod 210) and so yields the minimal positive
solution x = 201. But not every such problem will be so easy.
n4 + 4 = n4 + 4n2 + 4 − 4n2
= (n2 + 2)2 − (2n)2
= (n2 + 2 + 2n) · (n2 + 2 − 2n)
= ((n + 1)2 + 1) · ((n − 1)2 + 1).
Both factors are positive. Moreover, one of the factors is 1 if and only if n = ±1.
So n4 + 4 is prime only if n = ±1. Moreover, if n = ±1, then n4 + 4 = 5, which
is prime. So the answer is, n = ±1.
151 = 71 · 2 + 9,
71 = 9 · 7 + 8,
9 = 8 · 1 + 1,
and hence
9 = 151 − 71 · 2,
8 = 71 − (151 − 71 · 2) · 7 = −151 · 7 + 71 · 15,
1 = 151 − 71 · 2 − (−151 · 7 + 71 · 15) = 151 · 8 − 71 · 17.
and (independently) (151a + 71b)x + (sa + tb)y = b. The first equation can be
rearranged as
(151x + sy)a + (71x + ty)b = a,
which is soluble if and only if the linear system
(
151x + sy = 1,
71x + ty = 0
(since ±1 are the only invertible integers). A solution to this equation is (17, 8).
151 · 8 + 71y = 1,
−1207
y= = −17.
71
But finding inverses may not always be so easy as finding the inverse of 9 modulo
71.
19 ≡ 2 (mod 17),
365 ≡ 13 (mod 16),
2007 ≡ 1 (mod 17),
Remark. Some people failed to use that 216 ≡ 1 (mod 17) by Fermat’s Theo-
rem. Of these, some happened to notice an alternative simplification: 24 ≡ −1
(mod 17); but a simplification along these lines, unlike the Fermat Theorem, may
not always be available.
Therefore a13 ≡ a (mod 210) for all a, since 210 = lcm(2, 3, 5, 7).
Remark. One should be clear about the restrictions on a, if any. The argument
here assumes that the reader is familiar with the equivalence between the two
forms of Fermat’s Theorem:
a) ap−1 ≡ 1 (mod p) when p ∤ a;
b) ap ≡ p (mod p) for all a.
Solution. (a) 0 + a = a.
(b) By the definition of 6, and the standard cancellation properties for addition,
we have
a 6 b ⇐⇒ a + d = b for some d
⇐⇒ a + c + d = b + c for some d
⇐⇒ a + c 6 b + c.
d + 1 6 e + 1 ⇐⇒ d 6 e [by (b)]
⇐⇒ d · (c + 1) 6 e · (c + 1) [by I.H.]
⇐⇒ d · (c + 1) + c + 1 6 e · (c + 1) + c + 1 [by (b)]
⇐⇒ (d + 1) · (c + 1) 6 (e + 1) · (c + 1).
a 6 b =⇒ a + d = b for some d
=⇒ a · (c + 1) + d · (c + 1) = b · (c + 1)
=⇒ a · (c + 1) 6 b · (c + 1).
a · (c + 1) + e · (c + 1) = b · (c + 1),
(a + e) · (c + 1) = b · (c + 1),
a + e = b,
a6b
nm+0 = nm = nm · 1 = nm · n0 .
So the claim holds when k = 0. For the inductive step, suppose, as an inductive
hypothesis, that the claim holds when k = ℓ, so that
nm+ℓ = nm · nℓ .
nm+(ℓ+1) = n(m+ℓ)+1
= nm+ℓ · n [by def’n of exponentiation]
m ℓ
= (n · n ) · n [by inductive hypothesis]
m ℓ
= n · (n · n)
= nm · nℓ+1 [by def’n of exponentiation].
Thus the claim holds when k = ℓ + 1. This completes the induction and the
proof.
Remark. Some people apparently forgot that, by the convention of this course,
the first element of ω is 0, so that the induction here must start with the case
k = 0. This convention can be inferred from the statement of the problem, since
the given recursive definition of exponentiation starts with n0 , not n1 .
Remark. The formal recursive definition of exponentiation is intended to be make
precise the informal definition
nm = n
| · n{z· · · n} .
m
Everybody knows nm+k = nm ·nk ; the point of the problem is to prove it precisely,
so the informal proof is not enough.
Problem .. Find some n such that 35 · ϕ(n) 6 8n.
ϕ(n) 8
Solution. We want 6 . We have
n 35
ϕ(n) Y p − 1
= .
n p
p|n
= H(m) · H(n),
so H is multiplicative.
Remark. The assumption that gcd(m, n) = 1 is essential here, because otherwise
we could not conclude, for example, f (mn) = f (m) · f (n); neither could we do
the trick with the divisors of mn.
P
Remark. Since f is multiplicative, we know for example that d|n f (d) is a mul-
P
tiplicative function of n. Hence d|n f (n/d) is also multiplicative, since it is
the same function.
P Likewise, once we know that f g is multiplicative, then we
know that d|n f (d)g(d) is multiplicative. But we cannot conclude so easily that
P
d|n f (d)g(n/d) is multiplicative. It does not make sense to say g(n/d) is multi-
plicative, since it has two variables. We do not have g(mn/d) = g(m/d) · g(n/d);
neither do we have g(n/de) = g(n/d) · g(n/e). What we have is g(mn/de) =
g(m/d)g(n/e), if d | m and e | n; but it takes some work to make use of this.
k 1 2 3 4 5 6 7 8 9 10 11 12
2k 2 4 8 3 6 12 11 9 5 10 7 1
X s
X
µ(d) · σ(d) = µ(pk ) · σ(pk ) =
d|ps k=0
Y
= µ(1) · σ(1) + µ(p) · σ(p) = 1 − (1 + p) = −p = (−q).
q|ps
This establishes the claim when n is a prime power, hence for all n.
Q
Remark. It should be understood in the product p|n (−p) that p is prime. This
product is a multiplicative function of n, Q
because if gcd(m,
Q n) = 1, Q and p | mn,
then p | m or p | n, but not both, so that p|mn (−p) = p|m (−p) · p|n (−p).
Remark. Using multiplicativity of functions to prove their equality is a powerful
technique. It works like magic. It is possible here to prove the desired equation
directly, for arbitrary n; but the proof is long and complicated. It is not enough to
write out part of the summation, detect a pattern, and claim (as some people did)
that everything cancels but what is wanted: one must prove this claim Q precisely.
One way is as follows. Every positive integer n can be written as p∈A ps(p) ,
where A is a (finite) set of prime numbers, and each exponent s(p) is at least 1.
(Note the streamlined method of writing a product.) Then the only divisors d of
This proves the desired equation; but it is probably easier just to use the multi-
plicativity of each side, as above.
Solution. 365 = 5 · 73, so ϕ(365) = ϕ(5) · ϕ(73) = 4 · 72 = 288. And 288 goes
into 3164 ten times, with remainder 284. Therefore, modulo 365, we have
63164 x ≡ 2 ⇐⇒ 6284 x ≡ 2
⇐⇒ x ≡ 2 · 64
≡ 2 · 362
≡ 2 · 1296
≡ 2 · 201
≡ 402
≡ 37.
Problem . ( points). Find the Legendre symbol (a/29), given that []
n o
ka
ka − 29 · : 1 6 k 6 14 = {1, 2, 5, 6, 7, 10, 11, 12, 15, 16, 20, 21, 25, 26}.
29
Solution. The given set has 6 elements greater than 29/2. Since ka − 29 · [ka/29]
is the remainder of ka after division by 29, by Gauss’s Lemma we have (a/29) =
(−a)6 = 1.
Problem . ( points). The numbers 1499 and 2999 are prime. Find a primi-
tive root of 2999. []
aa
1 2 3 4 5 6 7 8 9 10 11
23
−a
23
a a
1 2 3 4 5 6 7 8 9 10 11
1 1 1 1 −1 1 −1 1 1 −1 −1
23
−a
−1 −1 −1 −1 1 −1 1 −1 −1 1 1
23
Remark. One can find the Legendre symbols by means of Euler’s Criterion and the
properties in the remark on Problem . (as in []), or by Gauss’s Lemma (as in
[]); but really, all of the necessary work has already been done in Problem ..
Problem . ( points). Solve the following congruences modulo 23. [(b)]
a) x2 ≡ 8 b) x369 ≡ 7
Solution. (a) From the solution to Problem ., we have 8 ≡ 56 ≡ (53 )2 ≡ 102 ,
so
x2 ≡ 8 ⇐⇒ x ≡ ±10 ≡ 10, 13 .
(b) From the computation at the right, as well as Problem ., we
have
x369 ≡ 7 (mod 23) ⇐⇒ x17 ≡ 7 (mod 23)
⇐⇒ 17 log5 x ≡ 19 (mod 22)
19 −3 3
⇐⇒ log5 x ≡ ≡ ≡ (mod 22)
17 −5 5
⇐⇒ log5 x ≡ 3 · 9 ≡ 27 ≡ 5 (mod 22)
⇐⇒ x ≡ 55 ≡ −3 (mod 23)
⇐⇒ x ≡ 20 (mod 23)
Remark. Some people seemed to overlook the information available from Prob-
lem .. In part (a), one may note from Problem . that there must be a
solution, since (8/23) = 1; but there is no need to do this, if one actually finds
the solutions.
1 1 −19
x2 − x + 5 ≡ 0 ⇐⇒ x2 − x + ≡ − 5 ≡ ≡1
4 4 4
1 2
⇐⇒ x − ≡1
2
1
⇐⇒ x − ≡ ±1
2
1
⇐⇒ x ≡ ± 1 ≡ 12 ± 1 ≡ 11, 13 (mod 23).
2
x2 − x + 5 ≡ 0 ⇐⇒ x2 + 22x + 5 ≡ 0
⇐⇒ x2 + 22x + 121 ≡ 121 − 5 ≡ 116 ≡ 1
⇐⇒ (x + 11)2 ≡ 1
⇐⇒ x + 11 ≡ ±1.
x2 − x + 5 ≡ 0 ⇐⇒ 4x2 − 4x + 20 ≡ 0
⇐⇒ (2x − 1)2 ≡ 1 − 20 ≡ −19 ≡ 4.
All approaches used to far can be used on any quadratic congruence (with odd
prime modulus). Nonetheless, many people chose to look for a factorization. Here
But for such problems, it does not seem advisable to rely on one’s ingenuity to find
factorizations. How would one best solve a congruence like x2 − 2987 + 2243 ≡ 0
(mod 2999)?
Problem . ( points). Explain briefly why exactly one element n of the set
{2661, 2662} has a primitive root. Give two numbers such that at least one of
them is a primitive root of n. []
Solution. The numbers with primitive roots are just 2, 4, odd prime powers,
and doubles of odd prime powers. Since 2661 = 3 · 887, and 3 ∤ 887, the number
2661 has no primitive root. However, 2662 = 2 · 1331 = 3 · 11 · 121 = 2 · 113 , so
this has a primitive root.
By the computation
k 1 2 3 4 5 (mod 10)
2k 2 4 −3 −6 −1 (mod 11)
Remark. This problem relies on the following propositions about odd primes p:
Problem .. For positive integers n, let ω(n) = |{p : p | n}|, the number of
primes dividing n.
a) Show that the function n 7→ 2ω(n) is multiplicative.
b) DefineX the Möbius function µ in terms of ω.
c) Show |µ(d)| = 2ω(n) for all positive integers n.
d|n
X s
X s
|µ(d)| = |µ(pk )| = |µ(1)| + |µ(p)| = 1 + 1 = 2 = 21 = 2ω(p ) .
d|ps k=0
a
a
1 2 3 5 7 11 13 17 19
257
Solution. By the table of powers, 3 must be a primitive root of 257. Hence
(a/257) = 1 if and only if a is an even power of 3 modulo 257. In particular,
(−1/257) = 1, so (a/257) = (−a/257). So the table of powers yields the answers:
a
a
1 2 3 5 7 11 13 17 19
1 1 −1 −1 −1 1 1 1 −1
257
Remark. Many people preferred to find these Legendre symbols by means of the
Law of Quadratic Reciprocity. Possibly this method is faster than hunting for
numbers in the table of powers; but it may also provide more opportunity for
error.
Problem .. In the following table, in the box below each number a, write the
least positive integer n such that ord257 (n) = a.
1 2 4 8 16 32 64 128 256
Hence 4 = 127 · 52 − 55 · 120, and gcd(127, 55) = 1, so the original equation has
the general solution
(52, −120) + (55, −127) · t.
Remark. Some people omitted to find the general solution. In carrying out the
Euclidean algorithm here, one can save a step, as some people did, by noting that,
once we find 4 = 55 · 7 − 127 · 3, we need not find 1 as a linear combination of 127
and 55; we can pass immediately to the general solution (7, −3) + (55, −127) · t.
Remark. One may, as some people did, use the algorithm associated with the
Chinese Remainder Theorem here. Even if we do not use the algorithm, we rely
on it to know that the solution we find to each pair of congruences is the only
solution.
( Some used a ) theoretical formation of the solution, noting for example
x ≡ 2 (mod 5)
that has the solution x ≡ 2 · 17ϕ(5) + 5 · 5ϕ(17) (mod 85); but
x ≡ 5 (mod 17)
this is not useful (the number is not between 0 and 85, or between −85/2 and
85/2).
rem(b, a) = r,
a = nx + a′ , b = ny + b′ , a′ + b′ = nz + (a′ + b′ )′ ,
(a + b)′ = (a′ + b′ )′
as desired.
b) With the same notation, for some w in ω we have
a′ · b′ = nw + (a′ · b′ )′ ,
(ab)′ = (a′ · b′ )′
as desired.
Remark. Books VII, VIII, and IX of Euclid’s Elements develop some of the theory
of what we would call the positive integers. If we allow also a zero, but not
negative numbers, then we could define
This problem then could be used to establish the basic facts about congruence.
Remark. A number of students used the arrow “⇒” in their proofs. Such usage
is a bad habit, albeit a common one, even among teachers. Indeed, I learned this
bad habit from somebody who was otherwise one of my best teachers. Later I
unlearned the habit.
In logic, the expression A ⇒ B means
If A is true, then B is true.
One rarely wants to say this in proofs. Rather, one wants to say things like
A is true, and therefore B is true.
If this is what you want to say, then you should just say it in words.
In the expression “A ⇒ B”, the arrow is a verb, usually read as “implies”. When
somebody writes the arrow in a proof, the intended meaning seems usually to be
that of “which implies” or “and this implies”. But the arrow should not be loaded
up with these extra meanings.
One student used the arrow in place of the equals sign “=”. This usage must
definitely be avoided.
Another practice that should be avoided is drawing arrows to direct the reader’s
eye. It should be possible to read a proof left to right, top to bottom, in the usual
fashion. If you need to refer to something that came before, then just say so.
It is true that, when I grade papers, I may use arrows. This is in part because,
when you see your paper, I am there to explain what I meant by the arrow, if
this is necessary. But what you write on exam should make sense without need
for additional explanation by you.
If I ask you to prove a claim, I already know the claim is true. The point is not
to convince me that the claim is true, or even to convince me that you know the
claim is true. The point is to write a proof of the claim. The point is to write the
sort of thing that is found in research articles and books of mathematics, often
labelled with the word Proof.
Problem .. Find integers k and ℓ, both greater than 1, such that, for all
positive integers n,
k | 196510n + ℓ.
x ≡ m · 1001 · 500 + n · 999 · 500 ≡ 1001 · 500m − 999 · 501n (mod 999 · 1001).
Remark. This is just a Chinese Remainder Theorem problem with letters instead
of numbers.
P408
Problem .. Letting n = j=1 j, find an integer k such that 0 6 k < 409 and
But this argument does not prove 408! ≡ 408 (n). Maybe I made a mistake, and
there is no k meeting the stated conditions.
Problem .. With justification, find an integer n, greater than 1, such that,
for all integers a,
an ≡ a (mod 1155).
Solution. We have 1155 = 3 · 5 · 7 · 11, and gcd(3 − 1, 5 − 1, 7 − 1, 11 − 1) =
gcd(2, 4, 6, 10) = 60. Then we can let n = 61. Indeed, by Fermat,
x·1=1·x (∗)
(y + 1) · x = y · x + x (†)
Problem .. Remembering that p is always prime, define the arithmetic func-
tion ω by
X
ω(n) = 1.
p|n
c) Prove that
X
τ(d) · µ(d) = (−1)ω(n) .
d|n
(
0, if p2 | n for some p,
Solution. a) µ(n) = .
(−1) ω(n)
, if p2 | n for no p.
b) Assume m and n are co-prime. If p | mn, then
p | m ⇐⇒ p ∤ n.
Therefore X X X
ω(mn) = 1= 1+ 1 = ω(m) + ω(n).
p|mn p|m p|n
where the exponents are positive, p1 < · · · < ps , q1 < · · · < qt , and pi 6= qj in
each case, and therefore
This may be a clearer argument than the one I wrote above. I don’t know a good
way to make the argument just with the Σ-notation. Some people wrote
X
‘ω(mn) = 1’,
pq|mn
which doesn’t make sense. (If it means anything, it means ω(mn) is the number
of factors d that mn has, where d is the product of two primes, possibly not
distinct. This is not what ω(mn) is.) Others wrote
XX
‘ω(mn) = 1’;
p|m q|n
this is meaningful, but false, since it makes ω(mn) equal to the product ω(m) ·
ω(n).
. In part c, it doesn’t hurt to say why the two sides are multiplicative. The
left-hand side is multiplicative because the product of two multiplicative func-
tions is multiplicative (weP didn’t prove this, but it’s fairly obvious), and if g is
multiplicative, so is n 7→ d|n g(d) (we did prove this). The right-hand side is
multiplicative by part b.
31
Solution. 600 = 23 · 3 · 52 , so φ(600) = 4 · 2 · 20 = 160. We compute 160 5117 .
480
317
160
157
Hence
5117 ≡ 157 ≡ −3 (mod 160).
Therefore
But
Remark. Not too many problems here. I’m guessing this is the sort of problem
that the dershane prepares one for. According to the Wikipedia article ‘Long
division’, my notation for long division is what used in Anglophone countries;
the notation I see on papers, Francophone. But the symbolism b ) a (used in the
former notation) for a/b is traced to Michael Stifel of the University of Jena in
Germany in (see the Wikipedia article ‘Division (mathematics)’).
m 1 2 3 4 5 6 7 8 9 10 11 12 13 14
log2 m
log2 (−m)
b) With respect to the modulus 29, exactly one of the two congruences
has a solution. Find all of its solutions ( modulo 29), and explain why the
other congruence has no solutions.
Solution. a)
m 1 2 3 4 5 6 7 8 9 10 11 12 13 14
log2 m 0 1 5 2 −6 6 12 3 10 −5 −3 7 −10 13
log2 (−m) 14 −13 −9 −12 8 −8 −2 −11 −4 9 11 −7 4 −1
b) For the first congruence, we have
the congruence has no solution since gcd(200, 14) = 2, and 2 ∤ −5. For the second
congruence:
Remark. The quickest way I know to fill out the table is, keeping in mind
Problem .. Is the following congruence soluble? Explain. (It is given that
2999 is prime.)
x2 − 2987x + 2243 ≡ 0 (mod 2999).
x2 + 12x ≡ 756,
(x + 6)2 ≡ 792.
Problem ..
Solution. a) n 7→ 2.
b) By a theorem of Gauss,
X X X X
φ(e) = n/d = d.
d|n e|n/d d|n d|n
Then it is enough to prove f (n) = n; but each side of this equation is am multi-
Pk Pk
plicative function of n, and f (pk ) = j=0 φ(pj ) = 1 + j=1 (pj − pj−1 ) = pk .
Problem .. Describe, as well as possible, the set of primes q such that 2 is a
primitive root of q and q = 2n · p + 1 for some prime p. (In particular, first find
the possibilities for n, and then p.)
[] W. R. Alford, Andrew Granville, and Carl Pomerance. There are infinitely
many Carmichael numbers. Ann. of Math. (), ():–, .
[] Carl B. Boyer. A history of mathematics. John Wiley & Sons Inc., New
York, .
[] Richard Dedekind. Essays on the theory of numbers. I: Continuity and irra-
tional numbers. II: The nature and meaning of numbers. authorized trans-
lation by Wooster Woodruff Beman. Dover Publications Inc., New York,
.
[] P. Erdős. Beweis eines Satzes von Tschebyschef (in German). Acta Litt.
Sci. Szeged, :–, . Available at http://www.renyi.hu/~p_erdos/
1932-01.pdf (as of December , ).
[] Euclid. The thirteen books of Euclid’s Elements translated from the text of
Heiberg. Vol. I: Introduction and Books I, II. Vol. II: Books III–IX. Vol.
III: Books X–XIII and Appendix. Dover Publications Inc., New York, .
Translated with introduction and commentary by Thomas L. Heath, nd ed.
[] Euclid. Euclid’s Elements. Green Lion Press, Santa Fe, NM, . All
thirteen books complete in one volume, the Thomas L. Heath translation,
edited by Dana Densmore.
[] Timothy Gowers, June Barrow-Green, and Imre Leader, editors. The Prince-
ton companion to mathematics. Princeton University Press, Princeton, NJ,
.
[] Ben Green and Terence Tao. The primes contain arbitrarily long arithmetic
progressions. http://arxiv.org, . arXiv:math/v [math.NT].
Bibliography
[] Edmund Landau. Elementary number theory. Chelsea Publishing Co., New
York, N.Y., . Translated by J. E. Goodman.
[] Barry Mazur. How did Theaetetus prove his theorem? In P. Kalkav-
age and E. Salem, editors, The Envisoned Life: Essays in honor of Eva
Brann. Paul Dry Books, . http://www.math.harvard.edu/~mazur/
preprints/Eva.pdf, accessed September , .
[] Bertrand Russell. Letter to Frege (). In Jean van Heijenoort, editor,
From Frege to Gödel, pages –. Harvard University Press, .
[] Lucio Russo. The forgotten revolution. Springer-Verlag, Berlin, . How
science was born in BC and why it had to be reborn, Translated from
the Italian original by Silvio Levy.
[] Filip Saidak. A new proof of Euclid’s theorem. The American Mathematical
Monthly, ():–, Dec. .
Bibliography
[] Ivor Thomas, editor. Selections illustrating the history of Greek mathematics.
Vol. I. From Thales to Euclid. Harvard University Press, Cambridge, Mass.,
. With an English translation by the editor.
[] Ivor Thomas, editor. Selections illustrating the history of Greek mathematics.
Vol. II. From Aristarchus to Pappus. Harvard University Press, Cambridge,
Mass, . With an English translation by the editor.
[] Jean van Heijenoort. From Frege to Gödel. A source book in mathematical
logic, –. Harvard University Press, Cambridge, Mass., .
Bibliography
Index
abelian —, natural logarithm,
natural number,
harmonic series, negative,
Hasse diagram, non-residue, quadratic,
homomorphism, number, see also prime
Carmichael —,
ideal, , composite —,
incommensurable, congruent —s,
induction, , first natural —, one,
inductive condition, Mersenne —,
inductive hypothesis, natural —,
strong —, one,
infinite descent, pentagonal —,
integral domain, perfect —,
inverse, predecessor,
irreducible, squarefree —,
isomorphism, successor,
triangular —,
Jacobi symbol,
one,
Korselt’s Criterion, , open subset,
order, ,
Lagrange, —’s Theorem, ordered commutative ring,
least common multiple, ordered field,
Legendre, , ordering,
— symbol, linear —,
Leibniz, well ordered,
linear ordering, ordinal number, ordinal,
logarithm,
look, Peano axioms,
pentagonal number,
measure, perfect number,
member, Pigeonhole Principle, ,
Mersenne, positive,
— number, predecessor,
— prime, , prime, ,
Möbius, Germain —, ,
— Inversion, absolute pseudo-—,
— function, Fermat —,
modulus, modulo, Mersenne —, ,
multiplicative function, pseudo-—,
completely —, relatively —, co-—,
Index
twin —s, Euler’s Th—, ,
prime number, Fermat’s Last Th—,
primitive root, , , Fermat’s Th—,
proof Fundamental Th— of Arith-
— by induction, metic,
— by infinite descent, Gauss’s Lemma,
pseudo-prime, Gauss’s Th—,
absolute —, Lagrange’s Th—,
Möbius Inversion,
quadratic Pigeonhole Principle, ,
— non-residue, Wilson’s Th—,
— residue, topology,
quadratic residue, nonresidue, transfinite,
quaternion, transitive class,
triangular number,
rational numbers, twin primes,
real number,
recursive definition, uncountable,
relatively prime, unit function,
remainder unit of a ring,
Chinese — problem,
residue, well ordered,
complete set of —s, Wilson, —’s Theorem,
quadratic —,
zero,
quadratic non-—,
Riemann zeta function,
ring, ,
set,
square root,
squarefree number,
Stirling’s approximation,
strict linear ordering,
strong inductive hypothesis,
subclass,
successor,
supremum,
Index