Number Theory (Róbert Freud, Edit Gyarmati)
Number Theory (Róbert Freud, Edit Gyarmati)
Number
Theory
Róbert Freud
Edit Gyarmati
Number
Theory
UNDERGRADUATE TEXTS • 48
Number
Theory
Róbert Freud
Edit Gyarmati
EDITORIAL COMMITTEE
Gerald B. Folland (Chair) Steven J. Miller
Jamie Pommersheim Maria Cristina Pereyra
Copying and reprinting. Individual readers of this publication, and nonprofit libraries acting
for them, are permitted to make fair use of the material, such as to copy select pages for use
in teaching or research. Permission is granted to quote brief passages from this publication in
reviews, provided the customary acknowledgment of the source is given.
Republication, systematic copying, or multiple reproduction of any material in this publication
is permitted only under license from the American Mathematical Society. Requests for permission
to reuse portions of AMS publication content are handled by the Copyright Clearance Center. For
more information, please visit www.ams.org/publications/pubpermissions.
Send requests for translation rights and licensed reprints to reprint-permission@ams.org.
c 2020 by the authors. All rights reserved.
Printed in the United States of America.
∞ The paper used in this book is acid-free and falls within the guidelines
established to ensure permanence and durability.
Visit the AMS home page at https://www.ams.org/
10 9 8 7 6 5 4 3 2 1 25 24 23 22 21 20
Contents
Introduction 1
Structure of the book 1
Exercises 2
Short overview of the individual chapters 2
Technical details 4
Commemoration 4
Acknowledgements 5
Chapter 2. Congruences 37
2.1. Elementary Properties 37
Exercises 2.1 40
v
vi Contents
Tables 537
Primes 2–1733 538
Primes 1741–3907 539
Prime Factorization 540
Mersenne Numbers 541
Fermat Numbers 542
Index 543
Introduction
(A) Theoretical textbook for teaching number theory at universities and colleges,
mostly for majors in mathematics, applied mathematics, mathematics education,
and computer science.
(C) Handbook for those interested in more detail in some chapters of number theory
beyond the compulsory and elective courses and/or writing a thesis in this subject.
(D) Manual summarizing the most important chapters of (elementary) number the-
ory for mathematicians and mathematics teachers.
1
2 Introduction
The book is structured to systemize the material and to provide a close relation
between the individual chapters as much as possible.
As a general guideline, the notions and statements are thoroughly illuminated
from various aspects beyond the formal phrasing, they are illustrated by examples and
connections to the previous material. Their essential features are strongly emphasized
pointing out the complications and analyzing the motives for introducing a given no-
tion. Careful attention is paid to start from the concrete where possible and to proceed
towards the general only afterwards. We try to give a broad perspective about the strong
and colorful relations of number theory to other branches of mathematics.
Exercises
Each section in every chapter is followed by exercises. They serve several purposes:
some of them check the comprehension of the notions, theorems, and methods, and
give a deeper understanding; others present new examples, relations, and applications;
again others study further problems related to the topic. They often include also theo-
rems disguised as exercises revealing some interesting aspects or more remote connec-
tions not treated in the text in detail.
Exercises vary in quantity and in difficulty within fairly large limits depending on
the topic, size, and depth of the material. The hard and extra-hard exercises (in our
judgement) are marked with one and two asterisks, resp. (The difficulty of an exercise
is always relative, of course: besides the abilities, interests, and preliminary general
knowledge of the solver, it depends strongly also on the exercises already solved.)
Answers and/or some hints to nearly all exercises can be found in the chapter An-
swers and Hints. To some (mostly harder) problems detailed solutions are presented
in an online chapter available at www.ams.org/bookpages/amstext-48. These exer-
cises are marked with a letter S in the text.
The reader is advised to consult a hint or solution only if an exercise turns out to
be absolutely unmanageable, or to return to the same problem later, or to solve first
some special case of it.
It is important to unravel the message and background of an exercise, its position
and role in the mathematical environment. Also a generalization or raising new prob-
lems are very useful (even if it is not clear how to solve them).
Chapter 5 deals with prime numbers. This simply defined set is one of the most
mysterious objects in mathematics. We discuss Euclid’s theorems (more than two thou-
sand years old) and the sensational discovery of the last decades, the public key cryp-
tosystems based on the contrast of quick primality testing and awfully slow prime fac-
torization. In this chapter we rely both on previously acquired knowledge in number
theory and the results and methods of elementary analysis.
In Chapter 6 we study arithmetic functions. Besides investigating some concrete
important functions, we present several general constructions and applications.
Chapter 7 is about Diophantine equations. After discussing the simplest types (lin-
ear equations, Pythagorean triples), we look at Waring’s problem and prove the special
cases of Fermat’s Last Theorem for exponents three and four. The methods require
the theory of Gaussian and Eulerian integers that will be generalized in Chapters 10
and 11.
The topic of Chapter 8 is Diophantine approximation that is important for certain
applications. We briefly consider also the connection with the geometry of numbers
and continued fractions.
Chapters 9–11 are closely related to each other. The basic properties of algebraic
numbers and algebraic integers from Chapter 9 are essential for understanding the next
two chapters. Chapter 10 studies field extensions, focusing on the arithmetic properties
of algebraic integers in a simple extension of the rational field by an algebraic number.
Here, an intensive use is made of the notions and theorems of elementary linear al-
gebra. Finally, in Chapter 11 the arithmetic aspects of ideals are investigated. On the
one hand, ideals constitute a fine tool for exhibiting some necessary and sufficient, or
useful sufficient, conditions for the validity of unique prime factorization in general
rings, and on the other hand, the validity of unique prime factorization for ideals of
algebraic integers (though in general not for the algebraic integers themselves) plays
an important role in studying algebraic number fields.
In Chapter 12 several interesting problems from combinatorial number theory are
presented. Some of these can be discussed even at a high school study circle, whereas
others require deeper methods from various branches of mathematics. We hope that
the selection gives an idea also about the fundamental role of Paul Erdős in the progress
of this field with thrilling questions and ingenious proofs.
Throughout the text, we often refer to interesting aspects of the history of number
theory and this purpose is served also by the short Historical Notes at the end of the
book.
As is clear also from the above description, the different subfields of number the-
ory are closely interrelated to each other and to other branches of mathematics. This
causes a serious difficulty since, on the one hand, it is important to emphasize this
tight connection during the discussion of the individual topics, but, on the other hand,
it is desirable that every chapter be self-contained and complete. We tried to achieve a
balance that makes it possible to get a gradually growing full picture of a mathematical
field rich in problems and ideas for continuous readers, but allows those who just pick
a few chapters to acquire interesting, substantial, and useful knowledge.
4 Introduction
Technical details
The chapters are divided into sections. Definitions, theorems, and formulas are num-
bered as 𝑘.𝑚.𝑛 where 𝑘 refers to the chapter, 𝑚 to the section, and 𝑛 is the serial num-
ber within the given section. Definitions and theorems have a common list, thus, for
example, Definition 6.2.1 is followed by Theorem 6.2.2. Examples, exercises, etc. are
numbered with a single number restarting in each section. The statement of a defini-
tion or theorem is closed by a ♣ sign and the end of a proof is denoted by .
The search for notations, notions, and theorems can be facilitated by the very de-
tailed Index at the end of the book.
We distinguish the floor and ceiling of (real) numbers, denoted by ⌊ ⌋ and ⌈ ⌉, resp.,
thus e.g. ⌊𝜋⌋ = 3, ⌈𝜋⌉ = 4 (we do not use the notation [𝜋]). The fractional part is de-
noted by { }, i.e. {𝑐} = 𝑐 − ⌊𝑐⌋. Divisibility, greatest common divisor, and least common
multiple are denoted as usual, so e.g. 7 ∣ 42, (9, 15) = 3, and [9, 15] = 45. Square brack-
ets [ ] can mean a least common multiple, a closed interval, or just a replacement for
(round) parentheses (this latter function occurs frequently in Chapter 11 where round
parentheses ( ) stand for an ideal; to avoid confusion, the greatest common divisor is
denoted here by gcd{𝑎, 𝑏}).
Polynomials and functions are denoted generally without indicating the argument:
𝑓, 𝑔, etc. but sometimes also 𝑓(𝑥), 𝑔(𝑥), etc. can occur. The degree of a polynomial is
denoted by “deg,” so e.g., deg(𝑥3 + 𝑥) = 3. As usual, 𝐐, 𝐑, and 𝐂 stand for the rational,
real, and complex numbers. 𝐙, 𝐙𝑚 , and 𝐹[𝑥] mean the integers, the modulo 𝑚 residue
classes, and the polynomials over 𝐹. At field extensions, 𝐐(𝜗) and 𝐼(𝜗) denote the
simple extension of the rationals by 𝜗 and (in case 𝜗 is algebraic) the ring of algebraic
integers in this extension. The letter 𝑝 denotes nearly exclusively a (positive) prime
and the log (without a lower index) stands for natural logarithm (of base 𝑒). For (finite
and infinite) products and sums we often use the signs ∏ and ∑, e.g.
𝑟
𝛼 1
∏ 𝑝𝑖 𝑖 , ∏ 𝑝, ∑
𝑖=1 𝑝≤𝑛 𝑝
𝑝2
𝛼 𝛼
mean the product 𝑝1 1 . . . 𝑝𝑟 𝑟 , the product of primes not greater than 𝑛, and the sum of
reciprocals of squares of primes.
Commemoration
The book is dedicated to the memory of Paul Turán, Paul Erdős, and Tibor Gallai (who
were close friends and collaborators).
Both authors enjoyed the privilege to be in touch with two giants of 20th century
number theory, Paul Turán and Paul Erdős.
We were educated in Paul Turán’s legendary seminars where we learned how to
explore, elaborate, and explain to others the essential components of a mathematical
problem. Turán taught us that connecting seemingly remote areas can often result in
new, efficient methods.
Acknowledgements 5
Edit Gyarmati wrote a number theory textbook (in Hungarian) some fifty years
ago using Turán’s lectures among several other sources that can be considered as a
predecessor of this book in a certain sense. The experiences of our lectures, the stu-
dents’ broadening preliminary knowledge (e.g. in linear algebra), and the new scien-
tific achievements in this field during the past decades necessitated the creation of a
new book instead of a long-due revision. The spirit and structure of the two books show
several similar features, of course.
Both of us were largely influenced by the mathematical and human greatness of
Paul Erdős sharing his enthusiastic devotion towards “nice” mathematical problems
and proofs, talking about these (and many more things) equally naturally and openly
with great scientists or just interested beginners. Róbert Freud owes many adventures
in doing joint mathematics and a great deal of his professional progress to Erdős.
Edit Gyarmati’s choosing mathematics as a profession is mostly due to her unfor-
gettable high school teacher, Tibor Gallai, who was a world-famous expert in graph
theory. Gallai was a brilliant personality whose wonderful classes both in high school
and at universities helped to start mathematical research for the best students, and
offered the joy of understanding and creation for all pupils.
Acknowledgements
We are very thankful for the great job the reviewers Imre Ruzsa (Chapter 12), András
Sárközy (Chapters 1–12), and Mihály Szalay (Chapters 1–11) did. All three of them
checked the manuscript with extreme thoroughness and suggested many general, con-
crete, and stylistic improvements nearly all of which were accepted by us. The concep-
tual remarks of András Sárközy helped us in unifying some notions, homogenizing the
structure, and mentioning several further results. Mihály Szalay checked every tiny de-
tail carefully, solved all the exercises without a solution given in the book, noted even
the smallest inaccuracies, and his concretely worded suggestions made it possible to
correct many lesser or greater errors and discrepancies. Imre Ruzsa added many valu-
able observations on Chapter 12.
In spite of all the efforts of the authors (and reviewers) there probably remain errors
and imperfections in the book. Any comments or suggestions are gratefully accepted.
The book in its present form is an English translation and an improved and cor-
rected version of the two Hungarian editions used by all universities of science in Hun-
gary. Edit Gyarmati, who was not only my coauthor but also my wonderful wife for
many decades, passed away in 2014, and could not participate in preparing this manu-
script. I devote this work to her memory.
Basic Notions
In this chapter, we survey some basic notions, theorems, and methods about the divisi-
bility of integers. When introducing the concepts, we mostly rely on general divisibility
properties only and keep the special features of the integers to a minimum. Using the
even numbers and some other examples, we point out that certain well known facts,
including the unique factorization into primes (the Fundamental Theorem of Arith-
metic), are by no means obvious.
To prove the Fundamental Theorem, we start from the division algorithm, then
describe the Euclidean algorithm yielding the special property of the greatest common
divisor, which is the key to verify the equivalence of the irreducible and prime elements
among the integers. We provide also a direct proof for the Fundamental Theorem us-
ing induction, that does not rely on the division algorithm. Finally, we discuss some
important consequences.
1.1. Divisibility
If 𝑎 and 𝑏 are rational numbers, where 𝑏 ≠ 0, then dividing 𝑎 by 𝑏, we get a rational
number again. A similar statement does not hold for integers, hence the following
definition makes sense:
7
8 1. Basic Notions
Proof. 1 and −1 are units, since for any integer 𝑎, we have 𝑎 = (±1)(±𝑎). Hence
±1 ∣ 𝑎.
Conversely, if 𝜀 is a unit, then 𝜀 divides 1, i.e. 1 = 𝜀𝑞 for some 𝑞. Since |𝜀| ≥ 1 and
|𝑞| ≥ 1, therefore only
|𝜀| = 1, i.e. 𝜀 = ±1
is possible. □
Remark: Divisibility can be introduced also in other sets of numbers (moreover, in any
integral domain, see Exercise 1.1.23). Consider, for example, the even numbers. Here
𝑏 ∣ 𝑎 means that there exists an even number 𝑞 satisfying 𝑎 = 𝑏𝑞. Hence, here 2 ∣ 20,
but 2 ∤ 10, and 10 has no divisors at all. This implies that there are no units among the
even numbers. On the other hand, there are infinitely many units among the (special
real) numbers 𝑐 + 𝑑√2 where 𝑐 and 𝑑 are arbitrary integers (see Exercise 1.1.22). This
means that the units may show very different forms and are related not (only) to the
sign changes as Theorem 1.1.3 could suggest falsely.
Theorem 1.1.4. If 𝜀 and 𝛿 are units and 𝑏 ∣ 𝑎, then also 𝜀𝑏 ∣ 𝛿𝑎 holds. ♣
By Theorem 1.1.4, a number and its associates behave identically concerning divis-
ibility, i.e. the units “do not count” in this respect. This makes possible to deal (later)
only with non-negative or (after clarifying the special role of 0) with positive integers
in divisibility investigations.
The next theorem summarizes some simple but important properties of divisibility
of integers.
Theorem 1.1.5. (i) For every 𝑎, we have 𝑎 ∣ 𝑎.
(ii) If 𝑐 ∣ 𝑏 and 𝑏 ∣ 𝑎, then 𝑐 ∣ 𝑎.
(iii) Both 𝑎 ∣ 𝑏 and 𝑏 ∣ 𝑎 hold simultaneously if and only if 𝑎 is an associate of 𝑏.
(iv) If 𝑐 ∣ 𝑎 and 𝑐 ∣ 𝑏, then 𝑐 ∣ 𝑎 + 𝑏, 𝑐 ∣ 𝑎 − 𝑏, 𝑐 ∣ 𝑘𝑎 for any (integer) 𝑘, and 𝑐 ∣ 𝑟𝑎 + 𝑠𝑏
for any (integers) 𝑟 and 𝑠. ♣
Proof. We verify only (iii). The others can be easily proven using just the definition of
divisibility.
If 𝑎 = 𝜀𝑏 where 𝜀 is a unit, then 𝑏 ∣ 𝑎 is straightforward. Also, 1 = 𝜀𝑟 implies
𝑟𝑎 = 𝑏, hence 𝑎 ∣ 𝑏 is valid as well.
Conversely, if 𝑎 ∣ 𝑏 and 𝑏 ∣ 𝑎, i.e. 𝑏 = 𝑎𝑞 and 𝑎 = 𝑏𝑠 with suitable integers 𝑞 and
𝑠, then 𝑏 = 𝑏(𝑞𝑠). If 𝑏 = 0, then necessarily 𝑎 = 0, thus 𝑎 = 𝜀𝑏. If 𝑏 ≠ 0, then 𝑞𝑠 = 1,
hence 𝑠 is a unit (and so is 𝑞), yielding 𝑎 = 𝜀𝑏. □
Exercises 1.1
(Unless stated otherwise, all numbers are integers, the exponents are non-negative in-
tegers, and the digits are understood to be in decimal representation.)
1. Write a three-digit number twice as one string. Show that the resulting six-digit
number is divisible by 91.
2. Verify that 8 always divides the difference of the squares of two odd numbers.
3. Assume that the three digit number 𝑎𝑏𝑐 (having digits 𝑎, 𝑏, and 𝑐 in this order) is
a multiple of 37. Prove that the number 𝑏𝑐𝑎 is also divisible by 37.
4. Show that if 5𝑎 + 9𝑏 is divisible by 23, then 3𝑎 + 10𝑏 is also divisible by 23.
5. True or false?
(a) 𝑐 ∣ 𝑎 + 𝑏 ⟹ 𝑐 ∣ 𝑎, 𝑐 ∣ 𝑏
(b) 𝑐 ∣ 𝑎 + 𝑏, 𝑐 ∣ 𝑎 ⟹ 𝑐 ∣ 𝑏
(c) 𝑐 ∣ 𝑎 + 𝑏, 𝑐 ∣ 𝑎 − 𝑏 ⟹ 𝑐 ∣ 𝑎, 𝑐 ∣ 𝑏
(d) 𝑐 ∣ 2𝑎 + 5𝑏, 𝑐 ∣ 3𝑎 + 7𝑏 ⟹ 𝑐 ∣ 𝑎, 𝑐 ∣ 𝑏
(e) 𝑐 ∣ 𝑎𝑏 ⟹ 𝑐 ∣ 𝑎 or 𝑐 ∣ 𝑏
(f) 𝑐 ∣ 𝑎, 𝑑 ∣ 𝑏 ⟹ 𝑐𝑑 ∣ 𝑎𝑏
(g) 𝑐 ∣ 𝑎, 𝑑 ∣ 𝑎 ⟹ 𝑐𝑑 ∣ 𝑎.
6. Verify the following:
(i) 𝑎 − 𝑏 ∣ 𝑎𝑛 − 𝑏𝑛
(ii) 𝑎 + 𝑏 ∣ 𝑎2𝑘+1 + 𝑏2𝑘+1
(iii) 𝑎 + 𝑏 ∣ 𝑎2𝑘 − 𝑏2𝑘 .
7. Determine all integers 𝑐 for which (𝑐6 − 3)/(𝑐2 + 2) is an integer.
8. Prove that 133 ∣ 11𝑛+2 + 122𝑛+1 for every 𝑛.
9. Find infinitely many 𝑛 satisfying 29 ∣ 2𝑛 + 5𝑛 .
10. Show that (𝑏 − 1)2 ∣ 𝑏𝑘 − 1 holds if and only if 𝑏 − 1 ∣ 𝑘.
* 11. Assume 2𝑏 − 1 ∣ 2𝑎 + 1. Prove that 𝑏 = 1 or 2.
10 1. Basic Notions
which again holds for exactly one integer 𝑞 (then 𝑞 is the “ceiling” (or upper integer
part) of 𝑎/𝑏: 𝑞 = ⌈𝑎/𝑏⌉, i.e. the smallest integer that is still greater than or equal to
𝑎/𝑏). □
The number 𝑞 is called the quotient and 𝑟 is called the (least non-negative) remain-
der (or residue) of the division algorithm. The divisibility 𝑏 ∣ 𝑎 holds (for 𝑏 ≠ 0) if and
only if the remainder is 0.
It is often more convenient to allow also negative remainders. The following vari-
ant of Theorem 1.2.1 refers to this situation and can be proven similarly.
Theorem 1.2.1A. To any integers 𝑎 and 𝑏 ≠ 0, there exist some uniquely determined
integers 𝑞 and 𝑟 satisfying
|𝑏| |𝑏|
𝑎 = 𝑏𝑞 + 𝑟 and − <𝑟≤ . ♣
2 2
In this case 𝑟 is called the remainder of least absolute value.
Example. Take 𝑎 = 30, 𝑏 = −8, then
30 = (−8)(−3) + 6 = (−8)(−4) − 2,
thus the least non-negative remainder is 6 and the remainder of least absolute value
is −2.
The proof of the next theorem shows how the division algorithm provides the rep-
resentation of positive integers in a number system.
Theorem 1.2.2. Let 𝑡 > 1 be a fixed integer. Then any positive integer 𝐴 has a unique
representation as
𝐴 = 𝑎𝑛 𝑡𝑛 + 𝑎𝑛−1 𝑡𝑛−1 + ⋯ + 𝑎1 𝑡 + 𝑎0 , where 0 ≤ 𝑎𝑖 < 𝑡 and 𝑎𝑛 ≠ 0. ♣
In this representation
𝐴 = 𝑎𝑛 𝑡𝑛 + 𝑎𝑛−1 𝑡𝑛−1 + ⋯ + 𝑎1 𝑡 + 𝑎0 ,
the numbers 𝑎𝑖 are the digits of 𝐴 in the number system of base 𝑡 (if 𝑡 > 10, then we have
to extend 0, 1, . . . , 9 with further digits). The above representation is denoted by
𝐴 = 𝑎𝑛 𝑎𝑛−1 . . . 𝑎1 𝑎0 [𝑡] or 𝐴 = 𝑎𝑛 𝑎𝑛−1 . . . 𝑎1 𝑎0 [𝑡]
(the overline may be needed to avoid ambiguity, i.e. not to confuse the string of digits
with a product). If 𝑡 = 10, then we generally omit the notation of the base of the
number system.
Exercises 1.2 13
In everyday life, we generally use the decimal system, but e.g. the binary system
can often be more useful in computers, among others. In the binary system we have
only two digits, 0 and 1, and to perform addition and multiplication we need only the
following simple tables (however, the representation of a number requires many more
digits than in the decimal case):
⊕ 0 1 ⊙ 0 1
0 0 1 0 0 0
1 1 10 1 0 1
Despite its simplicity, the division algorithm (independently of the least non-
negative or least absolute value character of the remainder) has a great significance
both from the practical and theoretical points of view. It can be efficiently used for
divisibility problems since only “the remainder counts” in many cases. Its most impor-
tant application is perhaps the Euclidean algorithm, which consists of a sequence of
division algorithms and will be treated in the next section.
Exercises 1.2
23. Write a positive integer in base 𝑏1 = 2. Then subtract 1 and consider the string as
a number in a larger base 𝑏2 . Subtract 1 again (in base 𝑏2 ) and read the string as a
number in a base 𝑏3 > 𝑏2 , etc. For example, we start with 23[10] = 10111[2] , then
subtracting 1 and switching to 𝑏2 = 5, we obtain 10110[5] = 655[10] . Subtracting
1 again (in base 5) and introducing 𝑏3 = 9, we get 10104[9] = 6646[10] , etc. What
happens if we continue this process indefinitely?
We often abbreviate the expression greatest common divisor as gcd using its ini-
tials. The notation is: 𝑑 = (𝑎, 𝑏), or 𝑑 = gcd(𝑎, 𝑏), or 𝑑 = gcd{𝑎, 𝑏}.
There is no greatest common divisor of 0 and 0 since every integer is a common
divisor and there is no maximal number among these.
In any other case, however, exactly one 𝑑 satisfies Definition 1.3.1 (for given 𝑎
and 𝑏), namely the maximal element of the set 𝐷 of common divisors; 𝐷 is not empty
since 1 is always a common divisor and 𝐷 is finite since a non-zero integer has only
finitely many divisors (see Exercise 1.1.12b).
Definition 1.3.2. A special common divisor of 𝑎 and 𝑏 is 𝛿, if
(i′ ) 𝛿 ∣ 𝑎, 𝛿 ∣ 𝑏
(ii′ ) if 𝑐 satisfies 𝑐 ∣ 𝑎 and 𝑐 ∣ 𝑏, then 𝑐 ∣ 𝛿. ♣
It is not at all straightforward, however, to show that the greatest common divi-
sor satisfies also the special property (ii′ ), i.e. that any two integers possess a special
common divisor.
Proof. We prove the existence of a special common divisor via the Euclidean algo-
rithm, which is one of the most ancient procedures in mathematics. We divide the first
number by the second one, then we divide the second number by the remainder, etc.,
and continue to divide the actual divisor by the actual remainder till we obtain 0 as a
remainder. We show that the procedure terminates and the last non-zero remainder is
a special common divisor of the two numbers.
Let us see the details. Assume that (e.g.) 𝑏 ≠ 0. If 𝑏 ∣ 𝑎, then 𝛿 = 𝑏.
If 𝑏 ∤ 𝑎, then we obtain for suitable integers 𝑞𝑖 and 𝑟 𝑖
𝑎 = 𝑏𝑞1 + 𝑟1 where 0 < 𝑟1 < |𝑏|
𝑏 = 𝑟1 𝑞2 + 𝑟2 where 0 < 𝑟2 < 𝑟1
𝑟1 = 𝑟2 𝑞3 + 𝑟3 where 0 < 𝑟3 < 𝑟2
⋯
𝑟𝑛−2 = 𝑟𝑛−1 𝑞𝑛 + 𝑟𝑛 where 0 < 𝑟𝑛 < 𝑟𝑛−1
𝑟𝑛−1 = 𝑟𝑛 𝑞𝑛+1 (𝑟𝑛+1 = 0).
The procedure terminates in finitely many steps since the remainders form a
strictly decreasing sequence of non-negative integers:
|𝑏| > 𝑟1 > 𝑟2 > . . . .
Now we verify that 𝑟𝑛 is a special common divisor of 𝑎 and 𝑏, indeed.
Proceeding through the equalities of the algorithm upwards, first we establish that
𝑟𝑛 is a common divisor of 𝑎 and 𝑏. The last equality implies 𝑟𝑛 ∣ 𝑟𝑛−1 . Using the next to
last equality, we get
𝑟𝑛 ∣ 𝑟𝑛−1 , 𝑟𝑛 ∣ 𝑟𝑛 ⟹ 𝑟𝑛 ∣ 𝑟𝑛−1 𝑞𝑛 + 𝑟𝑛 = 𝑟𝑛−2 .
Continuing upwards similarly, finally we arrive at 𝑟𝑛 ∣ 𝑏 and (from the first equality)
𝑟𝑛 ∣ 𝑎.
To show the special property, we proceed now downwards. Let 𝑐 ∣ 𝑎 and 𝑐 ∣ 𝑏,
then we have 𝑐 ∣ 𝑎 − 𝑏𝑞 = 𝑟1 from the first equality. Turning to the second equality, we
obtain
𝑐 ∣ 𝑏, 𝑐 ∣ 𝑟1 ⟹ 𝑐 ∣ 𝑏 − 𝑟1 𝑞2 = 𝑟2 .
Continuing downwards similarly, the next to last equality implies 𝑐 ∣ 𝑟𝑛 . □
Remarks: (1) Instead of least non-negative remainders, we can perform the Euclidean
algorithm also with remainders of least absolute value; then the absolute values
of the remainders form a strictly decreasing sequence of non-negative integers,
hence the procedure terminates in finitely many steps in this case, too.
1.3. Greatest Common Divisor 17
(2) As an integer and its negative behave equivalently concerning divisibility, we can
restrict ourselves to the positive value of the special common divisor which is (as
we have seen) equal to the greatest common divisor. Hence the notations (𝑎, 𝑏)
and gcd(𝑎, 𝑏) will mean this uniquely determined positive integer, and we shall
(generally) use the greatest common divisor name also for the special common
divisor.
(3) For a practical computation of the greatest common divisor, it is often more con-
venient to use the variant
(𝑎, 𝑏) = (𝑏, 𝑟1 ) = (𝑟1 , 𝑟2 ) = ⋯ = (𝑟𝑛−1 , 𝑟𝑛 ) = (𝑟𝑛 , 0) = 𝑟𝑛
of the Euclidean algorithm that is based on the simple relation (𝑎, 𝑏) = (𝑏, 𝑎−𝑘𝑏).
(4) At first sight, Definition 1.3.2, including the special property (ii′ ), might seem
artificial and unnecessary, but it is justified by the fact that it relies on divisibil-
ity relations only in contrast to Definition 1.3.1 which uses also ordering relations
(greater-smaller). Therefore, it is not surprising that—as it will soon turn out—we
can apply rather the special property (ii′ ) instead, both for theoretical and prac-
tical purposes. A further advantage of building the notion purely on divisibility
is that in certain sets of numbers (or more generally in most integral domains)
Definition 1.3.1 does not even make sense. An obvious reason for this is if we
cannot define an order (satisfying the usual “good” properties) in the set as, for
example, in certain subsets of the complex numbers. But we can run into a prob-
lem with Definition 1.3.1 also in sets that can be ordered, e.g., among the num-
bers 𝑐 + 𝑑√2 (where 𝑐 and 𝑑 are integers). Here we have infinitely many units
(see Exercise 1.1.22) and there is no maximal one among them. (If we consider
only common divisors where no two are associates, Definition 1.3.1 still makes
no sense since taking any two common divisors we can multiply the first one by a
unit so that the resulting associate will exceed the second one.) Therefore, in the
further chapters of number theory we shall always define the greatest common
divisor according to Definition 1.3.2.
Now we prove some important properties of the greatest common divisor (among
the integers).
Theorem 1.3.4. If 𝑐 > 0, then (𝑐𝑎, 𝑐𝑏) = 𝑐(𝑎, 𝑏). ♣
Proof. Consider the Euclidean algorithm determining (𝑎, 𝑏) and let 𝑟𝑛 = (𝑎, 𝑏) be the
last non-zero residue. Multiplying each equality by 𝑐, we obtain the Euclidean algo-
rithm producing (𝑐𝑎, 𝑐𝑏). Hence, here the last non-zero residue is (𝑐𝑎, 𝑐𝑏) = 𝑐𝑟𝑛 =
𝑐(𝑎, 𝑏). □
Proof. From the first equality of the Euclidean algorithm, we can express 𝑟1 as
𝑟1 = 𝑎 − 𝑏𝑞1 .
18 1. Basic Notions
Proof. Assume first that there exists a solution 𝑥0 , 𝑦0 . Then (𝑎, 𝑏) ∣ 𝑎 and (𝑎, 𝑏) ∣ 𝑏
imply
(𝑎, 𝑏) ∣ 𝑎𝑥0 + 𝑏𝑦0 = 𝑐.
Conversely, assume (𝑎, 𝑏) ∣ 𝑐, i.e. (𝑎, 𝑏)𝑡 = 𝑐 for some integer 𝑡. By Theorem 1.3.5, we
have
(𝑎, 𝑏) = 𝑎𝑢 + 𝑏𝑣
with suitable integers 𝑢 and 𝑣. Multiplying this equality by 𝑡, we get
𝑐 = 𝑎(𝑢𝑡) + 𝑏(𝑣𝑡),
i.e. 𝑥 = 𝑢𝑡, 𝑦 = 𝑣𝑡 is a solution of the Diophantine equation 𝑎𝑥 + 𝑏𝑦 = 𝑐. □
Note that the Euclidean algorithm serves also as a procedure to find a solution of
a linear Diophantine equation.
We deal with further questions (the number of solutions, a survey of all solutions,
another method to find the solutions) concerning a linear Diophantine equation in
Section 7.1 and discuss its relation to congruences in Section 2.5.
We define the greatest common divisor of more than two integers by the special
property immediately as a common divisor that is a multiple of every common divi-
sor. We denote the positive greatest common divisor of 𝑎1 , 𝑎2 , . . . , 𝑎𝑘 (not all zero) by
(𝑎1 , 𝑎2 , . . . , 𝑎𝑘 ). Its existence can be proven simply, using that the set of all common di-
visors of two numbers is the same as the set of divisors of the greatest common divisor
of the two numbers. Hence
Definition 1.3.7. The integers 𝑎1 , 𝑎2 , . . . , 𝑎𝑘 are relatively prime or coprime if they have
no other common divisors than units, i.e. (𝑎1 , 𝑎2 , . . . , 𝑎𝑘 ) = 1. ♣
Definition 1.3.8. The integers 𝑎1 , 𝑎2 , . . . , 𝑎𝑘 are pairwise relatively prime or pairwise
coprime if no two have other common divisors than units, i.e. (𝑎𝑖 , 𝑎𝑗 ) = 1 for every
1 ≤ 𝑖 ≠ 𝑗 ≤ 𝑘. ♣
Exercises 1.3 19
Evidently, pairwise coprime integers are coprime as well, but the converse is false
(for 𝑘 > 2); see Exercise 1.3.5.
We saw already in Exercise 1.1.5e that if an integer divides a product and does not
divide one of the factors, then this does not imply that it divides the other factor. The
correct condition is contained in the following theorem, that occurs already in Euclid’s
Elements, and, besides its usefulness in divisibility problems, plays a key role in the
proof of the Fundamental Theorem of Arithmetic.
Theorem 1.3.9. If 𝑐 ∣ 𝑎𝑏 and (𝑐, 𝑎) = 1, then 𝑐 ∣ 𝑏. ♣
Proof. Clearly, we may assume that 𝑎, 𝑏, and 𝑐 are positive. Using the special property
of the greatest common divisor and Theorem 1.3.4, the divisibilities 𝑐 ∣ 𝑎𝑏 and 𝑐 ∣ 𝑐𝑏
imply
𝑐 ∣ (𝑎𝑏, 𝑐𝑏) = (𝑎, 𝑐)𝑏 = 𝑏. □
Exercises 1.3
(Using here the notation (𝑐, 𝑑), we assume automatically that 𝑐 and 𝑑 cannot be both
zero.)
1. Compute (3794, 2226) and write it in the form 3794𝑢 + 2226𝑣.
2. Show that the following fractions are in reduced form for every positive integer 𝑛:
3𝑛 + 5
(a)
7𝑛 + 12
3𝑛2 + 1
(b)
4𝑛2 + 3
𝑛! −1
(c)
(𝑛 + 1)! −1
7𝑛 − 2
(d) 𝑛+1 .
7 −5
3. Find all possible values of (𝑛2 + 2, 𝑛4 + 4) if 𝑛 assumes all positive integers.
4. What are the possible values of
(a) (𝑎 + 𝑏, 𝑎 − 𝑏)
(b) (𝑎 + 2𝑏, 4𝑎 − 𝑏)
if (𝑎, 𝑏) = 5?
5. Exhibit three coprime integers no two of which are coprime.
6. True or false?
𝑎 𝑏
(a) If (𝑎, 𝑏) = 𝑑, then ( 𝑑 , 𝑑 ) = 1.
𝑎 𝑏
(b) If (𝑎, 𝑏) = 𝑑, then at least one of ( 𝑑 , 𝑏) = 1 and (𝑎, 𝑑 ) = 1 holds.
𝑐
(c) 𝑐 ∣ 𝑎𝑏 if and only if (𝑐,𝑎)
∣ 𝑏.
(d) 𝑐 ∣ 𝑎𝑏, (𝑎, 𝑏) = 1 ⟹ 𝑐 ∣ 𝑎 or 𝑐 ∣ 𝑏.
20 1. Basic Notions
7. Let 𝑎 and 𝑏 be positive integers. How many numbers are divisible by 𝑏 among the
integers 𝑎, 2𝑎, 3𝑎, . . . , 𝑏𝑎?
8. Let 𝑎 and 𝑏 be distinct positive integers. True or false?
(a) (𝑎 + 𝑛, 𝑏 + 𝑛) = 1 holds for infinitely many integers 𝑛.
(b) (𝑎 + 𝑛, 𝑏 + 𝑛) = (𝑏 + 𝑛, 𝑏𝑛) = 1 holds for infinitely many integers 𝑛.
(c) (𝑎 + 𝑛, 𝑏𝑛) = (𝑏 + 𝑛, 𝑏𝑛) = 1 holds for infinitely many integers 𝑛.
9. Let 𝑎 and 𝑏 be given integers.
(a) How many pairs of integers 𝑢, 𝑣 satisfy (𝑎, 𝑏) = 𝑎𝑢 + 𝑏𝑣?
(b) What is the greatest common divisor of 𝑢 and 𝑣 in the representation (𝑎, 𝑏) =
𝑎𝑢 + 𝑏𝑣?
(c) Let 𝐻 be the set of numbers 𝑎𝑢 + 𝑏𝑣 where 𝑢 and 𝑣 assume all integer values.
What is the smallest positive element of 𝐻?
10. Uniqueness of the special common divisor. Let 𝛿 be a special common divisor of
integers 𝑎 and 𝑏. Using the definition of the special common divisor, prove the
following propositions.
(a) For any unit 𝜀, 𝜀𝛿 is a special common divisor of 𝑎 and 𝑏.
(b) If 𝛿1 is another special common divisor of 𝑎 and 𝑏, then 𝛿1 = 𝜀𝛿 for some
unit 𝜀.
S 11. Give an alternative proof for Theorem 1.3.4 that uses only the notion (and exis-
tence) of the special common divisor and does not rely (directly) on the Euclidean
algorithm.
12. We call repunits those positive integers where every digit is 1 (in decimal represen-
tation).
(a) Which numbers have a repunit multiple?
(b) Which is the smallest repunit multiple of 31000 ?
S* 13. Show that
(𝑎𝑛 − 1, 𝑎𝑘 − 1) = 𝑎(𝑛,𝑘) − 1
holds for any integers 𝑛 > 0, 𝑘 > 0, and 𝑎 > 1.
14. Let 𝑎 be a positive integer.
(a) Verify that if 𝑛 and 𝑘 are distinct powers of two an 𝑎 is an even number, then
(𝑎𝑛 + 1, 𝑎𝑘 + 1) = 1.
* (b) Determine (𝑎𝑛 + 1, 𝑎𝑘 + 1) in general.
15. Prove that any two consecutive Fibonacci numbers (see Exercise 1.2.5) are co-
prime. What about the second neighbors? And the third neighbors?
** 16. Let 𝜑𝑚 be the 𝑚th Fibonacci number. Verify
𝑘 ∣ 𝑛 ⟺ 𝜑𝑘 ∣ 𝜑𝑛 , moreover, 𝜑(𝑘,𝑛) = (𝜑𝑘 , 𝜑𝑛 ).
1.4. Irreducible and Prime Numbers 21
At the end of Definition 1.4.2, the word “or” occurs in an inclusive sense since it
can happen that 𝑝 divides both factors of the product. We also note that the restriction
𝑝 ≠ 0 was necessary here since 0 would otherwise satisfy the property required in
Definition 1.4.2:
0 ∣ 𝑎𝑏 ⟹ 𝑎𝑏 = 0 ⟹ 𝑎 = 0 or 𝑏 = 0 ⟹ 0 ∣ 𝑎 or 0 ∣ 𝑏.
Definition 1.4.2 implies that if a prime divides a product of more (than two) factors,
then it must divide at least one of them.
Proof. We may clearly assume that 𝑝 is not zero and not a unit.
I. First, we take a prime 𝑝 and prove that it is irreducible. Given a product 𝑝 = 𝑎𝑏,
we have to verify that 𝑎 or 𝑏 is a unit.
The equality 𝑝 = 𝑎𝑏 implies that 𝑝 ∣ 𝑎𝑏. Since 𝑝 is a prime, therefore we infer
that 𝑝 ∣ 𝑎 or 𝑝 ∣ 𝑏. The first case means that 𝑎𝑏 ∣ 𝑎 and hence 𝑏 ∣ 1 (since 𝑎 ≠ 0),
i.e. 𝑏 is a unit. The second case yields similarly that 𝑎 is a unit.
II. We assume now that 𝑝 is irreducible and prove that it is a prime. Given 𝑝 ∣ 𝑎𝑏,
we have to verify that at least one of 𝑝 ∣ 𝑎 and 𝑝 ∣ 𝑏 holds.
If 𝑝 ∣ 𝑎, then we are done. If 𝑝 ∤ 𝑎, then the irreducibility of 𝑝 and (𝑝, 𝑎) ∣ 𝑝 yield
(𝑝, 𝑎) = 1. The conditions 𝑝 ∣ 𝑎𝑏 and (𝑝, 𝑎) = 1 imply 𝑝 ∣ 𝑏 by Theorem 1.3.9. □
Thus we have shown that the irreducible and prime numbers coincide among the
integers. Therefore we can define the prime numbers as in high school by the irre-
ducible property and to use either of the two adjectives irreducible and prime for these
numbers. For brevity, we shall generally use the word prime except if we want to em-
phasize the irreducible property.
The two notions, however, are not equivalent in many other sets of numbers. E.g.
among the even numbers, 6 is irreducible since it cannot be written as the product of
two even numbers, but it is not a prime because it divides 18 ⋅ 2 without dividing either
of the factors. We shall see further examples in Chapter 10.
Among the integers, the study of prime numbers is one of the most important
areas in number theory. Euclid proved that there exist infinitely many primes (Theo-
rem 5.1.1), but on the other hand, there are many easily formulated and yet unsolved
problems concerning the prime numbers. We shall deal with these more in detail in
Chapter 5.
Exercises 1.4 23
Exercises 1.4
According to the conventions, we shall use the word prime or prime number also for
the irreducible numbers among the integers. We note, however, that Exercises 1.4.1–
1.4.7 refer to irreducible numbers.
1. Determine all positive integers 𝑛 for which each of the following numbers is a
prime:
(a) 𝑛, 𝑛 + 2, and 𝑛 + 4
(b) 𝑛 and 𝑛2 + 8
(c) 𝑛, 𝑛 + 6, 𝑛 + 12, 𝑛 + 18, and 𝑛 + 24
(d) 𝑛, 𝑛3 − 6, and 𝑛3 + 6.
2. Does there exist an infinite arithmetic progression with a non-zero difference con-
sisting purely of primes?
3. Captain Immortal has three immortal grandchildren whose ages are three distinct
primes and the sum of the squares of their ages is a prime. How old is the captain’s
youngest grandchild? (Do not forget about the immortality of the grandchildren,
they can be several million years old!)
4. Let 𝑎 and 𝑘 be integers greater than one. Prove the following assertions.
(a) If 𝑎𝑘 − 1 is a prime, then 𝑎 = 2 and 𝑘 is a prime.
(b) If 𝑎𝑘 + 1 is a prime, then 𝑘 is a power of two.
Remark: The primes of the form 2𝑘 − 1 are called Mersenne primes and the primes
of the form 2𝑘 + 1 are called Fermat primes. We shall study them in detail in Sec-
tion 5.2.
S 5. Determine all integers 𝑡 > 1 and odd numbers 𝑘 > 0 for which 1𝑘 +2𝑘 +3𝑘 +⋯+𝑡𝑘
is a prime.
6. Find all positive integers 𝑛 for which
(a) 𝑛3 − 𝑛 + 3
(b) 𝑛3 − 27
(c) 𝑛8 + 𝑛7 + 𝑛6 + 𝑛5 + 𝑛4 + 𝑛3 + 𝑛2 + 𝑛 + 1
(d) 𝑛4 + 4
(e) 𝑛8 + 𝑛6 + 𝑛4 + 𝑛2 + 1
is a prime.
7. Let 𝑛 > 1. Prove the following assertions.
(a) If 𝑛 has no divisor 𝑡 satisfying 1 < 𝑡 ≤ √𝑛, then 𝑛 is a prime.
(b) The smallest divisor of 𝑛 greater than 1 is a prime.
3
(c) If 𝑛 is composite but has no divisor 𝑡 satisfying 1 < 𝑡 ≤ √𝑛, then 𝑛 is the
product of two primes.
24 1. Basic Notions
(4) When stating the theorem, we should definitely use the notion of irreducible
numbers since the theorem declares that (nearly) every integer can be assembled
essentially in a unique way from these bricks. For clarity, we shall strictly distin-
guish the notions irreducible and prime during the proof. We shall see that their
equivalence is crucial for the validity of the Fundamental Theorem.
(5) The Fundamental Theorem is false in many sets of numbers (and integral do-
mains). Taking e.g. the even numbers, 100 has two essentially different decom-
positions into the product of irreducible elements: 100 = 2 ⋅ 50 = 10 ⋅ 10. We shall
see further examples in Chapter 10.
1.5. The Fundamental Theorem of Arithmetic 25
Now we turn to the proof of the Fundamental Theorem. We shall give two proofs
for the uniqueness part.
First proof of uniqueness. Our main tool is that every irreducible number is a prime
(Theorem 1.4.3).
The proof is by contradiction. Assume that a certain 𝑎 has (at least) two essentially
different decompositions into the product of irreducible elements:
(1.5.1) 𝑎 = 𝑝1 𝑝2 . . . 𝑝𝑟 = 𝑞1 𝑞2 . . . 𝑞𝑠 .
unique. If not, then 𝑛 has (at least) two essentially different decompositions into the
product of irreducible numbers:
(1.5.2) 𝑛 = 𝑝1 𝑝2 . . . 𝑝𝑟 = 𝑞1 𝑞2 . . . 𝑞𝑠 .
(If eventually 𝑞1 − 𝑝1 = 1, then the factors 𝑣 𝑖 are missing in which case the argu-
ment will be even more valid.)
We show that the two decompositions in (1.5.6) are essentially different. The first
one contains 𝑝1 . But 𝑝1 is missing from the second one, since on the one hand 𝑝1 ≠ 𝑞𝑗 ,
and on the other hand, if 𝑝1 = 𝑣 𝑖 for some 𝑖, then
𝑝1 ∣ 𝑣 1 . . . 𝑣 𝑚 = 𝑞1 − 𝑝1 ⟹ 𝑝1 ∣ 𝑞1 ,
which is impossible. Thus (1.5.4) is proven. □
Remarks: (1) Analyzing the first proof of uniqueness, we find that the division al-
gorithm served as its basis, after all. It made possible the Euclidean algorithm,
yielding the existence of a special common divisor based on which we showed
(via Theorem 1.3.9) that an irreducible number is always a prime, giving the key
step to the proof.
It is true also generally that if in some number sets (or integral domains) we can
perform the division algorithm, then the Fundamental Theorem of Arithmetic
holds there. Our proof of uniqueness remains valid literally also for the general
case, whereas the decomposability may require some more refined arguments in
Exercises 1.5 27
certain sets. We shall see such examples in Chapters 7 and 10. In Section 11.3,
using ideals, we shall give a unified proof for the general case that division al-
gorithm always implies the Fundamental Theorem (both decomposability and
uniqueness).
We note that the relation between the division algorithm and the Fundamental
Theorem is not symmetric; there exist sets of numbers where the Fundamental
Theorem is true but there do not exist division algorithms of any kind. We shall
see an example in Chapter 10.
(2) The second proof of uniqueness did not rely on the theorems of Sections 1.3 and
1.4. Thus we can give new proofs for some of those theorems using the Funda-
mental Theorem. We emphasize two important results: the existence of a special
common divisor (Theorem 1.3.3) and that every irreducible number is a prime
(the “harder” part of Theorem 1.4.3). To derive these from the Fundamental The-
orem, consult the proof of Theorem 1.6.4 for the first one, and Exercise 1.5.8 for
the second one.
Exercises 1.5
S 8. Derive from the Fundamental Theorem that every irreducible number is a prime.
9. Find all (not necessarily positive and not necessarily distinct) primes (among the
integers) satisfying
1 1 1
= + .
𝑝1 − 𝑝2 − 𝑝3 𝑝2 𝑝3
S* 10. Determine all positive primes (among the integers) a power of which (with positive
integer exponent) is the sum of the cubes of two positive integers.
where 𝑝1 , . . . , 𝑝𝑟 are distinct (positive) primes and each 𝛼𝑖 > 0 is an integer. This form is
𝛼
unique apart from the order of the prime power factors 𝑝𝑖 𝑖 . ♣
Now, we turn to the standard form of the greatest common divisor of two inte-
gers. We use the modified standard form again: we include in the standard forms of
both numbers also those primes that divide only one of our integers (these occur with
exponent 0 in the standard form of the other integer, of course).
Theorem 1.6.4. Let the standard forms of the positive integers 𝑎 and 𝑏 be
𝛼 𝛼 𝛼 𝛽 𝛽 𝛽
𝑎 = 𝑝1 1 𝑝2 2 . . . 𝑝𝑟 𝑟 and 𝑏 = 𝑝1 1 𝑝2 2 . . . 𝑝𝑟 𝑟 where 𝛼𝑖 ≥ 0, 𝛽𝑗 ≥ 0.
Then
min(𝛼1 ,𝛽1 ) min(𝛼2 ,𝛽2 ) min(𝛼𝑟 ,𝛽𝑟 )
(𝑎, 𝑏) = 𝑝1 𝑝2 . . . 𝑝𝑟
(where min(𝛼𝑖 , 𝛽 𝑖 ) means the smaller number of 𝛼𝑖 and 𝛽 𝑖 if 𝛼𝑖 ≠ 𝛽 𝑖 , and their common
value if 𝛼𝑖 = 𝛽 𝑖 ). ♣
30 1. Basic Notions
Proof. Consider
𝑟
min(𝛼𝑖 ,𝛽𝑖 )
𝑑 = ∏ 𝑝𝑖 .
𝑖=1
We shall show that 𝑑 is a common divisor of 𝑎 and 𝑏 and is a multiple of every common
divisor. We shall rely on Theorem 1.6.2.
Since min(𝛼𝑖 , 𝛽 𝑖 ) ≤ 𝛼𝑖 and min(𝛼𝑖 , 𝛽 𝑖 ) ≤ 𝛽 𝑖 , 𝑑 ∣ 𝑎 and 𝑑 ∣ 𝑏, so 𝑑 is a common
divisor.
Let 𝑐 be an arbitrary common divisor of 𝑎 and 𝑏. Then
𝑟
𝛾
𝑐 = ∏ 𝑝𝑖 𝑖 where 𝛾 𝑖 ≤ 𝛼𝑖 , 𝛾 𝑖 ≤ 𝛽 𝑖 .
𝑖=1
We turn now to the least common multiple, or shortly lcm. According to its name,
this means the smallest positive element among the common multiples.
Definition 1.6.5. The least common multiple of integers 𝑎 and 𝑏 is the positive integer
𝑘 if
(i) 𝑎 ∣ 𝑘, 𝑏 ∣ 𝑘
(ii) if 𝑎 ∣ 𝑐 and 𝑏 ∣ 𝑐 for some 𝑐 > 0, then 𝑐 ≥ 𝑘. ♣
We denote the least common multiple of 𝑎 and 𝑏 by [𝑎, 𝑏] (or lcm(𝑎, 𝑏)).
Since the product 𝑎𝑏 is clearly a common multiple of 𝑎 and 𝑏, we can determine
[𝑎, 𝑏] by checking the finitely many positive integers not greater than 𝑎𝑏, seeing which
is the smallest among the common multiples of 𝑎 and 𝑏. Thus the existence and unique-
ness of the least common multiple are obvious.
Analogously to the greatest common divisor, we can replace the minimality of the
least common multiple by a more important special divisibility property: the least com-
mon multiple divides every common multiple (the lcm is often defined by this feature
directly). We summarize this and further basic facts concerning the lcm in the next
theorem.
Theorem 1.6.6. (I) If the standard forms of the positive integers 𝑎 and 𝑏 are
𝛼 𝛼 𝛼 𝛽 𝛽 𝛽
𝑎 = 𝑝1 1 𝑝2 2 . . . 𝑝𝑟 𝑟 and 𝑏 = 𝑝1 1 𝑝2 2 . . . 𝑝𝑟 𝑟 where 𝛼𝑖 ≥ 0, 𝛽𝑗 ≥ 0,
1.6. Standard Form 31
then
max(𝛼1 ,𝛽1 ) max(𝛼2 ,𝛽2 ) max(𝛼𝑟 ,𝛽𝑟 )
[𝑎, 𝑏] = 𝑝1 𝑝2 . . . 𝑝𝑟
(where max(𝛼𝑖 , 𝛽 𝑖 ) denotes the larger number of 𝛼𝑖 and 𝛽 𝑖 if 𝛼𝑖 ≠ 𝛽 𝑖 , and their
common value if 𝛼𝑖 = 𝛽 𝑖 ).
(II) 𝑎 ∣ 𝑐, 𝑏 ∣ 𝑐 if and only if [𝑎, 𝑏] ∣ 𝑐.
(III) (𝑎, 𝑏)[𝑎, 𝑏] = 𝑎𝑏. ♣
Proof. I and II. A positive integer 𝑐 is a common multiple of 𝑎 and 𝑏 if and only if both
𝑎 ∣ 𝑐 and 𝑏 ∣ 𝑐. This means that the exponent 𝛾 𝑖 of any prime 𝑝 𝑖 in the standard form
of 𝑐 satisfies 𝛾 𝑖 ≥ 𝛼𝑖 and 𝛾 𝑖 ≥ 𝛽 𝑖 , which is equivalent to 𝛾 𝑖 ≥ max(𝛼𝑖 , 𝛽 𝑖 ).
We obtain the smallest such 𝑐 when 𝛾 𝑖 = max(𝛼𝑖 , 𝛽 𝑖 ) (𝑖 = 1, 2, . . . , 𝑟) and 𝑐 is not
divisible by any other primes than the 𝑝 𝑖 . This proves I.
We also obtained that the exponents of the primes 𝑝 𝑖 in the standard forms of all
common multiples 𝑐 are greater than or equal to the exponent in [𝑎, 𝑏] and there may
also occur other primes in their standard forms. This means that the common multi-
ples 𝑐 are the same as the multiples of [𝑎, 𝑏]. This proves II.
III. We show that every prime 𝑝 𝑖 occurs with the same exponent in the standard
forms of (𝑎, 𝑏)[𝑎, 𝑏] and 𝑎𝑏, i.e.
min(𝛼𝑖 , 𝛽 𝑖 ) + max(𝛼𝑖 , 𝛽 𝑖 ) = 𝛼𝑖 + 𝛽 𝑖 , 𝑖 = 1, 2, . . . , 𝑟.
If e.g 𝛼𝑖 ≤ 𝛽 𝑖 , then the left-hand side is 𝛼𝑖 + 𝛽 𝑖 which is the same as the right-hand
side. □
Remarks: (1) An important consequence of III is that 𝑎𝑏 = [𝑎, 𝑏] if and only if (𝑎, 𝑏) =
1.
(2) Note that 𝑎 ∣ 𝑐 and 𝑏 ∣ 𝑐 do not imply 𝑎𝑏 ∣ 𝑐, e.g. 4 ∣ 36, and 6 ∣ 36, but 24 ∤ 36.
The correct implication is given by II:
𝑎 ∣ 𝑐, 𝑏 ∣ 𝑐 ⟹ [𝑎, 𝑏] ∣ 𝑐.
If 𝑎 and 𝑏 are coprime, then, according to the previous remark, we have [𝑎, 𝑏] =
𝑎𝑏, and obtain the following important special case:
𝑎 ∣ 𝑐, 𝑏 ∣ 𝑐, (𝑎, 𝑏) = 1 ⟹ 𝑎𝑏 ∣ 𝑐.
So, to prove 72 ∣ 𝑐, it suffices to verify that 𝑐 is divisible both by 8 and 9. Also in
general, any divisibility problem can be reduced to divisibilities by prime powers:
𝑟 𝛼
If the standard form of 𝑚 is 𝑚 = ∏𝑖=1 𝑝𝑖 𝑖 (𝛼𝑖 > 0), then
𝑚∣𝑐
if and only if
𝛼
𝑝𝑖 𝑖 ∣ 𝑐, 𝑖 = 1, 2, . . . , 𝑟.
(3) The notion and properties of the lcm can be generalized for more than two inte-
gers. We shall often use that the least common multiple of finitely many positive
integers equals their product if and only if the integers are pairwise coprime. We
also note that the equality in III has no simple direct generalization for more than
two numbers (see Exercise 1.6.15).
32 1. Basic Notions
We infer from the Fundamental Theorem that two integers are coprime if and only
if they share no common prime divisors. This implies the following theorem immedi-
ately:
Theorem 1.6.7.
(𝑐, 𝑎𝑏) = 1 ⟺ (𝑐, 𝑎) = 1 and (𝑐, 𝑏) = 1. ♣
Therefore, if two positive integers are coprime, then generally it is best to exhibit
their standard forms without common primes, as
𝑟 𝑠
𝛼 𝛽𝑗
𝑎 = ∏ 𝑝𝑖 𝑖 , 𝑏 = ∏ 𝑞𝑗 , 𝑝 𝑖 ≠ 𝑞𝑗 .
𝑖=1 𝑗=1
In the formula, ⌊𝑥⌋ is the floor or (lower) integer part of 𝑥 and 𝑝 under the product
sign means a (positive) prime, so we have to form the product for all primes 𝑝 satisfying
𝑝 ≤ 𝑛. We shall often meet similar notations later, as well,
1
∑ , ∏ 𝑝, ∑1
𝑝≤𝑛
𝑝 𝑝≤𝑛 𝑝∣𝑛
mean the sum of reciprocals of primes not greater than 𝑛, the product of primes not
greater than 𝑛, and the number of distinct prime divisors of 𝑛.
Observe that in Theorem 1.6.8, it is sufficient to consider only finitely many terms
in the sum defining 𝛼𝑝 since we have ⌊𝑛/𝑝𝑘 ⌋ = 0 for 𝑝𝑘 > 𝑛 (hence the number of
non-zero terms is ⌊log𝑝 𝑛⌋).
The multiples of 𝑝2 contain at least two copies of 𝑝, but we considered only one of
these so far. Thus every multiple of 𝑝2 yields a new 𝑝. The number of these newcomers
is ⌊𝑛/𝑝2 ⌋, similar to the previous case.
We can continue similarly. Every multiple of 𝑝3 gives rise to a new 𝑝 since there
are at least three factors of 𝑝 in them and we took only two of them into consideration
in the first two steps of our argument. This means a further ⌊𝑛/𝑝3 ⌋ copies of 𝑝, etc.
The procedure terminates in finitely many steps, since if 𝑝𝑘 > 𝑛, then none of the
numbers 1, 2, . . . , 𝑛 is divisible by 𝑝𝑘 .
This method counted every prime occurring in 𝑛! exactly once, hence 𝛼𝑝 is equal
to the sum in (1.6.2). □
Exercises 1.6
(We always mean a positive integer by number, divisor, prime, etc. in the exercises.)
1. How can we see from the standard form that a given integer is a square, a cube, or
in general, a 𝑘th power (of a positive integer)?
2. (a) Demonstrate that if the product of two coprime integers is a 𝑘th power, then
the factors are 𝑘th powers.
(b) How should we modify this assertion if we consider all integers (instead of
positive numbers)?
(c) How does the statement generalize for more factors?
S 3. Prove that the product of
(a) 2
(b) 3
* (c) 4
consecutive (positive) integers is never a power of an integer with exponent greater
than one.
Remark: It is true in general that the product of consecutive integers is never a
power. This long-standing conjecture of Catalan was proven by Paul Erdős and
John Selfridge in 1975.
S* 28. Finitely many monkeys sit around a round table and play the following game. In
front of each monkey there is a dime on the table. At a command, each monkey
checks the coin of her right neighbor: if it shows head, then she turns her own coin;
if it shows tail, then she leaves her coin as it was. They repeat this procedure till
all coins show tails. What can the number of monkeys be if the game terminates
for every initial position of the coins?
S* 29. Show that each of the integers 𝑛! +1, . . . , 𝑛! +𝑛 has a prime divisor that divides
none of the other 𝑛 − 1 numbers.
S 30. Consider 5000 distinct positive integers where any ten of them have the same lcm.
At most how many of them can be pairwise coprime?
31. Which positive integers 𝑛 satisfy 𝑛 ∣ 𝑘2 ⟹ 𝑛 ∣ 𝑘 (i.e. 𝑛 can divide a square of a
number only if it divides the number itself)?
32. Show that the difference of two 𝑘th powers never divides their sum (for 𝑘 > 1).
5
33. Prove that (a) √100 (b) log6 18 are irrational numbers.
S* 34. Given a positive integer 𝑚, consider all sets of integers 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑡 where
𝑎1 = 𝑚 and 𝑎1 𝑎2 . . . 𝑎𝑡 is a square (𝑡 = 1 is allowed). We denote the smallest
possible value of 𝑎𝑡 by 𝑆(𝑚). For example, 𝑆(1) = 1, 𝑆(2) = 6 since the product
2 ⋅ 3 ⋅ 6 is the best choice for 𝑚 = 2, 𝑆(3) = 8, 𝑆(4) = 4, etc.
Prove that the sequence 𝑆(2), 𝑆(3), 𝑆(4), . . . contains exactly the positive composite
numbers and each of them occurs exactly once.
S* 35. (a) Can distinct powers form an infinite arithmetic progression?
(b) Can distinct powers form finite arithmetic progressions of arbitrary length?
Chapter 2
Congruences
We study the basic facts concerning congruences in this chapter. After introducing the
notion of congruence, we investigate residue classes, residue systems, and Euler’s func-
tion 𝜑. We prove the theorems of Euler–Fermat and Wilson, using linear congruences
for the latter one. Related to linear congruences, we treat also simultaneous systems
of congruences. We shall learn more about congruences in Chapters 3 and 4.
Definition 2.1.1. Let 𝑎 and 𝑏 be integers and 𝑚 a positive integer. We say that 𝑎 is
congruent to 𝑏 modulo 𝑚 if 𝑚 ∣ 𝑎 − 𝑏. ♣
𝑎 ≡ 𝑏 (mod 𝑚) ⟺ 𝑏 ≡ 𝑎 (mod 𝑚) ,
and so we may say also that “𝑎 and 𝑏 are congruent modulo 𝑚”. (Instead of “modulo 𝑚”,
we can use the expressions “mod 𝑚,” or “with respect to the modulus 𝑚,” or “related
to the modulus 𝑚,” as well.)
Clearly, 𝑎 and 𝑏 are congruent modulo 𝑚 if and only if 𝑎 and 𝑏 give the same
(least non-negative) remainder when they are divided by 𝑚. (The same holds for the
remainder of least absolute value.)
If 𝑎 and 𝑏 are not congruent modulo 𝑚, we write 𝑎 ≢ 𝑏 (mod 𝑚), and we say that
𝑎 and 𝑏 are incongruent modulo 𝑚 (or 𝑎 is incongruent to 𝑏 modulo 𝑚).
37
38 2. Congruences
Clearly, any two integers are congruent with respect to the modulus 𝑚 = 1.
The definition of congruence can trivially be extended for 𝑚 < 0, but we can ignore
it since 𝑚 ∣ 𝑎 − 𝑏 if and only if −𝑚 ∣ 𝑎 − 𝑏.
Theorem 2.1.2. (i) 𝑎 ≡ 𝑎 (mod 𝑚) for every 𝑎.
(ii) 𝑎 ≡ 𝑏 (mod 𝑚) ⟹ 𝑏 ≡ 𝑎 (mod 𝑚).
(iii) 𝑎 ≡ 𝑏 (mod 𝑚) and 𝑏 ≡ 𝑐 (mod 𝑚) ⟹ 𝑎 ≡ 𝑐 (mod 𝑚).
(iv) 𝑎 ≡ 𝑏 (mod 𝑚) and 𝑐 ≡ 𝑑 (mod 𝑚) ⟹ 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 (mod 𝑚) and 𝑎 − 𝑐 ≡ 𝑏 − 𝑑
(mod 𝑚).
(v) 𝑎 ≡ 𝑏 (mod 𝑚) and 𝑐 ≡ 𝑑 (mod 𝑚) ⟹ 𝑎𝑐 ≡ 𝑏𝑑 (mod 𝑚). ♣
Proof. All the assertions follow easily from the definition of congruence and the ele-
mentary properties of divisibility, hence we verify only property (v) as an illustration.
We rewrite the assumptions as 𝑚 ∣ 𝑎 − 𝑏 and 𝑚 ∣ 𝑐 − 𝑑 which imply
𝑚 ∣ 𝑐(𝑎 − 𝑏) + 𝑏(𝑐 − 𝑑) = 𝑎𝑐 − 𝑏𝑑, so 𝑎𝑐 ≡ 𝑏𝑑 (mod 𝑚) . □
Properties (i), (ii), and (iii) express that congruence is reflexive, symmmetric, and
transitive, hence it is an equivalence relation. We can thus divide the integers into (pair-
wise) disjoint sets of numbers congruent to each other, i.e. those that give the same
remainder when divided by 𝑚. (Properties (i)–(iii) guarantee that the expression “con-
gruent to each other” makes sense.) These sets are called residue classes modulo 𝑚. We
shall study them in Section 2.2.
By (iv) and (v), congruences (with the same modulus) can be added, subtracted,
and multiplied. This implies immediately that we can add the same number to both
sides of a congruence, and this holds also for subtraction and multiplication. Further,
a congruence can be multiplied by itself arbitrarily many times, so we may raise a con-
gruence to a power with a positive integer exponent:
(vi) 𝑎 ≡ 𝑏 (mod 𝑚) ⟹ 𝑎 + 𝑐 ≡ 𝑏 + 𝑐 (mod 𝑚) and 𝑎 − 𝑐 ≡ 𝑏 − 𝑐 (mod 𝑚).
(vii) 𝑎 ≡ 𝑏 (mod 𝑚) ⟹ 𝑎𝑐 ≡ 𝑏𝑐 (mod 𝑚).
(viii) 𝑎 ≡ 𝑏 (mod 𝑚) ⟹ 𝑎𝑛 ≡ 𝑏𝑛 (mod 𝑚).
The repeated application of these relations yields the useful law:
(ix) Let 𝑓 be a polynomial with integer coefficients. Then
𝑎 ≡ 𝑏 (mod 𝑚) ⟹ 𝑓(𝑎) ≡ 𝑓(𝑏) (mod 𝑚) .
E3 Verify that 232 +1 is a composite number. (Cf. with Exercise 1.4.4 and Section 5.2.)
Solution: We establish the divisibility 641 ∣ 232 + 1 relying on
641 = 54 + 24 = 5 ⋅ 27 + 1.
We infer
−1 ≡ 5 ⋅ 27 (mod 641) and 54 ≡ −24 (mod 641) .
Raising the first congruence to the fourth power and substituting the result into
the second one, we obtain
1 = (−1)4 ≡ 54 ⋅ 228 ≡ −24 ⋅ 228 = −232 (mod 641) ,
so 641 ∣ 232 + 1.
𝑎𝑐 ≡ 𝑏𝑐 (mod 𝑚) ⟺ 𝑚 ∣ (𝑎 − 𝑏)𝑐,
An important special case of Theorem 2.1.3 is when 𝑐 and the modulus are co-
prime. Then the congruence remains valid with the same modulus after cancellation
by 𝑐:
Theorem 2.1.3A.
Exercises 2.1
3. Give a new proof using congruences for the divisibility rules by 9 and 11 (Exer-
cise 1.1.14) and for their generalizations in other number systems (Exercise 1.2.14).
4. True or false?
5. There are several digits that can not be the last one in the decimal representation
of a square. How many such digits can be found in the number system of base 101?
7. Verify: 𝑚 ∣ 𝑎 − 𝑏 ⟹ 𝑚2 ∣ 𝑎𝑚 − 𝑏𝑚 .
8. Assuming 3 ∤ 𝑎 and (6, 𝑛) = 1, prove 𝑎𝑛 ≡ 𝑏𝑛 (mod 3𝑛 ) ⟹ 𝑎 ≡ 𝑏 (mod 3𝑛 ).
9. Let 𝑝 > 2 be a prime and 1 ≤ 𝑘 ≤ 𝑝−1. Verify the following congruences modulo 𝑝:
(a) (𝑘𝑝) ≡ 0
(b) (𝑝−1
𝑘
) ≡ (−1)𝑘
(c) (𝑝−2
𝑘
) ≡ (−1)𝑘 (𝑘 + 1).
10. Determine all primes 𝑝 for which the remainder of (3𝑝
𝑝
) when divided by 𝑝 is 𝑝 − 2.
* 11. Let 𝑝 be a prime. Prove the following congruences modulo 𝑝:
𝑛
(a) (𝑛𝑝) ≡ ⌊ 𝑝 ⌋
𝑛
(b) (𝑘𝑝) ≡ (⌊𝑛/𝑝⌋
𝑘
)
𝑛
(c) (𝑝𝑛𝑘 ) ≡ ⌊ 𝑝𝑘 ⌋.
Notation: (𝑎)𝑚 . If there is no ambiguity, we can omit the index 𝑚 referring to the
modulus.
Thus, the residue class (𝑎)𝑚 is an infinite arithmetic progression in both directions
with difference 𝑚 and 𝑎 being one of its elements. There are 𝑚 residue classes mod 𝑚,
and each contains infinitely many numbers. By the definition, (𝑎)𝑚 = (𝑐)𝑚 if and only
if 𝑎 ≡ 𝑐 (mod 𝑚).
Example. (23)7 = {. . . , −5, 2, 9, 16, 23, 30, . . . } = (100)7 .
Definition 2.2.2. Given the modulus 𝑚, choosing one element from each residue
class, we obtain a complete residue system modulo 𝑚. ♣
Example. {33, −5, 11, −11, −8} is a complete residue system modulo 5.
Proof. Let 𝐶𝑚 be a complete residue system modulo 𝑚. Since there are 𝑚 residue
classes and we picked one element from each class, 𝐶𝑚 contains exactly 𝑚 numbers.
Further, we took each number from a different residue class, hence the elements of 𝐶𝑚
are pairwise incongruent modulo 𝑚.
Conversely, consider 𝑚 integers pairwise incongruent modulo 𝑚. Then they be-
long to distinct residue classes. Since their number is 𝑚, they represent 𝑚 residue
classes, i.e. all classes are represented. Thus, these integers form a complete residue
system modulo 𝑚. □
Proof. Since the new system has 𝑚 elements, it is enough to show, by Theorem 2.2.3,
that the elements are pairwise incongruent mod 𝑚. We have to prove that 𝑎𝑟 𝑖 + 𝑏 ≡
𝑎𝑟𝑗 + 𝑏 (mod 𝑚) implies 𝑖 = 𝑗. Subtracting 𝑏 from both sides, we obtain 𝑎𝑟 𝑖 ≡ 𝑎𝑟𝑗
(mod 𝑚). Since (𝑎, 𝑚) = 1, by Theorem 2.1.3A, we can cancel 𝑎: 𝑟 𝑖 ≡ 𝑟𝑗 (mod 𝑚), and
so 𝑖 = 𝑗, indeed. □
Note that for (𝑎, 𝑚) ≠ 1, the integers 𝑎𝑟 𝑖 +𝑏 never form a complete residue system;
see Exercise 2.2.11.
We examine now the distribution of the integers coprime to the modulus in the
residue classes. It turns out that in a residue class, either all elements, or no elements
are coprime to the modulus:
Let 𝑎 ≡ 𝑏 (mod 𝑚). Then (𝑎, 𝑚) = 1 if and only if (𝑏, 𝑚) = 1.
2.2. Residue Systems and Residue Classes 43
The residue classes with elements coprime to the modulus play an important role
in the sequel:
Definition 2.2.6. A residue class (𝑎)𝑚 is called a reduced residue class (mod 𝑚) if
(𝑎, 𝑚) = 1. ♣
The simplest way to obtain a reduced residue system is to select the elements co-
prime to the modulus from the least non-negative remainders or from the remainders
of least absolute value.
Now, we prove the analogues of Theorems 2.2.3 and 2.2.4 for reduced residue sys-
tems.
Theorem 2.2.9. A set of integers forms a reduced residue system modulo 𝑚 if and only
if
(i) their number is 𝜑(𝑚)
(ii) they are pairwise incongruent modulo 𝑚 and
(iii) each of them is coprime to 𝑚. ♣
44 2. Congruences
Proof. Let 𝑅𝑚 be a reduced residue system modulo 𝑚. Since there are 𝜑(𝑚) reduced
residue classes and we picked one element from each, 𝑅𝑚 contains exactly 𝜑(𝑚) el-
ements. Further, because we took each element from a different residue class, the
elements of 𝑅𝑚 are pairwise incongruent modulo 𝑚. Finally, every element of 𝑅𝑚 is
coprime to 𝑚, since they were chosen from reduced residue classes.
Conversely, consider 𝜑(𝑚) pairwise incongruent integers modulo 𝑚 that are co-
prime to 𝑚. The pairwise incongruence and the relative primeness guarantee that they
belong to distinct reduced residue classes. Since their number is 𝜑(𝑚), they represent
𝜑(𝑚) reduced residue classes, i.e. all classes are represented. Thus, these integers form
a reduced residue system modulo 𝑚. □
Theorem 2.2.10. If 𝑟1 , 𝑟2 , . . . , 𝑟𝜑(𝑚) is a reduced residue system modulo 𝑚 and (𝑎, 𝑚) = 1,
then
𝑎𝑟1 , 𝑎𝑟2 , . . . , 𝑎𝑟𝑚
is also a reduced residue system modulo 𝑚. ♣
Note that for (𝑎, 𝑚) ≠ 1, the integers 𝑎𝑟 𝑖 never form a reduced residue system, and
moreover none of them is coprime to 𝑚.
Adding an integer 𝑏 to the elements of a reduced residue system will not, in gen-
eral, yield a reduced residue system, a significant difference from the complete residue
systems. See Exercise 2.2.12.
Exercises 2.2
𝑟
𝛼 𝛼 𝛼 𝛼
𝑛 = 𝑝1 1 𝑝2 2 . . . 𝑝𝑟 𝑟 = ∏ 𝑝𝑖 𝑖 , where 𝛼𝑖 > 0.
𝑖=1
Then
𝑟
𝛼 𝛼 −1 𝛼 𝛼 −1 𝛼 𝛼 −1
𝜑(𝑛) = (𝑝1 1 − 𝑝1 1 ) . . . (𝑝𝑟 𝑟 − 𝑝𝑟 𝑟 ) = ∏ (𝑝𝑖 𝑖 − 𝑝𝑖 𝑖 ). ♣
𝑖=1
This formula for 𝜑(𝑛) is valid only if the exponents 𝛼𝑖 in the standard form of 𝑛
are positive (in contrast e.g. to the formula for 𝑑(𝑛) in Theorem 1.6.3 which remains
valid even if we allow 0 to occur among the exponents 𝛼𝑖 ). Some equivalent forms of
the formula are:
𝑟 𝑟
𝛼 −1 1 1
𝜑(𝑛) = ∏ 𝑝𝑖 𝑖 (𝑝 𝑖 − 1) = 𝑛 ∏ (1 − ) = 𝑛 ∏ (1 − ) .
𝑖=1 𝑖=1
𝑝𝑖 𝑝∣𝑛
𝑝
𝑝 prime
We give two proofs of Theorem 2.3.1. A third one can be derived from Exercise 6.5.4b.
Also, Exercises 2.2.14 and 2.6.10 contain two further verifications of assertion II which
is the key step in the first proof.
First proof. We infer the theorem from the two propositions below:
These imply the theorem: It follows from II by induction on the number of factors
that if the integers 𝑎1 , . . . , 𝑎𝑟 are pairwise coprime, then 𝜑(𝑎1 . . . 𝑎𝑟 ) = 𝜑(𝑎1 ) . . . 𝜑(𝑎𝑟 ).
𝛼 𝛼
Applying this for 𝑎𝑖 = 𝑝𝑖 𝑖 and substituting the value for 𝜑(𝑝𝑖 𝑖 ) obtained in I, we arrive
at the desired formula.
We start with the verification of I. An integer is coprime to 𝑝𝛼 if and only if it is not
divisible by 𝑝. Hence, we obtain the coprime integers to 𝑝𝛼 among 1, 2, . . . , 𝑝𝛼 , if we
discard the multiples of 𝑝. We thus discard 𝑝, 2𝑝, . . . , 𝑝𝛼−1 𝑝, which are 𝑝𝛼 /𝑝 = 𝑝𝛼−1
numbers. This implies that 𝜑(𝑝𝛼 ) = 𝑝𝛼 − 𝑝𝛼−1 integers remain.
Now, we turn to the proof of II. (As indicated earlier, two other methods are avail-
able in Exercises 2.2.14 and 2.6.10.)
The number 𝜑(𝑎𝑏) is the number of positive integers not greater than 𝑎𝑏 that are
coprime to 𝑎𝑏, i.e. are relatively prime to both 𝑎 and 𝑏.
Denoting the smallest positive elements of the reduced residue classes modulo 𝑎
by 𝑟1 , 𝑟2 , . . . , 𝑟𝜑(𝑎) , we enumerate all positive integers not greater than 𝑎𝑏 and coprime
48 2. Congruences
to 𝑎:
𝑟1 𝑟2 ... 𝑟𝜑(𝑎)
𝑎 + 𝑟1 𝑎 + 𝑟2 ... 𝑎 + 𝑟𝜑(𝑎)
(2.3.1) 2𝑎 + 𝑟1 2𝑎 + 𝑟2 ... 2𝑎 + 𝑟𝜑(𝑎)
⋮ ⋮ ⋮
(𝑏 − 1)𝑎 + 𝑟1 (𝑏 − 1)𝑎 + 𝑟2 ... (𝑏 − 1)𝑎 + 𝑟𝜑(𝑎)
We have to select those numbers from (2.3.1) that are coprime also to 𝑏.
Consider an arbitrary column of the table. For example, the integers in column 𝑖
are
(2.3.2) 𝑟 𝑖 , 𝑎 + 𝑟 𝑖 , 2𝑎 + 𝑟 𝑖 , . . . , (𝑏 − 1)𝑎 + 𝑟 𝑖 .
A simple direct calculation verifies that the right-hand side of (2.3.3) is equal to the
product
𝑟
1
𝑛 ∏ (1 − ) ,
𝑖=1
𝑝 𝑖
Exercises 2.3
(b3) 7
(b4) 10.
12. Which integers occur in the range of the function 𝑛/𝜑(𝑛)?
13. Prove that 𝜑(𝑛2 ) = 𝜑(𝑘2 ) holds only for 𝑛 = 𝑘.
14. Verify ∑𝑑∣𝑛 𝜑(𝑑) = 𝑛.
15. Show that 𝜑(𝑛) → ∞ if 𝑛 → ∞.
* 16. Demonstrate that for every positive integer 𝑘 there exists an 𝑛 satisfying 𝜑(𝑛) =
𝜑(𝑛 + 𝑘).
* 17. Exhibit 1000 distinct integers where the function 𝜑 assumes the same value.
S* 18. Determine all 𝑛 satisfying 𝜑(𝑛! ) = 𝑘! for some 𝑘.
S* 19. For which 𝑚 can a reduced residue system mod 𝑚 form an arithmetic progression?
Note that for a prime 𝑝, the conditions (𝑎, 𝑝) = 1, 𝑝 ∤ 𝑎, and 𝑎 ≢ 0 (mod 𝑝) are
equivalent.
From Theorem 2.4.1A, it is easy to get a congruence valid for every 𝑎:
Theorem 2.4.1B (Second form of Fermat’s Little Theorem). If 𝑝 is a prime, then 𝑎𝑝 ≡ 𝑎
(mod 𝑝) holds for every 𝑎.
Remarks: (1) The converse of the Euler–Fermat Theorem (Theorem 2.4.1) is also true,
i.e. (𝑎, 𝑚) = 1 is not only a sufficient, but also a necesssary condition for 𝑎𝜑(𝑚) ≡
1 (mod 𝑚). In fact, the following stronger proposition holds: There exists an
exponent 𝑘 > 0 such that 𝑎𝑘 ≡ 1 (mod 𝑚) only if 𝑎 and 𝑚 are coprime. Namely,
𝑎𝑘 ≡ 1 (mod 𝑚) implies (𝑎𝑘 , 𝑚) = (1, 𝑚) = 1 by Theorem 2.2.5, hence also
(𝑎, 𝑚) = 1 must hold.
(2) The second form of Fermat’s Little Theorem (Theorem 2.4.1B) has no natural gen-
eralization for arbitrary modulus 𝑚, i.e. there exists no simple variant of the gen-
eral Euler–Fermat Theorem that would be valid for every 𝑎 (see Exercise 2.4.15).
(3) As their names indicate, Theorems 2.4.1A and B are due to Fermat. Both variants
can be verified directly, without relying on Theorem 2.4.1. Form B can be proven
by induction (on 𝑎), and form A follows easily (see Exercise 2.4.16). Theorem 2.4.1
was found by Euler as a generalization of Fermat’s Little Theorem.
(4) The adjective “little” serves to distinguish this result from Fermat’s Last Theorem
which is a very famous and only recently solved problem of mathematics. We
shall treat this topic in Chapter 7.
Exercises 2.4
7. Show that 𝑎88 − 𝑏88 is not divisible by 23 if and only if exactly one of 𝑎 and 𝑏 is
divisible by 23.
8. Let 𝑝 be a prime and 𝑟1 , . . . , 𝑟𝑝 be a complete residue system mod 𝑝. Prove that also
2𝑝−3 2𝑝−3
𝑟1 , . . . , 𝑟𝑝 is a complete residue system mod 𝑝.
9. (a) Let 𝑝 be a prime, 𝑎 an integer, and 𝑖 and 𝑗 positive integers satisfying 𝑖 ≡ 𝑗
(mod 𝑝 − 1). Prove 𝑎𝑖 ≡ 𝑎𝑗 (mod 𝑝).
(b) How can we generalize the assertion in (a) for arbitrary 𝑚 (instead of primes)?
10. True or false? (With decimal notation and powers with positive integer exponents.)
(a) Infinitely many powers of 133 terminate with the string 133.
(b) Infinitely many powers of 134 terminate with the string 134.
(c) Infinitely many powers of 136 terminate with the string 136.
11. Show that an infinite arithmetic progression of distinct positive integers 𝑎, 𝑎+𝑑, . . . ,
𝑎 + 𝑘𝑑, . . . contains infinitely many powers of 𝑎 (with positive integer exponents)
if and only if 𝑑/(𝑎, 𝑑) and 𝑎 are coprime.
12. Give a new solution to Exercise 1.3.12a using the Euler–Fermat Theorem.
13. Verify that every positive odd divisor of 𝑛2 + 1 is of the form 4𝑘 + 1.
14. Assume that 19 divides 𝑎40 + 𝑏40 . Show that then 19 must divide both 𝑎 and 𝑏, as
well.
15. Verify the following propositions and investigate their relation to Fermat’s Little
Theorem.
(a) 𝑎𝜑(𝑚)+1 ≡ 𝑎 (mod 𝑚) holds for every 𝑎 if and only if 𝑚 is squarefree.
(b) 𝑎𝑚 ≡ 𝑎𝑚−𝜑(𝑚) (mod 𝑚) holds for every 𝑚 and 𝑎.
(c) 𝑎1729 ≡ 𝑎 (mod 1729) holds for every 𝑎.
16. Give a direct proof of both versions of Fermat’s Little Theorem: First verify Theo-
rem 2.4.1B by induction and then deduce Theorem 2.4.1A.
Clearly, if 𝑠 is a solution, then every other element of the residue class (𝑠)𝑚 is a
solution, too. Hence, to find all solutions, it is enough to check a complete residue
system to see which elements of it satisfy the congruence; then all solutions are the
integers congruent to them.
Therefore the number of solutions of a linear congruence is defined as how many
pairwise incongruent integers satisfy the congruence, i.e. what is the number of residue
2.5. Linear Congruences 53
classes the solutions come from, or (again in a slightly different formulation) how many
elements of a complete residue system make the congruence valid. The same applies
for congruences of higher degree as well, thus we define this convention immediately
for the general case.
Definition 2.5.2. Let 𝑓 be a polynomial with integer coefficients. The number of so-
lutions of the congruence 𝑓(𝑥) ≡ 0 (mod 𝑚) is how many elements 𝑠 of a complete
residue system modulo 𝑚 satisfy 𝑓(𝑠) ≡ 0 (mod 𝑚). ♣
Since 𝑢 ≡ 𝑣 (mod 𝑚) ⟹ 𝑓(𝑢) ≡ 𝑓(𝑣) (mod 𝑚), this notion does not depend on
which complete residue system modulo 𝑚 we considered.
Returning to linear congruences, we want to answer the following questions aris-
ing for equations in general:
(i) What is a necessary and sufficient condition for solvability?
(ii) How many solutions do we have?
(iii) How can we describe or characterize all solutions?
(iv) Which methods yield these solutions?
We discuss solvability first.
We see from the proof that the linear congruence 𝑎𝑥 ≡ 𝑏 (mod 𝑚) and the linear
Diophantine equation 𝑎𝑥 + 𝑚𝑦 = 𝑏 can be deduced from each other. (Moreover, the
linear Diophantine equation 𝑎𝑥 + 𝑚𝑦 = 𝑏 can also be transformed into the linear
congruence 𝑚𝑦 ≡ 𝑏 (mod |𝑎|) if 𝑎 ≠ 0.)
Based on this, every result obtained for linear congruences can be used also for
linear Diophantine equations and vice versa.
We should be aware, however, of the significant differences: The solutions of a lin-
ear congruence are integers (or rather residue classes), whereas the solutions of a linear
Diophantine equation are pairs of integers; the number of solutions of a congruence is
finite, but a linear Diophantine equation has infinitely many solutions, etc.
In the next theorem, we determine the number of solutions of a linear congruence,
and also see how we can get all solutions from a given one.
54 2. Congruences
Theorem 2.5.4. (I) If 𝑎𝑥 ≡ 𝑏 (mod 𝑚) is solvable, then there are (𝑎, 𝑚) solutions.
(II) Let (𝑎, 𝑚) = 𝑑, 𝑚 = 𝑑𝑚1 , and 𝑠 be a solution of 𝑎𝑥 ≡ 𝑏 (mod 𝑚). Then
(2.5.1) 𝑠, 𝑠 + 𝑚1 , 𝑠 + 2𝑚1 , ... , 𝑠 + (𝑑 − 1)𝑚1
are pairwise incongruent modulo 𝑚, satisfy the congruence, and every solution is
congruent to one of them modulo 𝑚. ♣
The most important special case of the linear congruence 𝑎𝑥 ≡ 𝑏 (mod 𝑚) is when
(𝑎, 𝑚) = 1. Then (𝑎, 𝑚) ∣ 𝑏 holds automatically, so the congruence is solvable, by The-
orem 2.5.3, and it has (𝑎, 𝑚) = 1 (pairwise incongruent) solutions, by Theorem 2.5.4.
2.5. Linear Congruences 55
We make some general preliminary remarks concerning methods for finding the
solutions.
(A) In general, it is advisable to check by the criterion of Theorem 2.5.3 whether the
congruence is solvable at all.
(B) If (𝑎, 𝑚) = 1, then the congruence is satisfied by the elements of just one residue
class, so if we find somehow a solution, then we are done. Also, in the general
case, it is sufficient to guess a single solution because we can easily obtain all
solutions by Theorem 2.5.4/II.
(C) In most cases, the best start is to reduce the original linear congruence to one
where the coefficient of 𝑥 and the modulus are coprime. We can do this as follows.
If 𝑎𝑥 ≡ 𝑏 (mod 𝑚) is solvable, then (𝑎, 𝑚) ∣ 𝑏. Let 𝑑 = (𝑎, 𝑚), then
𝑎 = 𝑑𝑎1 , 𝑚 = 𝑑𝑚1 , 𝑏 = 𝑑𝑏1 , and (𝑎1 , 𝑚1 ) = 1.
Hence, we can divide the congruence by 𝑑 (including also the modulus): 𝑎𝑥 ≡ 𝑏
(mod 𝑚) is equivalent to 𝑎1 𝑥 ≡ 𝑏1 (mod 𝑚1 ) and here (𝑎1 , 𝑚1 ) = 1. (Looking at
the corresponding Diophantine equations, this just means that 𝑎𝑥 + 𝑚𝑦 = 𝑏 is
divided by 𝑑 to yield 𝑎1 𝑥 + 𝑚1 𝑦 = 𝑏1 .)
The word “equivalent” in the previous paragraph should remind us that though
the two congruences are satisfied by the same integers, we have to group them into
residue classes of different moduli: mod 𝑚 at the first congruence and mod 𝑚1 at the
second one. As a consequence, the two congruences will differ also in the number of
solutions (for 𝑑 > 1).
We turn now to the detailed discussion of a few methods for finding the solutions
of a linear congruence. Each will be illustrated by an example.
M1 Trial. We check each element of a complete residue system modulo 𝑚 to see if it
satisfies the congruence. (This should be applied only for very small moduli.)
E1 23𝑥 ≡ 11 (mod 5). To make calculations simpler, it is worthwhile to replace the
coefficients with congruent numbers having smaller (absolute) value before substitut-
ing into 𝑥: 3𝑥 ≡ 1 (mod 5) or −2𝑥 ≡ 1 (mod 5). Testing the numbers 0, 1, 2, 3, 4 (or
0, ±1, ±2), we obtain that the residue class 𝑥 ≡ 2 (mod 5) is the only solution. (Since
(23, 5) = 1 implies that there is only one solution, after finding it we do not have to
check more numbers.)
M2 Diophantine equation. We reduce the linear congruence to a Diophantine equation
as seen in the proof of Theorem 2.5.3, and then reconstitute its solutions into solutions
of the congruence.
E2 18𝑥 ≡ 38 (mod 28). The corresponding Diophantine equation is 18𝑥 + 28𝑦 = 38.
Dividing by 2, we obtain 9𝑥 +14𝑦 = 19. Following the proof of Theorem 1.3.6, we write
the gcd of 9 and 14 in form 9𝑢+14𝑣. From the Euclidean algorithm or after a few trials,
56 2. Congruences
𝜑(𝑚 )−1
Hence, 𝑥 = 𝑎1 1 𝑏1 is a solution of the original congruence, too. Finally, we can
obtain all solutions from Theorem 2.5.4/II.
E3 36𝑥 ≡ 81 (mod 21). Here (36, 21) = 3, hence we can reduce the problem to the
congruence 12𝑥 ≡ 27 (mod 7). Decreasing the coefficients, we obtain −2𝑥 ≡ −1
(mod 7). Its solution is 𝑥 = (−2)6−1 (−1) ≡ 4 (mod 7). Thus, all solutions of the
original congruence are 𝑥 ≡ 4, 11, 18 (mod 21).
Reducing the coefficients in the congruence 12𝑥 ≡ 27 (mod 7), we may choose
the least non-negative remainders instead of the ones with least absolute value. Then
we get 5𝑥 ≡ 6 (mod 7) and 𝑥 ≡ 55 ⋅ 6 (mod 7).
Since (12, 7) = 1, 12𝑥 ≡ 27 (mod 7) has a unique solution modulo 7, i.e. 55 ⋅ 6 ≡ 4
(mod 7) For a direct verification, one should not compute the actual value of 55 but
rather take the remainders modulo 7 while raising to powers:
(mod 27) by 11: 55𝑥 ≡ 22 (mod 27) and since 55 ≡ 1 (mod 27) we obtain 𝑥 ≡ 22(≡ −5)
(mod 27).
So the solutions of the original congruence are 𝑥 ≡ −5, 22, 49, 76 (mod 108).
Comparing the above methods, M3 or M4 could seem to be the easiest to apply at
first sight. It turns out, however, that only M2 works for large moduli. This will be
treated in Section 5.7.
Exercises 2.5
The proof will yield a method for finding the solutions; one has to solve a linear
Diophantine equation (or, equivalently, a linear congruence).
This means that the system of congruences (2.6.1) can be reduced to the linear
Diophantine equation (2.6.4).
By Theorem 1.3.6, it is solvable if and only if (𝑚1 , 𝑚2 ) ∣ 𝑐 1 − 𝑐 2 , hence the same
applies for (2.6.1).
As we indicated before the proof, we also obtained a method of finding the solu-
tions: we have to solve Diophantine equation (2.6.4) or a corresponding congruence.
II. Let 𝑠 be a solution so
𝑠 ≡ 𝑐 1 (mod 𝑚1 ) ,
(2.6.5)
𝑠 ≡ 𝑐 2 (mod 𝑚2 ) .
2.6. Simultaneous Systems of Congruences 59
The most importamt special case is when the moduli 𝑚1 and 𝑚2 in system (2.6.1)
are coprime. Then (𝑚1 , 𝑚2 ) ∣ 𝑐 1 − 𝑐 2 holds automatically, so the system of congruences
is solvable and the solutions form a unique residue class modulo 𝑚1 𝑚2 . We state this
important result as a theorem:
Theorem 2.6.1A. If (𝑚1 , 𝑚2 ) = 1, then the simultaneous system of congruences
𝑥 ≡ 𝑐 1 (mod 𝑚1 )
𝑥 ≡ 𝑐 2 (mod 𝑚2 )
is solvable for arbitrary 𝑐 1 and 𝑐 2 , and the solutions form a single residue class modulo
𝑚1 𝑚2 .
Theorem 2.6.1A implies that if 𝑚1 and 𝑚2 are coprime, then the remainder of a
number when divided by 𝑚1 is independent of its remainder mod 𝑚2 . For example, the
last digits of an integer give its remainder modulo a power of 10 and they provide no
information on the remainder, say, modulo 3, 7, or 13, since these moduli are coprime
to 10.
Turning to systems consisting of more than two congruences, we deal only with the
case when the moduli are pairwise coprime (see Exercise 2.6.13 for the general case).
This result was known by the Chinese mathematician Sun Tsu about 2000(!) years ago,
therefore it is generally referred to as the Chinese Remainder Theorem.
Theorem 2.6.2 (Chinese Remainder Theorem). Let 𝑚1 , . . . , 𝑚𝑘 be pairwise coprime.
Then the system of congruences
𝑥 ≡ 𝑐 1 (mod 𝑚1 )
𝑥 ≡ 𝑐 2 (mod 𝑚2 )
(2.6.8)
⋮
𝑥 ≡ 𝑐 𝑘 (mod 𝑚𝑘 )
is solvable for any integers 𝑐 1 , . . . , 𝑐 𝑘 , and the solutions form one residue class modulo
𝑚1 𝑚2 . . . 𝑚 𝑘 . ♣
First proof. We can easily obtain the result from Theorem 2.6.1A by induction on 𝑘.
The case 𝑘 = 2 is just Theorem 2.6.1A.
60 2. Congruences
Assume now that the statement is true for systems of 𝑘 − 1 congruences, and
consider the system (2.6.8) of 𝑘 congruences. The integers satsifying the first 𝑘 − 1
congruences constitute one residue class modulo 𝑚1 𝑚2 . . . 𝑚𝑘−1 by the induction hy-
pothesis, so we can replace the first 𝑘 − 1 congruences by the congruence 𝑥 ≡ 𝑐
(mod 𝑚1 𝑚2 . . . 𝑚𝑘−1 ) with a suitable integer 𝑐. Thus, (2.6.8) is equivalent to the system
𝑥 ≡ 𝑐 (mod 𝑚1 𝑚2 . . . 𝑚𝑘−1 )
(2.6.9)
𝑥 ≡ 𝑐 𝑘 (mod 𝑚𝑘 )
Applying Theorem 2.6.1A to (2.6.9), we obtain just the statement for 𝑘. □
Second proof. We show a new argument for solvability and we produce a solution in
an explicit form (in a certain sense).
The procedure reminds us somewhat of the construction of the interpolation poly-
nomials by Lagrange.
We consider first the special case of (2.6.8) when one 𝑐 𝑖 is 1 and all other 𝑐𝑗 are 0,
and then use this result to solve the general case.
Let us see the details. Let
𝑀
𝑀 = 𝑚1 . . . 𝑚𝑘 and 𝑀𝑖 = , 𝑖 = 1, 2, . . . , 𝑘.
𝑚𝑖
Since the moduli 𝑚1 , . . . , 𝑚𝑘 are pairwise coprime,
(2.6.10) (𝑀𝑖 , 𝑚𝑖 ) = 1, 𝑖 = 1, 2, . . . , 𝑘.
I. We fix an index 1 ≤ 𝑖 ≤ 𝑛 and solve the problem in the special case when 𝑐 𝑖 = 1 and
𝑐𝑗 = 0 for 𝑗 ≠ 𝑖 in (2.6.8).
The congruences 𝑥 ≡ 0 (mod 𝑚𝑗 ) mean that 𝑥 is a multiple of every 𝑚𝑗 with 𝑗 ≠ 𝑖.
The moduli 𝑚𝑗 are pairwise coprime, hence equivalently 𝑥 is a multiple of the product
𝑀𝑖 of the numbers 𝑚𝑗 : 𝑥 = 𝑀𝑖 𝑧.
Substituting this in the remaining congruence 𝑥 ≡ 1 (mod 𝑚𝑖 ), we obtain
(2.6.11) 𝑀𝑖 𝑧 ≡ 1 (mod 𝑚𝑖 ) .
𝛼 𝛼
form of 𝑚 is 𝑚 = 𝑝1 1 . . . 𝑝𝑟 𝑟 , then the congruence
(2.6.13) 𝑓(𝑥) ≡ 0 (mod 𝑚)
is equivalent to the system
𝛼
𝑓(𝑥) ≡ 0 (mod 𝑝1 1 )
𝛼
𝑓(𝑥) ≡ 0 (mod 𝑝2 2 )
(2.6.14)
⋮
𝛼
𝑓(𝑥) ≡ 0 (mod 𝑝𝑟 𝑟 ) .
We solve every congruence of (2.6.14) separately. If some of them are not solvable,
then (2.6.13) is not solvable either. If all of them are solvable, then consider a solution
of each, say ℎ1 , . . . , ℎ𝑟 . Now, solving the system
𝛼
𝑥 ≡ ℎ1 (mod 𝑝1 1 )
𝛼
𝑥 ≡ ℎ2 (mod 𝑝2 2 )
⋮
𝛼
𝑥 ≡ ℎ𝑟 (mod 𝑝𝑟 𝑟 ) ,
we get a solution of the original congruence (2.6.13). We obtain all solutions by con-
sidering all possible solution systems ℎ1 , . . . , ℎ𝑟 for the congruences (2.6.14).
Example E1. Solve the congruence
(2.6.15) 10𝑥84 + 3𝑥 + 7 ≡ 0 (mod 245) .
By the above, (2.6.15) is equivalent to the system
(2.6.16) 10𝑥84 + 3𝑥 + 7 ≡ 0 (mod 5)
(2.6.17) 10𝑥84 + 3𝑥 + 7 ≡ 0 (mod 49) .
(2.6.16) is identical to 3𝑥 + 7 ≡ 0 (mod 5) since 10 ≡ 0 (mod 5). The only solution of
this linear congruence is
(2.6.16a) 𝑥 ≡ 1 (mod 5) .
and
(2.6.16a) 𝑥 ≡ 1 (mod 5) .
(2.6.17b) 𝑥 ≡ 14 (mod 49) .
To determine the solutions, we can use the procedure in the proof of Theorem 2.6.1,
but it is often more convenient to apply the following method.
From the congruence (2.6.17a)—using the larger modulus—-we have:
49𝑧 − 22 ≡ 1 (mod 5) .
We find that
(2.6.19) 𝑧 ≡ 2 (mod 5) so 𝑧 = 5𝑤 + 2.
Substituting (2.6.19) back into (2.6.18), we obtain 𝑥 = 245𝑤 + 76. Thus the solution of
the first system of congruences is 𝑥 ≡ 76 (mod 245).
Proceeding similarly, the solution of the second system is 𝑥 ≡ 161 (mod 245).
Thus all solutions of (2.6.15) are
The digits actually are a simultaneous system of congruences where the moduli 𝑝 𝑖
are pairwise coprime, hence the remainder modulo 𝑚, i.e. the original number itself,
can be uniquely reconstructed.
Adding or multiplying two numbers, we have to add or multiply the correspond-
ing remainders (i.e. digits), there is no overflow, and the operations can be performed
independently for the various moduli. From the system of the remainders modulo 𝑝 𝑖
thus obtained, we have to determine the remainder modulo 𝑚, i.e. the number itself.
Example E2. As an illustration, let 𝑁 = 1000, and we execute the multiplication 27⋅34
in the remainder number system.
We can take
𝑚 = 2 ⋅ 3 ⋅ 5 ⋅ 7 ⋅ 11 = 2310.
The remainders of 27 when divided by the primes 2, 3, 5, 7, and 11 are 1, 0, 2, 6, and 5,
so the representation of 27 in the remainder number system is
27 = (1, 0, 2, 6, 5).
Similarly,
34 = (0, 1, 4, 6, 1).
To do the multiplication 27 ⋅ 34, we multiply the corresponding digits (there is no over-
flow), reduce the products modulo 𝑝 𝑖 , and solve the resulting system of congruences:
27 ⋅ 34 = (1 ⋅ 0, 0 ⋅ 1, 2 ⋅ 4, 6 ⋅ 6, 5 ⋅ 1) = (0, 0, 3, 1, 5).
The solution of the system
𝑥 ≡ 0 (mod 2)
𝑥 ≡ 0 (mod 3)
𝑥 ≡ 3 (mod 5)
𝑥 ≡ 1 (mod 7)
𝑥 ≡ 5 (mod 11)
is
𝑥 ≡ 918 (mod 2310) .
Thus, 27 ⋅ 34 = 918.
If we perform more operations, we can keep working with the form in the remain-
der number system and convert only the final result into the usual representation of
numbers.
We mention that systems of congruences can similarly be applied also to solve
systems of linear equations (with rational coefficients). The main point of the method
is that the system of equations is handled modulo various prime moduli, and from
the solutions obtained we determine the solution modulo the product of these primes.
This yields the solution wanted if certain conditions are satisfied and sufficiently many
moduli are used. The advantage of the method in contrast with the traditional Gaussian
elimination is that no too large (or too small) numbers can occur here, and thus there
is no danger of overflow.
64 2. Congruences
Exercises 2.6
11. Verify that there are arbitrarily large gaps in the sequence of squarefree numbers.
That is, for any 𝐾, there exist 𝐾 consecutive positive integers none of which is
squarefree.
* 12. (a) Prove that the following two systems are solvable for any positive integers 𝑎,
𝑏, and 𝑐.
(a1) 𝑥 ≡ 𝑎 + 𝑏 (mod 𝑐)
𝑥 ≡ 𝑏 + 𝑐 (mod 𝑎)
𝑥 ≡ 𝑐 + 𝑎 (mod 𝑏)
(a2) 𝑥 ≡ 𝑎𝑏 (mod 𝑐)
𝑥 ≡ 𝑏𝑐 (mod 𝑎)
𝑥 ≡ 𝑐𝑎 (mod 𝑏) .
(b) Show that
(where the moduli 𝑚𝑖 are not necessarily pairwise coprime) is solvable if and only
if (𝑚𝑖 , 𝑚𝑗 ) ∣ 𝑐 𝑖 − 𝑐𝑗 for every 1 ≤ 𝑖 < 𝑗 ≤ 𝑘.
14. Does there exist a polynomial 𝑓(𝑥) with integer coefficients for which the congru-
ence 𝑓(𝑥) ≡ 0 (mod 30) has exactly 14 solutions?
15. (a) Prove that there exist integers forming both a complete residue system mod-
ulo 𝑛 and a reduced residue system modulo 𝑘 if and only if 𝜑(𝑘) = 𝑛 and
(𝑘, 𝑛) = 1.
** (b) Prove that there exist integers forming a reduced residue system both mod-
ulo 𝑛 and modulo 𝑘 if and only if 𝜑(𝑛) = 𝜑(𝑘).
16.* (a) Verify that for any distinct integers 𝑎1 , 𝑎2 , and 𝑎3 , there exist infinitely many
positive numbers 𝑛 such that 𝑎1 + 𝑛, 𝑎2 + 𝑛, and 𝑎3 + 𝑛 are pairwise coprime.
(b) Find distinct integers 𝑎1 , 𝑎2 , 𝑎3 , and 𝑎4 such that the numbers 𝑎𝑖 + 𝑛, 𝑖 =
1, 2, 3, 4 are not pairwise coprime for any 𝑛.
* (c) Demonstrate that for any distinct integers 𝑎1 , 𝑎2 , 𝑎3 , and 𝑎4 , there exist infin-
itely many positive numbers 𝑛 such that (𝑎𝑖 + 𝑛, 𝑎𝑗 + 𝑛) ≤ 2 for every 𝑖 ≠ 𝑗.
* (d) Verify that for any distinct integers 𝑎1 , 𝑎2 , 𝑎3 , and 𝑎4 , there exist infinitely
many positive numbers 𝑛 such that (𝑎𝑖 + 𝑛, 𝑎𝑗 + 𝑛, 𝑎𝑘 + 𝑛) = 1 for all 1 ≤ 𝑖 <
𝑗 < 𝑘 ≤ 4.
* (e) Do the statements in (c) and (d) remain valid if we increase the number of
integers 𝑎𝑖 from four to five or six?
66 2. Congruences
For further proofs of Wilson’s Theorem, see the note after Theorem 3.1.2 and Ex-
ercise 3.3.6.
Exercises 2.7
We have to verify that we have defined the operations so that both addition and
multiplication assign a unique residue class to any two given residue classes.
The difficulty is that addition and multiplication of residue classes were defined
using representatives, thus we have to clarify that the resulting residue classes do not
depend on which representatives in the initial two classes were chosen.
Consider addition. We have to show that if (𝑎)𝑚 = (𝑎′ )𝑚 and (𝑏)𝑚 = (𝑏′ )𝑚 , then
(𝑎 + 𝑏)𝑚 = (𝑎′ + 𝑏′ )𝑚 . This holds since
(𝑎)𝑚 = (𝑎′ )𝑚 ⟹ 𝑎 ≡ 𝑎′ (mod 𝑚)
} ⟹ 𝑎 + 𝑏 ≡ 𝑎′ + 𝑏′ (mod 𝑚)
(𝑏)𝑚 = (𝑏′ )𝑚 ⟹ 𝑏 ≡ 𝑏′ (mod 𝑚)
⟹ (𝑎 + 𝑏)𝑚 = (𝑎′ + 𝑏′ )𝑚 .
We can argue similarly about multiplication.
We must be aware that there are many operations on the integers that cannot be
defined for residue classes using representatives. We illustrate this by an example; for
some further examples see Exercise 2.8.6.
Let 𝑎 and 𝑏 be integers and denote by max(𝑎, 𝑏) the larger one (or their common
value if 𝑎 = 𝑏). This maximum assigns a unique integer to any two integers, so it is a
well defined operation on the integers.
Among the residue classes modulo 𝑚, however, the specification max((𝑎)𝑚 , (𝑏)𝑚 )
= (max(𝑎, 𝑏))𝑚 does not define an operation, since the right-hand side of the equality
(may) give different residue classes if we represent (𝑎)𝑚 and/or (𝑏)𝑚 with another el-
ement. For example, let the modulus be 𝑚 = 9 and consider the two residue classes
𝐴 = (3)9 = (12)9 and 𝐵 = (10)9 = (1)9 . Then max(𝐴, 𝐵) would be (max(3, 10))9 =
(10)9 on the one hand and (max(12, 1))9 = (12)9 on the other hand but (10)9 ≠ (12)9 .
We turn now to study the most important properties of addition and multiplication
defined on the residue classes.
We can easily derive that most properties valid among the integers hold also for
the residue classes:
Theorem 2.8.2. Among the residue classes modulo 𝑚,
• addition is associative and commutative
• (0)𝑚 is a zero element, i.e. (0)𝑚 + (𝑎)𝑚 = (𝑎)𝑚 + (0)𝑚 = (𝑎)𝑚 holds for every (𝑎)𝑚
• the negative of (𝑎)𝑚 is (−𝑎)𝑚 , i.e. (−𝑎)𝑚 + (𝑎)𝑚 = (𝑎)𝑚 + (−𝑎)𝑚 = (0)𝑚
• multiplication is associative and commutative
2.8. Operations with Residue Classes 69
• (1)𝑚 is an identity element, i.e. (1)𝑚 (𝑎)𝑚 = (𝑎)𝑚 (1)𝑚 = (𝑎)𝑚 holds for every (𝑎)𝑚
• the distributive law is valid. ♣
Proof. Each statement follows immediately from the definition of the operations and
from the corresponding property of the integers. We illustrate this for the commutative
law for addition:
(𝑎)𝑚 + (𝑏)𝑚 = (𝑎 + 𝑏)𝑚 = (𝑏 + 𝑎)𝑚 = (𝑏)𝑚 + (𝑎)𝑚
(we applied the definition of addition for residue classes in the first and third equalities
and the commutative law for the addition of integers in the second equality). □
Summarizing the properties listed in Theorem 2.8.2, the residue classes modulo 𝑚
form a commutative ring with identity element with respect to addition and multiplica-
tion.
We mention that—as in every ring—also subtraction can be performed for residue
classes, i.e. to any (𝑎)𝑚 and (𝑏)𝑚 , there exists exactly one (𝑐)𝑚 satisfying (𝑎)𝑚 = (𝑏)𝑚 +
(𝑐)𝑚 ; we obtain this (𝑐)𝑚 as (𝑎)𝑚 + (−𝑏)𝑚 . (We can verify the existence of subtraction
also by relying on subtraction among the integers; then we have (𝑐)𝑚 = (𝑎 − 𝑏)𝑚 .)
We examine now which residue classes have a multiplicative inverse (or “recipro-
cal”), i.e. for which (𝑎)𝑚 does there exist a residue class (𝑐)𝑚 satisfying
(2.8.1) (𝑐)𝑚 (𝑎)𝑚 = (𝑎)𝑚 (𝑐)𝑚 = (1)𝑚 ?
Condition (2.8.1) is equivalent to (𝑎𝑐)𝑚 = (1)𝑚 , i.e. to 𝑎𝑐 ≡ 1 (mod 𝑚) which means
that the linear congruence 𝑎𝑥 ≡ 1 (mod 𝑚) is solvable. By Theorem 2.5.3, this holds
if and only if (𝑎, 𝑚) ∣ 1, or (𝑎, 𝑚) = 1. This is exactly the case when (𝑎)𝑚 is a reduced
residue class. Thus, we have proved:
Theorem 2.8.3. Among the residue classes modulo 𝑚, exactly the reduced residue classes
have a multiplicative inverse. ♣
We note that for any associative operation, every element can have only one in-
verse. Thus, the inverse of a reduced residue class is unique, as well. (This follows also
from Theorem 2.5.5.)
A field is a commutative ring (with at least two elements) that has an identity ele-
ment and every non-zero element has an inverse. By Theorem 2.8.3, the residue classes
satisfy these requirements if and only if every non-zero residue class is reduced, i.e. 𝑚
is a prime. This gives the result:
Theorem 2.8.4. The residue classes modulo 𝑚 form a field if and only if 𝑚 is a prime. ♣
It can occur that the product of two non-zero residue classes is the zero residue
class, e.g. (5)10 (4)10 = (0)10 . A residue class (𝑎)𝑚 ≠ (0)𝑚 is called a zero divisor if
(2.8.2) there exists some (𝑏)𝑚 ≠ (0)𝑚 satisfying (𝑎)𝑚 (𝑏)𝑚 = (0)𝑚 .
Thus, (4)10 and (5)10 are zero divisors in the previous example.
Theorem 2.8.5. A residue class (𝑎)𝑚 ≠ (0)𝑚 is a zero divisor if and only if (𝑎)𝑚 is not a
reduced residue class, i.e. (𝑎, 𝑚) ≠ 1. ♣
70 2. Congruences
The condition (𝑎)𝑚 ≠ (0)𝑚 means 𝑚 ∤ 𝑎 or (𝑎, 𝑚) < 𝑚 for the representative 𝑎.
Proof. Rephrasing the definition in (2.8.2), the residue class (𝑎)𝑚 ≠ (0)𝑚 is a zero
divisor if and only if
(2.8.3) there exists some 𝑏 ≢ 0 (mod 𝑚) satisfying 𝑎𝑏 ≡ 0 (mod 𝑚).
Since 𝑥 ≡ 0 (mod 𝑚) is always a solution of 𝑎𝑥 ≡ 0 (mod 𝑚), (2.8.3) means that 𝑎𝑥 ≡ 0
(mod 𝑚) has more solutions. The number of solutions is (𝑎, 𝑚), hence (𝑎)𝑚 ≠ (0)𝑚 is
a zero divisor if and only if (𝑎, 𝑚) > 1. □
We see from Theorem 2.8.5 that residue classes modulo 𝑚 contain a zero divisor if
and only if 𝑚 is composite.
Finally, we touch briefly some group theoretic connections of the residue classes.
A set 𝐺 is called a group if an associative operation with an identity element is
defined on 𝐺 and every element has an inverse. If the operation is commutative we
have a commutative or Abelian group.
Thus, the residue classes modulo 𝑚 form a commutative group under addition,
and the same is true for the reduced residue classes with respect to multiplication (this
follows from the fact that the product of two reduced classes and the inverse of a re-
duced class is a reduced class again).
The Euler–Fermat Theorem can be considered as a special case of a general theo-
rem for groups: For any element 𝑎 of a finite group 𝐺, 𝑎|𝐺| is the identity element (where
|𝐺| denotes the number of elements in the group). This general result can be verified
similarly to the Euler–Fermat Theorem for commutative groups (see Exercise 2.8.7)
and follows from Lagrange’s Theorem for arbitrary 𝐺.
Generalizing Wilson’s theorem, we can ask which element of a finite commutative
group will be equal to the product of all its elements (see Exercise 2.8.8).
Exercises 2.8
1. For which 𝑚 does there exist a non-zero residue class that is the negative of itself?
2. Consider the ring of the residue classes modulo 100.
(a) What is the multiplicative inverse of the residue class (13)?
(b) What is the number of zero divisors?
(c) How many zero divisor pairs belong to (40), i.e. how many residue classes
(𝑏) ≠ (0) satisfy (40)(𝑏) = (0)?
(d) Does there exist a residue class (𝑐) satisfying (35)(𝑐) = (90)?
3. How many residue classes modulo 𝑚 are their own multiplicative inverses if 𝑚 is
(a) 47
(b) 30
(c) 800
* (d) arbitrary?
Exercises 2.8 71
Congruences of Higher
Degree
We start with a few general remarks concerning congruences modulo a prime. Next, we
discuss the most important properties of order, primitive roots, and discrete logarithms.
Applying these, we “take roots” modulo 𝑝, i.e. examine binomial congruences. We
will include an interesting theorem by Kőnig and Rados and another one by Chevalley.
Finally, we show how congruences with composite moduli can be reduced to those
with prime moduli.
73
74 3. Congruences of Higher Degree
The rest of this section deals with congruences with prime moduli.
Theorem 3.1.2. If 𝑝 is a prime and the degree of 𝑓 modulo 𝑝 is 𝑘, then the congruence
𝑓(𝑥) ≡ 0 (mod 𝑝) has at most 𝑘 solutions. ♣
The statement of Theorem 3.1.2 is false for composite moduli. For example, the
linear congruence
10𝑥 − 15 ≡ 0 (mod 25)
has 5 solutions, the congruence
𝑥(𝑥 − 1)(𝑥 − 2)(𝑥 − 3) ≡ 0 (mod 24)
of degree 4 has 24 solutions, etc.
Using Theorem 3.1.2, we can get a new proof for Wilson’s Theorem (Theorem 2.7.1):
If 𝑝 is a prime, then (𝑝 − 1)! ≡ −1 (mod 𝑝).
This is obvious for 𝑝 = 2. Let 𝑝 > 2 and consider the polynomial
𝑓 = 𝑥𝑝−1 − 1 − (𝑥 − 1)(𝑥 − 2) . . . (𝑥 − (𝑝 − 1)) = 𝑎0 + 𝑎1 𝑥 + ⋯ + 𝑎𝑝−2 𝑥𝑝−2 .
By Fermat’s Little Theorem, each of the (pairwise incongruent) numbers 𝑥 = 1, 2, . . . ,
𝑝 − 1 satisfies the congruence 𝑓(𝑥) ≡ 0 (mod 𝑝), hence the number of solutions is at
least 𝑝 − 1. If 𝑓 had a degree modulo 𝑝, then this degree could be at most 𝑝 − 2 contra-
dicting Theorem 3.1.2. Therefore 𝑓 has no degree modulo 𝑝, i.e. every coefficient 𝑎𝑖 is
0 (mod 𝑝). Hence,
𝑎0 = −1 − (−1)𝑝−1 (𝑝 − 1)! = −1 − (𝑝 − 1)! ≡ 0 (mod 𝑝) ,
thus proving Wilson’s Theorem. □
Since a congruence modulo 𝑚 can have at most 𝑚 solutions, the statement of The-
orem 3.1.2 becomes empty if the degree of 𝑓 modulo 𝑝 is 𝑝 or larger. In this case, we
can reduce the congruence 𝑓(𝑥) ≡ 0 (mod 𝑝) to a congruence of degree at most 𝑝 − 1,
in the following sense:
Theorem 3.1.3. To every prime 𝑝 and polynomial 𝑓 with integer coefficients, there exists
a polynomial 𝑔 with integer coefficients such that
(i) the degree of 𝑔 modulo 𝑝 is at most 𝑝 − 1 or every coefficient of 𝑔 is 0 (mod 𝑝)
(ii) 𝑓(𝑐) ≡ 𝑔(𝑐) (mod 𝑝) for every integer 𝑐. ♣
Exercises 3.1 75
In other words, Theorem 3.1.3 asserts that to every polynomial over the field 𝐙𝑝 ,
we can find a polynomial 𝑔 of degree at most 𝑝 − 1 (allowing also the zero polynomial)
such that the two polynomials define the same function.
The theorem clearly implies that the congruences 𝑓(𝑥) ≡ 0 (mod 𝑝) and 𝑔(𝑥) ≡ 0
(mod 𝑝) have exactly the same solutions, hence the number of solutions is at most the
degree of 𝑔 modulo 𝑝 by Theorem 3.1.2.
Exercises 3.1
6. Let 𝑝 > 2 be a prime and 1 ≤ 𝑗 ≤ 𝑝 − 2. Show that the sum of all products with 𝑗
distinct factors taken from the numbers 1, 2, . . . , 𝑝 − 1 is divisible by 𝑝.
7. Let 𝑝 > 2 be a prime and
𝑓 = 𝑎 0 + 𝑎1 𝑥 + ⋯ + 𝑎 𝑛 𝑥 𝑛 where 𝑎0 ≢ 0 (mod 𝑝) .
Prove that 𝑓(𝑥) ≡ 0 (mod 𝑝) can be reduced to a congruence of degree at most
𝑝 − 2 in the following sense: We can find a polynomial ℎ of degree at most 𝑝 − 2
modulo 𝑝 or with all coefficients 0 (mod 𝑝) satisfying 𝑓(𝑐) ≡ ℎ(𝑐) (mod 𝑝) for
every (𝑐, 𝑝) = 1.
8. Prove the existence of a polynomial 𝑔 occurring in Theorem 3.1.3 using the inter-
polation polynomials by Lagrange or Newton.
9. Prove that the polynomial 𝑔 satisfying the requirements of Theorem 3.1.3 is unique
over 𝐙𝑝 , i.e. its coefficients are uniquely determined modulo 𝑝.
10. Demonstrate that Theorem 3.1.3 remains valid also for composite moduli.
3.2. Order
It follows from the Euler–Fermat Theorem that if (𝑎, 𝑚) = 1, then 𝑎𝑡 ≡ 1 (mod 𝑚) for
some positive integer 𝑡 and 𝜑(𝑚) or any multiple of it can be taken as 𝑡. The minimal
positive integer 𝑡 with this property plays a distinguished role in the further investiga-
tions:
Definition 3.2.1. Let (𝑎, 𝑚) = 1. The positive integer 𝑘 is called the order of 𝑎 mod-
ulo 𝑚, if 𝑎𝑘 ≡ 1 (mod 𝑚) and 𝑎𝑖 ≢ 1 (mod 𝑚) for every 0 < 𝑖 < 𝑘. ♣
We denote the order of 𝑎 by 𝑜𝑚 (𝑎). For example, 𝑜7 (2) = 3, 𝑜10 (3) = 4, etc. If there
is no ambiguity, we can omit the index referring to the modulus.
The Euler–Fermat Theorem implies that every 𝑎 coprime to 𝑚 has an order and
𝑜𝑚 (𝑎) ≤ 𝜑(𝑚).
The order can be defined only for (𝑎, 𝑚) = 1: If (𝑎, 𝑚) ≠ 1, then there is no 𝑘 > 0
satisfying 𝑎𝑘 ≡ 1 (mod 𝑚) (see the first remark after Theorem 2.4.1B).
3.2. Order 77
thus
1329 = 1316 ⋅ 138 ⋅ 134 ⋅ 13
≡ (−24) ⋅ 25 ⋅ 5 ⋅ 13
= (−600) ⋅ 65
≡ (−10) ⋅ 6
≡ −1 (mod 59) .
Hence 𝑜59 (13) = 58. (There is no need to compute the remainder of 1358 modulo 59;
we know from the Euler–Fermat Theorem that it must be 1.)
Finally, we mention that Definition 3.2.1 is a special case of the order of an element
in a group, and also the analog of Theorem 3.2.2 is true in arbitrary groups.
Exercises 3.2
(The notation 𝑜(𝑎) without an index refers to an arbitrary modulus unless a modulus
𝑚 or 𝑝 was specified in the exercise.)
1. Compute:
(a) 𝑜77 (155)
(b) 𝑜100 (199)
(c) 𝑜65 (2)
(d) 𝑜47 (43).
2. Does there exist an 𝑎 with 𝑜𝑚 (𝑎) = 4 if 𝑚 is (a) 11 (b) 12 (c) 17?
3. Which moduli 𝑚 satisfy 𝑜𝑚 (2) = 6?
4. Let (𝑎, 𝑚) = 1, 𝑜𝑚 (𝑎) = 𝑘, and 𝑖 ≥ 0. Prove
(a) 𝑜𝑚 (𝑎𝑖 ) ∣ 𝑘
(b) 𝑜𝑚 (𝑎𝑖 ) = 𝑘 ⟺ (𝑖, 𝑘) = 1
(c) 𝑜𝑚 (𝑎𝑖 ) = 𝑘/(𝑖, 𝑘).
5. What are the possible values of 𝑜(𝑎) if 𝑜(𝑎3 ) is (a) 10 (b) 12?
S 6. Let 𝑝 > 2 be a prime. Verify 𝑜𝑝 (𝑎) = 𝑜𝑝 (−𝑎) ⟺ 4 ∣ 𝑜𝑝 (𝑎).
7. Assume that 𝑎5 , 𝑎13 , and 𝑎21 belong to exactly two reduced residue classes mod-
ulo 𝑚. Compute 𝑜𝑚 (𝑎).
8. Let 𝑝 be a prime and 𝑜𝑝 (𝑎) = 3.
(a) Show that 1 + 𝑎 + 𝑎2 ≡ 0 (mod 𝑝).
(b) Determine 𝑜𝑝 (1 + 𝑎).
S 9. Assume that 𝑝 > 5 is a prime and 𝑎2𝑝−10 ≡ −1 (mod 𝑝). Compute 𝑜𝑝 (𝑎).
Exercises 3.2 79
10. (a) Show that both congruences 𝑎𝑛 ≡ 1 (mod 𝑚) and 𝑎𝑘 ≡ 1 (mod 𝑚) hold
simultaneously if and only if 𝑎(𝑛,𝑘) ≡ 1 (mod 𝑚).
(b) Using (a), find a new proof for Exercise 1.3.13.
11. Show that (𝑎𝑛 − 1, 𝑎𝑘 + 1) ≤ 2 if 𝑛 is odd.
12. Let 𝑝 > 2 be a prime and (𝑎, 𝑝) = 1. Verify that 𝑎𝑠 ≡ −1 (mod 𝑝) is true for some 𝑠
if and only if 𝑜𝑝 (𝑎) is even. What happens if we replace 𝑝 by a composite modulus
𝑚?
13. Prove
(a) (𝑎, 𝑚) = 1, 𝑑 ∣ 𝑚 ⟹ 𝑜 𝑑 (𝑎) ∣ 𝑜𝑚 (𝑎)
(b) (𝑎, 𝑚𝑛) = 1 ⟹ 𝑜 [𝑚,𝑛] (𝑎) = [𝑜𝑚 (𝑎), 𝑜𝑛 (𝑎)].
14. How many of the integers 1, 2, . . . , 999 have order 2 modulo 1000?
* 15. Let 𝑜(𝑎) = 𝑢 and 𝑜(𝑏) = 𝑣. Verify
(a) 𝑜(𝑎𝑏) = 𝑢𝑣 ⟺ (𝑢, 𝑣) = 1
[ᵆ,𝑣]
(b) | 𝑜(𝑎𝑏) and 𝑜(𝑎𝑏) ∣ [𝑢, 𝑣].
(ᵆ,𝑣)
(d) The decimal fraction of the rational number 𝑎/𝑏 has a mixed periodicity if
and only if (𝑏, 10) > 1 but 𝑏 has also a prime divisor different from 2 and 5:
𝑏 = 2𝑟 5𝑠 𝑡 where (𝑡, 10) = 1, 𝑡 > 1, and 𝑘 = max(𝑟, 𝑠) > 0. Then the (first)
period starts with the (𝑘 + 1)st digit after the decimal point and its length is
𝑜𝑡 (10).
Proof. Assume that 𝑔 is a primitive root, so 𝑜𝑚 (𝑔) = 𝜑(𝑚). Then the 𝜑(𝑚) numbers
1, 𝑔, 𝑔2 , . . . , 𝑔𝜑(𝑚)−1 are pairwise incongruent modulo 𝑚 by part (ii) of Theorem 3.2.2,
and (𝑔, 𝑚) = 1 implies that they are all coprime to 𝑚. Thus they constitute a reduced
residue system mod 𝑚 by Theorem 2.2.9.
For the converse, assume that the powers of 𝑔 form a reduced residue system
mod 𝑚. Then (𝑔, 𝑚) = 1 implies that 𝑜𝑚 (𝑔) exists and 𝑜𝑚 (𝑔) ≤ 𝜑(𝑚) by the Euler–
Fermat Theorem. Further, the pairwise incongruence guarantees that none of 𝑔, 𝑔2 ,
. . . , 𝑔𝜑(𝑚)−1 can be congruent to the element 1 in this reduced residue system. Hence,
𝑜𝑚 (𝑔) = 𝜑(𝑚). □
Now we examine, for which moduli 𝑚 a primitive root exists. Or, in a group theo-
retic formulation, for which 𝑚 is the multiplicative group of the reduced residue classes
cyclic.
We prove first that all prime moduli have a primitive root.
3.3. Primitive Roots 81
As a generalization of Theorem 3.3.3, it can be shown that any finite field contains
an element whose powers supply all non-zero elements in the field. Theorem 3.3.3 is
the special case for the field 𝐙𝑝 of the residue classes mod 𝑝.
We give two proofs for Theorem 3.3.3 and a third argument is sketched in Exer-
cise 3.3.14. All three proofs can be adapted with suitable modifications to verify the
more general proposition mentioned above.
Second proof. Let ℎ(𝑑) be the number of those integers among 1, 2, . . . , 𝑝 − 1 that
have order 𝑑 modulo 𝑝. Clearly, ℎ(𝑑) = 0 if 𝑑 ∤ 𝑝 − 1 and
(3.3.5) ∑ ℎ(𝑑) = 𝑝 − 1.
𝑑∣𝑝−1
We show that
(3.3.6) ℎ(𝑑) ≤ 𝜑(𝑑)
holds for every 𝑑.
82 3. Congruences of Higher Degree
If there is no element of order 𝑑, then (3.3.6) is true trivially since 0 = ℎ(𝑑) < 𝜑(𝑑).
Thus, we can assume that 𝑜𝑝 (𝑎) = 𝑑 for some 𝑎. Then 𝑎, 𝑎2 , . . . , 𝑎𝑑 are pairwise
incongruent modulo 𝑝, and by (𝑎𝑡 )𝑑 = (𝑎𝑑 )𝑡 ≡ 1 (mod 𝑝), they are all solutions of the
congruence 𝑥𝑑 ≡ 1 (mod 𝑝).
Since this congruence cannot have more than 𝑑 solutions, every 𝑐 satisfying 𝑐𝑑 ≡ 1
(mod 𝑝) must be congruent to one of the numbers 𝑎, 𝑎2 , . . . , 𝑎𝑑 .
Every integer of order 𝑑 is a solution of 𝑥𝑑 ≡ 1 (mod 𝑝), hence it must be congruent
to one of 𝑎, 𝑎2 , . . . , 𝑎𝑑 . By Exercise 3.2.4b, 𝑜𝑝 (𝑎𝑗 ) = 𝑜𝑝 (𝑎) = 𝑑 holds if and only if
(𝑗, 𝑑) = 1. Therefore exactly 𝜑(𝑑) numbers will have order 𝑑 among 𝑎, 𝑎2 , . . . , 𝑎𝑑 ,
i.e. ℎ(𝑑) = 𝜑(𝑑). Thus we have verified (3.3.6).
Using (3.3.5), (3.3.6), and the equality ∑𝑑∣𝑝−1 𝜑(𝑑) = 𝑝 − 1 from Exercise 2.3.14,
we obtain
𝑝 − 1 = ∑ ℎ(𝑑) ≤ ∑ 𝜑(𝑑) = 𝑝 − 1.
𝑑∣𝑝−1 𝑑∣𝑝−1
This can hold only if ℎ(𝑑) = 𝜑(𝑑) for every 𝑑 ∣ 𝑝 − 1.
This proves that in a reduced residue system mod 𝑝, exactly 𝜑(𝑑) elements have
order 𝑑. For 𝑑 = 𝑝 − 1 this means that the number of primitive roots is 𝜑(𝑝 − 1)
(implying the existence of primitive roots). □
Remark: The second proof yielded a (seemingly) stronger result: Besides guarantee-
ing a primitive root, we obtained also the number of (pairwise incongruent) primitive
roots, and even more generally, the number of elements of order 𝑑 for every given
𝑑. This surplus, however, easily follows merely from the existence of a single primitive
root (whichever proof produced it) using Theorem 3.3.2 and Exercises 3.2.4b and 3.2.4c
(see Exercise 3.3.9).
In the next theorem we characterize the moduli that have primitive roots.
Theorem 3.3.5. There exists a primitive root modulo 𝑚 > 1 if and only if 𝑚 = 𝑝𝛼 , 2𝑝𝛼 , 2,
or 4 where 𝑝 > 2 is a prime and 𝛼 > 0. ♣
(N1) No, there is no primitive root modulo 𝑚 if 𝑚 has an odd prime divisor and is
divisible by 4, or it has at least two distinct odd prime divisors.
(N2) No, there is no primitive root modulo 2𝛼 with 𝛼 > 2.
(Y1) Let 𝑔 be a primitive root modulo 𝑝. We show that at least one of 𝑔 and 𝑔 + 𝑝 is a
primitive root modulo 𝑝2 .
We know that
𝑜𝑝2 (𝑔) ∣ 𝜑(𝑝2 )
and
𝑜𝑝 (𝑔) ∣ 𝑜𝑝2 (𝑔)
by Exercise 3.2.13a. Substituting 𝜑(𝑝2 ) = 𝑝(𝑝 − 1) and 𝑜𝑝 (𝑔) = 𝑝 − 1, we get
𝑝 − 1 ∣ 𝑜𝑝2 (𝑔) and 𝑜𝑝2 (𝑔) ∣ 𝑝(𝑝 − 1).
Hence, 𝑜𝑝2 (𝑔) = 𝑝 − 1 or 𝑜𝑝2 (𝑔) = 𝑝(𝑝 − 1).
In the second case, 𝑔 is a primitive root modulo 𝑝2 (by definition).
We show that if 𝑜𝑝2 (𝑔) = 𝑝 − 1, then 𝑔 + 𝑝 is a primitive root mod 𝑝2 .
Repeating the previous argument with 𝑔 + 𝑝 instead of 𝑔, we find that 𝑜𝑝2 (𝑔 + 𝑝)
can equal only 𝑝 − 1 or 𝑝(𝑝 − 1). Thus, it is sufficient to verify (𝑔 + 𝑝)𝑝−1 ≢ 1 (mod 𝑝2 ).
By the binomial theorem,
𝑝 − 1 2 𝑝−3
(𝑔 + 𝑝)𝑝−1 ≡ 𝑔𝑝−1 + (𝑝 − 1)𝑝𝑔𝑝−2 + ( )𝑝 𝑔 + ... .
2
The first term on the right-hand side is 1 (mod 𝑝2 ) by our assumption and every other
term is divisible by 𝑝2 except the second one. Hence,
(𝑔 + 𝑝)𝑝−1 ≡ 𝑔𝑝−1 + (𝑝 − 1)𝑝𝑔𝑝−2 ≡ 1 − 𝑝𝑔𝑝−2 ≢ 1 (mod 𝑝2 ) .
(Y2) We show that if 𝑔 is a primitive root modulo 𝑝2 , then it is a primitive root mod-
ulo 𝑝𝛼 for any 𝛼 > 2. As in (Y1), it is enough to check
𝛼−2 (𝑝−1)
𝑔𝑝 ≢ 1 (mod 𝑝𝛼 ) .
We shall verify this in the form
𝛼−2 (𝑝−1)
(3.3.7) 𝑔𝑝 = 1 + 𝑡𝛼 𝑝𝛼−1 where 𝑝 ∤ 𝑡𝛼 .
Exercises 3.3
(a) Show that if a polynomial 𝑓 with integer coefficients divides 𝑥𝑝−1 − 1, then
the number of solutions of 𝑓(𝑥) ≡ 0 (mod 𝑝) is equal to the degree of 𝑓.
(b) Assume that 𝑞𝛽 ∣ 𝑝 − 1 for some prime 𝑞 and 𝛽 > 0. Verify for the polynomials
𝛽 𝛽−1
𝑓1 = 𝑥𝑞 − 1 and 𝑓2 = 𝑥𝑞 −1
that the congruences 𝑓1 (𝑥) ≡ 0 (mod 𝑝) and 𝑓2 (𝑥) ≡ 0 (mod 𝑝) have exactly
𝑞𝛽 and 𝑞𝛽−1 solutions.
(c) Using the notations and result of (b), exhibit the existence of a 𝑐 satisfying
𝑜𝑝 (𝑐) = 𝑞𝛽 .
(d) Using (c) and Exercise 3.2.15a, verify the existence of elements of order 𝑑 for
every 𝑑 ∣ 𝑝 − 1.
Notation: ind𝑝,𝑔 (𝑎). Since the modulus 𝑝 is fixed in most cases, we can write just
ind𝑔 𝑎 in general. If there is no ambiguity concerning the primitive root, then ind 𝑎 is
sufficient.
By the preliminary remark, ind𝑔 𝑎 exists and is unique for any (𝑎, 𝑝) = 1. Of course,
the discrete logarithm of a number 𝑎 depends on which primitive root 𝑔 was chosen as
base.
If 𝑎 ≡ 𝑏 (mod 𝑝), then clearly ind𝑔 𝑎 = ind𝑔 𝑏, thus all elements in a reduced
residue class have the same discrete logarithm (with 𝑔 fixed).
We shall often use the fact
𝑔𝑠 ≡ 𝑔𝑡 (mod 𝑝) ⟺ 𝑠 ≡ 𝑡 (mod 𝑝 − 1)
(which follows from assertion (ii) in Theorem 3.2.2 with 𝑚 = 𝑝, 𝑎 = 𝑔, and 𝑜𝑝 (𝑔) =
𝑝 − 1).
According to this, all integers 𝑗 ≥ 0 satisfying 𝑔𝑗 ≡ 𝑎 (mod 𝑝) are just the non-
negative elements of a residue class modulo 𝑝 − 1, i.e.
𝑔𝑗 ≡ 𝑎 (mod 𝑝) ⟺ 𝑗 ≡ ind𝑔 𝑎 (mod 𝑝 − 1) .
(Therefore, as an alternative definition, the discrete logarithm of 𝑎 with base 𝑔 could
mean this entire residue class mod 𝑝 − 1.)
Exercises 3.4 87
The analogs of the logarithmic identities are valid also for the discrete log (see
Exercises 3.4.3 and 3.4.4).
The discrete logarithm will be the key for taking roots modulo 𝑝 in the next section.
An application in cryptography will be mentioned in Exercise 5.8.6.
As an illustration, we attach an exponential and a logarithmic table for the modu-
lus 𝑝 = 13 and the primitive root 𝑔 = 2.
𝑗 0 1 2 3 4 5 6 7 8 9 10 11
2𝑗 (mod 13) 1 2 4 8 3 6 12 11 9 5 10 7
𝑎 1 2 3 4 5 6 7 8 9 10 11 12
ind2 𝑎 0 1 4 2 9 5 11 3 8 10 7 6
Exercises 3.4
Throughout the exercises, 𝑔 and ℎ denote primitive roots modulo a prime 𝑝 > 2, 𝑎 and
𝑏 are coprime to 𝑝, and the index refers to base 𝑔 unless indicated otherwise.
1. For which primes 𝑝 is ind𝑝,7 (2) = 3?
2. Compute the discrete logarithms.
(a) ind𝑔 1
(b) ind𝑔 (−1)
(c) ind𝑔 (−𝑔).
3. Verify the logarithmic identities.
(a) ind(𝑎𝑏) ≡ ind 𝑎 + ind 𝑏 (mod 𝑝 − 1)
(b) ind(𝑎𝑘 ) ≡ 𝑘 ⋅ ind 𝑎 (mod 𝑝 − 1).
4. Demonstrate the law for switching between logarithms from base 𝑔 to base ℎ
(a) ind𝑔 ℎ ⋅ indℎ 𝑔 ≡ 1 (mod 𝑝 − 1)
(b) indℎ 𝑎 ≡ indℎ 𝑔 ⋅ ind𝑔 𝑎 (mod 𝑝 − 1).
5. Determine the smallest positive integer 𝑠 satisfying 𝑝 − 1 ∣ 𝑠 ⋅ ind 𝑎.
6. Prove that 𝑎 is a primitive root mod 𝑝 if and only if (ind𝑔 𝑎, 𝑝 − 1) = 1.
7. Verify the propositions.
(a) (ind𝑔 𝑎, 𝑝 − 1) = 1 ⟺ (indℎ 𝑎, 𝑝 − 1) = 1.
(b) (ind𝑔 𝑎, 𝑝 − 1) = (indℎ 𝑎, 𝑝 − 1).
8. Let 𝑎, 𝑏, and 𝑐 be arbitrary primitive roots modulo 𝑝. Show that
𝑎ind𝑏 𝑐
is a primitive root mod 𝑝.
S* 9. Show that 𝑜𝑝 (𝑎) = 𝑜𝑝 (𝑏) holds if and only if ind𝑔 𝑎 = indℎ 𝑏 for some primitive
roots 𝑔 and ℎ.
88 3. Congruences of Higher Degree
10. Find the smallest positive primitive roots for the primes below and prepare the
corresponding tables of indices (a) 7 (b) 11 (c) 17.
* 11. Prove that for any prime 𝑝 and integer 𝑎, there are infinitely many positive integers
satisfying 𝑎 ≡ 𝑘𝑘 (mod 𝑝).
Proof. The first assertion is just a reformulation of (a part of) Theorem 3.5.1.
To prove the second assertion, note that by Theorem 3.5.1, the 𝑘th power residues
are exactly the solutions of the congruence
(𝑝−1)
𝑧 (𝑘,𝑝−1) ≡ 1 (mod 𝑝)
and the number of solutions is
𝑝−1 𝑝−1
( , 𝑝 − 1) = . □
(𝑘, 𝑝 − 1) (𝑘, 𝑝 − 1)
Exercises 3.5
(a) The product of two 𝑘th power residues is always a 𝑘th power residue.
(b) The product of a 𝑘th power residue and a 𝑘th power non-residue is always a
𝑘th power non-residue.
10. How can we characterize in terms of 𝑝 and 𝑘 that there exist 𝑘th power residues
and the product of any two of them is again a 𝑘th power residue?
11. What is the remainder mod 𝑝 of (a) the sum (b) the product of all (pairwise incon-
gruent) 𝑘th power residues?
S 12. Prove that 𝑎 is both a 20th and 50th power residue modulo 𝑝 if and only if it is a
100th power residue. Investigate also the generalized problem.
𝑓𝑖 (𝑥1 , 𝑥2 , . . . , 𝑥𝑡 ), 𝑖 = 1, 2, . . . , 𝑘
are polynomials in 𝑡 variables with integer coefficients and constant terms 0, i.e.
(3.6.2) 𝑓𝑖 (0, 0, . . . , 0) = 0, 𝑖 = 1, 2, . . . , 𝑘.
has a non-trivial solution with not all 𝑥𝑖 multiples of 23. (Here 𝑘 = 2 and 5 = 𝑡 >
1 + 3 = deg 𝑓1 + deg 𝑓2 .)
92 3. Congruences of Higher Degree
We can apply Theorem 3.6.1 also for 𝑘 = 1, just one polynomial. For example, the
divisibility
𝑝 ∣ 𝑥13 + 3𝑥23 + 5𝑥33 + 7𝑥43 + 9𝑥1 𝑥2 + 11𝑥3 𝑥4
can be satisfied for any prime 𝑝 so that not all 𝑥𝑖 are divisible by 𝑝. (Now 𝑡 = 4 and
deg 𝑓 = 3.)
Proof. Assuming that there is only a trivial solution, we shall force a contradiction.
We define two new polynomials in 𝑡 variables:
𝑘
𝑝−1
𝐹(𝑥1 , 𝑥2 , . . . , 𝑥𝑡 ) = ∏(1 − 𝑓𝑖 (𝑥1 , 𝑥2 , . . . , 𝑥𝑡 )) and
𝑖=1
𝑡
𝑝−1
𝐺(𝑥1 , 𝑥2 , . . . , 𝑥𝑡 ) = ∏(1 − 𝑥𝑗 ).
𝑗=1
From now on, we shall consider all polynomials as polynomials in 𝑡 variables over
the modulo 𝑝 field.
In this interpretation, (3.6.6) tells us that 𝐹 and 𝐺 assume the same values for every
substitution (the same polynomial functions belong to 𝐹 and 𝐺; however, this does not
imply in general the equality of the polynomials themselves, that is, the equality of the
coefficients in the case of a finite field).
𝑝
Let 𝐻 ∗ be the reduced form of the polynomial 𝐻 obtained by replacing every 𝑥𝑖
in 𝐻 with 𝑥𝑖 as long as possible. The exponents of 𝑥𝑖 in the terms of 𝐻 ∗ are at most
𝑝 − 1, and 𝐻 and 𝐻 ∗ assume the same values everywhere. It can be easily proven by
induction on the number of variables that if the polynomials 𝐻 and 𝐾 assume the same
values everywhere, then the (formal) polynomials 𝐻 ∗ and 𝐾 ∗ are equal (so they have
the same coefficients).
We saw that 𝐹 and 𝐺 assume the same values everywhere, therefore the polyno-
mials 𝐹 ∗ and 𝐺 ∗ are equal. Hence, deg 𝐺 ∗ = deg 𝐹 ∗ . However, by 𝐺 = 𝐺 ∗ and (3.6.3),
this leads to a contradiction:
𝑘
deg 𝐺 ∗ = deg 𝐺 = (𝑝 − 1)𝑡 > (𝑝 − 1) ( ∑ deg 𝑓𝑖 ) = deg 𝐹 ≥ deg 𝐹 ∗ . □
𝑖=1
In the second half of this section, we express the number of solutions of a con-
gruence 𝑓(𝑥) ≡ 0 (mod 𝑝) in an exact formula with the help of the coefficients. This
theorem by Kőnig and Rados is rather only of theoretical significance; it can be hardly
applied for computing the number of solutions in practice.
𝑎 𝑎1 ... 𝑎𝑝−2
⎛ 0 ⎞
𝑎𝑝−2 𝑎0 ... 𝑎𝑝−3
𝐴=⎜ ⎟. ♣
⎜ ⋮ ⋮ ⋱ ⋮ ⎟
⎝ 𝑎1 𝑎2 ... 𝑎0 ⎠
Remarks: (1) The theorem immediately implies that 𝑓(𝑥) ≡ 0 (mod 𝑝) is solvable if
and only if the rank of 𝐴 is less than 𝑝 − 1, i.e. det 𝐴 ≡ 0 (mod 𝑝).
(2) The requirements imposed on 𝑓 are not serious restrictions; we can obtain the
number of solutions for an arbitrary polynomial 𝑓 by a simple reduction to the
Kőnig–Rados Theorem, see Exercise 3.6.11.
Proof. We shall need the following elementary results from linear algebra. They all
refer to 𝑛 × 𝑛 matrices over a field 𝐹 where 𝑟(𝐵) denotes the rank of matrix 𝐵; in our
case, 𝑛 = 𝑝 − 1 and 𝐹 is the modulo 𝑝 field.
94 3. Congruences of Higher Degree
Exercises 3.6
The proof yields a procedure to produce 𝑐 𝑘 and clarifies the situation in the case
𝑓′ (𝑐) ≡ 0 (mod 𝑝) as well.
Assume now that the assertion is true for 𝑘 − 1. This means that the congruence
(3.7.5) 𝑓(𝑥) ≡ 0 (mod 𝑝𝑘−1 )
has exactly one solution 𝑥 ≡ 𝑐 𝑘−1 (mod 𝑝𝑘−1 ) with 𝑐 𝑘−1 ≡ 𝑐 (mod 𝑝).
We want to find a solution of (3.7.1) satisfying also 𝑐 𝑘 ≡ 𝑐 (mod 𝑝). Because (3.7.5)
holds for 𝑐 𝑘 , 𝑐 𝑘 ≡ 𝑐 𝑘−1 (mod 𝑝𝑘−1 ), so
(3.7.6) 𝑐 𝑘 = 𝑐 𝑘−1 + 𝑡𝑝𝑘−1 .
Substituting (3.7.6) into (3.7.1) and applying (3.7.3) (with 𝑎 = 𝑐 𝑘−1 and 𝑗 = 𝑘 − 1)
we obtain
(3.7.7) 𝑓(𝑐 𝑘 ) = 𝑓(𝑐 𝑘−1 + 𝑡𝑝𝑘−1 ) ≡ 𝑓(𝑐 𝑘−1 ) + 𝑡𝑝𝑘−1 𝑓′ (𝑐 𝑘−1 ) ≡ 0 (mod 𝑝𝑘 ) .
Here, 𝑝𝑘−1 ∣ 𝑓(𝑐 𝑘−1 ) by the induction hypothesis. Cancelling 𝑝𝑘−1 in (3.7.7) and using
𝑐 𝑘−1 ≡ 𝑐 (mod 𝑝), we obtain
𝑓(𝑐 𝑘−1 )
(3.7.8) + 𝑡𝑓′ (𝑐) ≡ 0 (mod 𝑝) .
𝑝𝑘−1
This is a linear congruence for 𝑡 that has exactly one solution 𝑡 ≡ 𝑡0 (mod 𝑝) due
to 𝑓′ (𝑐) ≢ 0 (mod 𝑝). Hence, 𝑡 = 𝑡0 + 𝑠𝑝. Substitution into (3.7.6) yields
𝑐 𝑘 = 𝑐 𝑘−1 + 𝑡0 𝑝𝑘−1 + 𝑠𝑝𝑘 so 𝑐 𝑘 ≡ 𝑐 𝑘−1 + 𝑡0 𝑝𝑘−1 (mod 𝑝𝑘 ) .
Thus we have proven that 𝑐 𝑘 exists and is unique mod 𝑝𝑘 . □
Following the proof, we can build up the values 𝑐 2 , . . . , 𝑐 𝑘 recursively starting from
𝑐 = 𝑐 1 . (We can even get a formula for 𝑐 𝑘 , see Exercise 3.7.4.)
If 𝑓′ (𝑐) ≡ 0 (mod 𝑝), then either every 𝑡, or no 𝑡 is a solution of (3.7.8) depending on
whether or not 𝑝𝑘 ∣ 𝑓(𝑐 𝑘−1 ). This means that a solution 𝑐 𝑘−1 of (3.7.5) either gives rise
to 𝑝 suitable 𝑐 𝑘 , or to none. In this case, the above recursion is much more complicated.
Example. Solve the congruence 𝑥3 + 2𝑥 ≡ 22 (mod 125).
We solve first
𝑓(𝑥) = 𝑥3 + 2𝑥 − 22 ≡ 0 (mod 5) .
Checking the elements of the complete residue system 0, ±1, ±2 modulo 5, we get two
solutions:
(i) 𝑥 ≡ 2 (mod 5), and
(ii) 𝑥 ≡ −1 (mod 5).
(i) If 𝑥 ≡ 2 (mod 5), then
𝑓′ (2) ≡ 3 ⋅ 22 + 2 ≡ −1 (mod 5) ,
hence we can apply Theorem 3.7.1.
Substituting 𝑥 = 2 + 5𝑡 into 𝑥3 + 2𝑥 − 22 ≡ 0 (mod 25), we obtain
−10 + (5𝑡) ⋅ 14 ≡ 0 (mod 25) so − 2 − 𝑡 ≡ 0 (mod 5) .
So 𝑡 ≡ −2 (mod 5) and 𝑡 = 5𝑠 − 2. Then
𝑥 = 2 + 5𝑡 = 2 + 5(5𝑠 − 2) = −8 + 25𝑠.
98 3. Congruences of Higher Degree
Exercises 3.7
4. Assume that the conditions of Theorem 3.7.1 hold, and let 𝑢 satisfy 𝑢𝑓′ (𝑐) ≡ 1
(mod 𝑝). Prove that the values 𝑐 𝑘 obey the recursion
𝑐1 = 𝑐 and 𝑐 𝑘 = 𝑐 𝑘−1 − 𝑢𝑓(𝑐 𝑘−1 ) for 𝑘 > 1.
5. Solve 𝑥6 + 4𝑥 ≡ 𝑑 (mod 73 ) where 𝑑 is
(a) 3
(b) 2
(c) 72.
Chapter 4
Legendre symbol is the principal tool for handling quadratic congruences. Besides its
basic properties, we shall prove Gauss’s Lemma and the celebrated Quadratic Reci-
procity Law, among other theorems. At the end of the chapter, we see that the Jacobi
symbol provides a useful generalization of the Legendre symbol.
The numbers 𝑎 ≡ 0 (mod 𝑝) are neither quadratic residues nor quadratic non-
residues.
Theorem 4.1.2. (i) An integer 𝑎 is a quadratic residue mod 𝑝 if and only if 𝑎(𝑝−1)/2 ≡
1 (mod 𝑝). An equivalent condition is that the index (with base to any primitive
root) of 𝑎 is even.
(ii) An integer 𝑎 is a quadratic non-residue mod 𝑝 if and only if 𝑎(𝑝−1)/2 ≡ −1 (mod 𝑝).
An equivalent condition is that the index (with base to any primitive root) of 𝑎 is odd.
(iii) The number of (pairwise incongruent) quadratic residues is (𝑝 − 1)/2 and the same
holds for the number of non-residues.
(iv) If 𝑎 is a quadratic residue, then the congruence 𝑥2 ≡ 𝑎 (mod 𝑝) has two (pairwise
incongruent) solutions. ♣
101
102 4. Legendre and Jacobi Symbols
Proof. We obtain (i) and (iii) from Theorem 3.5.3 and (iv) from an assertion of Theo-
rem 3.5.1 as special cases of 𝑘 = 2.
By (i), 𝑎 is a quadratic non-residue if and only if 𝑎(𝑝−1)/2 ≢ 1 (mod 𝑝), or equiva-
lently, the index of 𝑎 is odd. Thus, to prove (ii), we need only the equivalence
𝑝−1 𝑝−1
(4.1.1) 𝑎 2 ≢ 1 (mod 𝑝) ⟺ 𝑎 2 ≡ −1 (mod 𝑝) .
Since (𝑎(𝑝−1)/2 )2 = 𝑎𝑝−1 ≡ 1 (mod 𝑝) and 𝑝 is a prime, only 𝑎(𝑝−1)/2 ≡ ±1 (mod 𝑝)
are possible. Also, 1 ≢ −1 (mod 𝑝) for 𝑝 > 2, therefore (4.1.1) holds. □
𝑎
Definition 4.1.3. The Legendre symbol ( 𝑝 ) is defined by
Combining the definition of the Legendre symbol with Theorem 4.1.2, we obtain
𝑝−1 𝑎
(4.1.2) 𝑎 2 ≡ ( ) (mod 𝑝)
𝑝
for every 𝑎.
We summarize some basic properties of the Legendre symbol in the next theorem.
𝑎 𝑏
Theorem 4.1.4. (i) 𝑎 ≡ 𝑏 (mod 𝑝) ⟹ ( ) = ( ).
𝑝 𝑝
𝑎𝑏 𝑎 𝑏
(ii) ( ) = ( )( ).
𝑝 𝑝 𝑝
(iii)
−1 1, if 𝑝 ≡ 1 (mod 4)
( )={ ♣
𝑝 −1, if 𝑝 ≡ −1 (mod 4).
Proof. Each assertion follows from (4.1.2) immediately; we describe the details only
for (ii):
𝑎𝑏 𝑝−1 𝑝−1 𝑝−1 𝑎 𝑏
( ) ≡ (𝑎𝑏) 2 = 𝑎 2 𝑏 2 ≡ ( )( ) (mod 𝑝) .
𝑝 𝑝 𝑝
Thus
𝑎𝑏 𝑎 𝑏
𝐾 = ( ) − ( )( )
𝑝 𝑝 𝑝
is divisible by 𝑝 > 2. As 𝐾 can assume no other values than 0 and ±2, only 𝐾 = 0 is
possible. □
Exercises 4.1 103
By Theorem 4.1.4, we can reduce the calculation of a Legendre symbol to the de-
2 𝑞
termination of ( 𝑝 ) and ( 𝑝 ) where 𝑞 > 2 is a prime different from 𝑝. We discuss these
results in the next section.
Exercises 4.1
(a) 𝑆(0, 𝑝) = 𝑝 − 1
* (b) (𝑎, 𝑝) = 1 ⟹ 𝑆(𝑎, 𝑝) = 𝑆(1, 𝑝)
𝑝−1
(c) ∑𝑎=0 𝑆(𝑎, 𝑝) = 0
(d) 𝑆(1, 𝑝) = −1.
16. Let 𝑀(𝑝) be the number of those integers 𝑎, 1 ≤ 𝑎 ≤ 𝑝 − 2, for which both 𝑎 and
𝑎 + 1 are quadratic residues mod 𝑝.
(a) Prove
𝑝−2
𝑎 𝑎+1
4𝑀(𝑝) = ∑ (( ) + 1)(( ) + 1).
𝑎=1
𝑝 𝑝
(b) Show that 𝑀(𝑝) is approximately 𝑝/4: if 𝑝 = 4𝑘 ± 1, then 𝑀(𝑝) = 𝑘 − 1.
𝑝−1
Proof. Taking the least positive remainders of the given 2
numbers, let 𝑟1 , . . . , 𝑟ᵆ be
𝑝 𝑝 𝑝−1
the ones smaller than 2 and 𝑝 − 𝑠1 , . . . , 𝑝 − 𝑠𝑣 the ones greater than 2
(𝑢 + 𝑣 = 2
).
𝑝−1
Then for every 1 ≤𝑡≤ 2
(4.2.1) 𝑡𝑎 ≡ 𝑟 𝑖 or 𝑡𝑎 ≡ 𝑝 − 𝑠𝑗 (mod 𝑝)
𝑝−1
with a suitable 𝑖 or 𝑗. Note that every 𝑟 𝑖 and 𝑠𝑗 is one of the integers 1, 2, . . . , 2
.
We show that 𝑟 𝑖 and 𝑠𝑗 are distinct, therefore they are the same as the numbers 1,
𝑝−1
2, . . . , 2 in some order.
Assuming 𝑟 𝑖 = 𝑟 𝑘 for some 𝑖 ≠ 𝑘, we have
𝜆𝑎 ≡ 𝑟 𝑖 = 𝑟 𝑘 ≡ 𝜇𝑎 (mod 𝑝)
𝑝−1
with suitable numbers 𝜆, 𝜇, 1 ≤ 𝜆 < 𝜇 ≤ 2
. Since (𝑎, 𝑝) = 1, cancelling 𝑎 gives 𝜆 ≡ 𝜇
(mod 𝑝), which is a contradiction.
We get a contradiction similarly assuming the equality of two 𝑠𝑗 .
Finally, if 𝑟 𝑖 = 𝑠𝑗 , then
𝜆𝑎 ≡ 𝑟 𝑖 = 𝑠𝑗 ≡ −𝜇𝑎 (mod 𝑝) ,
so 𝑝 ∣ 𝑎(𝜆 + 𝜇). However, (𝑎, 𝑝) = 1 and 0 < 𝜆 + 𝜇 < 𝑝, hence none of the factors is
divisible by 𝑝, which contradicts the prime property of 𝑝.
Multiplying the congruences (4.2.1) for 𝑡 = 1, 2, . . . , (𝑝 − 1)/2, we obtain
𝑝−1 𝑝−1
( )! 𝑎 2 ≡ 𝑟1 . . . 𝑟ᵆ (𝑝 − 𝑠1 ) . . . (𝑝 − 𝑠𝑣 ) ≡
(4.2.2) 2
𝑝−1
≡ (−1)𝑣 𝑟1 . . . 𝑟ᵆ 𝑠1 . . . 𝑠𝑣 = (−1)𝑣 ( )! (mod 𝑝) .
2
𝑝−1
Cancelling ( 2
)! in (4.2.2), we arrive at
𝑝−1 𝑎
𝑎 2 ≡ (−1)𝑣 (mod 𝑝) or ( ) = (−1)𝑣 . □
𝑝
Proof. To apply Gauss’s Lemma for 𝑎 = 2, we count how many of the numbers 2, 4,
𝑝
6, . . . , 𝑝 − 1 exceed 2 .
𝑝−1 𝑝−1 𝑝
There are altogether 2
numbers, ⌊ 4
⌋ of which are less than 2 , hence the 𝑣 to
be computed is
𝑝−1 𝑝−1
𝑣= −⌊ ⌋.
2 4
2
If 𝑝 = 8𝑘 + 1, then 𝑣 = 4𝑘 − 2𝑘 = 2𝑘, so ( 𝑝 ) = (−1)2𝑘 = 1.
We get the propositions for 𝑝 = 8𝑘 ± 3 and 8𝑘 − 1 similarly. □
106 4. Legendre and Jacobi Symbols
Theorem 4.2.3 (Quadratic Reciprocity Law). If 𝑝 > 2 and 𝑞 > 2 are two distinct primes,
then
𝑞 𝑝 𝑝−1 𝑞−1
(4.2.3) ( ) ( ) = (−1) 2 ⋅ 2 ,
𝑝 𝑞
or
𝑝
𝑞 −( ), if 𝑝 ≡ 𝑞 ≡ −1 (mod 4)
( ) = { 𝑝𝑞 ♣
𝑝 ( ), otherwise.
𝑞
and since
𝑝−1 𝑞−1
𝑧= ⋅
2 2
by (4.2.5), (4.2.3) holds.
To prove (A), we apply Gauss’s Lemma (Theorem 4.2.1). Keeping the previous
notations, it is sufficient to show
(𝑝−1)/2
𝑡𝑎
(4.2.6) 𝑤= ∑ ⌊ ⌋ ≡ 𝑣 (mod 2) .
𝑡=1
𝑝
We rewrite the congruences in (4.2.1) as equalities obtained from the division al-
gorithm:
𝑡𝑎 either 𝑟 𝑖
(4.2.7) 𝑡𝑎 = ⌊ ⌋𝑝 + {
𝑝 or 𝑝 − 𝑠𝑗 .
4.2. Quadratic Reciprocity 107
𝑝−1
Taking the sum of the equalities (4.2.7) for 𝑡 = 1, 2, . . . , 2
, we obtain
(𝑝−1)/2 ᵆ 𝑣
𝑝−1 𝑡𝑎
(1 + 2 + ⋯ + )𝑎 = 𝑝 ∑ ⌊ ⌋ + ∑ 𝑟 𝑖 + ∑ (𝑝 − 𝑠𝑗 ).
2 𝑡=1
𝑝 𝑖=1 𝑗=1
𝑝−1
Since 𝑟1 , . . . , 𝑟ᵆ , 𝑠1 , . . . , 𝑠𝑣 is a permutation of 1, 2, . . . , 2
, we get, after ordering
𝑣 (𝑝−1)/2
𝑝−1 𝑡𝑎
(4.2.8) (1 + 2 + ⋯ + ) (𝑎 − 1) + 2 ∑ 𝑠𝑗 = 𝑝 ( ∑ ⌊ ⌋ + 𝑣) .
2 𝑗=1 𝑡=1
𝑝
As 𝑎 is odd, the left-hand side of (4.2.8) is even. Since 𝑝 > 2, (4.2.6) holds.
To verify (B), consider a rectangle 𝑅 in the plane with vertices
𝑏 𝑏 𝑐 𝑐
𝐴 = (0, 0),
𝐵 = ( , 0), 𝐶 = ( , ), and 𝐷 = (0, ).
2 2 2 2
The right-hand side of (4.2.5) is the number of points with integer coordinates (lattice
points) inside 𝑅.
We show that also the left-hand side of (4.2.5) is the number of these lattice points.
𝑐
We halve the rectangle 𝑅 along the diagonal 𝑦 = 𝑏 𝑥 connecting 𝐴 and 𝐶. The diagonal
itself does not contain lattice points since (𝑏, 𝑐) = 1.
Now, we count the number 𝑛 of lattice points inside the lower triangle 𝐴𝐵𝐶. Con-
sider such a lattice point on the vertical line 𝑥 = 𝜈. Its first coordinate is 𝜈 and its
𝑐 𝜈𝑐
second coordinate 𝑦 satisfies 1 ≤ 𝑦 < 𝑏 𝜈. Thus, there are ⌊ 𝑏 ⌋ lattice points on this
vertical segment. To obtain the total number of lattice points inside the triangle 𝐴𝐵𝐶,
𝜈𝑐 𝑏−1
we sum these values ⌊ 𝑏 ⌋ for 𝜈 = 1, 2, . . . , 2 :
(𝑏−1)/2
𝜈𝑐
𝑛= ∑ ⌊ ⌋.
𝜈=1
𝑏
This is just the second sum on the left-hand side of (4.2.5).
We can verify the same way that counting the lattice points inside the upper tri-
angle 𝐴𝐶𝐷 by the horizontal lines 𝑦 = 𝜇, we get the first sum on the left-hand side of
(4.2.5). Thus (4.2.5) is proven and so we have completed the proof of Theorem 4.2.3.
□
The next example illustrates how Theorems 4.1.4, 4.2.2, and 4.2.3 can be used to
compute a Legendre symbol.
Example. Is the congruence 𝑥2 ≡ 198 (mod 1997) solvable? (1997 is a prime.)
The standard form of 198 is 198 = 2 ⋅ 32 ⋅ 11, therefore
198 2 3 2 11
( )=( )( ) ( ).
1997 1997 1997 1997
2
1997 ≡ −3 (mod 8), thus ( 1997 ) = −1 by Theorem 4.2.2.
1997 ≡ 1 (mod 4), so using Theorem 4.2.3, then 1997 ≡ −5 (mod 11), etc.,
11 1997 −5 −1 5 11 1
( )=( ) = ( ) = ( )( ) = (−1)( ) = (−1)( ) = −1.
1997 11 11 11 11 5 5
108 4. Legendre and Jacobi Symbols
Hence,
198
( ) = (−1) ⋅ 1 ⋅ (−1) = 1,
1997
so 𝑥2 ≡ 198 (mod 1997) is solvable.
For very large numbers, a problem arises. We have to factor the “numerators” of
the Legendre symbols and no fast algorithm is known for that. We shall see in the next
section how the Jacobi symbol eliminates this difficulty.
Exercises 4.2
𝑎 𝑎 𝑎
( ) = ( ) . . . ( ). ♣
𝑚 𝑝1 𝑝𝑟
7 7 2 7 2
Example. ( ) = ( ) ( ) = ( ) = −1.
45 3 5 5
For 𝑚 prime, the Jacobi symbol equals the Legendre symbol. Therefore, no ambi-
guity can arise if we use the same notation for both.
In contrast to prime moduli, the solvability of 𝑥2 ≡ 𝑎 (mod 𝑚) cannot be charac-
𝑎
terized with the Jacobi symbol ( 𝑚 ) for composite 𝑚 (see Exercise 4.3.2).
On the other hand, the Jacobi symbol inherits the properties of the Legendre sym-
bol listed in Theorems 4.1.4, 4.2.2, and 4.2.3.
Theorem 4.3.2. Assume that the Jacobi symbols below make sense, i.e. every “denomi-
nator” is an odd number greater than 1 coprime to the “numerator” (thus e.g. in (v), 𝑚
and 𝑛 are coprime odd integers greater than 1).
𝑎 𝑏
(i) 𝑎 ≡ 𝑏 (mod 𝑚) ⟹ ( 𝑚 ) = ( 𝑚 ).
𝑎𝑏 𝑎 𝑏 𝑎 𝑎 𝑎
(ii) ( 𝑚 ) = ( 𝑚 )( 𝑚 ), ( 𝑚𝑛 ) = ( 𝑛 )( 𝑚 ).
−1 1, if 𝑚 ≡ 1 (mod 4)
(iii) ( 𝑚 ) = {
−1, if 𝑚 ≡ −1 (mod 4).
110 4. Legendre and Jacobi Symbols
2 1, if 𝑚 ≡ ±1 (mod 8)
(iv) ( 𝑚 ) = {
−1, if 𝑚 ≡ ±3 (mod 8).
𝑛
𝑚 − ( ) , if 𝑛 ≡ 𝑚 ≡ −1 (mod 4)
(v) ( 𝑛 ) = { 𝑚 𝑛 ♣
( 𝑚 ) , otherwise.
Proof. Each property follows from the definition of the Jacobi symbol and from the
corresponding property of the Legendre symbol. We verify this for (v) (i.e. for reci-
procity) in detail; the others can be proven similarly.
Let 𝑚 = 𝑝1 . . . 𝑝𝑟 and 𝑛 = 𝑞1 . . . 𝑞𝑠 (where 𝑝 𝑖 ≠ 𝑞𝑗 ). The definition of the Jacobi
symbol and the multiplicativity of the Legendre symbol (or properties (ii) of the present
theorem) imply
𝑚 𝑝 𝑛 𝑞𝑗
(4.3.1) ( ) = ∏ ( 𝑖) and ( ) = ∏ ( ).
𝑛 1≤𝑖≤𝑟
𝑞𝑗 𝑚 1≤𝑖≤𝑟
𝑝𝑖
1≤𝑗≤𝑠 1≤𝑗≤𝑠
Denote by 𝑢 and 𝑣 the number of primes of the form 4𝑘 − 1 among the 𝑝 𝑖 and the 𝑞𝑗 .
𝑝 𝑞 𝑝 𝑞
Then ( 𝑞 𝑖 ) = −( 𝑝𝑗 ) for these 𝑢𝑣 pairs 𝑝 𝑖 , 𝑞𝑗 , and ( 𝑞 𝑖 ) = ( 𝑝𝑗 ) for all other pairs. Hence,
𝑗 𝑖 𝑗 𝑖
by (4.3.1),
𝑚 𝑛
( ) = − ( ) ⟺ 𝑢𝑣 is odd
𝑛 𝑚
⟺ 𝑢 and 𝑣 are odd
⟺ 𝑚 ≡ 𝑛 ≡ −1 (mod 4) . □
Exercises 4.3
Prime Numbers
The notion of primes is very simple, but they form perhaps the most mysterious se-
quence in mathematics. Euclid’s Elements contains a proof that there are infinitely
many of them, but we do not know whether the same holds for twin primes. After
introducing some other similar famous, innocent looking but hopelessly difficult un-
solved problems, we shall deal with primes of special forms such as Mersenne and
Fermat primes and with primes in arithmetic progressions. Concerning the distribu-
tion of primes, we shall establish lower and upper bounds for the number of primes
not exceeding 𝑥 and investigate the sum of reciprocals of the primes. Finally, we shall
study how we can determine practically whether a large number is prime or not (pri-
mality testing), and how we can factor a large composite number (prime factorization).
The amount of time needed to solve these two types of problems differ dramatically (at
least according to our present knowledge), and we shall discuss the RSA scheme, the
widely applied public key cryptosystem based on this discrepancy.
Proof. Assume the converse, i.e. there exist only finitely many primes, 𝑝1 (= 2), . . . ,
𝑝𝑟 . Consider the number 𝐴 = 𝑝1 . . . 𝑝𝑟 + 1.
Clearly, 𝐴 is not divisible by any of the primes 𝑝1 , . . . , 𝑝𝑟 .
113
114 5. Prime Numbers
As with every integer greater than 1, 𝐴 has a prime divisor. It must differ from the
primes 𝑝1 , . . . , 𝑝𝑟 , which contradicts the assumption that these were the only primes.
□
where 𝑝𝑛 denotes the 𝑛th prime number (Exercise 5.1.9a). A much better upper bound
will be established in Section 5.4.
Now we present the sieve of Eratosthenes. This procedure generates all primes up
to a given limit 𝑁.
Theorem 5.1.2 (Sieve of Eratosthenes). We list all integers from 2 to 𝑁. In the first step
we mark the number 2 and delete all multiples of 2 greater than 2: 4, 6, 8, . . . Then we
mark the smallest integer not yet marked or deleted; this is the number 3, and then we
delete all its multiples greater than itself: 6, 9, . . . ( 6, 12, etc. are deleted the second time).
We repeat the above process always with the smallest integer not yet marked or deleted
as long as this number does not exceed √𝑁. If every number up to √𝑁 is either marked
or deleted, then we stop.
At this point, the remaining numbers (i.e. the marked and the unmarked but un-
deleted integers together) form all primes not greater than 𝑁 (the marked ones are the
primes not greater than √𝑁, whereas those unmarked but undeleted are the primes be-
tween √𝑁 and 𝑁). ♣
Proof. The deleted numbers are clearly composite since they have a proper divisor
greater than 1.
We show by induction that the marked numbers are primes. The first marked
number, 2 is irreducible. Let now 𝑠 ≤ √𝑁 be the 𝑘th marked integer, and assume that
the first 𝑘 − 1 marked integers constitute all irreducible elements less than 𝑠. None of
them divides 𝑠 (since 𝑠 was not deleted), i.e. 𝑠 is not divisible by any irreducible element
less than 𝑠, hence 𝑠 must be irreducible itself.
Finally, let 𝑡 be any other undeleted (and unmarked) integer (√𝑁 < 𝑡 ≤ 𝑁). If
𝑡 were composite, then (e.g. by Exercise 1.4.7a-b) 𝑡 would have an irreducible factor
𝑝 ≤ √𝑡 ≤ √𝑁. This is a contradiction, however, since 𝑡 was not divisible by any
marked number, i.e. by any irreducible integer up to √𝑁. □
Now we mention a few famous unsolved problems about prime numbers. We shall
deal with some of them more in detail in later sections of this chapter.
Twin primes. {3, 5}, {5, 7}, {11, 13}, {17, 19}, . . . : Does it occur infinitely often that
two consecutive odd integers are both primes?
Remarks: (1) As of Feb. 2019 the largest known twin primes are 2996863034895 ⋅
21290000 ± 1 (these numbers have 388342 digits in decimal system).
5.1. Classical Problems 115
(2) Replacing 2 by any other even number 2𝑘, it is unknown whether there exist
infinitely many pairs of primes with a difference of 2𝑘. It was a major break-
through, however, when, improving the recent results and ideas of Goldston,
Pintz, and Yildirim, Zhang proved in 2013 that there exists such a number 2𝑘 <
70000000. The Polymath8 group led by Terence Tao obtained the presently known
best bound 2𝑘 ≤ 246 in 2014.
(3) As further generalizations, one can investigate prime triples, quadruples, etc. It
is easy to check that each of 𝑛, 𝑛 + 2, and 𝑛 + 4 is prime only if 𝑛 = 3, but it is
conceivable that 𝑛, 𝑛 + 2, and 𝑛 + 6, or even 𝑛, 𝑛 + 2, 𝑛 + 6, and 𝑛 + 8 are all primes
for infinitely many 𝑛, etc. (Cf. with Exercises 1.4.1 and 5.1.1.)
(4) The twin prime problem asks whether the difference of two consecutive primes is
very small infinitely often. Another famous conjecture in the opposite direction
is that there is always a prime between any two consecutive squares, so the differ-
ence of consecutive primes cannot grow too fast. We investigate the gaps between
consecutive primes in more detail in Section 5.5.
(5) The twin primes (even if there are infinitely many of them) are very rare among
the primes. The sum of their reciprocals converges, whereas the sum of recipro-
cals of all primes diverges (see Section 5.6).
(6) Another interesting result is that there exist infinitely many primes 𝑝 where 𝑝 + 2
is either prime or the product of two primes (i.e. just one step is missing from the
solution of the twin prime problem).
(B) Every sufficiently large even integer can be written in the form 𝑝 + 𝑚 where
𝑝 is a prime and 𝑚 is either a prime, or the product of two primes. (The first
result in this direction where 𝑚 is the product of at most 𝑘 primes with some
fixed 𝑘 was found by Rényi in 1947.)
(C) The even integers possibly not representable as the sum of two primes occur
as very rare exceptions (in a precisely defined sense). Unfortunately “rare”
cannot be replaced yet by “finitely many”.
Long arithmetic progressions. {3, 5, 7}, {5, 11, 17, 23, 29}, {7, 37, 67, 97, 127, 157},
. . . : Are there arbitrarily long (nonconstant) arithmetic progressions consisting purely
of primes? It was a great surprise when Ben Green and Terence Tao proved in 2004
that the answer is yes.
Remarks: (1) It is very hard to exhibit such long arithmetic progressions explicitly.
The record length as of February 2019 is 26; one of the record-holders is
43142746595714191 + 23681770 ⋅ 223092870𝑘, 𝑘 = 0, 1, . . . , 25.
Here 223092870 is the product of all primes less than 26, which necessarily divides
the difference of any such arithmetic progression (see Exercise 5.1.5).
(2) An infinite arithmetic progression cannot consist purely of primes (see Exercise
1.4.2), but there are infinitely many primes in it if its first (or any other) term and
the difference are coprime (Dirichlet’s Theorem, see Section 5.3).
Formulas for primes. Can we establish a formula of practical value that yields
the 𝑛th prime for every 𝑛, or at least an effectively computable function defined on the
natural numbers that assumes only prime values (among its infinitely many values)?
Remarks: (1) It is generally agreed that there is no real hope of finding such a func-
tion. The formulas in Exercises 5.1.9b and 5.5.9b do not meet the requirement of
practical computability.
(2) As noticed by Euler, 𝑛2 +𝑛+41 is a prime for every 0 ≤ 𝑛 ≤ 39 (but it is composite
for 𝑛 = 40). This immediately implies that
(𝑛 − 40)2 + (𝑛 − 40) + 41 = 𝑛2 − 79𝑛 + 1601
is a prime for every 0 ≤ 𝑛 ≤ 79. If we allow polynomials with rational coefficients,
then we can construct arbitrarily long such sequences of primes (Exercise 5.1.7).
However, a (nonconstant) polynomial cannot yield a general formula for primes
since it cannot assume prime values at every integer (Exercise 5.1.8).
Exercises 5.1 117
(3) On the other hand, we have the following surprising result (also of theoretical
significance only): There are polynomials in several variables where on substitut-
ing all non-negative integers into the variables, the set of positive values is exactly
the set of all (positive) primes. (Such a polynomial may assume the same prime
values at different places and it assumes negative values as well.)
The existence of such a polynomial was first shown by Matiyasevich in 1970 as
a by-product when he (crowning the work of many other mathematicians) pro-
vided a negative answer to Hilbert’s tenth problem: he disproved the existence of
a general algorithm that could decide for every Diophantine equation whether or
not it has a(n integer) solution. The present records for such polynomials are the
following: (i) the minimal degree is 5 with 42 variables; (ii) the minimal number
of variables is 10, but then the degree is about 1.6 ⋅ 1045 .
Exercises 5.1
where the digits in the decimal fraction 𝑐 are obtained from the decimal expan-
sions of the primes written one after the other and separated by sufficiently
many 0 digits to avoid collision. Show that
2𝑛 2𝑛 −22𝑛−1 2𝑛−1
𝑝𝑛 = ⌊102 𝑐⌋ − 102 ⋅ ⌊102 𝑐⌋.
The following two theorems give practical tools for investigating the Fermat num-
bers. Theorem 5.2.1 is an effective help in finding their prime divisors and Theo-
rem 5.2.2 yields a (relatively) fast algorithm to test whether a given Fermat number
is prime or composite.
Theorem 5.2.1. Any (positive) divisor of 𝐹𝑛 is of the form 𝑘2𝑛+1 + 1, and for 𝑛 ≥ 2 it is
of the form 𝑟2𝑛+2 + 1. ♣
Presumably Euler used this theorem for proving that 𝐹5 is composite: the prime
divisors of 𝐹5 can only be primes of form 128𝑘 + 1. The first two of these are 257 and
641, and the latter one divides 𝐹5 .
Proof. First we verify the statement if the divisor is a prime 𝑝. Then 𝑝 ∣ 𝐹𝑛 means
𝑛
(5.2.1) 22 ≡ −1 (mod 𝑝) .
Squaring both sides, we obtain
𝑛+1
(5.2.2) 22 ≡ 1 (mod 𝑝) .
By Theorem 3.2.2(i),
2𝑗 ≡ 1 (mod 𝑝) ⟺ 𝑜𝑝 (2) ∣ 𝑗.
Hence (5.2.2) implies
𝑜𝑝 (2) ∣ 2𝑛+1 ,
and by (5.2.1), we have
𝑜𝑝 (2) ∤ 2𝑛 ,
since clearly 𝑝 > 2, and thus −1 ≢ 1 (mod 𝑝). It follows that
𝑜𝑝 (2) = 2𝑛+1 .
Using 𝑜𝑝 (2) ∣ 𝑝 − 1, we obtain 2𝑛+1 ∣ 𝑝 − 1, so 𝑝 = 𝑘2𝑛+1 + 1 for a suitable integer 𝑘.
If 𝑛 ≥ 2, then this implies 𝑝 = 8𝑠 + 1, so
2 𝑝−1
( ) = 1, hence 2 2 ≡ 1 (mod 𝑝) .
𝑝
Therefore
𝑝−1
𝑜𝑝 (2) = 2𝑛+1 || ,
2
so 𝑝 = 𝑟2𝑛+2 + 1 for a suitable integer 𝑟.
These results can be written also as 𝑝 ≡ 1 (mod 2𝑛+1 ), and for 𝑛 ≥ 2, as 𝑝 ≡ 1
(mod 2𝑛+2 ).
Consider an arbitrary divisor 𝑑 ∣ 𝐹𝑛 . Write 𝑑 as the product of (not necessarily
distinct) primes (if 𝑑 > 1): 𝑑 = 𝑝1 . . . 𝑝𝑠 . We have just proven that 𝑝 𝑖 ≡ 1 (mod 2𝑛+1 )
for every 𝑖. Multiplying these congruences, we see that also 𝑑 ≡ 1 (mod 2𝑛+1 ) holds.
We can use the same argument also for the modulus 2𝑛+2 . □
Theorem 5.2.2 (Pepin’s test). Let 𝑛 ≥ 1. Then 𝐹𝑛 is prime if and only if
(5.2.3) 3(𝐹𝑛 −1)/2 ≡ −1 (mod 𝐹𝑛 ) . ♣
120 5. Prime Numbers
Proof. Assume first that 𝐹𝑛 is a prime. Then (5.2.3) means that 3 is a quadratic non-
residue modulo 𝐹𝑛 , i.e.
3
( ) = −1.
𝐹𝑛
𝑛
To verify this, we use that 𝑛 ≥ 1 yields 22 = 4𝑡 , hence
𝐹𝑛 ≡ 1 (mod 4) , and 𝐹𝑛 = 4𝑡 + 1 ≡ −1 (mod 3) .
Applying quadratic reciprocity, we obtain
3 𝐹 −1
( ) = ( 𝑛 ) = ( ) = −1.
𝐹𝑛 3 3
To prove the converse, assume that (5.2.3) holds. Squaring both sides, we get
(5.2.4) 3𝐹𝑛 −1 ≡ 1 (mod 𝐹𝑛 ) .
leading scientists, and encouraged the search for such primes in the hope of finding
new perfect numbers.
Mersenne was aware of the difficulty of determining whether a large integer is
prime or composite. He wrote in his book in 1644: “To tell if a given number of 15 or
20 digits is prime or not, all time would not suffice for the test, whatever use is made of
what is already known.” A few pages later, however, we can read his claim that: 2𝑝 − 1
is a prime for 𝑝 = 2, 3, 5, 7, 13, 17, 19, 31, 67, 127, 257, but for no other values of 𝑝
below 257.
For more than two centuries, nobody knew whether Mersenne’s list was correct or
not. The first error was discovered in 1876(!) by another Frenchman, Édouard Lucas,
who proved that 267 − 1 is composite. It is interesting that Lucas proved the compos-
iteness of 267 − 1 without exhibiting any factors of it (based on Theorem 5.2.4 bearing
also his name). The factorization
193707721 ⋅ 761838257287
was found only in 1903(!) by the American mathematician F. N. Cole who spent three
years of Sunday afternoons wrestling with the problem (remember, he had to work by
hand without computers, since these were invented half a century later).
Later four other errors were discovered in Mersenne’s list: the missing 261 − 1,
289 − 1, and 2107 − 1 are primes and 2257 − 1 is composite.
The presently (as of February 2019) known 51 Mersenne primes are 2𝑝 − 1 where
𝑝 = 2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253,
4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091,
756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011,
24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161,
74207281, 77232917, and 82589933. The last number, 282589933 − 1 is the largest known
prime—it has 24862048 decimal digits! It is a famous unsolved problem whether there
are infinitely many Mersenne primes.
In the table of Mersenne numbers at the end of this book you can find the prime
factorization of all composite Mersenne numbers for the (prime) exponents between
10 and 100.
Now we prove the analogues of Theorems 5.2.1 and 5.2.2 for Mersenne numbers.
Theorem 5.2.3. Let 𝑝 > 2 be a prime. Then any (positive) divisor of 𝑀𝑝 = 2𝑝 − 1 is of
the forms 2𝑘𝑝 + 1 and 8𝑟 ± 1. ♣
Example. Consider 𝑝 = 47. Then for any prime divisor 𝑞 of 𝑀47 = 247 − 1, we have
𝑞 = 94𝑘 + 1 = 8𝑟 ± 1. Solving the system of simultaneous congruences
𝑥 ≡ 1 (mod 94) , 𝑥 ≡ ±1 (mod 8)
we obtain
𝑥 ≡ 1 or 95 (mod 376) .
The primes satisfying these conditions are
𝑞 = 1129, 1223, 2351, . . .
We find that 2351 ∣ 𝑀47 , hence 𝑀47 is composite.
122 5. Prime Numbers
It is conceivable that also Mersenne found this divisor of 𝑀47 , and therefore he
did not include 𝑝 = 47 into his list (and the missing of this value is not just a lucky
coincidence).
Proof. Similar to the argument seen at the Fermat numbers, it is sufficient to prove
the statement for prime divisors.
Assume that a prime 𝑞 satisfies
𝑞 ∣ 2𝑝 − 1, i.e. 2𝑝 ≡ 1 (mod 𝑞) .
Then 𝑜𝑞 (2) ∣ 𝑝, and 𝑜𝑞 (2) ≠ 1, hence 𝑜𝑞 (2) = 𝑝.
We infer 𝑝 ∣ 𝑞 − 1, thus 𝑞 = 𝑡𝑝 + 1. Since 𝑞 and 𝑝 are odd, therefore 𝑡 is even, so
𝑞 = 2𝑘𝑝 + 1.
To verify 𝑞 = 8𝑟 ± 1, we have to show that 2 is a quadratic residue mod 𝑞. This
follows from the congruence 2𝑝 ≡ 1 (mod 𝑞) by the properties of the Legendre symbol
using that 𝑝 is odd:
𝑝
2 2 2𝑝 1
( ) = ( ) = ( ) = ( ) = 1. □
𝑞 𝑞 𝑞 𝑞
Theorem 5.2.4 (Lucas–Lehmer-test). Let 𝑝 > 2 be a prime, 𝑎1 = 4, and 𝑎𝑖+1 = 𝑎2𝑖 − 2
for 𝑖 ≥ 1. Then 𝑀𝑝 is a prime if and only if
(5.2.5) 𝑀𝑝 ∣ 𝑎𝑝−1 . ♣
Example. Put 𝑝 = 5. Then
𝑎1 = 4, 𝑎2 = 14, 𝑎3 = 194 ≡ 8 (mod 31) , and 𝑎4 ≡ 62 ≡ 0 (mod 31) ,
hence 𝑀5 = 31 is a prime.
Proof. The numbers 𝑎+𝑏√3 (where 𝑎, 𝑏 are integers) form a (commutative) ring (with
identity element and without zero divisors) for the usual operations; we denote this
ring by 𝐻. In our proof we shall rely on the elementary properties of divisibility, con-
gruences, and order in 𝐻 (which hold exactly the same way as for the integers). Unique
prime factorization is valid in 𝐻 (see Theorem 10.3.6 and Exercise 10.3.1), but we shall
not need this result in our argument.
I. We can easily verify by induction that
𝑘−1 𝑘−1
𝑎𝑘 = (2 + √3)2 + (2 − √3)2
holds for every 𝑘. Hence (5.2.5) is equivalent to the divisibility
𝑝−2 𝑝−2
(5.2.6) 𝑀𝑝 ∣ (2 + √3)2 + (2 − √3)2 .
Factoring the right-hand side in (5.2.6), we obtain
𝑝−2 𝑝−1
(5.2.7) 𝑀𝑝 ∣ (2 − √3)2 ((2 + √3)2 + 1).
We note that the divisibility in (5.2.7) holds among the integers if and only if it is
valid in 𝐻 (see Exercise 5.2.10), and (2 − √3)(2 + √3) = 1 implies that 2 ± √3 raised to
5.2. Fermat and Mersenne Primes 123
integer powers are units in 𝐻. Therefore (5.2.7) and thus (5.2.5) are equivalent to the
congruence
𝑝−1
(5.2.8) (2 + √3)2 ≡ −1 (mod 𝑀𝑝 ) .
We conclude that Theorem 5.2.4 can be reformulated as follows: 𝑀𝑝 is a prime if
and only if (5.2.8) holds.
II. We shall need the following lemma: For any prime 𝑞 > 3, we have
3
(5.2.9) (𝑎 + 𝑏√3)𝑞 ≡ 𝑎 + ( ) 𝑏√3 (mod 𝑞) .
𝑞
Proof of the lemma: Consider the binomial expansion
𝑞 𝑞
(5.2.10) (𝑎 + 𝑏√3)𝑞 = 𝑎𝑞 + ( )𝑎𝑞−1 𝑏√3 + ( )𝑎𝑞−2 3𝑏2 + ⋯ + 𝑏𝑞 3(𝑞−1)/2 √3.
1 2
By Fermat’s Little Theorem,
𝑎𝑞 ≡ 𝑎 (mod 𝑞) and 𝑏𝑞 ≡ 𝑏 (mod 𝑞) ,
further, each of
𝑞 𝑞 𝑞
( ), ( ), . . . , ( )
1 2 𝑞−1
is divisible by 𝑞, and
3
3(𝑞−1)/2 ≡ ( ) (mod 𝑞) .
𝑞
Substituting these into (5.2.10), we obtain (5.2.9) as stated.
III. Now we are in the position to show that (5.2.8) implies the primality of 𝑀𝑝 .
Squaring (5.2.8), we have
𝑝
(5.2.11) (2 + √3)2 ≡ 1 (mod 𝑀𝑝 ) .
Let 𝑞 be a prime divisor of 𝑀𝑝 (clearly 𝑞 > 3). Then (5.2.11) and (5.2.8) hold also
for the modulus 𝑞 instead of 𝑀𝑝 . This yields (similar to the argument used in the proofs
of Theorems 5.2.1 and 5.2.2) that 𝑜𝑞 (2 + √3) = 2𝑝 .
3
If ( 𝑞 ) = 1, then by (5.2.9) we obtain
Exercises 5.2
We do not prove this general theorem; we shall verify only a few special cases.
Theorem 5.3.2. There are infinitely many primes of the form 4𝑘 + 3. ♣
126 5. Prime Numbers
Proof. We follow the Euclidean ideas seen in Theorem 5.1.1. For a proof by contra-
diction, we assume that there exist only finitely many primes of the form 4𝑘 + 3. Let
them be 𝑝1 = 3, . . . , 𝑝𝑟 , and let 𝐴 = 4𝑝1 . . . 𝑝𝑟 − 1.
Clearly, no 𝑝 𝑖 divides 𝐴.
We write 𝐴 as a product of primes: 𝐴 = 𝑞1 . . . 𝑞𝑠 (possibly 𝑠 = 1 or 𝑞𝑖 = 𝑞𝑗 ). Every
𝑞𝑗 > 2, since 𝐴 is odd. Further, all factors 𝑞𝑗 cannot satisfy 𝑞𝑗 ≡ 1 (mod 4), because
multiplying these congruences would yield 𝐴 ≡ 1 (mod 4) which is false. Therefore
there must be a prime of the form 4𝑘 + 3 among the 𝑞𝑗 . This differs from the primes
𝑝1 , . . . , 𝑝𝑟 , providing thus a contradiction. □
Proof. We need a further refinement of the Euclidean ideas. Again, we assume that
there exist only finitely many such primes, 𝑝1 = 5, . . . , 𝑝𝑟 . We consider now 𝐴 =
(2𝑝1 . . . 𝑝𝑟 )2 + 1.
Clearly, no 𝑝 𝑖 divides 𝐴.
Let 𝑞 be any prime divisor of 𝐴. Obviously, 𝑞 > 2. We rewrite the divisibility 𝑞 ∣ 𝐴
as
(2𝑝1 . . . 𝑝𝑟 )2 ≡ −1 (mod 𝑞) .
It follows that the congruence 𝑥2 ≡ −1 (mod 𝑞) is solvable, i.e. 𝑞 ≡ 1 (mod 4). Thus
we found a new prime of the form 4𝑘 + 1 which is a contradiction. □
Using quadratic congruences, we can settle many other special cases of Dirichlet’s
Theorem, too, see Exercise 5.3.3.
Now we verify Dirichlet’s Theorem for any arithmetic progression having 1 as its
first term:
Theorem 5.3.4. For any 𝑚 > 0, there are infinitely many primes in the sequence 𝑚𝑘 + 1,
𝑘 = 0, 1, 2, . . . . ♣
Proof. We shall use the following facts about cyclotomic polynomials and multiple
roots of polynomials:
(i) The 𝑚th cyclotomic polynomial Φ𝑚 has leading coefficient 1 and its zeros are the
complex 𝑚th primitive roots of unity. Thus the degree of Φ𝑚 is 𝜑(𝑚). Examples:
Φ4 = 𝑥2 + 1, Φ11 = 𝑥10 + 𝑥9 + ⋯ + 1.
(5.3.1) Φ𝑚 ∣ 𝑥𝑚 − 1, moreover, 𝑥𝑚 − 1 = ∏ Φ𝑑 .
𝑑|𝑚
(ii) Let 𝐹 be any (commutative) field and let 𝑓 ∈ 𝐹[𝑥]. An element 𝛼 ∈ 𝐹 is called a
multiple root of 𝑓 if (𝑥 − 𝛼)2 ∣ 𝑓. This holds if and only if 𝑓(𝛼) = 𝑓′ (𝛼) = 0, where
𝑓′ is the (formal) derivative of 𝑓.
Exercises 5.3 127
Using the above notions and theorems, we prove first the following lemma of in-
dependent interest:
Let 𝑐 be an integer and 𝑞 a prime. Then
(5.3.3) 𝑐𝑚 − 1 = ∏ Φ𝑑 (𝑐).
𝑑|𝑚
Because 𝑜𝑞 (𝑐) = 𝑚 implies 𝑐𝑚 ≡ 1 (mod 𝑞), 𝑞 divides the left-hand side of (5.3.3).
Since 𝑞 is a prime, a factor Φ𝑑 (𝑐) on the right-hand side must be a multiple of 𝑞. Due
to Φ𝑑 (𝑐) ∣ 𝑐𝑑 − 1 we get 𝑐𝑑 ≡ 1 (mod 𝑞) for some 𝑑 ∣ 𝑚. But 𝑜𝑞 (𝑐) = 𝑚, therefore only
𝑑 = 𝑚 can occur, so 𝑞 ∣ Φ𝑚 (𝑐).
Turning to the converse, we assume 𝑞 ∣ Φ𝑚 (𝑐) and 𝑞 ∤ 𝑚. Then Φ𝑚 (𝑐) ∣ 𝑐𝑚 − 1
implies 𝑐𝑚 ≡ 1 (mod 𝑞). Assuming 𝑜𝑞 (𝑐) = 𝑡 < 𝑚, we shall arrive at a contradiction.
We have 𝑡 ∣ 𝑚 and 𝑐𝑡 ≡ 1 (mod 𝑞). Applying (5.3.3) for 𝑡 instead of 𝑚, we obtain
𝑞 ∣ Φ𝑑 (𝑐) for some 𝑑 ∣ 𝑡. This means that at least two factors are divisible by 𝑞 on the
right-hand side of the original (5.3.3).
We shall consider the identity 𝑥𝑚 − 1 = ∏𝑑|𝑚 Φ𝑑 in (5.3.1) over the modulo 𝑞 field
𝐙𝑞 . Then the last sentence of the previous paragraph can be interpreted so that 𝑐 (as an
element of 𝐙𝑞 ) is a root of at least two factors in ∏𝑑|𝑚 Φ𝑑 . This product equals 𝑥𝑚 − 1,
hence 𝑐 is a multiple root of the polynomial 𝑓 = 𝑥𝑚 − 1 ∈ 𝐙𝑞 [𝑥]. By (ii), we have
𝑓′ (𝑐) = 𝑚𝑐𝑚−1 = 0 (in 𝐙𝑞 ).
Since 𝑞 ∤ 𝑚 and 𝑞 ∤ 𝑐, i.e. 𝑚 ≠ 0 and 𝑐 ≠ 0 in the field 𝐙𝑞 , therefore 𝑚𝑐𝑚−1 cannot
be 0, which is a contradiction. This completes the proof of the lemma.
Turning to the proof of Theorem 5.3.4, we assume that there are only finitely many
primes (possibly none) of the form 𝑚𝑘+1, 𝑝1 , . . . , 𝑝𝑟 . Define 𝑐 as 𝑐 = 𝑣𝑚𝑝1 . . . 𝑝𝑟 , where
𝑣 is any positive integer (𝑐 = 𝑣𝑚 if 𝑟 = 0). If 𝑣 is large enough, Φ𝑚 (𝑐) > 1.
Let 𝑞 be any prime divisor of Φ𝑚 (𝑐). Here Φ𝑚 (𝑐) ∣ 𝑐𝑚 − 1 guarantees (𝑞, 𝑐) = 1,
hence 𝑞 ∤ 𝑚. Thus 𝑜𝑞 (𝑐) = 𝑚, by the lemma.
Therefore 𝑚 ∣ 𝑞 − 1, so 𝑞 is of the form 𝑞 = 𝑚𝑘 + 1. Finally, (𝑞, 𝑐) = 1 implies
𝑞 ≠ 𝑝 𝑖 , which contradicts our assumption that 𝑝1 , . . . , 𝑝𝑟 were all primes of the form
𝑚𝑘 + 1. □
Exercises 5.3
2. Why can one not apply the proof of Theorem 5.3.2 to Theorem 5.3.3 directly, taking
𝐴 = 4𝑝1 . . . 𝑝𝑟 + 1?
128 5. Prime Numbers
3. Prove without relying on the general form of Dirichlet’s Theorem that the arith-
metic progressions below contain infinitely many primes:
(a) 6𝑘 + 5
(b) 8𝑘 + 3
(c) 8𝑘 + 5
(d) 8𝑘 + 7
(e) 10𝑘 + 9
(f) 12𝑘 + 5
(g) 12𝑘 + 7
(h) 12𝑘 + 11.
4. How many primes have 4321 as last four digits in their decimal representation?
5. Write all primes one after the other following the decimal point. Show that the
resulting number 0.235711131719 . . . is irrational.
6. For which positive integers 𝑎, 𝑏, 𝑐 does the set of numbers 𝑎 + 𝑏𝑘 + 𝑐𝑛 contain
infinitely many primes, where 𝑘 = 0, 1, 2, . . . , 𝑛 = 0, 1, 2, . . . ?
7. (a) Show that every non-zero integer is a quadratic residue mod 𝑝 for some suit-
able prime 𝑝.
(b) Which integers are quadratic non-residues mod 𝑝 for some suitable prime 𝑝?
8. Prove that for any 𝑛 > 1, there exists a polynomial 𝑓 with integer coefficients of
degree 𝑛 reducible over the rational field such that 𝑓(𝑣 𝑖 ) is a positive prime for each
of the suitably chosen integers 𝑣 1 , . . . , 𝑣 𝑛 .
9. Show (without relying on the general form of Dirichlet’s Theorem), that if there ex-
ists a prime of the form 𝑎+𝑘𝑑 for every pair of coprime integers 𝑎 and 𝑑, then there
always exist infinitely many such primes. (This means that the main difficulty in
proving Dirichlet’s Theorem lies not in guaranteeing the infinitude of such primes
but in showing that there exist such primes at all in every suitable arithmetic pro-
gression.)
Remarks: (1) The Prime Number Theorem refers to the ratio, and not to the difference
𝑥 𝑥
of 𝜋(𝑥) and log 𝑥 . In fact, lim𝑥→∞ 𝜋(𝑥) − log 𝑥 = ∞.
𝑥
(2) The Prime Number Theorem states that there are approximately log 𝑥 primes not
exceeding 𝑥. Whether this is much or few, depends on to which set it is compared.
Compared to all positive integers, the primes are very scarce as
𝑥
𝜋(𝑥) log 𝑥 1
lim = lim = lim = 0.
𝑥→∞ ⌊𝑥⌋ 𝑥→∞ 𝑥 𝑥→∞ log 𝑥
At the same time, the primes occur much more densely than, for example, the
squares since there are ⌊√𝑥⌋ squares up to 𝑥, and
𝑥
𝜋(𝑥) log 𝑥 √𝑥
lim = lim = lim = ∞.
𝑥→∞ ⌊√𝑥⌋ 𝑥→∞ √𝑥 𝑥→∞ log 𝑥
(3) The Prime Number Theorem was first conjectured at the end of the 18th century
by Legendre and Gauss independently. Gauss was just 15 years old, and 𝑥/ log 𝑥
is replaced by the logarithmic integral
𝑥
𝑑𝑡
Li(𝑥) = ∫
2
log 𝑡
in his conjecture. Later it turned out that this integral approximates 𝜋(𝑥) much
better than 𝑥/ log 𝑥. The way towards the proof of the Prime Number Theorem
was devised some 70 years later by Riemann, and the first proofs were achieved
in 1896 independently by de la Vallée Poussin and Hadamard. Erdős and Selberg
found a so-called elementary proof (not relying on deep theorems from analysis)
in 1949.
The Prime Number Theorem provides an asymptotic formula for the 𝑛th prime.
The reciprocal of the sequence on the left-hand side of (5.4.1) can be written as
𝑛 log 𝑛 𝑛 log 𝑝𝑛 log 𝑛
(5.4.3) = ⋅ .
𝑝𝑛 𝑝𝑛 log 𝑝𝑛
By (5.4.2) and (5.4.3), to prove (5.4.1) we have to show that the limit of the second
fraction on the right-hand side of (5.4.3) is 1, i.e.
log 𝑛
(5.4.4) lim = 1.
𝑛→∞ log 𝑝𝑛
130 5. Prime Numbers
In the remaining part of the section we prove a result weaker than the Prime Num-
ber Theorem:
Theorem 5.4.3. There exist positive constants 𝑐 1 and 𝑐 2 and an 𝑥0 such that every 𝑥 ≥ 𝑥0
satisfies
𝑥 𝑥
(5.4.7) 𝑐1 < 𝜋(𝑥) < 𝑐 2 . ♣
log 𝑥 log 𝑥
Remarks: (1) Theorem 5.4.3 means that the order of magnitude of 𝜋(𝑥) is the same
as that of 𝑥/ log 𝑥. This in itself is sufficient to answer several questions, e.g. the
density comparisons in Remark 2 after Theorem 5.4.1.
(2) To parallel Theorems 5.4.1 and 5.4.3, the quotient of 𝜋(𝑥) and 𝑥/ log 𝑥 tends to 1
by the Prime Number Theorem, and stays between two positive constants (for 𝑥
large enough) by Theorem 5.4.3. It immediately follows that (5.4.7) can hold only
with constants 𝑐 1 ≤ 1 and 𝑐 2 ≥ 1. The Prime Number Theorem means that the
estimates of Theorem 5.4.3 are valid for any constants 0 < 𝑐 1 < 1 and 𝑐 2 > 1,
i.e. there exists an 𝑥0 for any constants 0 < 𝑐 1 < 1 and 𝑐 2 > 1 so that (5.4.7)
holds for every 𝑥 ≥ 𝑥0 . (Moreover, even 𝑐 1 = 1 is possible; see Remark 1 after
Theorem 5.4.1.)
(3) In Theorem 5.4.3 even 𝑥0 = 2 is possible (at the price of obtaining worse values
for 𝑐 1 and 𝑐 2 ), see Exercise 5.4.2.
(4) Theorem 5.4.3 was first proven by Chebyshev in 1850. Below we present Erdős’s
proof for the lower bound and a joint proof by Erdős and Kalmár for the upper
bound.
The sum of terms in each of the 𝑡 columns is of the form ⌊𝑎 + 𝑏⌋ − ⌊𝑎⌋ − ⌊𝑏⌋. It follows
that each expression is always 0 or 1 (see Exercise 5.4.1), hence 𝛽𝑝 ≤ 𝑡. □
Now we turn to the proof of the lower bound for 𝜋(𝑥). The right-hand side of
(5.4.8) is the product of (at most) 𝜋(𝑛) prime powers, and each of these factors is less
than or equal to 𝑛, by Lemma 5.4.4. This immediately implies
𝑛
(5.4.9) ( ) = ∏ 𝑝𝛽𝑝 ≤ 𝑛𝜋(𝑛) .
𝑘 𝑝≤𝑛
We apply the induction hypothesis for 𝑛 = 𝑘 + 1 to the first product on the right-hand
side of (5.4.12):
(5.4.13) ∏ 𝑝 < 4𝑘+1 .
𝑝≤𝑘+1
We get an upper bound for the second product using the binomial coefficient
2𝑘 + 1 (2𝑘 + 1)(2𝑘) . . . (𝑘 + 2)
( )= .
𝑘 𝑘!
Every prime 𝑘 + 2 ≤ 𝑝 ≤ 2𝑘 + 1 occurs in the numerator, but none of them divides the
denominator, hence (the integer) (2𝑘+1
𝑘
) is divisible by each of them, so it is a multiple
of their product, as well:
| 2𝑘 + 1
∏ 𝑝|( ).
𝑘+2≤𝑝≤2𝑘+1 |
𝑘
Hence
2𝑘 + 1
(5.4.14) ∏ 𝑝≤( ).
𝑘+2≤𝑝≤2𝑘+1
𝑘
Further,
2𝑘 + 1 1 2𝑘 + 1 2𝑘 + 1 1
(5.4.15) ( ) = (( )+( )) < ⋅ 22𝑘+1 = 4𝑘 .
𝑘 2 𝑘 𝑘+1 2
(5.4.14) and (5.4.15) imply
(5.4.16) ∏ 𝑝 < 4𝑘 .
𝑘+2≤𝑝≤2𝑘+1
Finally, substituting (5.4.13) and (5.4.16) into (5.4.12), we obtain the desired inequality
∏ 𝑝 < 42𝑘+1 . □
𝑝≤2𝑘+1
Now we turn to the proof of the upper bound for 𝜋(𝑥). There are 𝜋(𝑛) factors on
the left-hand side of (5.4.11). To get an upper bound for 𝜋(𝑛), we try to replace every
factor by the smallest prime, i.e. by 2. Unfortunately, this gives only
2𝜋(𝑛) < ∏ 𝑝 < 4𝑛 ,
𝑝≤𝑛
yielding 𝜋(𝑛) < 2𝑛 which is worse than the trivial upper bound 𝑛.
Exercises 5.4 133
We refine the method of reducing the product on the left-hand side of (5.4.11) so
that we omit the small primes and replace the other factors (roughly) by their mini-
mum:
𝜋(𝑛)−𝜋(√𝑛)
(5.4.17) ∏𝑝 ≥ ∏ 𝑝 ≥ √𝑛 .
𝑝≤𝑛 √𝑛<𝑝≤𝑛
we obtain that 𝜋(√𝑛) is less than (say) 0.01𝑛/ log 𝑛 for 𝑛 large enough, thus (5.4.18)
implies
𝑛
𝜋(𝑛) < (2 log 4 + 0.01) . □
log 𝑛
Exercises 5.4
𝑝 always denotes a prime, 𝑝𝑛 stands for the 𝑛th prime, and 𝑢𝑛 ∼ 𝑣 𝑛 means 𝑢𝑛 is asymp-
totically equal to 𝑣 𝑛 , i.e. lim𝑛→∞ 𝑢𝑛 /𝑣 𝑛 = 1.
1. Verify that ⌊𝑎 + 𝑏⌋ − ⌊𝑎⌋ − ⌊𝑏⌋ equals 0 or 1 for any real numbers 𝑎 and 𝑏.
2. Show that Theorem 5.4.3 holds with 𝑥0 = 2, i.e. the corresponding inequalities
(5.4.7) are true with suitable positive constants 𝑐′1 and 𝑐′2 for every real number
𝑥 ≥ 2.
* 3. Which lower and upper bounds follow for 𝑝𝑛 if (instead of Theorem 5.4.1) we rely
on (the weaker) Theorem 5.4.3?
4. Verify the estimates below using the Prime Number Theorem.
(a) ∑𝑝≤𝑛 log 𝑝 ∼ 𝑛.
(b) The product of all primes not exceeding 𝑛 is approximately 𝑒𝑛 in the following
sense (cf. Lemma 5.4.5): To any 𝜀 > 0 there exists an 𝑛0 such that
𝑒(1−𝜀)𝑛 < ∏ 𝑝 < 𝑒(1+𝜀)𝑛
𝑝≤𝑛
* 5. Let 1 ≤ 𝑎1 < 𝑎2 < . . . be an arbitrary subsequence of the positive integers and let
𝐴(𝑛) denote the number of its elements not greater than 𝑛, i.e. 𝐴(𝑛) = ∑𝑎 ≤𝑛 1.
𝑖
Prove the equivalence of the following four statements.
(i) 𝐴(𝑛) ∼ 𝑛/ log 𝑛.
(ii) 𝑎𝑛 ∼ 𝑛 log 𝑛.
(iii) ∑𝑎 ≤𝑛 log 𝑎𝑖 ∼ 𝑛.
𝑖
(iv) To any 𝜀 > 0 there exists an 𝑛0 such that
𝑒(1−𝜀)𝑛 < ∏ 𝑎𝑖 < 𝑒(1+𝜀)𝑛
𝑎𝑖 ≤𝑛
Generalizing Theorem 5.5.1, we prove now that even both of two consecutive gaps
can be arbitrarily large, i.e. there exist primes surrounded by many composite numbers
from both sides (these are called solitary primes).
5.5. Gaps between Consecutive Primes 135
Theorem 5.5.2. For any positive integer 𝐾 there exists a prime 𝑝 such that all numbers
𝑝 ± 1, 𝑝 ± 2, . . . , 𝑝 ± 𝐾 are composite. ♣
Now we prove Chebyshev’s Theorem stating that there must occur a prime be-
tween any number and its double.
Theorem 5.5.3 (Chebyshev’s Theorem). For any integer 𝑛 ≥ 1 there exists a prime 𝑝
satisfying 𝑛 < 𝑝 ≤ 2𝑛. ♣
This obviously implies that the theorem remains valid for any real numbers 𝑛 ≥ 1
(instead of integers).
Another name for this result is Bertrand’s postulate, because the conjecture was
first formulated in 1845 by Bertrand in a slightly stronger form: To every 𝑛 > 3 there
is a prime 𝑝 satisfying 𝑛 < 𝑝 ≤ 2𝑛 − 2. (This version is true as well, and even much
stronger results hold, see assertions (A) in Theorems 5.5.4 and 5.5.5.) Theorem 5.5.3
was proved by Chebyshev in 1852. The proof below was found by Erdős when he was
19 years old.
Proof. The basic idea is to observe that the product of primes between 𝑛 and 2𝑛 is
closely related to the binomial coefficient (2𝑛
𝑛
). We assume 𝑛 ≥ 5 from now on.
I. We write the standard form of (2𝑛
𝑛
) and break it into the product of three factors
according to the size of the primes the following way:
2𝑛
(5.5.1) ( ) = ∏ 𝑝𝜈𝑝 = ∏ 𝑝𝜈𝑝 ⋅ ∏ 𝑝𝜈𝑝 ⋅ ∏ 𝑝𝜈𝑝 .
𝑛 𝑝≤2𝑛 𝑛+1≤𝑝≤2𝑛
𝑝≤√2𝑛 √2𝑛<𝑝≤𝑛
So
2𝑛 4𝑛
(5.5.2) ( )> .
𝑛 2𝑛 + 1
III. Upper bound for 𝐴: By Lemma 5.4.4, we have 𝑝𝜈𝑝 ≤ 2𝑛, hence
IV. Upper bound for 𝐵: Again, 𝑝𝜈𝑝 ≤ 2𝑛, by Lemma 5.4.4, and since 𝑝 > √2𝑛, this
implies 𝜈𝑝 ≤ 1.
We show that 𝜈𝑝 = 0 for (𝑝 > 2 and) 2𝑛/3 < 𝑝 ≤ 𝑛. Indeed, such a 𝑝 occurs exactly
to the first power both in the numerator and denominator of
2𝑛 2𝑛(2𝑛 − 1) . . . (𝑛 + 1)
( )= ,
𝑛 𝑛!
it appears only in the factor 2𝑝 in the numerator, and in the factor 𝑝 in the denominator.
Hence
(5.5.4) 𝐵= ∏ 𝑝𝜈𝑝 = ∏ 𝑝𝜈𝑝 ≤ ∏ 𝑝.
√2𝑛<𝑝≤𝑛 √2𝑛<𝑝≤2𝑛/3 √2𝑛<𝑝≤2𝑛/3
V. Substituting (5.5.2), (5.5.3), and (5.5.5) into (5.5.1), and expressing 𝐶, we get
4𝑛 4𝑛/3
(5.5.6) 𝐶> > .
(2𝑛 + 1)(2𝑛)√2𝑛 ⋅ 42𝑛/3 (2𝑛 + 1)1+√2𝑛
To prove 𝐶 > 1 it is sufficient to verify that the logarithm of the expression 𝑠𝑛 on the
right-hand side of (5.5.6) is positive. Since
𝑛 log 4
(5.5.7) log 𝑠𝑛 = − (1 + √2𝑛) log(2𝑛 + 1) → ∞ as 𝑛 → ∞,
3
log 𝑠𝑛 > 0 if 𝑛 is large enough. A calculation shows that 𝑛 > 511 guarantees positivity,
hence 𝐶 > 1 for 𝑛 > 511.
VI. Finally, we verify the statement directly for 𝑛 ≤ 511. This can be done by
generating a sequence of primes starting with 2 where every element is less than the
double of the previous element: 2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631 is such a sequence.
(It is Chebyshev’s Theorem which guarantees the existence of an infinite sequence with
this property.) □
Related to Chebyshev’s Theorem the following more general problem arises con-
cerning the “gap function”:
For which functions ℎ(𝑛) is it true that the open interval (𝑛, 𝑛 + ℎ(𝑛)) always con-
tains a prime if 𝑛 is large enough?
5.5. Gaps between Consecutive Primes 137
Chebyshev’s Theorem asserts that ℎ(𝑛) = 𝑛 works, but according to Theorem 5.5.1,
a constant ℎ(𝑛) is not suitable, as the interval (𝑛, 𝑛 + 𝐾) is primefree for infinitely many
𝑛 however we fix 𝐾.
The order of magnitude of the best ℎ(𝑛) is a famous unsolved problem. We state
the related strongest results without proof:
Theorem 5.5.4. (A) Let 𝜃 = 0.525. Then the interval (𝑛, 𝑛 + 𝑛𝜃 ) contains a prime for
every 𝑛 is large enough.
(B) There exists a constant 𝑐 > 0 such that the interval
𝑐 ⋅ log 𝑛 ⋅ log log 𝑛 ⋅ log log log log 𝑛
(𝑛, 𝑛 + )
log log log 𝑛
is primefree for infinitely many positive integers 𝑛. ♣
Both assertions in Theorem 5.5.4 are very deep results (they are much sharper
than the ones deducible from the Prime Number Theorem, see Theorem 5.5.5). There
is, however, an enormous gulf between them: ℎ(𝑛) can be chosen as 𝑛𝜃 , and cannot be
chosen as a function not much bigger than the logarithm. Some probabilistic consid-
erations suggest that the boundary should be around (log 𝑛)2 .
It is interesting to note that (A) does not imply even the innocent looking conjec-
ture mentioned in Section 5.1 claiming that every interval between two consecutive
squares contains a prime. To prove this conjecture one has to reduce the exponent 𝜃
to 1/2 which could not be verified even assuming the famous unproved Riemann Hy-
pothesis.
Another remarkable fact about the difficulties in this field is that the previous best
result concerning primefree intervals was achieved in 1936(!), which differed from (𝐵)
just in the denominator being squared, and there was no progress at all for nearly
80(!) years, in spite of all efforts and a prize of 10000(!) US dollars offered by Erdős.
The five authors of this slight improvement thus got the biggest prize ever given (now
with the contribution of Ron Graham) for the solution of an Erdős problem.
In what follows, we show how the results of Theorems 5.5.3 and 5.5.1 can be sharp-
ened using the Prime Number Theorem.
Theorem 5.5.5. (A) For any 𝜀 > 0 there exists an 𝑛0 (depending on 𝜀) such that the
interval (𝑛, (1 + 𝜀)𝑛) contains a prime for every 𝑛 > 𝑛0 .
(B) For any 0 < 𝜀 < 1 there exist infinitely many positive integers so that the interval
(𝑛, 𝑛 + (1 − 𝜀) log 𝑛) is primefree. ♣
if 𝑁 is large enough. Substituting (5.5.16) and (5.5.17) into (5.5.15), we obtain that the
right-hand side of (5.5.14) is less than
𝜀 𝜀 𝜀
((1 − 𝜀)(1 + ) + ) 𝑁 < (1 − )𝑁 < 𝑁,
4 4 2
yielding the desired contradiction. □
Exercises 5.5
𝑛
* (b) Prove the existence of a real number 𝛼 > 1 such that ⌊𝛼3 ⌋ is a prime for every
positive integer 𝑛.
(c) Why can one not generate large primes practically with the formula in (b)?
10. Establish results similar to (B) in Theorem 5.5.5 using the following facts or meth-
ods instead of the Prime Number Theorem:
(a) Theorem 5.4.3
(b) the proof of Theorem 5.5.1
(c) the Remark after the proof of Theorem 5.5.1.
* 11. (Cf. with Remark 2 on twin primes in Section 5.1.) Prove that for any 𝜀 > 0 there
exist infinitely many positive integers 𝑛 satisfying 𝑝𝑛+1 − 𝑝𝑛 < (1 + 𝜀) log 𝑛. (As
usual, 𝑝𝑛 denotes the 𝑛th prime.)
For every integer 𝑛0 ≤ 𝑗 ≤ 𝑛, we draw a rectangle so that its base is the segment
[𝑗, 𝑗 + 1] on the 𝑥-axis, and its height is 1/(𝑗 log 𝑗). Then the sum of the areas of the
rectangles is just the sum on the right-hand side of (5.6.2) (without the multiplier 1/𝑐).
5.6. The Sum of Reciprocals of Primes 141
As the function 1/(𝑥 log 𝑥) is strictly decreasing for 𝑥 > 1, in the interval [𝑛0 , 𝑛+1],
its graph lies in the region formed by the rectangles. Hence, the area below the graph
of the function is less than the total area of the rectangles, i.e.
𝑛 𝑛+1
1 𝑑𝑥
(5.6.3) ∑ >∫ .
𝑗=𝑛0
𝑗 log 𝑗 𝑛
𝑥 log 𝑥
0
Since
lim log log 𝑛 = ∞,
𝑛→∞
the right-hand side in (5.6.5) tends to infinity if 𝑛 → ∞. But then the same holds also
for the left-hand side, so (5.6.1) is true. □
with a suitable positive constant 𝑐′ if 𝑛 is large enough. We can show similarly that
1
∑ < 𝑐″ log log 𝑛.
𝑝≤𝑛
𝑝
A slightly more refined use of the Prime Number Theorem (or equivalently, of Theo-
rem 5.4.2) gives
1
∑ ∼ log log 𝑛.
𝑝≤𝑛
𝑝
Much sharper estimates will be obtained in Theorem 5.6.2 (without relying on the
Prime Number Theorem). Even (5.6.13) in our third proof of Theorem 5.6.1 is much
better than (5.6.5a).
Second proof. For a proof by contradiction, assume that the sum of reciprocals of
primes converges. Then
∞
1 1
(5.6.6) ∑ <
𝑗=𝑘+1
𝑝𝑗 2
for some 𝑘. We fix 𝑘, and divide the positive integers into two groups: the first group
consists of the numbers with a prime divisor greater than 𝑝 𝑘 , and the second group is
formed by the numbers with all prime divisors less than or equal to 𝑝 𝑘 .
142 5. Prime Numbers
Let 𝑁 be a (large) natural number, and consider the set 𝐻 = {1, 2, . . . , 𝑁}. We show
that each of the two groups contains less than the half of the elements in 𝐻 for 𝑁 large
enough, which is a contradiction.
𝑁
We start with the first group. There are ⌊ 𝑝 ⌋ elements in 𝐻 divisible by a prime 𝑝.
This yields the following upper bound for the size of the first group:
∞
𝑁 𝑁 1 𝑁
∑ ⌊ ⌋≤ ∑ <𝑁 ∑ <
𝑝𝑘 <𝑝≤𝑁
𝑝 𝑝 <𝑝≤𝑁
𝑝 𝑝
𝑗=𝑘+1 𝑗
2
𝑘
(we used (5.6.6) in the last step). This means that fewer than half of the elements in 𝐻
belong to the first group.
To investigate the second group, we shall use the fact that every positive integer
has a (unique) representation as a product of a square and a squarefree number. This
is a direct consequence of unique prime factorization: separating the even and odd
exponents in the standard form of 𝑛,
2𝛽1 2𝛽 2𝛽 +1 2𝛽𝑠 +1
𝑛 = 𝑞1 . . . 𝑞𝑟 𝑟 𝑞𝑟+1𝑟+1 . . . 𝑞𝑠
(𝑟 = 0 or 𝑟 = 𝑠 may occur), we obtain the required representation as
2
𝛽 𝛽 𝑟+1 𝛽 𝛽
𝑛 = (𝑞1 1 . . . 𝑞𝑟 𝑟 𝑞𝑟+1 . . . 𝑞𝑠 𝑠 ) ⋅ (𝑞𝑟+1 . . . 𝑞𝑠 ).
We write the elements of the second group in 𝐻 in the form 𝑎2 𝑏 where 𝑏 is squarefree.
Then 1 ≤ 𝑎 ≤ ⌊√𝑁⌋, and 𝑏 is the product of some of the primes 𝑝1 , . . . , 𝑝 𝑘 (possibly of
all of them, or 𝑏 can be also the empty product when 𝑏 = 1).
Hence, 𝑎2 can assume ⌊√𝑁⌋ values, and 𝑏 can be chosen in 2𝑘 ways (this is the
number of subsets in the set {𝑝1 , . . . , 𝑝 𝑘 }). Thus there are at most √𝑁 ⋅ 2𝑘 such products
𝑎2 𝑏. Since 𝑘 is fixed, 2𝑘 < √𝑁/2 for 𝑁 large enough, so √𝑁 ⋅ 2𝑘 < 𝑁/2. This proves
that fewer than half of the elements in 𝐻 belong to the second group. □
To illustrate the idea, we consider first 𝑛 = 10, and write the factors of 𝐴10 in detail:
1 1 1 1 1 1 1
𝐴10 = (1 + + 2 + 3 ) (1 + + 2 ) (1 + ) (1 + ) .
2 2 2 3 3 5 7
For 𝑗 ≤ 10, the standard form of 𝑗 may contain only the primes 2, 3, 5, and 7 with
an exponent not greater than the ones in the corresponding factors of 𝐴10 . Therefore
𝑗 ≤ 10 is a (unique) product of these prime powers. This means that performing the
multiplication in 𝐴10 , we shall obtain the reciprocals of all integers 𝑗 ≤ 10 (and of some
10
others, too), thus 𝐴10 ≥ ∑𝑗=1 1/𝑗.
Applying the same argument for any 𝑛 instead of 10, we obtain (5.6.7). Using (i),
we infer
(5.6.8) 𝐴𝑛 > log 𝑛.
Now we establish an upper bound for 𝐴𝑛 . The summation of the geometric series in
the factors of 𝐴𝑛 gives
1 𝜈𝑝 +1
1 − (𝑝) 1
(5.6.9) 𝐴𝑛 = ∏ 1 <∏ 1 .
𝑝≤𝑛 1− 𝑝 𝑝≤𝑛 1− 𝑝
Finally, the second sum on the right-hand side of (5.6.12) is less than 2 by (ii), hence
1
(5.6.13) ∑ > log log 𝑛 − 2,
𝑝≤𝑛
𝑝
We observe from the third proof that the sum of reciprocals of primes not greater
than 𝑛 cannot be much less than log log 𝑛 (see (5.6.13)). We sharpen this result by
showing that the difference of this sum of reciprocals and of log log 𝑛 is bounded:
Theorem 5.6.2. There exists a constant 𝑐 such that
1
(5.6.14) | ∑ − log log 𝑛| < 𝑐
𝑝≤𝑛
𝑝
Proof. We shall need an estimate for the sum ∑𝑝≤𝑛 (log 𝑝)/𝑝.
144 5. Prime Numbers
Proof. We take the logarithm of the standard form of 𝑛! (see Theorem 1.6.8):
𝑛 𝑛 𝑛
(5.6.16) log 𝑛! = ∑ log 𝑝 (⌊ ⌋ + ⌊ 2 ⌋ + ⌊ 3 ⌋ + . . . ) .
𝑝≤𝑛
𝑝 𝑝 𝑝
We shall show that the left-hand side of (5.6.16) is about 𝑛 log 𝑛, and we can omit
the floor in the multiplier of log 𝑝 on the right-hand side and only the first term counts,
i.e. the right-hand side is about 𝑛 ∑𝑝≤𝑛 (log 𝑝)/𝑝. Then dividing by 𝑛, we get (5.6.15).
Let us see the details. To estimate log 𝑛! on the left-hand side of (5.6.16), we use
𝑛 𝑛
( ) < 𝑛! < 𝑛𝑛
𝑒
for 𝑛 ≥ 2. The upper bound is obvious, and the lower bound can be easily verified by
induction. Taking the logarithm, we obtain
(5.6.17) 𝑛(log 𝑛 − 1) < log 𝑛! < 𝑛 log 𝑛.
2
The sum ⌊𝑛/𝑝⌋ + ⌊𝑛/𝑝 ⌋ + . . . can be estimated as follows:
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
(5.6.18) − 1 < ⌊ ⌋ + ⌊ 2⌋ + ⋯ < + 2 + ⋯ = + .
𝑝 𝑝 𝑝 𝑝 𝑝 𝑝 𝑝(𝑝 − 1)
Denoting the right-hand side of (5.6.16) by 𝐽, we get the following bounds from (5.6.18):
log 𝑝 log 𝑝 log 𝑝
(5.6.19) 𝑛∑ − ∑ log 𝑝 < 𝐽 < 𝑛 ∑ +𝑛 ∑ .
𝑝≤𝑛
𝑝 𝑝≤𝑛 𝑝≤𝑛
𝑝 𝑝≤𝑛
𝑝(𝑝 − 1)
By Lemma 5.4.5,
(5.6.20) ∑ log 𝑝 = log ∏ 𝑝 < log 4𝑛 = 𝑛 log 4,
𝑝≤𝑛 𝑝≤𝑛
further
∞
log 𝑝 log 𝑘
(5.6.21) ∑ < ∑ ,
𝑝≤𝑛
𝑝(𝑝 − 1) 𝑘=2 𝑘(𝑘 − 1)
where the infinite series on the right-hand side of (5.6.21) is convergent and it can be
shown that its sum is less than 4. Using (5.6.20) and (5.6.21), we infer from (5.6.19)
that
|𝐽 |
(5.6.22) | − ∑ log 𝑝 | < 4.
|𝑛 𝑝 ||
| 𝑝≤𝑛
This implies
𝑛
1
(5.6.26) ∑ = 𝑓(2)𝑔(2) + ∑ (𝑓(𝑘) − 𝑓(𝑘 − 1))𝑔(𝑘)
𝑝≤𝑛
𝑝 𝑘=3
for every integer 𝑛 ≥ 3. Rewriting the right-hand side of (5.6.26) by Abel’s partial
summation, we obtain
1
∑ =𝑓(2)(𝑔(2) − 𝑔(3)) + 𝑓(3)(𝑔(3) − 𝑔(4)) + . . .
𝑝
(5.6.27) 𝑝≤𝑛
We show that a general term on the right-hand side of (5.6.27) (except the last one)
can be transformed into
𝑘+1
(5.6.28) 𝑓(𝑘)(𝑔(𝑘) − 𝑔(𝑘 + 1)) = − ∫ 𝑓(𝑡)𝑔′ (𝑡) 𝑑𝑡.
𝑘
Indeed, the function 𝑓(𝑡) assumes the constant value 𝑓(𝑘) on the interval [𝑘, 𝑘 + 1)
(closed from the left and open from the right), further
𝑘+1
∫ 𝑔′ (𝑡) 𝑑𝑡 = 𝑔(𝑘 + 1) − 𝑔(𝑘)
𝑘
To estimate the second integral on the right-hand side of (5.6.30), we rely on |ℎ(𝑡)| < 6
(which follows from (5.6.24) and (5.6.25)):
| 𝑛 ℎ(𝑡) 𝑑𝑡 | 𝑛
𝑑𝑡 −1
𝑛
6 6
(5.6.32) |∫ | < 6 ∫ = 6 [ ] = − .
| 2 𝑡(log 𝑡)2 | 2
𝑡(log 𝑡) 2 log 𝑡 2 log 2 log 𝑛
Now we verify that the product 𝑓(𝑛)𝑔(𝑛) on the right-hand side of (5.6.29) is
bounded:
| log 𝑛 + ℎ(𝑛) | | ℎ(𝑛) |
(5.6.34) |𝑓(𝑛)𝑔(𝑛)| = | | = |1 + | < 1 + 6 = 7.
| log 𝑛 | | log 𝑛 |
Finally, combining (5.6.29), (5.6.33), and (5.6.34), we obtain the statement of The-
orem 5.6.2. □
Remark: Repeating the estimate in (5.6.32) for the interval [𝑛, 𝑁] instead of [2, 𝑛], it
turns out that the second integral on the right-hand side of (5.6.30) has a limit as 𝑛 →
∞, and the difference between the integral and the limit is at most 6/ log 𝑛 in absolute
value. The same is obvious for 𝑓(𝑛)𝑔(𝑛). This proves that with suitable constants 𝑐 1
and 𝑐 2 ,
| ∑ 1 − log log 𝑛 − 𝑐 | ≤ 𝑐 2
| 𝑝 1|
log 𝑛
𝑝≤𝑛
Exercises 5.6
S 1. Let 𝐿 be a fixed positive integer. Consider the following sequences of positive inte-
gers and determine whether the series of the reciprocals of their elements converge
or diverge:
(a) the multiples of 𝐿
(b) the perfect powers
(c) the squarefree numbers
(d) the integers with no prime divisor greater than 𝐿
(e) the integers with no prime divisors less than 𝐿
(f) the squareful numbers, i.e. the ones where no prime has exponent 1 in the
standard form.
Examine in each case except for (c), about how many elements are in the sequence
up to some large 𝑛; more precisely, find asymptotics or good estimates for the
counting function 𝑈(𝑛) = ∑ᵆ ≤𝑛 1 of the sequence 𝑈 = {𝑢1 < 𝑢2 < . . . }. (For
𝑖
the squarefree numbers see Exercise 6.7.2.)
2. Using the integral criterion seen in the first proof of Theorem 5.6.1, determine
whether the following infinite series converge or diverge:
∞
1
(a) ∑ 1.01
𝑛=1
𝑛
∞
1
(b) ∑
𝑛=2
𝑛(log 𝑛)2
∞
1
(c) ∑ .
𝑛=2
𝑛 ⋅ log 𝑛 ⋅ log log 𝑛
3. In the infinite series below, the summation is over all primes. Investigate the ques-
tion of convergence or divergence:
1
(a) ∑
𝑝
𝑝 log 𝑝
1
(b) ∑ .
𝑝
𝑝 log log 𝑝
4. Consider sequences 𝑎1 < 𝑎2 < . . . of positive integers with the properties below.
What can be asserted about the convergence/divergence of the infinite series of
the reciprocals of their elements? (Possible answers: always convergent—always
divergent—can be convergent, but can be divergent, as well.)
(a) The elements 𝑎𝑛 are pairwise coprime composite numbers.
(b) The sum of exponents of primes in the standard form of 𝑎𝑛 is at least 2 log 𝑛
for every 𝑛.
(c) 𝑎𝑛+1 − 𝑎𝑛 < 101000 for every 𝑛.
148 5. Prime Numbers
for any real number 𝑠 > 1. It is well known (or can be proven similarly to Exer-
cise 5.6.2a) that the infinite series on the right-hand side of (5.6.35) converges for
𝑠 > 1. E.g. 𝜁(2) = 𝜋2 /6.
Now we define an infinite product (𝑝 ranges over the primes):
1 1
(5.6.36) ∏ 1 = lim ∏ 1 .
𝑝 1− 𝑝𝑠
𝑛→∞
𝑝≤𝑛 1− 𝑝𝑠
Verify for 𝑠 > 1 that the limit on the right-hand side of (5.6.36) exists and is equal
to 𝜁(𝑠).
7. Let 0 < 𝑎𝑗 < 1, 𝑗 = 1, 2, . . . , and define the infinite product
∞ 𝑛
∏(1 − 𝑎𝑗 ) = lim ∏(1 − 𝑎𝑗 ).
𝑛→∞
𝑗=1 𝑗=1
Prove
∞ ∞
∑ 𝑎𝑗 = ∞ ⟺ ∏(1 − 𝑎𝑗 ) = 0.
𝑗=1 𝑗=1
(see formula (5.6.10)). In the other direction, exhibit the following lower bound:
There exists a constant 𝑐 such that
1
𝑐 log 𝑛 > ∏ 1
𝑝≤𝑛 1 − 𝑝
for every 𝑛 ≥ 2.
9. For 𝑛 > 1, let 𝑝(𝑛) and 𝑃(𝑛) denote the smallest and largest prime divisor of 𝑛.
Determine whether the following infinite series converge or diverge:
∞
1
(a) ∑
𝑛=2
𝑛𝑝(𝑛)
5.7. Primality Tests 149
∞
1
** (b) ∑ .
𝑛=2
𝑛𝑃(𝑛)
10. Give a new proof for Exercise 5.3.5 based on the following observation: If writing
positive integers 𝑎1 < 𝑎2 < . . . one after the other following the decimal point, the
∞
resulting decimal fraction is rational, then ∑𝑖=1 1/𝑎𝑖 < ∞.
Thus, considering a large 𝑏 with 500 digits, these computations can be executed in
steps at most. They can be performed in a split second by a fast computer and the
procedures can even be speeded up and automated by a more efficient organization.
Probably 𝑏 is stored in the computer in this form, but if necessary, the conversion from
another base can be done in not more than log2 𝑏 steps, since we obtain the digits from
a sequence of division algorithms, by Theorem 1.2.2.
Then we compute the remainder of
𝑡
𝑎2 , 𝑎 4 , 𝑎 8 , . . . , 𝑎 2
52 , 54 , 58 , . . . , 5512
modulo 𝑚, and then multiply the relevant ones (reducing modulo 𝑚 in each step):
II. To compute a greatest common divisor, we apply the Euclidean algorithm with
remainders of least absolute value (i.e. allowing also negative remainders, but the ab-
solute value of a remainder is at most the half of the absolute value of the divisor, see
Theorem 1.2.1A):
𝑏
𝑎 = 𝑏𝑞1 + 𝑟1 where |𝑟1 | ≤
2
|𝑟1 | 𝑏
𝑏 = 𝑟1 𝑞2 + 𝑟2 where |𝑟2 | ≤ ≤
2 4
|𝑟2 | 𝑏
𝑟1 = 𝑟2 𝑞3 + 𝑟3 where |𝑟3 | ≤ ≤
2 8
⋮
|𝑟𝑛−1 | 𝑏
𝑟𝑛−2 = 𝑟𝑛−1 𝑞𝑛 + 𝑟𝑛 where |𝑟𝑛 | ≤ ≤ 𝑛
2 2
𝑟𝑛−1 = 𝑟𝑛 𝑞𝑛+1 (𝑟𝑛+1 = 0).
2𝑛 ≤ 𝑏 or 𝑛 ≤ log2 𝑏.
This shows that the Euclidean algorithm requires 1 + log2 𝑏 steps at most (where each
step is a division algorithm).
We note that also the usual Euclidean algorithm with least non-negative residues
terminates in at most a constant times log 𝑏 steps, see Exercise 5.7.1.
III. By Theorem 4.3.2, we can compute a Jacobi symbol by the repeated application
of detaching the powers of two in the numerator (we call, in a mild abuse of language,
the top and bottom of Jacobi and Legendre symbols the numerator and the denomina-
tor) and using the law of reciprocity (which is just a variant of the Euclidean algorithm,
as in the Example after Theorem 4.3.2).
𝑎
Let us see the details. To compute ( 𝑏 ), we first perform the division algorithm of
𝑎 by 𝑏, and have
𝑎 𝑟 𝑏
( ) = ( ), where |𝑟| < .
𝑏 𝑏 2
−1
If necessary, we can achieve 𝑟 > 0 with the help of ( 𝑏 ). If 𝑟 is even, then we can halve
the numerator by separating a factor of 2. If 𝑟 is odd, then using the law of reciprocity,
𝑟 gets transferred into the denominator, and the new numerator is the remainder 𝑠 of 𝑏
when divided by 𝑟. Thus |𝑠| < 𝑟/2, and we can achieve 𝑠 > 0 now, as well. This means
that the numerator gets halved in each step, so no more than log2 𝑏 steps occur. To
−1 2
compute ( 𝑣 ) and ( 𝑣 ) we need the modulo 4 and modulo 8 residues of 𝑣, which can
be obtained by a division algorithm or can be seen directly from the two or three last
digits in the binary representation of 𝑣. It is likewise simple to check the parity for the
numerator and to halve it if it is even.
152 5. Prime Numbers
𝑎
The Jacobi symbol ( 𝑏 ) makes sense only for odd 𝑏 > 1 and (𝑎, 𝑏) = 1. This latter
condition can be checked in advance by the Euclidean algorithm, but there is no need
for that: If (𝑎, 𝑏) = 𝑑 > 1, then applying the procedure, we shall run into a situation
where the numerator is 𝑑, and the denominator is a multiple of 𝑑 (see Exercise 5.7.2).
𝑎
Thus we get stuck, and the Jacobi symbol ( 𝑏 ) does not exist. (This cannot occur for
±1 ±2
(𝑎, 𝑏) = 1 because the last step is to compute a Jacobi symbol ( 𝑣
) or ( 𝑣
).)
IV–V. We saw in Section 2.5 that the two tasks are equivalent. Further, by The-
orems 1.3.6 and 1.3.5 (or 7.1.1), we can find the solutions of a Diophantine equation
𝑎𝑥 + 𝑏𝑦 = 𝑐 from the Euclidean algorithm, which gives the desired bound for the
number of steps. □
Now we turn to the discussion of primality tests. The simplest general test is a
direct consequence of Fermat’s Little Theorem:
If 2𝑛−1 ≢ 1 (mod 𝑛) for some 𝑛 > 2, then 𝑛 is composite.
This condition can be checked quickly, by Theorem 5.7.1. But what can we say
about 𝑛 if 2𝑛−1 ≡ 1 (mod 𝑛)? Unfortunately, we cannot be absolutely certain that 𝑛 is
a prime, since infinitely many composite 𝑛 satisfy 2𝑛−1 ≡ 1 (mod 𝑛), as well. They are
called pseudoprimes of base 2 (the smallest one is 341).
It can be shown, however, that the pseudoprimes of base 2 occur very rarely com-
pared to the primes: the ratio of the number of pseudoprimes up to 𝑥 and 𝜋(𝑥) tends
(very strongly) to 0 when 𝑥 → ∞. (As an illustration, up to 1010 there are 14887 pseu-
doprimes of base 2 and 455052511 primes, their ratio is roughly one to thirty thousand.)
Thus if a large number 𝑛 satisfies 2𝑛−1 ≡ 1 (mod 𝑛), then we can declare that 𝑛 is
a prime with very high probability. This assertion means that if we execute the test for
many random integers 𝑛, then it will happen only very rarely (practically never) that
the remainder of 2𝑛−1 is 1, but 𝑛 is composite.
We summarize the above in a theorem.
Theorem 5.7.2. Let 𝑛 > 2. If 2𝑛−1 ≢ 1 (mod 𝑛), then 𝑛 is necessarily composite. If
2𝑛−1 ≡ 1 (mod 𝑛), then it is nearly sure that 𝑛 is a prime. ♣
The condition can be checked quickly if we compute the power by repeated squar-
ings. We can improve the test by checking the residue of 𝑎𝑛−1 modulo 𝑛 not just for
𝑎 = 2, but for (say) all primes less than 1000: if the residue is different from 1 for at
least one 𝑎 (and 𝑛 > 1000), then 𝑛 must be composite by Fermat’s Little Theorem. It is
even more efficient, if 𝑎 is chosen randomly from the numbers not divisible by 𝑛 (see
Exercise 5.7.13).
If 𝑎𝑛−1 ≡ 1 (mod 𝑛) for every tested 𝑎, then 𝑛 is even more probably prime, but
we can still not be absolutely sure because there exist composite numbers 𝑛 satisfying
𝑎𝑛−1 ≡ 1 (mod 𝑛) for every (𝑎, 𝑛) = 1. For example, 1729 has this property (see Exer-
cise 2.4.15c). These integers are called universal pseudoprimes or Carmichael numbers.
We summarize the types of pseudoprimes in the following definition:
Definition 5.7.3. If a composite integer 𝑛 satisfies 𝑎𝑛−1 ≡ 1 (mod 𝑛), then 𝑛 is a
pseudoprime of base 𝑎.
5.7. Primality Tests 153
If a composite integer 𝑛 satisfies the above congruence for every (𝑎, 𝑛) = 1, then 𝑛
is a universal pseudoprime or Carmichael number. ♣
At the same time, no composite integer can hide from the Solovay–Strassen test,
there are no pseudoprimes related to it: there are lots of, so-called, witnesses who
certify the compositeness of 𝑛. This means that the probability of error can be
made arbitrarily small (independent of the tested integer) by checking sufficiently
many values of 𝑎. (The error probability of 2−1000 in the case of a thousand trials
provides a perfect practical security.)
Proof. (B) is a direct consequence of (A), thus it is sufficient to verify the latter.
For a prime 𝑛, we obtain (5.7.1) from Theorem 4.1.2 and the definition of the Le-
gendre symbol (see formula (4.1.2) after Definition 4.1.3).
Let now 𝑛 be composite. Since (5.7.1) can be valid only for 𝑎 coprime to 𝑛, it is
enough to show that (5.7.1) is satisfied by at most half of the elements in a reduced
residue system modulo 𝑛.
Let us call 𝑎 coprime to 𝑛 a witness (for compositeness) if (5.7.1) is false, and an
accomplice if (5.7.1) is true. Thus we have to prove that at least half of the elements in
a reduced residue system are witnesses.
We start by showing that there exists a witness for any odd 𝑛.
Consider first the case when 𝑛 is not squarefree, i.e. 𝑞2 ∣ 𝑛 for some prime 𝑞. Let
𝑞 = 𝑞1 , 𝑞2 , . . . , 𝑞𝑠 be the distinct prime divisors of 𝑛, let 𝑔 be a primitive root modulo
𝑞2 , and let 𝑣 be a solution of the system of congruences
𝑥 ≡ 𝑔 (mod 𝑞2 ) , 𝑥 ≡ 1 (mod 𝑞𝑖 ) , 2≤𝑖≤𝑠
(for 𝑠 = 1, take 𝑣 = 𝑔). We claim that 𝑣 is a witness.
Since (𝑣, 𝑞𝑖 ) = 1 for every 𝑖, (𝑣, 𝑛) = 1. For a proof by contradiction, assume
𝑛−1 𝑣
(5.7.2) 𝑣 2 ≡ ( ) (mod 𝑛) .
𝑛
Squaring (5.7.2), we obtain
𝑣 2
(5.7.3) 𝑣𝑛−1 ≡ ( ) = 1 (mod 𝑛) .
𝑛
Since 𝑞2 ∣ 𝑛, (5.7.3) remains valid if we replace the modulus 𝑛 by 𝑞2 . Using 𝑣 ≡ 𝑔
(mod 𝑞2 ), this gives
(5.7.4) 𝑔𝑛−1 ≡ 1 (mod 𝑞2 ) .
As 𝑔 is a primitive root mod 𝑞2 , its order is 𝜑(𝑞2 ) = 𝑞(𝑞 − 1), so (5.7.4) implies 𝑞(𝑞 − 1) ∣
𝑛 − 1. But 𝑞2 ∣ 𝑛 so 𝑞 divides both 𝑛 and 𝑛 − 1, which is a contradiction.
Now we turn to the case where 𝑛 is squarefree, 𝑛 = 𝑞1 . . . 𝑞𝑠 with distinct primes
𝑞𝑖 and 𝑠 ≥ 2.
Let ℎ be a quadratic non-residue modulo 𝑞1 , and let 𝑤 be a solution of the system
of congruences
(5.7.5) 𝑥 ≡ ℎ (mod 𝑞1 ) , 𝑥 ≡ 1 (mod 𝑞𝑖 ) , 2 ≤ 𝑖 ≤ 𝑠.
We claim that 𝑤 is a witness. Assume the converse, i.e. 𝑤 satisfies (5.7.1). Then (𝑤, 𝑛) =
1 and
𝑤 𝑤 𝑤 𝑤 ℎ 1 1
( ) = ( ) ( ) . . . ( ) = ( ) ( ) . . . ( ) = −1.
𝑛 𝑞1 𝑞2 𝑞𝑠 𝑞1 𝑞2 𝑞𝑠
5.7. Primality Tests 155
By (5.7.1), we have
𝑛−1
𝑤 2 ≡ −1 (mod 𝑛) .
Since 𝑞2 ∣ 𝑛 and 𝑤 ≡ 1 (mod 𝑞2 ) by (5.7.5), we infer
𝑛−1
(5.7.6) −1 ≡ 𝑤 2 ≡ 1 (mod 𝑞2 ) ,
which is a contradiction. Hence 𝑤 is a witness.
We have proved that there exists a witness for any odd composite 𝑛.
Finally, we show that at least half of the elements in a reduced residue system are
witnesses.
Let 𝑤 be an arbitrary witness and let 𝑎1 , 𝑎2 , . . . , 𝑎𝑘 be pairwise incongruent accom-
plices. We claim that 𝑤𝑐 1 , . . . , 𝑤𝑐 𝑘 are pairwise incongruent witnesses.
From (𝑤, 𝑛) = (𝑎𝑖 , 𝑛) = 1, (𝑤𝑎𝑖 , 𝑛) = 1 and 𝑤𝑎𝑖 are pairwise incongruent mod-
ulo 𝑛. For a proof by contradiction, assume that some 𝑤𝑎𝑖 is an accomplice, i.e.
𝑛−1 𝑤𝑎
(5.7.7) (𝑤𝑎𝑖 ) 2 ≡ ( 𝑖 ) (mod 𝑛) .
𝑛
Since 𝑎𝑖 is an accomplice,
𝑛−1
𝑎𝑖
(5.7.8) 𝑎𝑖 2 ≡ (
) (mod 𝑛) .
𝑛
Multiplying (5.7.7) and (5.7.8), we obtain
𝑛−1 𝑤 𝑎 2
(5.7.9) 𝑤 2 𝑎𝑛−1
𝑖 ≡ ( ) ( 𝑖 ) (mod 𝑛) .
𝑛 𝑛
Squaring (5.7.8), we have
𝑎𝑖 2
𝑎𝑛−1
𝑖 ≡( ) = 1 (mod 𝑛)
𝑛
which substituted into (5.7.9) yields
𝑤 𝑛−1
≡ ( ) (mod 𝑛) .
𝑤 2
𝑛
This means that 𝑤 is an accomplice, which is a contradiction.
Thus we verified that multiplying pairwise incongruent accomplices by a fixed wit-
ness gives pairwise incongruent accomplices. So the number of witnesses in a reduced
residue system is at least as big as the number of accomplices: at least half of the ele-
ments are witnesses. □
The next primality test is based on Fermat’s Little Theorem and on the fact that if
2
𝑢 ≡ 1 (mod 𝑝) for a prime 𝑝, then 𝑢 ≡ ±1 (mod 𝑝). This implies that for 𝑝 ∤ 𝑎, the
sequence of remainders of least absolute value of the numbers
𝑝−1 𝑝−1
𝑎𝑝−1 , 𝑎 2 ,𝑎 4 , ...
starts with 1 and either remains 1 to the very end, or the first remainder different from 1
must be −1. At the same time, replacing 𝑝 by a composite 𝑛, the sequence of remainders
will not obey this rule for many values of 𝑎. This gives the following primality test (for
technical reasons, we state the above condition in a modified form, essentially for the
inverted sequence):
156 5. Prime Numbers
Theorem 5.7.5 (Miller–Lenstra–Rabin primality test). Let 𝑛 > 1 be odd and 𝑛−1 = 2𝑘 𝑟
with 𝑟 odd. The numbers
𝑘−2 𝑟 𝑛−1 𝑘−1 𝑟 𝑛−1
(5.7.10) 𝑎𝑟 , 𝑎2𝑟 , 𝑎4𝑟 , . . . , 𝑎2 =𝑎 4 , 𝑎2 =𝑎 2
form a good sequence if either −1 occurs among their residues of least absolute value mod-
ulo 𝑛, or the residue of 𝑎𝑟 is 1.
For a prime 𝑛, (5.7.10) is a good sequence for every 𝑎 ≢ 0 (mod 𝑛).
For a composite 𝑛, (5.7.10) is a good sequence only for fewer than half of the elements
of a complete residue system modulo 𝑛. ♣
Outline of proof. We follow the ideas and the usage of “witness” and “accomplice”
seen in Theorem 5.7.4 with suitable modifications.
If 𝑛 is a prime, then we sketched before stating Theorem 5.7.5 that every 𝑝 ∤ 𝑎
produces a good sequence.
If 𝑛 is composite and is not squarefree, then we can construct a witness exactly as
in the proof of Theorem 5.7.4.
If 𝑛 is composite and squarefree, then consider the largest 0 ≤ 𝑗 ≤ 𝑘 − 1 satisfying
𝑗𝑟
(5.7.11) 𝑎2 ≢ 1 (mod 𝑛)
for some 𝑎 coprime to 𝑛. Since (5.7.11) holds with some 𝑗 and 𝑎, e.g. with 𝑗 = 0 and
𝑎 = −1 (as (−1)𝑟 ≢ 1 (mod 𝑛)), therefore a maximal 𝑗 exists.
By (5.7.11),
𝑗
𝑎2 𝑟 ≢ 1 (mod 𝑞1 )
for some prime divisor 𝑞1 of 𝑛. Then 𝑤 obtained from the system of congruences (5.7.6)
in the proof of Theorem 5.7.4 is a witness, since similarly to the argument seen there,
𝑗𝑟
𝑤2 ≢ ±1 (mod 𝑛) ,
but
𝑗+1
𝑤2 𝑟 ≡ 1 (mod 𝑛)
by the maximal property of 𝑗 (for 𝑗 < 𝑘 − 1).
Finally, multiplying this 𝑤, or 𝑣 in the not squarefree case, by pairwise incongru-
ent accomplices we obtain pairwise incongruent witnesses as seen in the proof of The-
orem 5.7.4 (but 𝑤 cannot be replaced now by an arbitrary witness). Thus we proved
that if 𝑛 is composite, then at least half of the elements in a reduced residue system are
witnesses. □
Remarks: (1) The Miller–Lenstra-Rabin test is even more efficient than stated in The-
orem 5.7.5: it can be shown by more refined methods that more than 75% of ele-
ments in a reduced residue system are witnesses.
Exercises 5.7 157
(2) Comparing the Solovay–Strassen and Miller–Lenstra–Rabin tests, it turns out that
the latter is more efficient in detecting composite numbers (see Exercise 5.7.17).
Agrawal, Kayal, and Saxena devised a quick primality test in 2002 that determines
not with 99.99999999999% but 100% certainty whether 𝑛 is prime or composite. The
test starts with a polynomial version of Fermat’s Little Theorem. We sketch the basic
idea below.
For (𝑐, 𝑛) = 1, we consider the polynomials 𝑓𝑐 = 𝑥𝑛 − 𝑐 and 𝑔𝑐 = (𝑥 − 𝑐)𝑛 over
𝐙𝑛 . If 𝑛 is a prime, then 𝑓𝑐 = 𝑔𝑐 (i.e. their coefficients are equal, which is a stronger
statement than the equality of the corresponding values assumed by the functions).
For the constant terms −𝑐 and (−𝑐)𝑛 , this follows from Fermat’s Little Theorem, the
leading coefficients are 1, and the other coefficients (𝑛𝑘)(−𝑐)𝑘 in 𝑔𝑐 are divisible by 𝑛 as
𝑛 is prime (see Exercise 2.1.9a), hence they are 0 in 𝐙𝑛 . It is another simple observation
that (𝑛𝑘) is not divisible by 𝑛 for some 0 < 𝑘 < 𝑛 if 𝑛 is composite, and as (𝑐, 𝑛) = 1, the
coefficient of 𝑥𝑛−𝑘 is not 0 in 𝑔𝑐 implying 𝑓𝑐 ≠ 𝑔𝑐 . Thus this is a perfect primality test
(e.g. with 𝑐 = 1), but unfortunately it is awfully slow since computing the coefficients
of 𝑔 requires many steps even using repeated squarings, due to the huge number of
terms.
The ingenious idea of the AKS test is that instead of 𝑓𝑐 = 𝑔𝑐 we check just the
equality of remainders of 𝑓𝑐 and 𝑔𝑐 divided by a suitable polynomial ℎ ∈ 𝐙𝑛 [𝑥]. If ℎ is
of sufficiently small degree (compared to 𝑛), then the computation can be carried out if
during the repeated squarings we reduce also modulo ℎ. This reduction is particularly
simple if ℎ is of the form ℎ = 𝑥𝑟 − 1, since then we just have to reduce the exponents
in the powers of 𝑥 mod 𝑟 (i.e. we replace 𝑥𝑗 by 𝑥𝑗−𝑟 as long as possible).
If 𝑛 is a prime, then 𝑓𝑐 = 𝑔𝑐 implies that the remainders are equal modulo any ℎ.
The main point in the AKS test is that choosing 𝑟 appropriately, no composite integer
satisfies this, so to any composite 𝑛 there exists some 𝑐 ≤ 𝐾 (where 𝐾 is very small
compared to 𝑛), such that 𝑓𝑐 and 𝑔𝑐 do not yield the same remainder when divided by
𝑥𝑟 − 1.
The corresponding algorithm hence selects a suitable 𝑟 and then checks 𝑓𝑐 ≡ 𝑔𝑐
(mod 𝑥𝑟 − 1) for every 𝑐 = 1, 2, . . . , 𝐾. If this fails for some 𝑐, then 𝑛 is composite (this
follows from our initial considerations). On the other hand, if it holds for every 𝑐, then
𝑛 is a prime for sure (this is the hard part in the proof of the test).
We have to select 𝑟 as a not too big prime with some special properties, its existence
is guaranteed by a deep theorem in number theory. To prove that after fixing this 𝑟,
any composite number gets detected by checking a few values of 𝑐, we need some basic
results about finite fields.
Exercises 5.7
1. Consider the usual Euclidean algorithm for the integers 𝑎, 𝑏, 𝑎 > 𝑏 > 0, where the
remainders satisfy 𝑏 = 𝑟0 > 𝑟1 > 𝑟2 > . . . ≥ 0.
𝑟𝑘
(a) Verify 𝑟 𝑘+2 < 2
for every 𝑘.
158 5. Prime Numbers
(b) Which upper bound follows from this for the number of steps in the algo-
rithm?
* (c) Prove that if the algorithm requires exactly 𝑠 steps, then the minimal possi-
ble value of 𝑏 is 𝜑𝑠+1 where 𝜑𝑗 denotes the 𝑗th Fibonacci number (defined in
Exercise 1.2.5).
Remark: By the explicit formula
1 1 + √5 𝑗 1 − √5 𝑗
𝜑𝑗 = (( ) −( ))
√5 2 2
for the Fibonacci numbers, (c) implies that the usual Euclidean algorithm re-
quires at most log𝛾 𝑏+𝛿 steps where 𝛾 = (1+√5)/2 and 𝛿 is a suitable constant,
and this bound is best possible.
2. Consider the procedure in part III of the proof of Theorem 5.7.1 for computing the
𝑎
Jacobi symbol ( 𝑏 ). Show that for (𝑎, 𝑏) = 𝑑 > 1, this leads to a situation when the
numerator is 𝑑 and the denominator is a multiple of 𝑑. (Thus the method reveals
that the Jacobi symbol makes no sense in this case, and there is no need to check
separately whether or not 𝑎 and 𝑏 are coprime.)
3. Show that 341 is a pseudoprime of base 2, but not of base 3.
S 4. Prove that if 𝑛 is a pseudoprime of base 2, then so is 2𝑛 − 1.
5. Let 𝑎 > 1. Show that if the prime 𝑝 > 2 does not divide 𝑎 ± 1, then
𝑎2𝑝 − 1
𝑛=
𝑎2 − 1
is a pseudoprime of base 𝑎. (For 𝑎 = 2 and 𝑝 = 5 we obtain 𝑛 = 341.)
6. Verify that 561 is a universal pseudoprime.
7. Prove the equivalence of the following conditions
(a) 𝑎𝑛−1 ≡ 1 (mod 𝑛) for any (𝑎, 𝑛) = 1.
(b) 𝑛 is squarefree and 𝑝 ∣ 𝑛 ⟹ 𝑝 − 1 ∣ 𝑛 − 1.
(c) 𝑎𝑛 ≡ 𝑎 (mod 𝑛) for any 𝑎.
Remark: This means that in Definition 5.7.3 of universal pseudoprimes we could
have chosen condition (c) (or (b)) instead of (a).
8. Show that a universal pseudoprime has at least three prime divisors.
9. (a) In the primality tests discussed, we check a condition, and there is no need to
compute in advance whether 𝑎 and 𝑛 are coprime. What advantage is there if
we compute (𝑎, 𝑛)?
(b) If 𝑛 is the product of two primes of hundred digits, then roughly what is the
chance that a random 𝑎 is not coprime to 𝑛?
10. Prove that if 𝑎2 ≡ 1 (mod 𝑛) but 𝑎 ≢ ±1 (mod 𝑛), then we can determine a non-
trivial divisor of 𝑛.
Exercises 5.7 159
* 11. Verify that if we know a (non-zero) multiple of 𝜑(𝑛) besides 𝑛, then we can find
the standard form of 𝑛 quickly. (More precisely, there is a theoretical chance that
we still cannot factor 𝑛, but this occurs practically never.)
12. Analyze whether Wilson’s Theorem and its converse, i.e. checking whether or not
𝑛 divides (𝑛 − 1)! +1, are suitable or not as a primality test.
13. (a) Show that if a composite number 𝑛 is not a universal pseudoprime, then 𝑎𝑛−1
≡ 1 (mod 𝑛) holds for fewer than half of the elements in a complete residue
system modulo 𝑛.
(b) Describe the concrete primality test based on part (a).
14. Prove that the following primality test can be performed quickly, and its probability
of error can be reduced below an arbitrarily small bound (prescribed in advance).
We want to decide whether an odd integer 𝑛 > 1 is prime or composite. We check
the remainder of 𝑎(𝑛−1)/2 modulo 𝑛 for a fixed (but sufficiently large) amount of
random integers 𝑎 where 𝑛 ∤ 𝑎. We declare 𝑛 to be a prime if every such remainder
is ±1 with −1 occurring at least once among them.
16. Let 𝑛 > 2. Show that any of the following conditions imply that 𝑛 is a prime.
* (c) There exists a divisor 𝑐 of 𝑛−1 greater than √𝑛 such that for any prime divisor
𝑝 𝑖 of 𝑐 there exists an integer 𝑎𝑖 satisfying
𝑛−1
𝑝𝑖
𝑎𝑛−1
𝑖 ≡ 1 (mod 𝑛) and (𝑎𝑖 − 1, 𝑛) = 1.
S 17. Show that the Miller–Lenstra–Rabin test is more efficient than the Solovay–
Strassen test in the following sense. If 𝑎 is a witness for 𝑛 in the Solovay–Strassen
test, then the same 𝑎 is a witness in the Miller–Lenstra–Rabin test; i.e. if condition
(5.7.1) of Theorem 5.7.4 is false for some 𝑎, then the set (5.7.10) in Theorem 5.7.5
cannot form a good sequence for this 𝑎.
160 5. Prime Numbers
5.8. Cryptography
In classical cryptography 𝐴 and 𝐵 agree in advance on an encoding key 𝐸 (e.g. to write
always the next letter instead of each letter in the alphabet). The inverse of 𝐸 is the
decoding key 𝐷 (in the example above, this means to write the preceding letter). When
communicating, (say) 𝐴 encodes the plain text by 𝐸 into a ciphertext and sends it to 𝐵
who can decode it by 𝐷.
The keys may refer not just to letters but also to sequences of characters, and can
be very complicated. In that case, computers do the encoding and decoding and the
messages are sent electronically instead of by a messenger.
These schemes meet two basic requirements, that only 𝐵 can understand the mes-
sage of 𝐴, and no third party can send a false message in the name of 𝐴. There are,
however, several disadvantages: the two parties have to agree on the keys in advance,
which may be a difficult (and dangerous) task; no disputes between 𝐴 and 𝐵 can be
resolved, since either party can falsify a message with the common keys in the other’s
name; and the bilateral communication of 𝐴 with several parties (e.g. in business) re-
quires a new pair of keys with each partner.
Diffie and Hellman suggested a cryptosystem based on a revolutionary new idea:
we make the key 𝐸 public and keep only 𝐷 secret.
This sounds absurd at the first hearing, since if we know the procedure in one
direction, then we can find it out in the opposite direction. Let the functions 𝐸 and
𝐷 be bijections of the set {1, 2, . . . , 𝑁} (we shall see that we can always assume this
without loss of generality). If we want to determine (say) 𝐷(5), then we compute 𝐸(1),
𝐸(2), . . . with the help of the public key 𝐸 till 𝐸(𝑘) = 5 occurs, providing 𝐷(5) = 𝑘.
This sounds good in principle, but if 𝑁 has (say) 500 digits, then it cannot be carried
out in practice. A computer could determine only a negligible fraction of the values
𝐸(1), 𝐸(2), . . . even in billions of years and so most probably would never find 𝐷(5).
(We illustrate the situation with an analogy. An English-French dictionary can be used
as a French-English dictionary in principle: if we want to find the English equivalent
of the French word “eau”, then we go through the English words of the English-French
dictionary (in alphabetic order) till we find “eau” among the French meanings. This
will occur at the English word “water”. So probably nobody would not also buy the
French-English dictionary.)
Hence it is not inconceivable that 𝐸 being public, 𝐷 can still remain secret. We
now discuss public key cryptosystems based on this idea.
Each party creates a pair of keys 𝐸 and 𝐷 which are inverses of each other, makes
𝐸 public, but keeps 𝐷 in secret. Let 𝐸𝐴 and 𝐷𝐴 be the keys of 𝐴, and 𝐸𝐵 and 𝐷𝐵 be the
keys of 𝐵. Then 𝐴 transforms the plain text 𝑢 into the ciphertext 𝑣 = 𝐸𝐵 (𝐷𝐴 (𝑢)) and
sends it to 𝐵 who can decode it as 𝑢 = 𝐸𝐴 (𝐷𝐵 (𝑣)):
(To compute 𝑣, 𝐴 uses his own function 𝐷𝐴 and the public function 𝐸𝐵 , and 𝐵 can act
similarly.)
5.8. Cryptography 161
This scheme meets the two basic requirements discussed above: only 𝐵 can under-
stand A’s message, since no one else knows 𝐷𝐵 needed for the decoding, and a third
party cannot falsify a message in the name of 𝐴 since only 𝐴 knows 𝐷𝐴 necessary for
the encoding.
The method has several further important advantages. There is no need to agree
about the keys in advance, and everybody can use the same keys with each partner.
There cannot be any dispute about the message between 𝐴 and 𝐵, since 𝐷𝐴 cannot be
falsified even by 𝐵, it acts as an electronic signature for 𝐴.
To implement the system, we have to construct pairs of keys 𝐸 and 𝐷 where the
owner knows both keys but other persons cannot determine 𝐷 even using the publicly
accessible 𝐸.
We saw previously that the prime factorization of a large number can serve as such
a secret known only by the person who formed the product of these primes. Based on
this, Rivest, Shamir, and Adleman made a concrete realization of the Diffie–Hellman
principle. Their procedure is called the RSA scheme from the initials of the discoverers
(or inventors?).
Before discussing RSA, we show that any cryptosystem can be reduced to the case
where 𝐸 and 𝐷 are permutations, i.e. bijections of the set {1, 2, . . . , 𝑁} where 𝑁 is a
sufficiently large integer. To see this, we encode (in a publicly known standard way)
letters and other characters as numbers, thus transforming a message into a sequence
of integers. Then we cut it into blocks of a given size, and consider each block as one
(large) number with many digits. These numbers will constitute both the domain and
the range of the functions 𝐸 and 𝐷.
We can transform letters and other characters into numbers for example in the
following way: A ↦ 01, B ↦ 02, . . . , Z ↦ 26, comma ↦ 27, space ↦ 28, etc. and say
that four such two-digit numbers should form a block. Then any message is converted
into a sequence of integers between 1 and 108 − 1 so 𝑁 = 108 − 1.
Let us find the equivalent of the expression “number theory”. N is converted into
14, U into 21, M into 13, etc., so we get the sequence
14211302|05182820|08051518|25.
Hence the blocks are 14211302, 05182820, 08051518, and 25999999 (the last block was
completed with 9s). We apply the keys 𝐸 and 𝐷 to these four numbers. (We repeatedly
emphasize that this conversion of the text into numbers is publicly known and its only
purpose is to provide a unified and comfortable handling of the functions 𝐸 and 𝐷.)
Now we turn to the construction of the keys 𝐸 and 𝐷 in the RSA.
Let 𝑁 = 𝑝𝑞 where 𝑝 and 𝑞 are two large primes. The holder of the key keeps 𝑝
and 𝑞 secret, but makes 𝑁 public. Further, he/she chooses an integer 𝑒 > 1 coprime to
𝜑(𝑁), and declares publicly his/her key 𝐸:
(5.8.1) 𝐸(𝑟) = the least positive residue (mod 𝑁) of 𝑟𝑒 , 𝑟 = 1, 2, . . . , 𝑁.
How can we get 𝐷 = 𝐸 −1 ? We try to find it in a similar form:
(5.8.2) 𝐷(𝑠) = the least positive residue (mod 𝑁) of 𝑠𝑑 , 𝑟 = 1, 2, . . . , 𝑁.
162 5. Prime Numbers
Exercises 5.8
Arithmetic Functions
165
166 6. Arithmetic Functions
Requiring similar conditions for the sum of the values instead of their product, we
get the notion of additive and completely additive arithmetic functions, resp.:
Definition 6.1.4. An arithmetic function 𝑓 is additive if 𝑓(𝑎𝑏) = 𝑓(𝑎) + 𝑓(𝑏) for every
coprime 𝑎 and 𝑏. ♣
Definition 6.1.5. An arithmetic function 𝑓 is completely additive (or totally additive),
if 𝑓(𝑎𝑏) = 𝑓(𝑎) + 𝑓(𝑏) for every 𝑎 and 𝑏. ♣
The definitions both of additivity and complete additivity refer to the values of
𝑓(𝑎𝑏) (and not of 𝑓(𝑎 + 𝑏)).
Examples. The logarithm function (with any base) is completely additive.
𝑓(𝑛) = 1 + (−1)𝑛 is additive, but not completely additive.
𝑔(𝑛) = 1 + log2 𝑛 is not additive (hence it cannot be completely additive either).
The identically zero function 𝑓 = 0 is both completely multiplicative and com-
pletely additive, but no other function can be both multiplicative and additive (this
follows from Theorem 6.1.6).
We show first that additive and non-zero multiplicative functions can assume only
special values at 1:
Theorem 6.1.6. If 𝑓 is multiplicative and 𝑓 ≠ 0, then 𝑓(1) = 1.
If 𝑔 is additive, then 𝑔(1) = 0. ♣
Proof. Let 𝑎 be a positive integer satisfying 𝑓(𝑎) ≠ 0. Then (𝑎, 1) = 1 implies 𝑓(𝑎) =
𝑓(𝑎 ⋅ 1) = 𝑓(𝑎)𝑓(1), and dividing by 𝑓(𝑎) ≠ 0 we get 1 = 𝑓(1).
The other statement can be proved similarly. □
Theorem 6.1.6 gives a necessary (but not sufficient) condition for a function to be
additive or multiplicative.
The definitions of additivity and multiplicativity imply that additive and (≠ 0) mul-
tiplicative functions are uniquely determined by their values at prime powers:
Exercises 6.1 167
𝛼 𝛼
Theorem 6.1.7. Let 𝑓 be multiplicative, 𝑔 additive, and 𝑛 = 𝑝1 1 . . . 𝑝𝑟 𝑟 be the standard
form of 𝑛 > 1. Then
𝛼 𝛼 𝛼 𝛼
𝑓(𝑛) = 𝑓(𝑝1 1 ) . . . 𝑓(𝑝𝑟 𝑟 ) and 𝑔(𝑛) = 𝑔(𝑝1 1 ) + ⋯ + 𝑔(𝑝𝑟 𝑟 ). ♣
We used this fact deducing the formula for 𝜑(𝑛) (in the first proof of Theorem 2.3.1).
Similarly, completely additive and (≠ 0) completely multiplicative functions are
uniquely determined by their values at primes:
Theorem 6.1.8. Let 𝑓 be completely multiplicative, 𝑔 completely additive, and
𝛼 𝛼
𝑛 = 𝑝1 1 . . . 𝑝𝑟 𝑟 be the standard form of 𝑛 > 1. Then
𝑓(𝑛) = 𝑓(𝑝1 )𝛼1 . . . 𝑓(𝑝𝑟 )𝛼𝑟 and 𝑔(𝑛) = 𝛼1 𝑔(𝑝1 ) + ⋯ + 𝛼𝑟 𝑔(𝑝𝑟 ). ♣
We can add to Theorem 6.1.7 that additivity or multiplicativity does not impose
any restrictions on the values assumed at prime powers, these can be chosen freely.
This means that prescribing the values arbitrarily at prime powers, gives a multiplica-
tive/additive function. An analogous statement holds with primes instead of prime
powers for completely multiplicative/additive functions (see Exercise 6.1.4).
Exercises 6.1
(b) Prove that there exists exactly one completely multiplicative function 𝑠 ≠ 0
and exactly one completely additive function 𝑡 satisfying
𝑠(𝑝 𝑖 ) = 𝑡(𝑝 𝑖 ) = 𝑐 𝑖 , 𝑖 = 1, 2, . . . .
5. If 𝑔 can assume only positive integer values, then we can define the composite
function ℎ(𝑛) = (𝑓 ∘ 𝑔)(𝑛) = 𝑓(𝑔(𝑛)) for any 𝑓. True or false?
(a) If 𝑓 and 𝑔 are completely multiplicative, then ℎ is completely multiplicative.
(b) If 𝑓 and 𝑔 are completely additive, then ℎ is completely additive.
(c) If 𝑓 is multiplicative and 𝑔 is completely multiplicative, then ℎ is multiplica-
tive.
(d) If 𝑓 is completely multiplicative and 𝑔 is multiplicative, then ℎ is multiplica-
tive.
6. (a) Let 𝑓 be completely additive. For which positive integers 𝑘 is the function
𝑔(𝑛) = 𝑓(𝑘𝑛) completely additive?
(b) Solve the problem for the case when we prescribe only additivity instead of
complete additivity (for both of 𝑓 and 𝑔).
(c) Investigate the variants for completely multiplicative and multiplicative func-
tions.
S 7. (a) Show that if 𝑓 is completely additive, then
(A.6.1) 𝑓(𝑎) + 𝑓(𝑏) = 𝑓((𝑎, 𝑏)) + 𝑓([𝑎, 𝑏]) holds for every 𝑎 and 𝑏.
(b) Prove (A.6.1) for any additive 𝑓.
* (c) Determine all functions 𝑓 satisfying (A.6.1).
* (d) Investigate also the corresponding equation 𝑓(𝑎)𝑓(𝑏) = 𝑓((𝑎, 𝑏))𝑓([𝑎, 𝑏]).
8. Let 𝑓 be real valued and 𝑔(𝑛) = 2𝑓(𝑛) . Demonstrate that 𝑔 is multiplicative if and
only if 𝑓 is additive.
Remark: This means that properties of additive functions assuming real values and
of multiplicative functions assuming positive values can be mutually deduced from
each other.
9. (a) Verify that both the sum and the difference of two additive functions are ad-
ditive, and the same holds if “additive” is replaced by “completely additive.”
(b) Prove that the product of two completely additive functions is never com-
pletely additive except in the trivial case when at least one of the factors is
the 0 function.
(c) Give examples when the product of two ≠ 0 additive functions is (c1) additive
(c2) not additive.
S* (d) Find all pairs of additive functions whose product is additive.
(e) Show that the product of two multiplicative functions is multiplicative, and
the same holds if “multiplicative” is replaced by “completely multiplicative.”
(f) Verify that neither the sum nor the difference of two distinct ≠ 0 multiplicative
functions can be multiplicative.
Exercises 6.1 169
10. (a) Show that the arithmetic mean of two additive or completely additive func-
tions has the same property.
(b) Prove that if the arithmetic mean of two completely multiplicative functions
is completely multiplicative then the two functions are equal. What happens
if we require only multiplicativity instead of complete multiplicativity (for all
three functions)?
11. Assume that 𝑓 is multiplicative, 𝑔 is additive, and 𝑓 + 𝑔 is constant. Show that
𝑓1000 + 𝑔1000 is multiplicative and 𝑓1000 𝑔1000 is additive.
* 12. Let ℎ be an additive function.
Proof. We follow the argument applied for deducing the formula for 𝑑(𝑛) (Theorem
1.6.3).
By Theorem 1.6.2, all divisors 𝑑 of 𝑛 are
𝛽 𝛽 𝛽
(6.2.1) 𝑑 = 𝑝1 1 𝑝2 2 . . . 𝑝𝑟 𝑟
where the exponents 𝛽1 , 𝛽2 , . . . , 𝛽𝑟 assume the values
𝛽1 = 0, 1, . . . , 𝛼1 , 𝛽2 = 0, 1, . . . , 𝛼2 , ... , 𝛽𝑟 = 0, 1, . . . , 𝛼𝑟 ,
further, every divisor has a unique representation in that form. Accordingly, 𝜎(𝑛) is the
sum of all these values of 𝑑.
On the other hand, we get the same sum performing the multiplication
𝑟
𝛼
(6.2.2) ∏(1 + 𝑝 𝑖 + 𝑝𝑖2 + ⋯ + 𝑝𝑖 𝑖 ) ∶
𝑖=1
𝛽 𝛽
product (6.2.1) occurs if we multiply 𝑝1 1 from the first factor of (6.2.2), 𝑝2 2 from the
second factor, etc.
This proves the first equality stated in the theorem.
The second equality follows from the well-known summation formula for finite
geometric series. □
⎧ 1, if 𝑛 = 1
𝜇(𝑛) = (−1)𝑟 , if 𝑛 = 𝑝1 . . . 𝑝𝑟 where 𝑝𝑗 are distinct primes ♣
⎨
⎩ 0, if 𝑝2 ∣ 𝑛 for some prime.
The following property is the key to the important applications of the Möbius func-
tion 𝜇:
6.2. Some Important Functions 171
Theorem 6.2.4.
1, if 𝑛 = 1
∑ 𝜇(𝑑) = { ♣
𝑑∣𝑛 0, if 𝑛 > 1.
Proof. No prime divisor can occur in 𝑥𝑖 other than 𝑝1 , . . . , 𝑝𝑟 , hence the standard form
of 𝑥𝑖 is
𝛽 𝛽 𝛽 𝛽
𝑥1 = 𝑝1 11 . . . 𝑝𝑟 𝑟1 , ... , 𝑥𝑘 = 𝑝1 1𝑘 . . . 𝑝𝑟 𝑟𝑘 ,
where
0 ≤ 𝛽 𝑖𝑗 ≤ 𝛼𝑖 , 𝑖 = 1, 2, . . . , 𝑟, 𝑗 = 1, 2, . . . 𝑘.
(The first index in the exponents refers to the prime, the second index refers to the
variable.)
Then 𝑛 = 𝑥1 𝑥2 . . . 𝑥𝑘 holds if and only if
(6.2.3) 𝛼1 = 𝛽11 + 𝛽12 + ⋯ + 𝛽1𝑘 , ... , 𝛼𝑟 = 𝛽𝑟1 + 𝛽𝑟2 + ⋯ + 𝛽𝑟𝑘 .
172 6. Arithmetic Functions
We note that the formulas for 𝜎(𝑛), Ω(𝑛), and 𝑑𝑘 (𝑛) (hence also for 𝑑(𝑛)) remain
valid even if the standard form of 𝑛 may contain some exponents 𝛼𝑖 = 0, but the for-
mulas for 𝜑(𝑛) and 𝜔(𝑛) are valid only if every exponent in the standard form is strictly
positive.
Finally, we examine these functions from the point of view of multiplicativity and
additivity.
Theorem 6.2.8. 𝜑(𝑛), 𝜎(𝑛), 𝜇(𝑛), and 𝑑𝑘 (𝑛) are multiplicative, but not completely (apart
from the trivial case 𝑑1 (𝑛) = 1).
𝜔(𝑛) is additive, but not completely.
Ω(𝑛) is completely additive. ♣
Proof. The multiplicativity of 𝜑(𝑛) was shown in the first proof of Theorem 2.3.1 (and
also in Exercises 2.2.14 and 2.6.10). Further,
6 = 𝜑(9) ≠ 𝜑(3)𝜑(3) = 4,
thus 𝜑(𝑛) is not completely multiplicative. (Moreover, 𝜑(𝑎𝑏) = 𝜑(𝑎)𝜑(𝑏) never holds
if 𝑎 and 𝑏 are not coprime, see Exercise 2.3.10a.)
Exercises 6.2 173
To show that 𝜎(𝑛) is multiplicative, we use the formula in Theorem 6.2.2 (another
proof can be obtained based on Exercise 1.6.5a-b, see Exercise 6.2.1).
If 𝑎 = 1 or 𝑏 = 1, then 𝜎(1) = 1 guarantees 𝜎(𝑎𝑏) = 𝜎(𝑎)𝜎(𝑏).
If 𝑎 and 𝑏 are coprime and their standard forms are
𝛼 𝛼 𝛽 𝛽
𝑎 = 𝑝1 1 . . . 𝑝𝑟 𝑟 and 𝑏 = 𝑞1 1 . . . 𝑞 𝑠 𝑠 ,
where 𝑝 𝑖 ≠ 𝑞𝑗 (due to (𝑎, 𝑏) = 1), then the standard form of 𝑎𝑏 is
𝛼 𝛼 𝛽 𝛽
𝑎𝑏 = 𝑝1 1 . . . 𝑝𝑟 𝑟 𝑞1 1 . . . 𝑞𝑠 𝑠 .
Applying the formula of 𝜎 for 𝑎, 𝑏, and 𝑎𝑏, we obtain
𝛼 +1 𝛼 +1 𝛽 +1 𝛽 +1
𝑝1 1 − 1 𝑝𝑟 𝑟 − 1 𝑞1 1 − 1 𝑞𝑠 𝑠 − 1
𝜎(𝑎)𝜎(𝑏) = ⋅⋯⋅ ⋅ ⋅⋯⋅ = 𝜎(𝑎𝑏).
𝑝1 − 1 𝑝𝑟 − 1 𝑞1 − 1 𝑞𝑠 − 1
Because
36 = 𝜎(2)𝜎(6) ≠ 𝜎(12) = 28,
thus 𝜎(𝑛) is not completely multiplicative. (Moreover, 𝜎(𝑎𝑏) = 𝜎(𝑎)𝜎(𝑏) never holds if
𝑎 and 𝑏 are not coprime, see Exercise 6.2.2.)
We verify the multiplicativity of 𝜇(𝑛) using its Definition 6.2.3. If 𝑎 = 1 or 𝑏 = 1,
then 𝜇(𝑎𝑏) = 𝜇(𝑎)𝜇(𝑏) since 𝜇(1) = 1. If at least one of 𝑎 and 𝑏 is not squarefree, then
their product is not squarefree, so 𝜇(𝑎𝑏) = 𝜇(𝑎)𝜇(𝑏) = 0. Finally if both 𝑎 and 𝑏 are
squarefree and are coprime, then their product is squarefree:
𝑎 = 𝑝1 . . . 𝑝𝑟 , 𝑏 = 𝑞1 . . . 𝑞 𝑠 , 𝑎𝑏 = 𝑝1 . . . 𝑝𝑟 𝑞1 . . . 𝑞𝑠 ,
thus
𝜇(𝑎)𝜇(𝑏) = (−1)𝑟 (−1)𝑠 = (−1)𝑟+𝑠 = 𝜇(𝑎𝑏).
Because
−1 = 𝜇(5)𝜇(15) ≠ 𝜇(75) = 0,
hence 𝜇(𝑛) is not completely multiplicative.
(We note that—in contrast with the behavior of 𝑑(𝑛), 𝜑(𝑛), and 𝜎(𝑛)—there are
infinitely many pairs 𝑎 and 𝑏 with (𝑎, 𝑏) ≠ 1 for which 𝜇(𝑎)𝜇(𝑏) = 𝜇(𝑎𝑏); e.g. 𝑎 = 4
and 𝑏 is an arbitrary even number.)
For 𝑑𝑘 (𝑛), we can proceed similarly as seen at 𝜎(𝑛).
Finally, the statements for 𝜔(𝑛) and Ω(𝑛) follow directly from Definition 6.2.5. □
Exercises 6.2
1. Prove the multiplicativity of 𝜎(𝑛) via Exercise 1.6.5a-b, and deduce the formula for
𝜎(𝑛) from the multiplicative property.
2. Show that if (𝑎, 𝑏) ≠ 1, then 𝜎(𝑎𝑏) < 𝜎(𝑎)𝜎(𝑏) and 𝑑𝑘 (𝑎𝑏) < 𝑑𝑘 (𝑎)𝑑𝑘 (𝑏) for 𝑘 > 1.
3. Assume that 𝑛𝜑(𝑛)𝜎(𝑛) is not divisible by 3. Verify that 𝑛 must be a square.
4. Prove that to any 𝑛 there exist infinitely many 𝑘 satisfying 𝜎(𝑛) ∣ 𝜎(𝑛𝑘 ).
174 6. Arithmetic Functions
(b) Demonstrate
𝑛2
* (b1) 𝜎(𝑛)𝜑(𝑛) >
2
𝜍(𝑛)𝜑(𝑛) 6
(b2) inf 𝑛2
= .
𝜋2
* 16. Prove
𝜑(𝑛) ∣ 𝑛𝜎(𝑛) − 2 ⟺ 𝑛 is a prime or 𝑛 = 1, 4, 6, 22.
17. What is the range of the following functions?
(a) 𝑓(𝑛) = 𝜇(𝑛) + 𝜇(2𝑛) + 𝜇(5𝑛) + 𝜇(10𝑛)
S (b) 𝑔(𝑛) = ∑ 𝜇(𝑘𝑛).
𝑘∣100!
18. (a) How many consecutive integers are there such that 𝜇(𝑛) is zero for none of
them?
(b) How many consecutive integers are there such that 𝜇(𝑛) is zero for each of
them?
* 19. Show that the sum of the 𝑛th primitive complex roots of unity is 𝜇(𝑛).
20. Give a simpler form for the function 𝜇(𝑛)(Ω(𝑛) − 𝜔(𝑛)).
21. (a) Prove
2𝜔(𝑛) ≤ 𝑑(𝑛) ≤ 2Ω(𝑛)
for every 𝑛. When do we have equality?
(b) How can we generalize part (a) for 𝑑𝑘 (𝑛) instead of 𝑑(𝑛)?
22. True or false?
(a) If 𝑛 is a square, then 𝑑(𝑛) ∣ 𝑑3 (𝑛).
(b) If 𝑑(𝑛) ∣ 𝑑3 (𝑛), then 𝑛 is a square.
23. Let 𝜈 be an arbitrary real number and define 𝜎𝜈 (𝑛) to be the sum of 𝜈th powers of
the divisors of 𝑛:
𝜎𝜈 (𝑛) = ∑ 𝑑 𝜈 .
𝑑∣𝑛
In particular: 𝜎1 (𝑛) = 𝜎(𝑛) and 𝜎0 (𝑛) = 𝑑(𝑛).
Find a formula for 𝜎𝜈 (𝑛) and show that 𝜎𝜈 (𝑛) is multiplicative.
Proof. First we show that these numbers are perfect. Since 2𝑝 − 1 is a prime, therefore
𝑛 is given in its standard form, and
𝜎(𝑛) = (1 + 2 + ⋯ + 2𝑝−1 )(1 + (2𝑝 − 1)) = (2𝑝 − 1)2𝑝 = 2𝑛,
by Theorem 6.2.2.
For the converse, assume that 𝑛 is even and perfect, i.e.
(6.3.1) 𝑛 = 2𝑘 𝑡, where 𝑘 ≥ 1 and 𝑡 is odd, and 𝜎(𝑛) = 2𝑛.
𝑘
Since (2 , 𝑡) = 1, we get
(6.3.2) 2𝑘+1 𝑡 = 2𝑛 = 𝜎(𝑛) = 𝜎(2𝑘 )𝜎(𝑡) = (2𝑘+1 − 1)𝜎(𝑡),
using the multiplicativity of 𝜎 and the formula for 𝜎(2𝑘 ).
Subtracting (2𝑘+1 − 1)𝑡 from the first and last terms in (6.3.2), we can factor 𝑡 as
(6.3.3) 𝑡 = (2𝑘+1 − 1)(𝜎(𝑡) − 𝑡).
We observe from (6.3.3) that 𝜎(𝑡)−𝑡 is a divisor of 𝑡. Also, 𝑘 ≥ 1 implies 2𝑘+1 −1 > 1,
thus 𝜎(𝑡) − 𝑡 ≠ 𝑡, by (6.3.3).
Since 𝜎(𝑡) − 𝑡 and 𝑡 are distinct divisors of 𝑡, with sum 𝜎(𝑡) which is the sum of all
divisors of 𝑡, 𝑡 has no other divisors. This means that 𝑡 is a prime, so 𝜎(𝑡) − 𝑡 = 1.
Substituting into (6.3.3) and (6.3.1), we obtain
𝑛 = 2𝑘 (2𝑘+1 − 1), where 2𝑘+1 − 1 is a prime,
which yields the desired form of 𝑛 (after replacing 𝑘 + 1 by 𝑝). □
Exercises 6.3 177
Exercises 6.3
1. Show that the last digit of an even perfect number is 6 or 8 (in the decimal system).
2. Prove that if there exists an odd perfect number 𝑛, then
(a) 𝑛 = 𝑠2 𝑝 where 𝑝 is a prime of the form 4𝑘 + 1
(b) 𝑛 ≡ 1 (mod 12) or 𝑛 ≡ 9 (mod 36).
3. Following the ancient Greeks, we call a natural number deficient if it is greater
than the sum of its proper divisors (i.e. the total of its parts is less than the number
itself). A number is abundant if this sum is greater than the number (i.e. its parts
together surpass the number). For example, 10 is deficient since 1 + 2 + 5 < 10,
but 12 is abundant as 1 + 2 + 3 + 4 + 6 > 12.
Verify the following statements.
(a) Every prime power is deficient.
(b) If an odd number has only two distinct prime divisors, then it is deficient.
(c) For every 𝑘 ≥ 3 there are both infinitely many odd abundant numbers and
infinitely many odd deficient numbers with exactly 𝑘 distinct prime divisors.
(d) Every multiple of an abundant number is abundant.
(e) Every deficient number has both infinitely many abundant multiples and in-
finitely many deficient multiples.
* 4. If we disregard trivial divisors (1 and the number itself), and want to assemble a
number from its other divisors, then we get the condition 𝜎(𝑛) = 2𝑛 + 1. Prove
that 𝑛 must be the square of an odd integer.
Remark: These numbers are called quasiperfect. It is unknown whether there exist
any quasiperfect numbers.
S* 5. A positive integer 𝑛 is called superperfect if 𝜎(𝜎(𝑛)) = 2𝑛. Prove the following
assertions.
(a) An even number 𝑛 is superperfect if and only if 𝑛 = 2𝑝−1 where 2𝑝 − 1 is a
(Mersenne) prime.
(b) An odd superperfect number must be a square.
(c) An odd prime power cannot be superperfect.
Remark: By part (a), there are as many even superperfect numbers as
Mersenne primes, thus it is unknown whether there exist infinitely many even
superperfect numbers. It is also unknown whether there are any odd superperfect
numbers.
6. A positive integer 𝑛 is a harmonic number (or Ore number) if the harmonic mean
of its divisors is an integer. Verify the following propositions.
(a) 𝑛 is harmonic if and only if 𝜎(𝑛) ∣ 𝑛𝑑(𝑛).
(b) Every perfect number is harmonic.
178 6. Arithmetic Functions
Remark: Numbers that are not perfect can be harmonic, e.g. 1 and 140 are har-
monic. It is unknown whether there are infinitely many harmonic numbers, and
whether there exists an odd harmonic number greater than 1.
7. The positive integers 𝑎 ≠ 𝑏 form an amicable pair if 𝜎(𝑎) = 𝜎(𝑏) = 𝑎 + 𝑏. E.g. 220
and 284 form an amicable pair.
(a) Show that every amicable pair consists of a deficient and an abundant number
(see the definitions in Exercise 6.3.3).
(b) Verify that a power of two cannot be a member of an amicable pair.
Remark: The origin of this notion is the ancient Greek numerology, as well: Each
of the two numbers can be assembled from the parts (i.e. from the proper divisors)
of the other. It is unknown whether there are infinitely many amicable pairs, and
whether there exists an amicable pair where the members are coprime or have
opposite parity.
Theorem 6.4.1 (Canyon theorem). Given any positive integer 𝐾, there are infinitely
many 𝑛 satisfying
simultaneously. ♣
Since (2𝐾+2 , 3𝐾+2 ) = 1, (6.4.2) is solvable and all (positive) solutions are of the
form 𝑥 ≡ 𝑥0 (mod 6𝐾+2 ), or
(6.4.3) 𝑥 = 𝑥0 + 𝑡6𝐾+2 , 𝑡 = 0, 1, 2, . . . .
We have to show that the arithmetic progression (6.4.3) contains infinitely many
primes. By Dirichlet’s Theorem (Theorem 5.3.1), this holds if 𝑥0 and 6𝐾+2 are coprime.
Since 𝑥0 is a solution of (6.4.2), 𝑥0 is relatively prime to both 2 and 3, hence also to
6𝐾+2 . □
6.4. Behavior of 𝑑(𝑛) 179
Theorem 6.4.2 (Peak theorem). Given any positive integer 𝐾, there are infinitely many
𝑛 satisfying
(6.4.4) 𝑑(𝑛) − 𝑑(𝑛 − 1) > 𝐾 and 𝑑(𝑛) − 𝑑(𝑛 + 1) > 𝐾
simultaneously. ♣
The canyon and peak theorems illustrate that the behavior of 𝑑(𝑛) is very irregular.
Now we shall investigate the average of the first 𝑛 values of the function. It turns out
that this mean value function (or average value function) is already very nice.
Theorem 6.4.3. Let
𝑛
𝐷(𝑛) = ∑ 𝑑(𝑖).
𝑖=1
Then
(6.4.7) | 𝐷(𝑛) − log 𝑛| ≤ 1
| 𝑛 |
for every 𝑛. ♣
for every 𝑛. (Inequalities (6.4.8) can be proved by comparing suitable areas and inte-
grals similar to the method applied in the first proof of Theorem 5.6.1.)
180 6. Arithmetic Functions
We construct an 𝑛 × 𝑛 matrix where the 𝑗th element of the 𝑖th row 𝑎𝑖𝑗 is 1 or 0,
depending on whether 𝑗 divides 𝑖 or not:
1, if 𝑗 ∣ 𝑖
𝑎𝑖𝑗 = {
0, if 𝑗 ∤ 𝑖.
For example, we obtain the following matrix for 𝑛 = 6:
1 0 0 0 0 0
⎛ ⎞
1 1 0 0 0 0
⎜ ⎟
⎜1 0 1 0 0 0⎟
.
⎜1 1 0 1 0 0⎟
⎜1 0 0 0 1 0⎟
⎝1 1 1 0 0 1⎠
The key idea of the proof is to determine the sum of all elements in the matrix (i.e. the
number of 1s) in two different ways.
In row 𝑖 there are 1s whenever 𝑗 ∣ 𝑖, so the sum of elements in row 𝑖 is 𝑑(𝑖). Thus
summing by rows, we obtain that the sum of all elements in the matrix is
𝑛
(6.4.9) 𝐷(𝑛) = ∑ 𝑑(𝑖).
𝑖=1
Both (6.4.9) and (6.4.10) provide the sum of elements in the matrix, so
𝑛
𝑛
(6.4.11) 𝐷(𝑛) = ∑ ⌊ ⌋.
𝑗=1
𝑗
and
𝑛 𝑛
𝑛 1
(6.4.12b) 𝐷(𝑛) > ∑ ( − 1) = (𝑛 ∑ ) − 𝑛 > 𝑛(−1 + log 𝑛).
𝑗=1
𝑗 𝑗=1
𝑗
Theorem 6.4.3 can be written also in the form |𝐷(𝑛) − 𝑛 log 𝑛| ≤ 𝑛. The next
theorem gives a better estimate for the difference of 𝐷(𝑛) and 𝑛 log 𝑛 (i.e. we obtain a
better bound for the error term).
𝑛
We shall need a more precise estimate of the sum ∑𝑗=1 1/𝑗 than that given by
𝑛
(6.4.8): The sequence ∑𝑗=1 1/𝑗−log 𝑛 converges, its limit is known as Euler’s constant,
𝛾 = 0.577 . . . , and
| 𝑛 1 |
(6.4.13) | ∑ − log 𝑛 − 𝛾| ≤ 10
| |
|𝑗=1 𝑗 | 𝑛
for every 𝑛.
for every 𝑛. ♣
Proof. 𝑑(𝑖) is the number of pairs of positive integers 𝑥 and 𝑦 satisfying 𝑥𝑦 = 𝑖 (where
𝑛
the order of 𝑥 and 𝑦 counts). Therefore 𝐷(𝑛) = ∑𝑖=1 𝑑(𝑖) is the number of pairs of
positive integers 𝑥 and 𝑦 satisfying 𝑥𝑦 ≤ 𝑛.
This means that 𝐷(𝑛) is the number of lattice points (𝑥, 𝑦) (with integer coordi-
nates) in the region defined by the positive halves of the coordinate axes and the hy-
perbola 𝑥𝑦 = 𝑛, including the lattice points on the hyperbola but not the ones on the
axes. Now we count these lattice points.
Let 𝐴(𝑛) be the number of lattice points (𝑥, 𝑦) with 𝑥 ≤ √𝑛. As lattice points are
symmetric about the line 𝑦 = 𝑥, the number of lattice points with 𝑦 ≤ √𝑛 is also 𝐴(𝑛).
We took thus all lattice points into consideration, but counted twice the lattice
points satisfying both 𝑥 ≤ √𝑛 and 𝑦 ≤ √𝑛. These are the lattice points in the square
where one of the diagonals is the segment connecting the origin and (√𝑛, √𝑛), so there
are ⌊√𝑛⌋2 lattice points in this square.
Thus the total number of lattice points is
Now we determine 𝐴(𝑛). There are ⌊𝑛/𝑗⌋ lattice points with first coordinate 𝑗, so
⌊√𝑛⌋
𝑛
(6.4.16) 𝐴(𝑛) = ∑ ⌊ ⌋.
𝑗=1
𝑗
Estimating the sum on the right-hand side of (6.4.16) similar to the proof of Theo-
rem 6.4.3, we obtain
⌊√𝑛⌋
1
(6.4.17) 𝐴(𝑛) = 𝑛 ∑ + 𝑓(𝑛), where |𝑓(𝑛)| < √𝑛.
𝑗=1
𝑗
182 6. Arithmetic Functions
where
10𝑛 10𝑛
(6.4.19b) |ℎ(𝑛)| = |𝑛𝑔(𝑛) + 𝑓(𝑛)| < + √𝑛 < + √𝑛 = 21√𝑛.
⌊√𝑛⌋ √𝑛
2
log 𝑛
To replace log⌊√𝑛⌋ in (6.4.19a) by log √𝑛 = 2
, we estimate the error term, the dif-
log 𝑛
ference 2
− log⌊√𝑛⌋.
Applying the mean value theorem of Lagrange and (log 𝑥)′ = 1/𝑥, to any 𝑎 > 1
there exists some 𝑢 satisfying 𝑎 − 1 < 𝑢 < 𝑎 and
log 𝑎 − log(𝑎 − 1) 1 1
log 𝑎 − log(𝑎 − 1) = = < .
𝑎 − (𝑎 − 1) 𝑢 𝑎−1
Therefore
log 𝑛 1 2
(6.4.20) 0≤ − log⌊√𝑛⌋ < log √𝑛 − log(√𝑛 − 1) < ≤
2 √𝑛 − 1 √𝑛
for any 𝑛 ≥ 4.
By (6.4.20), we can rewrite (6.4.19a) and (6.4.19b) as
𝑛 log 𝑛
(6.4.21) 𝐴(𝑛) = + 𝛾𝑛 + 𝑘(𝑛), where |𝑘(𝑛)| < 23√𝑛.
2
To eliminate the floor sign in (6.4.15) and to replace ⌊√𝑛⌋2 by 𝑛, we estimate 𝑛 − ⌊√𝑛⌋2 :
0 ≤ 𝑛 − ⌊√𝑛⌋2
= (√𝑛)2 − ⌊√𝑛⌋2
(6.4.22) = (√𝑛 − ⌊√𝑛⌋)(√𝑛 + ⌊√𝑛⌋)
< 1(√𝑛 + √𝑛)
= 2√𝑛.
Remarks: (1) Improving the bound (6.4.14) for the error term in Theorem 6.4.4 is
called the divisor problem and has an extensive literature. It was shown that √𝑛
can be replaced by 𝑛0.32 , but not by 𝑛0.25 .
6.4. Behavior of 𝑑(𝑛) 183
(2) As
log 1 + log 2 + ⋯ + log 𝑛 ∼ 𝑛 log 𝑛
(the two functions are asymptotically equal, their ratio tends to 1), Theorem 6.4.3
(or 6.4.4) implies
(6.4.23) 𝑑(1) + 𝑑(2) + ⋯ + 𝑑(𝑛) ∼ log 1 + log 2 + ⋯ + log 𝑛.
Relation (6.4.23) expresses that the average order of magnitude of 𝑑(𝑛) is log 𝑛.
This does not mean, however, that a typical 𝑛 has about log 𝑛 divisors; we prove in
Section 6.7 (see Exercise 6.7.6), that the number of divisors is smaller in general:
𝑑(𝑛) is about
(log 𝑛)log 2 = (log 𝑛)0.69. . .
for most integers 𝑛. The bigger average log 𝑛 is due to those rarely occurring num-
bers that have extremely many divisors.
Let 𝜀 > 0 be arbitrary. We have to guarantee an 𝑛0 = 𝑛0 (𝜀) such that |𝑓(𝑛)| < 𝜀 for
every 𝑛 > 𝑛0 .
By the condition, there exists an 𝑠 = 𝑠(𝜀) such that
𝜀
(6.4.27) |𝑓(𝑞𝑗 )| < 𝑘 , for every 𝑗 > 𝑠.
𝐻
We claim that 𝑞1 . . . 𝑞𝑠 can be chosen as 𝑛0 .
If 𝑛 > 𝑞1 . . . 𝑞𝑠 , then there must occur a prime power 𝑞𝑗 greater than 𝑞𝑠 : 𝑛 = 𝑞𝑗 𝑚
where (𝑞𝑗 , 𝑚) = 1.
By (6.4.27), |𝑓(𝑞𝑗 )| < 𝜀/𝐻 𝑘 , and |𝑓(𝑚)| ≤ 𝐻 𝑘 , by (6.4.25), so
𝜀
|𝑓(𝑛)| = |𝑓(𝑞𝑗 )| ⋅ |𝑓(𝑚)| < 𝑘 ⋅ 𝐻 𝑘 = 𝜀. □
𝐻
Proof of Theorem 6.4.5. We apply Theorem 6.4.6 for the function
𝑑(𝑛)
𝑓(𝑛) = .
𝑛𝛿
To do this, we have to show
𝑑(𝑞𝑗 )
(6.4.28) lim = 0.
𝑗→∞ 𝑞𝑗𝛿
Let 𝑞𝑗 = 𝑝𝛼 (where 𝑝 is a prime). Then
2 log(𝑝𝛼 ) 2 log 𝑞𝑗
𝑑(𝑞𝑗 ) = 𝑑(𝑝𝛼 ) = 𝛼 + 1 ≤ 2𝛼 = ≤ ,
log 𝑝 log 2
hence
𝑑(𝑞𝑗 ) 2 log 𝑞𝑗
(6.4.29) ≤ ⋅ .
𝑞𝑗𝛿 log 2 𝑞𝑗𝛿
Since
log 𝑥
lim= 0,
𝑥𝛿
𝑥→∞
the right-hand side in (6.4.29) tends to 0, therefore this is true also for the left-hand
side. □
Remark: It can be shown that the maximal order of magnitude of 𝑑(𝑛) is approximately
log 2
𝑛 log log 𝑛 .
The precise formulation is:
(i) For any 𝜀 > 0, there exists an 𝑛0 = 𝑛0 (𝜀) such that
(1+𝜀) log 2
𝑑(𝑛) < 𝑛 log log 𝑛
Exercises 6.4
* 1. Show that the statements of Theorems 6.4.1 and 6.4.2 remain valid if 𝑑(𝑛) is re-
placed by 𝜎(𝑛), 𝜑(𝑛), Ω(𝑛), 𝜔(𝑛), or 𝑑𝑘 (𝑛) with 𝑘 > 1.
2. Prove
𝑑𝑘 (𝑛)
lim =0
𝑛→∞ 𝑛𝛿
for any fixed 𝛿 > 0 and positive integer 𝑘.
3. Let 𝜀 > 0 be arbitrary. Find infinitely many 𝑛 satisfying
(a) 𝑑(𝑛) > (log 𝑛)100
(1−𝜀) log 2
* (b) 𝑑(𝑛) > 𝑛 log log 𝑛 .
4. Prove Ω(𝑛) ≤ log2 𝑛 for every 𝑛. When do we get equality?
* 5. Let 𝜀 > 0 be arbitrary. Prove the following statements.
(a) If 𝑛 is sufficiently large, then
(1 + 𝜀) log 𝑛
𝜔(𝑛) < .
log log 𝑛
(b) There are infinitely many 𝑛 satisfying
(1 − 𝜀) log 𝑛
𝜔(𝑛) > .
log log 𝑛
6. Show that if 𝑛 is large enough, then
(a) 𝜑(𝑛) > 𝑛0.99
𝑛
(b) 𝜑(𝑛) >
2 log 𝑛
𝑛
* (c) 𝜑(𝑛) >
𝐶 log log 𝑛
(d) 𝜎(𝑛) < 𝑛1,01
(e) 𝜎(𝑛) < 2𝑛 log 𝑛
* (f) 𝜎(𝑛) < 𝐶𝑛 log log 𝑛
where 𝐶 is a suitable absolute constant in parts (c) and (f).
7. Verify.
(a) The range of 𝜑(𝑛)/𝑛 is everywhere dense in the interval [0, 1].
(b) The range of 𝜎(𝑛)/𝑛 is everywhere dense in [1, ∞].
* 8. Dirichlet’s Theorem (Theorem 5.3.1) states that if the positive integers 𝑎 and 𝑑 are
coprime, then the arithmetic progression 𝑎 + 𝑘𝑑, 𝑘 = 0, 1, 2, . . . contains infinitely
many primes. The following significantly stronger results hold as well:
(i) The sum of reciprocals of these primes is divergent.
186 6. Arithmetic Functions
(ii) The number of such primes not greater than 𝑛 (with 𝑎 and 𝑑 fixed) is asymp-
totically
𝑛
𝜑(𝑑) log 𝑛
when 𝑛 → ∞.
(i) and (ii) are far-reaching generalizations of Theorems 5.6.1 and 5.4.1.
(a) Let 𝑘 be a fixed positive integer. Apply (i) to show that 𝑘 ∣ 𝜑(𝑛) holds for nearly
every 𝑛. More precisely, let 𝐹(𝑁) be the number of integers 𝑥 ≤ 𝑁 satisfying
𝑘 ∣ 𝜑(𝑥); then lim𝑁→∞ 𝐹(𝑁)/𝑁 = 1.
S (b) Prove that nearly all positive integers are missing from the range of 𝜑(𝑛). (Sim-
ilar to the previous interpretation, let 𝐺(𝑁) be the number of values 𝑦 ≤ 𝑁
occurring in the range of 𝜑(𝑛); then lim𝑁→∞ 𝐺(𝑁)/𝑁 = 0.)
* 9. Show that the statements of the previous exercise remain valid if 𝜑 is replaced by 𝜎.
Examples. The summation function of 𝑓(𝑛) = 1 is 𝑓+ (𝑛) = 𝑑(𝑛), the one of 𝑔(𝑛) = 𝑛
is 𝑔+ (𝑛) = 𝜎(𝑛).
By Exercise 2.3.14, 𝜑+ (𝑛) = 𝑛, and by Theorem 6.2.4, 𝜇+ (𝑛) = 𝑒(𝑛) where
1, if 𝑛 = 1
(6.5.1) 𝑒(𝑛) = {
0, if 𝑛 > 1.
Theorem 6.5.2. To every arithmetic function 𝑓 there exists exactly one function having
𝑓 as its summation function. This uniquely determined function is called the inversion
function of 𝑓 and is denoted by 𝑓.̃ ♣
We have to show that this system consisting of infinitely many equations and contain-
̃
ing infinitely many variables 𝑓(1), ̃
𝑓(2), . . . has a unique solution.
The first equation is satisfied if and only if
̃ = 𝑓(1).
𝑓(1)
̃ is the value obtained from
Both of the first two equations are valid if and only if 𝑓(1)
the first equation and
̃ = 𝑓(2) − 𝑓(1).
𝑓(2) ̃
We can proceed similarly by induction. Assume that the system of the first 𝑚 − 1
equations has exactly one solution 𝑓(1),̃ . . . , 𝑓(𝑚̃ − 1), and consider the system of the
̃
first 𝑚 equations. Since the variable 𝑓(𝑚) occurs only in the 𝑚th equation, the first 𝑚
̃
equations are satisfied if and only if 𝑓(1), ̃ − 1) are the unique values obtained
. . . , 𝑓(𝑚
from the first 𝑚 − 1 equations (according to the induction hypothesis) and
(6.5.2) ̃
𝑓(𝑚) ̃
= 𝑓(𝑚) − ∑ 𝑓(𝑑).
𝑑∣𝑚
𝑑<𝑚
This proves the existence and uniqueness of the function 𝑓.̃ (Formula (6.5.2) serves as
a recursion for determining the values of 𝑓.)̃ □
Examples. Reading the examples after Definition 6.5.1 backwards (and keeping the
notation used there), we have
̃
𝑑(𝑛) =1 𝜎(𝑛)
̃ =𝑛 𝑔(𝑛)
̃ = 𝜑(𝑛) 𝑒(𝑛)
̃ = 𝜇(𝑛).
(6.5.3) ̃ = ∑ 𝜇(𝑑)𝑓( 𝑛 ).
𝑓(𝑛)
𝑑∣𝑛
𝑑
Proof. Since 𝑓 ̃ is unique by Theorem 6.5.2, it is sufficient to verify that the summation
function ℎ+ (𝑛) of
𝑛
ℎ(𝑛) = ∑ 𝜇(𝑑)𝑓( ) = ∑ 𝜇(𝑑)𝑓(𝑐)
𝑑∣𝑛
𝑑 𝑐𝑑=𝑛
on the right-hand side of (6.5.3) is 𝑓(𝑛). We can do this by rearranging the sums and
applying (6.5.1):
ℎ+ (𝑛) = ∑ ℎ(𝑘) = ∑ ∑ 𝜇(𝑑)𝑓(𝑐) = ∑ 𝜇(𝑑)𝑓(𝑐)
𝑘∣𝑛 𝑘∣𝑛 𝑐𝑑=𝑘 𝑐𝑑∣𝑛
𝑛 𝑛
+
= ∑ 𝑓(𝑐)(∑ 𝜇(𝑑)) = ∑ 𝑓(𝑐)𝜇 ( ) = ∑ 𝑓(𝑐)𝑒( ) = 𝑓(𝑛). □
𝑐∣𝑛 𝑛 𝑐∣𝑛
𝑐 𝑐∣𝑛
𝑐
𝑑∣ 𝑐
Proof. Consider the 𝑛 × 𝑛 matrices 𝐵 and 𝐶 where the 𝑗th element in row 𝑖 is 𝑏𝑖𝑗 and
𝑐 𝑖𝑗 , defined as
1, if 𝑗 ∣ 𝑖
𝑏𝑖𝑗 = {
0, if 𝑗 ∤ 𝑖,
and
̃
𝑓(𝑗), if 𝑗 ∣ 𝑖;
̃
𝑐 𝑖𝑗 = 𝑏𝑖𝑗 𝑓(𝑗), i.e. 𝑐 𝑖𝑗 = {
0, if 𝑗 ∤ 𝑖.
Both matrices have only 0s above the main diagonal, hence each determinant is the
product of the elements on the main diagonal. The main diagonal of 𝐵 consists of 1s,
̃
whereas the elements on the main diagonal of 𝐶 are 𝑓(1), ̃
. . . , 𝑓(𝑛), hence
(6.5.4) det 𝐵 = 1 and ̃ 𝑓(2)
det 𝐶 = 𝑓(1) ̃ . . . 𝑓(𝑛).
̃
Now we examine the product 𝐷 = 𝐵𝐶 𝑇 where 𝐶 𝑇 means the transpose of 𝐶. The 𝑗th
element in row 𝑖 in 𝐷 is
𝑑𝑖𝑗 = 𝑏𝑖1 𝑐𝑗1 + 𝑏𝑖2 𝑐𝑗2 + ⋯ + 𝑏𝑖𝑛 𝑐𝑗𝑛 =
(6.5.5)
̃ + 𝑏𝑖2 𝑏𝑗2 𝑓(2)
= 𝑏𝑖1 𝑏𝑗1 𝑓(1) ̃ + ⋯ + 𝑏𝑖𝑛 𝑏𝑗𝑛 𝑓(𝑛).
̃
Here
̃
̃ = {𝑓(𝑘),
𝑏𝑖𝑘 𝑏𝑗𝑘 𝑓(𝑘)
if 𝑘 ∣ 𝑖 and 𝑘 ∣ 𝑗
0, otherwise,
so
̃
𝑓(𝑘), if 𝑘 ∣ (𝑖, 𝑗)
(6.5.6) ̃ ={
𝑏𝑖𝑘 𝑏𝑗𝑘 𝑓(𝑘)
0, if 𝑘 ∤ (𝑖, 𝑗).
Substituting (6.5.6) into (6.5.5) and applying the definition of 𝑓,̃ we obtain
̃ = 𝑓((𝑖, 𝑗)),
𝑑𝑖𝑗 = ∑ 𝑓(𝑘)
𝑘∣(𝑖,𝑗)
thus 𝐷 = 𝐴.
Finally, (6.5.4) and the product rule of determinants imply
̃ 𝑓(2)
det 𝐴 = det 𝐷 = (det 𝐵)(det 𝐶) = 𝑓(1) ̃ . . . 𝑓(𝑛).
̃ □
Exercises 6.5 189
Exercises 6.5
9. Verify.
(a) The sum of all primitive complex 𝑛th roots of unity is 𝜇(𝑛).
* (b) The sum of the 𝑘th powers of all primitive complex 𝑛th roots of unity is
𝜇(𝑛′ )𝜑(𝑛) 𝑛
where 𝑛′ = .
𝜑(𝑛′ ) (𝑛, 𝑘)
(c) For any prime 𝑝, the sum of all pairwise incongruent primitive roots modulo 𝑝
is congruent to 𝜇(𝑝 − 1) modulo 𝑝.
10. Evaluate the determinants of 𝑛 × 𝑛 matrices whose 𝑗th element in row 𝑖 is
(a) (𝑖, 𝑗)
(b) 𝜎((𝑖, 𝑗))
(c) 𝑑((𝑖, 𝑗))
(d) 𝜔((𝑖, 𝑗)).
11. Let 𝑠1 , . . . , 𝑠𝑛 be arbitrary distinct integers such that every divisor of each 𝑠𝑖 occurs
among the numbers 𝑠𝑗 . Show that the analog of Theorem 6.5.4 remains valid if the
numbers 1, 2, . . . , 𝑛 are replaced by 𝑠1 , . . . , 𝑠𝑛 .
6.6. Convolution
Definition 6.6.1. The convolution of arithmetic functions 𝑓 and 𝑔 is
𝑛
(𝑓 ∗ 𝑔)(𝑛) = ∑ 𝑓(𝑑)𝑔( ) = ∑ 𝑓(𝑑)𝑔(𝑐). ♣
𝑑∣𝑛
𝑑 𝑐𝑑=𝑛
The summation and inversion functions are special cases of convolution: by def-
inition, 𝑓+ is the convolution of 𝑓 and the constant function 1, and by the Möbius
inversion formula, 𝑓 ̃ is the convolution of 𝑓 and 𝜇, i.e.
𝑓+ = 𝑓 ∗ 1 and 𝑓 ̃ = 𝑓 ∗ 𝜇.
Now we examine the properties of convolution as an operation.
Theorem 6.6.2. Convolution is associative and commutative, the identity element is
1, if 𝑛 = 1
𝑒(𝑛) = {
0, if 𝑛 > 1,
and 𝑓 has an inverse if and only if 𝑓(1) ≠ 0. ♣
and ((𝑓 ∗ 𝑔) ∗ ℎ)(𝑛) can be transformed into the same final form.
Identity element:
𝑛 𝑛
(𝑒 ∗ 𝑓)(𝑛) = ∑ 𝑒(𝑑)𝑓( ) = 1 ⋅ 𝑓(𝑛) + ∑ 0 ⋅ 𝑓( ) = 𝑓(𝑛).
𝑑∣𝑛
𝑑 1<𝑑∣𝑛
𝑑
6.6. Convolution 191
Inverse: We can argue similarly as in the proof of Theorem 6.5.2. The inverse 𝑔 of
𝑓 has to satisfy 𝑒 = 𝑓 ∗ 𝑔 so
1 = 𝑒(1) = 𝑓(1)𝑔(1)
0 = 𝑒(2) = 𝑓(1)𝑔(2) + 𝑓(2)𝑔(1)
0 = 𝑒(3) = 𝑓(1)𝑔(3) + 𝑓(3)𝑔(1)
0 = 𝑒(4) = 𝑓(1)𝑔(4) + 𝑓(2)𝑔(2) + 𝑓(4)𝑔(1)
0 = 𝑒(5) = 𝑓(1)𝑔(5) + 𝑓(5)𝑔(1)
0 = 𝑒(6) = 𝑓(1)𝑔(6) + 𝑓(2)𝑔(3) + 𝑓(3)𝑔(2) + 𝑓(6)𝑔(1)
⋮
In this system of infinitely many equations, 𝑔(1), 𝑔(2), . . . are the unknowns to be de-
termined. The first 𝑚 equations contain only the variables 𝑔(1), . . . , 𝑔(𝑚), and 𝑔(𝑚)
occurs first in the 𝑚th equation.
If 𝑓(1) = 0, then the first equation has no solution, hence 𝑓(1) ≠ 0 is a necessary
condition for the existence of the inverse. To prove its sufficiency, we have to show that
for 𝑓(1) ≠ 0 the system of equations has a (unique) solution.
The first equation holds if and only if
1
𝑔(1) = .
𝑓(1)
The first two equations hold simultaneously if and only if 𝑔(1) is the uniquely deter-
mined value obtained from the first equation and
−𝑓(2)𝑔(1)
𝑔(2) = .
𝑓(1)
We can proceed similarly by induction. Assume that the system consisting of the first
𝑚 − 1 equations has a unique solution 𝑔(1), . . . , 𝑔(𝑚 − 1), and consider now the system
of the first 𝑚 equations. As 𝑔(𝑚) occurs first in the 𝑚th equation, the first 𝑚 equations
are satisfied if and only if 𝑔(1), . . . , 𝑔(𝑚−1) are the uniquely determined values obtained
from the first 𝑚 − 1 equations and
−1 𝑚
𝑔(𝑚) = ∑ 𝑔(𝑑)𝑓( ).
𝑓(1) 𝑑∣𝑚 𝑑
𝑑<𝑚
Convolution gives a simple proof for the Möbius inversion formula and it will also
clarify why the function 𝜇 plays such a special role.
Using convolution, the inversion function can be written as
(6.6.1) 𝑓 ̃ ∗ 1 = 𝑓,
and we have to express 𝑓.̃ Let 𝑔 be the inverse of the constant function 1, and multiply
(6.6.1) by 𝑔, i.e. apply the convolution 𝑔 to both sides. Then, using also the properties
of convolution, we obtain
(6.6.2) 𝑓 ̃ = 𝑓 ∗ 𝑔.
192 6. Arithmetic Functions
Thus the domain of 𝐹 is the set of those real numbers for which the infinite series
(6.5.3) converges.
It is easy to check (see Exercise 6.6.6) that if (6.5.3) converges for some 𝑠0 , then it
is absolutely convergent for every 𝑠 > 𝑠0 + 1. In the sequel, we shall consider function
𝐹(𝑠) only at places 𝑠 where the series (6.5.3) is absolutely convergent. This will have
the advantage that we can use theorems on absolutely convergent series that can be
roughly summarized as stating that the same rules of computation apply to absolutely
convergent series as to the sums with finitely many terms. This means, among other
things, that rearranging and grouping the terms of an absolutely convergent series arbi-
trarily gives an absolutely convergent series again having the same sum as the original
one, and multiplying two absolutely convergent series using the every term by every
term law (and rearranging and grouping the result in any fashion) yields an absolutely
convergent series whose sum is the product of the sums of the two original series.
We note that a Dirichlet series can be investigated as a function of a complex vari-
able, and also as formal series when convergence is not considered, but we do not deal
with these variants.
The most famous Dirichlet series is Riemann’s zeta function belonging to 𝑓 = 1:
∞
1
(6.6.4) 𝜁(𝑠) = ∑ 𝑠
,
𝑛=1
𝑛
defined already in Exercise 5.6.6. The series (6.6.4) is absolutely convergent for 𝑠 > 1,
and by Exercise 5.6.6, it can be represented as the infinite product
1 1
(6.6.5) 𝜁(𝑠) = ∏ lim ∏
1 = 𝑛→∞ 1 .
𝑝 1 − 𝑝𝑠 𝑝≤𝑛 1 − 𝑝𝑠
Formula (6.6.5) is due to Euler, and it reveals why the distribution of primes is closely
connected to the behavior of the 𝜁 function. Extremely important theorems concern-
ing the primes would follow from the Riemann Hypothesis which claims that all non-
real roots of the extended version of the zeta function to complex variables have real
part 1/2.
Exercises 6.6 193
The next theorem reveals the connection between Dirichlet series and convolution:
Theorem 6.6.4. Assume that the Dirichlet series 𝐹(𝑠), 𝐺(𝑠), and 𝐻(𝑠) belonging to the
arithmetic functions 𝑓, 𝑔, and ℎ, are absolutely convergent, and ℎ = 𝑓 ∗ 𝑔. Then 𝐻(𝑠) =
𝐹(𝑠)𝐺(𝑠). ♣
hence
∞
1 𝜇(𝑛) 1
(6.6.6) 𝑀(𝑠) = , i.e. ∑ 𝑠
= ∞ 1 .
𝜁(𝑠) 𝑛=1
𝑛 ∑𝑛=1 𝑛𝑠
Exercises 6.6
1. Which (well known) function will be the 𝑘th power by convolution of the function
𝑓 = 1 (i.e. the convolution 1 ∗ 1 ∗ ⋯ ∗ 1 of 𝑘 factors)?
2. Prove that the arithmetic functions form a commutative ring with identity element
and without zero divisors with respect to the operations of addition and convolu-
tion.
194 6. Arithmetic Functions
5. Prove
𝑛
∑ 𝜎(𝑑)𝜑( ) = 𝑛𝑑(𝑛).
𝑑∣𝑛
𝑑
10. In this exercise we generalize the product form of 𝜁 for multiplicative and com-
pletely multiplicative functions. The infinite product taken for all primes is defined
as in Exercise 5.6.6 (and as in (6.6.5) of this section), and absolute convergence is
assumed for all infinite series.
(b) Let 𝑓 ≠ 0, 𝑓 be completely multiplicative, and |𝑓(𝑝)| < 𝑝𝑠 for every prime 𝑝.
Prove
∞
𝑓(𝑛) 1
∑ 𝑠 =∏ .
𝑛=1
𝑛 𝑝 1−
𝑓(𝑝)
𝑝𝑠
11. Demonstrate
∞
𝜇(𝑛) 1
∑ 𝑠
= ∏(1 − 𝑠 )
𝑛=1
𝑛 𝑝
𝑝
for 𝑠 > 1.
S 12. Compute the sums
∞
𝑑(𝑛)
(a) ∑
𝑛=1
𝑛2
∞
𝑑(𝑛) 2
* (b) ∑ ( ) .
𝑛=1
𝑛
* 13. Determine the sum of squares of reciprocals of all squarefree numbers.
14. (a) Prove that if |𝑥| < 1 and both infinite series occurring in
∞ ∞
𝑓(𝑛)𝑥𝑛
∑ = ∑ 𝑓+ (𝑘)𝑥𝑘
𝑛=1
1 − 𝑥𝑛 𝑘=1
Proof. We try first a suitable modification of the method used for 𝑑(𝑛), applying (6.7.2).
Let 𝑣(𝑛) = 𝑛, then 𝜎 = 𝑣+ = 𝑣 ∗ 1, so
𝑛 𝑛
𝑛
(6.7.6) Σ(𝑛) = ∑ 𝜎(𝑖) = ∑ 𝑗⌊ ⌋.
𝑖=1 𝑗=1
𝑗
Estimating the right-hand side of (6.7.6) by the usual inequalities 𝑎 − 1 < ⌊𝑎⌋ ≤ 𝑎, we
get
𝑛(𝑛 + 1)
𝑛2 − < Σ(𝑛) ≤ 𝑛2
2
which does not yield an asymptotic value for Σ(𝑛).
Therefore we interchange the roles of 1 and 𝑣(𝑛) = 𝑛, and apply Theorem 6.7.2
with 𝑔 = 1 and ℎ = 𝑣 for the convolution 𝜎 = 1 ∗ 𝑣:
𝑛 𝑛
𝑛 ⌊𝑛/𝑗⌋ 𝑛 ⌊ 𝑗 ⌋ (⌊ 𝑗 ⌋ + 1)
(6.7.7) Σ(𝑛) = ∑ ∑ 𝑘 = ∑ .
𝑗=1 𝑘=1 𝑗=1
2
6.7. Mean Value 197
so
𝑛
𝑛2 1
(6.7.9) Σ(𝑛) = ∑ + 𝑈(𝑛), where |𝑈(𝑛)| < 𝑛 log 𝑛 for 𝑛 ≥ 3.
2 𝑗=1 𝑗2
If 𝑛 → ∞, then the limit of the first term on the right-hand side of (6.7.10) is
∞
1 1 𝜋2
∑ 2 = ,
2 𝑗=1 𝑗 12
Thus (6.7.12) states that the mean value of 𝜑 can be well approximated by 3𝑛/𝜋2 ,
and (6.7.13) expresses that the average order of magnitude of 𝜑 is 6𝑛/𝜋2 .
198 6. Arithmetic Functions
Proof. We apply Theorem 6.7.2 now for the convolution 𝜑 = 𝜇 ∗ 𝑣, i.e. with 𝑔 = 𝜇 and
ℎ = 𝑣 (where 𝑣(𝑛) = 𝑛):
𝑛 𝑛
𝑛 ⌊𝑛/𝑗⌋ 𝑛 ⌊ 𝑗 ⌋(⌊ 𝑗 ⌋ + 1)
(6.7.14) Φ(𝑛) = ∑ 𝜇(𝑗) ∑ 𝑘 = ∑ 𝜇(𝑗) .
𝑗=1 𝑘=1 𝑗=1
2
We can continue analogously to the proof of Theorem 6.7.3 (for estimating the error
term, we use |𝜇(𝑗)| ≤ 1). Finally we arrive at
𝑛
Φ(𝑛) 1 𝜇(𝑗) 𝑈(𝑛)
(6.7.15) = ∑ 2 + 2 ,
𝑛2 2 𝑗=1 𝑗 𝑛
which corresponds to (6.7.10). If 𝑛 → ∞, then the second term on the right-hand side
of (6.7.15) tends to 0, and the limit of the first term is
∞
1 𝜇(𝑗)
∑ .
2 𝑗=1 𝑗2
therefore
Φ(𝑛) 3
lim = 2. □
𝑛→∞ 𝑛2 𝜋
We show that this limit exists and will call it the probability in question.
Theorem 6.7.5. The probability of two numbers being relatively prime (in the sense of
(6.7.16)) is 6/𝜋2 . ♣
It is part of the theorem, of course, that this probability, the limit in (6.7.16), exists.
As indicated earlier, this probability is closely related to the mean value of 𝜑, so
Theorem 6.7.5 will follow immediately from Theorem 6.7.4. We shall present also a
second proof of Theorem 6.7.5 based on the Inclusion and Exclusion Principle (actually,
herewith we obtain another proof also of Theorem 6.7.4).
6.7. Mean Value 199
satisfy
(6.7.17) 𝐻(𝑛) = 2Φ(𝑛) − 1.
To prove (6.7.17), consider the square 𝑄𝑛 and cut it into two triangles along its diagonal,
starting from the origin. 𝐻(𝑛) is just the number of lattice points in 𝑄𝑛 with coprime
coordinates (disregarding the lattice points on the axes). These lattice points are sym-
metric about the diagonal starting from the origin. In the lower triangle, a lattice point
with first coordinate 𝑖 counts if and only if its second coordinate 𝑡 satisfies 1 ≤ 𝑡 ≤ 𝑖
and (𝑖, 𝑡) = 1. There are 𝜑(𝑖) such lattice points, hence there are altogether
𝑛
∑ 𝜑(𝑖) = Φ(𝑛)
𝑖=1
suitable lattice points in the lower triangle. By symmetry, the same holds for the upper
triangle. We counted twice the lattice points on the diagonal, but (1, 1) is the only
relevant point here. Accordingly, the number of lattice points visible from the origin is
2Φ(𝑛) − 1.
By Theorem 6.7.4, (6.7.17) implies
𝐻(𝑛) Φ(𝑛) 6
lim 2
= 2 lim 2
= 2. □
𝑛→∞ 𝑛 𝑛→∞ 𝑛 𝜋
Second proof. We compute 𝐻(𝑛) with the Inclusion and Exclusion Principle.
We have to find the number of ordered pairs { (𝑎, 𝑏) ∣ 1 ≤ 𝑎 ≤ 𝑛, 1 ≤ 𝑏 ≤ 𝑛} where
𝑎 and 𝑏 are coprime.
We exclude the wrong ones, i.e. those for which 𝑎 and 𝑏 share one or more prime
divisors.
Consider first those pairs where both coordinates are divisible by a prime 𝑝 (not
examining whether or not they have some other common prime divisors too). There
are ⌊𝑛/𝑝⌋2 such pairs.
Consider now those pairs where both coordinates are divisible by more than one
of the primes 𝑝𝑗 (again not caring whether or not they share further common prime
divisors). An integer is a multiple of each of them if and only if it is a multiple of their
product. Thus there are
𝑛 2
⌊ ⌋
𝑝1 𝑝2
pairs where both coordinates are divisible both by 𝑝1 and 𝑝2 where 𝑝1 < 𝑝2 are distinct
primes, etc.
Hence, by the Inclusion and Exclusion Principle,
𝑛 2 𝑛 2
(6.7.18) 𝐻(𝑛) = 𝑛2 − ∑ ⌊ ⌋ + ∑ ⌊ ⌋ ∓ ... .
𝑝≤𝑛
𝑝 𝑝 𝑝 ≤𝑛
𝑝1 𝑝2
1 2
200 6. Arithmetic Functions
i.e.
𝑛
𝜇(𝑗)
(6.7.21) 𝐻(𝑛) = 𝑛2 ∑ + 𝑉(𝑛) where |𝑉(𝑛)| < 4𝑛 log 𝑛
𝑗=1
𝑗2
and we get
∞
𝐻(𝑛) 𝜇(𝑗) 6
lim =∑ 2 = 2
𝑛→∞ 𝑛2 𝑗 𝜋
𝑗=1
similar to the end of the proof of Theorem 6.7.4. □
Proof. We apply Theorem 6.7.2 for the convolution 𝜔 = 𝜔̃ ∗ 1 (then 𝑔 = 𝜔̃ and ℎ = 1):
𝑛 𝑛
𝑛
(6.7.22) 𝑧(𝑛) = ∑ 𝜔(𝑖) = ∑ 𝜔(𝑗)⌊
̃ ⌋.
𝑖=1 𝑗=1
𝑗
i.e.
(6.7.25) | 𝑧(𝑛) − ∑ 1 | < 1.
| 𝑛 𝑝|
𝑝≤𝑛
Since
1
∑ − log log 𝑛
𝑝≤𝑛
𝑝
is bounded (for 𝑛 ≥ 3) by Theorem 5.6.2, the desired assertion follows from (6.7.25).
□
Theorem 6.7.7 (Hardy–Ramanujan Theorem). Let 𝛿 > 1/2 be a fixed real number,
𝑛 ≥ 3, and 𝑘(𝑛) the number of integers 𝑖 satisfying 3 ≤ 𝑖 ≤ 𝑛 and
(6.7.27) |𝜔(𝑖) − log log 𝑖| < (log log 𝑖)𝛿 .
Then
𝑘(𝑛)
lim = 1. ♣
𝑛→∞ 𝑛
Since
(log log 𝑖)𝛿
lim =0
𝑖→∞ log log 𝑖
(for 𝛿 < 1), Theorem 6.7.7 implies that apart from a rare subsequence
𝜔(𝑖) ∼ log log 𝑖.
We shall deduce Theorem 6.7.7 from its finite variant.
Theorem 6.7.7A. For any 𝜀 > 0 there exists a 𝑇 (depending on 𝜀) such that for any 𝑛 ≥ 3
at least (1 − 𝜀)𝑛 integers 𝑖 among the integers 1, 2, . . . , 𝑛 satisfy
(6.7.28) |𝜔(𝑖) − log log 𝑛| < 𝑇√log log 𝑛.
We call the attention to the difference that the argument of log log is 𝑖 in (6.7.27)
and 𝑛 in (6.7.28). But as the function log log increases very slowly, this means only a
negligible difference for most values of 𝑖 (as shown in (6.7.41) later).
We prove Theorem 6.7.7A first, and then show how this implies Theorem 6.7.7.
is relatively small, hence the non-negative terms |𝜔(𝑖) − log log 𝑛| can be large only for
a few values of 𝑖.
Let us see the details. We show
𝑛
2
(6.7.30) 𝑈 = ∑ (𝜔(𝑖) − log log 𝑛) < 𝑐𝑛 log log 𝑛
𝑖=1
with a suitable constant 𝑐 for every 𝑛 ≥ 3. We use Theorems 6.7.6 and 5.6.2 stating (for
𝑛 ≥ 3)
𝑛
(6.7.31) 𝑧(𝑛) = ∑ 𝜔(𝑖) = 𝑛 log log 𝑛 + 𝑛𝐴(𝑛) where 𝐴(𝑛) is bounded,
𝑖=1
and
1
(6.7.32) ∑ = log log 𝑛 + 𝐵(𝑛) where 𝐵(𝑛) is bounded.
𝑝≤𝑛
𝑝
By (6.7.31), we obtain
𝑛
𝑈 = ∑ 𝜔2 (𝑖) − 2 log log 𝑛(𝑛 log log 𝑛 + 𝑛𝐴(𝑛)) + 𝑛(log log 𝑛)2 =
𝑖=1
(6.7.33) 𝑛
= ∑ 𝜔2 (𝑖) − 𝑛(log log 𝑛)2 − 2𝑛𝐴(𝑛) log log 𝑛.
𝑖=1
𝑛
(6.7.34) 𝑉 = ∑ 𝜔2 (𝑖)
𝑖=1
from above.
Substituting (partly) the definition of 𝜔(𝑖) and rearranging the sum, we get
𝑛 𝑛 ⌊𝑛/𝑝⌋
(6.7.35) 𝑉 = ∑ 𝜔2 (𝑖) = ∑ 𝜔(𝑖) ∑ 1 = ∑ ∑ 𝜔(𝑝𝑘).
𝑖=1 𝑖=1 𝑝∣𝑖 𝑝≤𝑛 𝑘=1
Since
𝜔(𝑘), if 𝑝 ∣ 𝑘
𝜔(𝑝𝑘) = {
1 + 𝜔(𝑘), if 𝑝 ∤ 𝑘,
(6.7.35) implies
⌊𝑛/𝑝⌋ ⌊𝑛/𝑝⌋
𝑛
(6.7.36) 𝑉 ≤ ∑ ∑ (1 + 𝜔(𝑘)) = ∑ ⌊ ⌋ + ∑ ∑ 𝜔(𝑘).
𝑝≤𝑛 𝑘=1 𝑝≤𝑛
𝑝 𝑝≤𝑛 𝑘=1
Let 𝐾 denote the first sum on the right-hand side of (6.7.36) and 𝐿 denote the second
double sum there.
By (6.7.32), we get an upper estimate for 𝐾:
𝑛 1
(6.7.37) 𝐾 = ∑ ⌊ ⌋ ≤ 𝑛 ∑ = 𝑛(log log 𝑛 + 𝐵(𝑛)).
𝑝≤𝑛
𝑝 𝑝≤𝑛
𝑝
To estimate 𝐿 from above, we substitute the definition of 𝜔(𝑘), rearrange the sum
as usual (here 𝑝′ indicates that the summation is performed for primes), and apply
204 6. Arithmetic Functions
(6.7.32):
⌊𝑛/𝑝⌋
𝐿 = ∑ ∑ 𝜔(𝑘)
𝑝≤𝑛 𝑘=1
⌊𝑛/𝑝⌋
= ∑ ∑ ∑1
𝑝≤𝑛 𝑘=1 𝑝′ ∣𝑘
𝑛
= ∑ ∑ ⌊ ⌋
(6.7.38) 𝑝≤𝑛 𝑝′ ≤𝑛/𝑝
𝑝𝑝′
1
≤𝑛 ∑ ′
𝑝𝑝′ ≤𝑛
𝑝𝑝
1 1
≤ 𝑛( ∑ )( ∑ ′ )
𝑝≤𝑛
𝑝 ′
𝑝 ≤𝑛
𝑝
2
= 𝑛(log log 𝑛 + 𝐵(𝑛)) .
Combining (6.7.39), (6.7.34), and (6.7.33), the terms 𝑛(log log 𝑛)2 get cancelled and we
have
Proof of Theorem 6.7.7. We will verify that for any 𝜀 > 0 there exists an 𝑛0 (depend-
ing on 𝜀) such that for every 𝑛 > 𝑛0 there are at most 𝜀𝑛 numbers 𝑖 among the integers
3, 4, . . . , 𝑛 that do not satisfy (6.7.27).
As noted earlier, Theorem 6.7.7A refers to log log 𝑛 in (6.7.28), whereas Theo-
rem 6.7.7 has log log 𝑖 in (6.7.27). The proof basically overcomes this discrepancy.
6.7. Mean Value 205
The main idea is the following observation: log log grows so slowly that it can be
considered as almost constant between √𝑛 and 𝑛, and there are so few values 𝑖 less
than √𝑛 that they can be included in the set of exceptions.
Let us see the details. We apply Theorem 6.7.7A with 𝜀/2 instead of 𝜀. Then there
are at most 𝜀𝑛/2 values 𝑖 among the integers between √𝑛 and 𝑛 that do not satisfy
(6.7.28). As √𝑛 ≤ 𝑖 ≤ 𝑛 implies
(6.7.41) log log 𝑛 − log 2 = log log √𝑛 ≤ log log 𝑖 ≤ log log 𝑛,
the previous sentence remains valid if we replace both occurrences of log log 𝑛
in (6.7.28) by log log 𝑖; we just have to make 𝑇 larger than prescribed in (6.7.40). If 𝑛 is
large enough, then the number of values 𝑖 smaller than √𝑛 is less than 𝜀𝑛/2. Summa-
rizing, we infer that with a suitable 𝑇 and for 𝑛 large enough, there are at least (1 − 𝜀)𝑛
values 𝑖 among the integers 3, 4, . . . , 𝑛 satisfying
Remark: The probabilistic background in the proof of Theorem 6.7.7A is the following.
Let 𝑛 be fixed, and consider 𝜔 as a random variable assuming each of the values 𝜔(1),
𝜔(2), . . . , 𝜔(𝑛) with the same probability 1/𝑛. The expectation 𝐸 of this random variable
is, by definition, the mean value of 𝜔 at 𝑛, which is about log log 𝑛. The expression 𝑈
in (6.7.29) is around 𝑛𝐷2 where 𝐷 is the standard deviation of 𝜔. Theorem 6.7.7A then
follows from the upper estimation of 𝐷 (see (6.7.30)) and Chebyshev’s inequality about
the small probability of the variable being far from its expectation:
1
(6.7.43) 𝑃(|𝜔 − 𝐸| > 𝑟𝐷) < .
𝑟2
Theorems 6.7.6, 6.7.7, and 6.7.7A remain valid also for Ω instead of 𝜔, see Exer-
cise 6.7.5b. Combining these with the inequality
we can verify the surprising fact mentioned in Section 6.4 that most 𝑛 have about
divisors, which is much less than the number log 𝑛 corresponding to the mean value
of 𝑑(𝑛) (see Exercise 6.7.6).
206 6. Arithmetic Functions
Exercises 6.7
1. Compute
𝑛
𝑛
∑ 𝜇(𝑗)⌊ ⌋.
𝑗=1
𝑗
Then
𝑓(𝑝)
𝑓(𝑛) ∼ ∑
𝑝≤𝑛
𝑝
Deleting the last digit of 𝑛 and modifying suitably the second-to-last digit, we find an
integer
(6.8.3) 𝑛′ = 𝑎𝑠 𝑘𝑠 + ⋯ + 𝑎2 𝑘2 + 𝑎′1 𝑘
fairly close to 𝑛 where (𝑎′1 , 𝑘) = 1. By the condition, 𝑓(𝑛) is not too far from
We repeat the process for the second term on the right-hand side of (6.8.4), etc., and
finally we arrive at
𝑓(𝑘) log 𝑛 𝑓(𝑛) 𝑓(𝑘)
𝑓(𝑛) ∼ 𝑠𝑓(𝑘) ∼ , so lim = .
log 𝑘 𝑛→∞ log 𝑛 log 𝑘
Hence 𝑓(𝑘)/ log 𝑘 is equal to this limit independent of 𝑘, so 𝑓(𝑘)/ log 𝑘 is a constant.
208 6. Arithmetic Functions
Let us see the detailed and precise elaboration. Let 𝜀 > 0 be arbitrary. By (6.8.1),
there exists an 𝑛0 (depending on 𝜀) such that every 𝑛 > 𝑛0 satisfies
(6.8.5) 𝑓(𝑛 + 1) − 𝑓(𝑛) ≥ −𝜀, i.e. 𝑓(𝑛) ≤ 𝑓(𝑛 + 1) + 𝜀.
(For technical convenience we assume 𝑛0 > 𝑘2 .)
Replacing 𝑛 by 𝑛 + 1, 𝑛 + 2, . . . , 𝑛 + 𝑡 − 1 in (6.8.5), we obtain
𝑓(𝑛 + 1) ≤ 𝑓(𝑛 + 2) + 𝜀, 𝑓(𝑛 + 2) ≤ 𝑓(𝑛 + 3) + 𝜀, . . . , 𝑓(𝑛 + 𝑡 − 1) ≤ 𝑓(𝑛 + 𝑡) + 𝜀,
thus
(6.8.6) 𝑓(𝑛) ≤ 𝑓(𝑛 + 1) + 𝜀 ≤ 𝑓(𝑛 + 2) + 2𝜀 ≤ . . . ≤ 𝑓(𝑛 + 𝑡) + 𝑡𝜀.
Let now 𝑛 be much bigger than 𝑛0 , and consider the representation (6.8.2) (with
a fixed 𝑘 > 1). We select the smallest 𝑛′ according to (6.8.3) satisfying 𝑛′ > 𝑛 and
(𝑎′1 , 𝑘) = 1. This means that we delete the last digit 𝑎0 of 𝑛, and replace the last but one
digit 𝑎1 by a bigger number 𝑎′1 (𝑎′1 = 𝑘 + 1 is possible). We consider the difference 𝑡 of
𝑛′ and 𝑛:
(6.8.7) 𝑡 = 𝑛′ − 𝑛 = (𝑎′1 − 𝑎1 )𝑘 − 𝑎0 .
If 𝑎1 = 0, then 𝑎′1 = 1, and if 𝑎1 ≥ 1, then 1 ≤ 𝑎1 < 𝑎′1 ≤ 𝑘 + 1, therefore (6.8.7) implies
(6.8.8) 0 < 𝑡 ≤ 𝑘2 .
Applying (6.8.6), (6.8.7), (6.8.8), and (6.8.4) in this order for 𝑛 > 𝑛0 , we obtain
(6.8.9) 𝑓(𝑛) ≤ 𝑓(𝑛 + 𝑡) + 𝑡𝜀 ≤ 𝑓(𝑛′ ) + 𝑘2 𝜀 = 𝑓(𝑘) + 𝑓(𝑎𝑠 𝑘𝑠−1 + ⋯ + 𝑎2 𝑘 + 𝑎′1 ) + 𝑘2 𝜀.
Consider now the number
𝑛1 = 𝑎𝑠 𝑘𝑠−1 + ⋯ + 𝑎2 𝑘 + 𝑎′1
in the middle term of the right-hand side of (6.8.9). If here 𝑎′1 = 𝑘 + 1, then transform
𝑛1 into the usual representation in the number system (where the coefficient of each
power of 𝑘 is less than 𝑘; the last digit will be 1, the last but one digit increases by 1, or
if it was 𝑘 − 1, then further changes are possible, too).
Now we repeat the process for 𝑛1 instead of 𝑛. We obtain
𝑓(𝑎𝑠 𝑘𝑠−1 + ⋯ + 𝑎2 𝑘 + 𝑎′1 ) = 𝑓(𝑛1 ) ≤ 𝑓(𝑘) + 𝑓(𝑎𝑠 𝑘𝑠−2 + ⋯ + 𝑎2′ ) + 𝑘2 𝜀.
Substituting into (6.8.9), we get
𝑓(𝑛) ≤ 2𝑓(𝑘) + 𝑓(𝑎𝑠 𝑘𝑠−2 + ⋯ + 𝑎′2 ) + 2𝑘2 𝜀.
We proceed similarly as long as the values of the function are greater than 𝑛0 . Finally,
we have
(6.8.10) 𝑓(𝑛) ≤ (𝑠 − 𝑠0 )𝑓(𝑘) + (𝑠 − 𝑠0 )𝑘2 𝜀 + 𝑀0 ,
where 𝑠 − 𝑠0 is the number of steps and 𝑀0 is the maximum value of 𝑓 assumed at
integers up to 𝑛0 . Here 𝑀0 depends only on 𝜀, and 𝑠0 depends on 𝜀 and on (the fixed)
𝑘, thus (6.8.10) can be rewritten as
(6.8.11) 𝑓(𝑛) ≤ 𝑠𝑓(𝑘) + 𝑠𝑘2 𝜀 + 𝑀1
where 𝑀1 is a constant depending on 𝜀 and 𝑘.
Exercises 6.8 209
We can estimate 𝑓(𝑛) from below using a similar method. We choose 𝑛′ close to 𝑛
with (𝑎′1 , 𝑘) = 1, but instead of the minimal 𝑛′ > 𝑛 we take the maximal 𝑛′ < 𝑛 (now
𝑎′1 = −1 can happen). We have to modify the steps of the upper estimate by defining 𝑡
as 𝑛 − 𝑛′ and applying
𝑓(𝑛) ≥ 𝑓(𝑛 − 𝑡) − 𝑡𝜀
instead of (6.8.6). We get finally
(6.8.12) 𝑓(𝑛) ≥ 𝑠𝑓(𝑘) − 𝑠𝑘2 𝜀 − 𝑀2
where 𝑀2 is a suitable constant.
Dividing (6.8.11) and (6.8.12) by 𝑠 = ⌊log𝑘 𝑛⌋, we obtain
| 𝑓(𝑛) | 𝑀
(6.8.13) | − 𝑓(𝑘)| ≤ 𝑘2 𝜀 + .
| ⌊log𝑘 𝑛⌋ | ⌊log𝑘 𝑛⌋
If 𝑛 → ∞, then the right-hand side of (6.8.13) tends to 𝑘2 𝜀. But 𝜀 was arbitrary, hence
𝑓(𝑛)
(6.8.14) lim = 𝑓(𝑘).
𝑛→∞ ⌊log𝑘 𝑛⌋
This clearly implies
𝑓(𝑛)
lim = 𝑓(𝑘),
𝑛→∞ log𝑘 𝑛
so
𝑓(𝑛) 𝑓(𝑘)
(6.8.15) lim = .
𝑛→∞ log 𝑛 log 𝑘
Denote the limit in (6.8.15) by 𝑐; as 𝑐 is independent of 𝑘
𝑓(𝑘)
= 𝑐,
log 𝑘
i.e.
(6.8.16) 𝑓(𝑘) = 𝑐 log 𝑘
for any 𝑘 > 1. Finally, 𝑓(1) = log 1 = 0, thus (6.8.16) holds for 𝑘 = 1. □
Exercises 6.8
Diophantine Equations
211
212 7. Diophantine Equations
Proof. As mentioned previously, (i) and (iii) were proved in Theorem 1.3.6.
Turning to (ii), we show first that the integers 𝑥′ , 𝑦′ given in (7.1.1) give a solution
of the equation. Since 𝑥0 , 𝑦0 is a solution, 𝑎𝑥0 + 𝑏𝑦0 = 𝑐, so
𝑏 𝑎
𝑎𝑥′ + 𝑏𝑦′ = 𝑎 (𝑥0 + 𝑡 ) + 𝑏 (𝑦0 − 𝑡 ) = 𝑎𝑥0 + 𝑏𝑦0 = 𝑐.
(𝑎, 𝑏) (𝑎, 𝑏)
To prove the converse, we assume that 𝑥′ , 𝑦′ is an arbitrary solution, and show that 𝑥′
and 𝑦′ are in the prescribed form.
We know that
𝑎𝑥0 + 𝑏𝑦0 = 𝑐 and 𝑎𝑥′ + 𝑏𝑦′ = 𝑐.
Subtracting, we get
𝑎(𝑥′ − 𝑥0 ) + 𝑏(𝑦′ − 𝑦0 ) = 0.
After rearranging the terms and dividing by (𝑎, 𝑏), we obtain
𝑎 𝑏
(7.1.2) (𝑥′ − 𝑥0 ) = (𝑦 − 𝑦′ ).
(𝑎, 𝑏) (𝑎, 𝑏) 0
Since
𝑏 𝑎
( , ) = 1,
(𝑎, 𝑏) (𝑎, 𝑏)
(7.1.2) implies
𝑏
∣ 𝑥 ′ − 𝑥0 ,
(𝑎, 𝑏)
7.1. Linear Diophantine Equation 213
so
𝑏
(7.1.3) 𝑥 ′ = 𝑥0 + 𝑡
(𝑎, 𝑏)
with a suitable integer 𝑡. Substituting (7.1.3) into (7.1.2), we arrive at
𝑎
𝑦′ = 𝑦 0 − 𝑡 .
(𝑎, 𝑏)
Thus we have shown that 𝑥′ and 𝑦′ are of the form in (7.1.1). □
Remarks: (1) The following pairs of coordinates occur during the procedure:
{43, 25}; {25, 7}; {7, 3}; {3, 1}.
How did we get them? In the first step, the remainder (of least absolute value) on
division of 43 by 25 was −7, in the next step the remainder on division of 25 by
7 was −3, etc. Thus we used a variant of the Euclidean algorithm. This implies
that we can find the solutions of the equation quickly with this procedure.
(2) The essential point of the method is reducing the absolute values of the coeffi-
cients of the variables to eliminate the fractions completely. It is irrelevant from
this point of view whether or not we reduce the absolute values also of the con-
stant term; it does not influence the number of steps in the procedure, though it
may be slightly easier to work with smaller numbers.
(3) We do not have to check in advance whether the equation is solvable because the
procedure decides automatically if there is no solution: we arrive at a fraction that
contains no variables but its value is not an integer.
(4) Formulas (B2)–(B1) correspond to (7.1.1) describing all solutions in Theorem
7.1.1; now 𝑥0 = −14, 𝑦0 = 28, and 𝑤 plays the role of 𝑡. This is a useful tool
to detect calculation errors.
We have similar results for linear Diophantine equations with more than two vari-
ables. We summarize them in the next theorem, and ask for the proofs in Exercise 7.1.8.
Theorem 7.1.2. Let 𝑘 ≥ 2, 𝑎1 , . . . , 𝑎𝑘 integers not all 0, 𝑐 any integer, and consider the
Diophantine equation
𝑎1 𝑥1 + ⋯ + 𝑎𝑘 𝑥𝑘 = 𝑐
where a solution is a 𝑘-tuple of integers 𝑥1 , . . . , 𝑥𝑘 .
(i) The equation is solvable if and only if (𝑎1 , . . . , 𝑎𝑘 ) ∣ 𝑐.
(ii) If it is solvable, there are infinitely many solutions. We can describe all solutions with
𝑘 − 1 integer parameters. We can find the solutions with a suitable generalization of
the method used for two variables. ♣
Exercises 7.1
1. In Crazyland there exist banknotes only of 47 and 79 dollars. How many ways can
we pay exactly 10000 dollars?
2. An island is inhabited by dragons with 7 or 11 heads. How many dragons live on
the island if they have 118 heads altogether?
3. A shop sells three types of chocolate bars costing 70 cents, 1 dollar and 30 cents,
and a dollar and a half. How many ways can we buy (exactly) 50 bars for (exactly)
50 dollars?
7.2. Pythagorean Triples 215
S 4. In a certain year of the twentieth century, Alice notes that her age in years equals
the sum of digits in the year of her birth date. Bob, who was born in a later year,
notes that his age has the same property. How much older is Alice than Bob, if
neither of them is older than 99 years?
5. Demonstrate that statement (ii) in Theorem 7.1.1 follows from the proof of Theo-
rem 2.5.4.
6. How many lattice points in the plane can lie on a line if its slope is (a) rational (b)
irrational?
7. Find all solutions of the Diophantine equation 6𝑥 + 10𝑦 + 15𝑧 = 7.
8. Verify the statements in Theorem 7.1.2.
9. Prove that the Diophantine equation 𝑎1 𝑥1 + ⋯ + 𝑎𝑘 𝑥𝑘 = 𝑐 is solvable if and only
if the congruence 𝑎1 𝑥1 + ⋯ + 𝑎𝑘 𝑥𝑘 ≡ 𝑐 (mod 𝑚) is solvable for every positive
integer 𝑚.
* 10. Characterize the integers 𝑎1 , . . . , 𝑎𝑘 for which the Diophantine equation 𝑎1 𝑥1 +
⋯ + 𝑎𝑘 𝑥𝑘 = 𝑐 is solvable in positive integers for every 𝑐 large enough.
* 11. Let 𝑎 and 𝑏 be fixed coprime integers greater than 1. We say that a positive integer
𝑐 is assemblable (from 𝑎 and 𝑏) if 𝑐 can be represented as 𝑐 = 𝑎𝑥 + 𝑏𝑦 with non-
negative integers 𝑥 and 𝑦.
(a) Show that every 𝑐 > 𝑎𝑏 − 𝑎 − 𝑏 is assemblable, but 𝑐 = 𝑎𝑏 − 𝑎 − 𝑏 is not
assemblable.
(b) How many positive integers are not assemblable?
Remark: We can generalize part (a) for more variables. Let 𝑎1 , . . . , 𝑎𝑘 be fixed
coprime integers greater than 1. Find the maximal integer 𝐹 = 𝐹(𝑎1 , . . . , 𝑎𝑘 ) for
which the Diophantine equation 𝑎1 𝑥1 + ⋯ + 𝑎𝑘 𝑥𝑘 = 𝐹 has no solutions in non-
negative integers. Intensive research has been done to answer this question, called
the problem of Frobenius for 𝑘 > 2, but we have no completely satisfactory answer
even in the case 𝑘 = 3.
* 12. (a) Show that for every sufficiently large 𝑛, there exist 𝑛 (not necessarily congru-
ent) cubes in space such that we can assemble a cube from them (using each
exactly once).
(b) Verify this for every 𝑛 ≥ 48.
(c) Find all 𝑛 for which there exist 𝑛 (not necessarily congruent) squares in the
plane such that we can assemble a square from them (using each exactly once).
Remark: It is unknown whether (b) is true for 𝑛 = 47.
Exercises 7.2
1. Show that if the side lengths of a right triangle are integers, then their product is a
multiple of 60.
2. Compute the side lengths of a right triangle of area 60 if these lengths are integers.
3. Find all right triangles with integer side lengths whose area and perimeter are
equal.
4. For which integers 𝑘 does there exist a right triangle with integer side lengths one
of them being 𝑘?
218 7. Diophantine Equations
5. Prove that there exist infinitely many three-term arithmetic progressions of co-
prime squares.
We count as distinct solutions that differ only in signs. From the theorem, we can
easily obtain the number of essentially distinct solutions, see Exercise 7.3.1.
Proof. Equality (𝑥 + 𝑦)(𝑥 − 𝑦) = 𝑛 holds if and only if 𝑥 + 𝑦 and 𝑥 − 𝑦 are two com-
plementary divisors of 𝑛, or
(7.3.1) 𝑥 + 𝑦 = 𝑑1 , 𝑥 − 𝑦 = 𝑑2 , where 𝑑1 𝑑2 = 𝑛.
Solving system (7.3.1), we get
𝑑1 + 𝑑 2 𝑑 − 𝑑2
𝑥= , 𝑦= 1 .
2 2
Here 𝑥 and 𝑦 are integers if and only if 𝑑1 and 𝑑2 have the same parity.
Accordingly, the Diophantine equation 𝑥2 − 𝑦2 = 𝑛 is solvable if and only if 𝑛 is
the product of two of its divisors of the same parity, and the number of solutions is the
number of such pairs of divisors (where also the signs and the order of the two divisors
count).
If 𝑛 is odd, then its divisors are odd. Therefore the equation is solvable and the
number of solutions is the number of all positive and negative divisors of 𝑛, i.e. 2𝑑(𝑛).
If 𝑛 is even but not a multiple of 4, then 𝑛 cannot be written as the product of
two divisors of the same parity, since the product of two odd numbers is odd, and the
product of two even numbers is divisible by 4. Thus the equation has no solutions for
such 𝑛.
If 4 ∣ 𝑛, then suitable pairs are 2𝑘1 , 2𝑘2 where: 𝑛 = (2𝑘1 )(2𝑘2 ). This is equivalent
to 𝑛/4 = 𝑘1 𝑘2 , so the equation is solvable and the number of solutions is the number
of all positive and negative divisors of 𝑛/4, i.e. 2𝑑(𝑛/4). □
7.3. Some Elementary Methods 219
1 (mod 5) , if 5 ∤ 𝑎
(7.3.7) 𝑎4 ≡ {
0 (mod 5) , if 5 ∣ 𝑎,
for any integer 𝑎. If 5 ∤ 𝑥, then the left-hand side of (7.3.6) is congruent to 1 and the
right-hand side is congruent to 0 or 4 modulo 5, by (7.3.7), which is impossible. The
case 5 ∤ 𝑧 leads to a contradiction similarly. Therefore 5 ∣ 𝑥 and 5 ∣ 𝑧.
Substituting 𝑥 = 5𝑥1 and 𝑧 = 5𝑧1 into the original equation, we get
54 𝑥14 + 5𝑦4 = 4 ⋅ 54 𝑧41 , i.e. 53 𝑥14 + 𝑦4 = 4 ⋅ 53 𝑧41 .
Thus 5 ∣ 𝑦4 , and so 5 ∣ 𝑦, as 5 is a prime. This, however, contradicts the condition
(𝑥, 𝑦, 𝑧) = 1.
(4) We emphasize repeatedly that this method (in itself) can be successful only if the
Diophantine equation has no solutions except perhaps a trivial one (as 𝑥 = 𝑦 =
𝑧 = 0 at the equation above). If the equation has a non-trivial solution, then it
satisfies also the corresponding congruence for every modulus 𝑚, so we cannot get
a contradiction for any modulus. (Of course, such arguments with congruences
can help to exclude solutions of certain types for any Diophantine equation.)
(5) This method is often not effective even if a Diophantine equation has no solu-
tions. It may be that we are not clever or lucky enough to find a suitable modulus
leading to a contradiction, but it is possible that no such modulus exists. We saw
an equation in Exercise 4.2.8 that had no integer or rational solutions, but the
corresponding congruence was solvable for every modulus 𝑚.
Exercises 7.3
1. Let 𝑛 be a fixed positive integer. In how many essentially distinct ways can 𝑛 be
represented as the difference of two squares, i.e. what is the number of solutions
of the equation 𝑥2 − 𝑦2 = 𝑛 in non-negative integers?
2. A housewife wants to slice up a rectangular cake (into uniform rectangular pieces)
so that she should get as many crispy pieces (that touched the tin’s wall) as soft
ones (that were away from the tin’s wall). How should she do the slicing?
3. Géza Ottlik was a famous Hungarian writer in the twentieth century who also stud-
ied mathematics. In his memoirs, he gives a vivid description how he succeeded
in defeating the problem:
Let 𝑝 > 2 be a prime. Verify that 2/𝑝 has exactly one representation as
a sum of reciprocals of two distinct positive integers. (The order of the
terms is irrelevant.)
222 7. Diophantine Equations
Remark: The reciprocals of positive integers, i.e. the rational numbers having pos-
itive denominators and 1 as numerator, are called unit fractions or Egyptian frac-
tions since the ancient Egyptians generally expressed the rational numbers as the
sum of such fractions.
* 4. Which fractions with numerator 4 can be written as the sum of reciprocals of two
natural numbers?
5. Show that if 𝑛 is a positive integer not of the form 24𝑘 + 1, then 4/𝑛 can be written
as a sum of reciprocals of three natural numbers.
Remark: A long-standing unsolved conjecture of Erdős and Straus claims that ev-
ery positive integer 𝑛 has this property.
6. Prove that every positive rational number has infinitely many representations as a
sum of reciprocals of finitely many distinct positive integers.
7. Can a fourth power exceed a fifth power by 4?
S 8. Find all solutions of the system of equations
𝑡2 + (𝑠 + 𝑥)2 = 𝑠2 + 𝑦2 = (𝑦 + 𝑡)2 + 𝑥2
in rational numbers 𝑥, 𝑦, 𝑠, and 𝑡.
9. Prove that the sum of 99 consecutive squares cannot be a power.
S 10. Determine all integers whose cubes are the sum of eight consecutive cubes.
* 11. Show that 6 consecutive natural numbers cannot be partitioned into two (disjoint)
groups so that the product of the elements in the two groups is equal. Demonstrate
that this is true also if 6 is replaced by 106.
12. For a given positive integer 𝑚, find all positive integers 𝑛, 𝑥, and 𝑦 satisfying
(𝑛, 𝑚) = 1 and (𝑥2 + 𝑦2 )𝑚 = (𝑥𝑦)𝑛 .
(c) 111111.
(See Exercise 7.7.7 for the missing 1111.)
To make a clear distinction, Roman letters will denote integers, and Greek letters
will denote Gaussian integers.
The Gaussian integers form a commutative ring without zero divisors (i.e. an inte-
gral domain) with an identity element under the addition and multiplication of com-
plex numbers.
The norm plays a central role in the number theory of Gaussian integers:
Definition 7.4.2. The norm 𝑁(𝛼) of a Gaussian integer 𝛼 = 𝑎 + 𝑏𝑖 is the square of the
absolute value of 𝛼:
𝑁(𝛼) = |𝛼|2 = 𝛼𝛼 = 𝑎2 + 𝑏2 . ♣
A few simple but important properties of the norm follow immediately from the
definition of Gaussian integers and from the properties of the absolute values of com-
plex numbers:
Theorem 7.4.3. (i) 𝑁(𝛼) is a non-negative integer.
(ii) 𝑁(𝛼) = 0 ⟺ 𝛼 = 0.
(iii) 𝑁(𝛼𝛽) = 𝑁(𝛼)𝑁(𝛽), for any Gaussian integers 𝛼 and 𝛽. ♣
To develop number theory for Gaussian integers, we follow the path for integers in
Chapter 1; we define the notions and prove the Fundamental Theorem of Arithmetic
according to that model. There is some difference in the form of the division algorithm
(Theorem 7.4.8), otherwise we just copy the structure for the integers.
224 7. Diophantine Equations
Definition 7.4.4. The Gaussian integer 𝛽 is a divisor of the Gaussian integer 𝛼 if there
exists a Gaussian integer 𝛾 satisfying 𝛼 = 𝛽𝛾. ♣
Proof. The implication follows from Definition 7.4.4 and Theorem 7.4.3(iii). □
The converse of Theorem 7.4.5 is false, see e.g. the second example above the the-
orem.
Definition 7.4.6. A Gaussian integer dividing every Gaussian integer is called a unit.
Multiplying a Gaussian integer 𝛾 by a unit, we get an associate of 𝛾. ♣
The Gaussian integers form the usual unit square lattice in the complex plane.
Hence, (7.4.2) means that the point (with rational coordinates) in the plane correspond-
ing to 𝛼/𝛽 is closer to lattice point 𝛾 than 1, i.e. it falls inside the unit circle around 𝛾.
Consider a unit square in the lattice that contains 𝛼/𝛽 (inside or on its border; there
is more than one such unit square if and only if at least one of the coordinates of 𝛼/𝛽 is
an integer). If we draw unit circles around two opposite vertices, the interiors of these
circles cover this unit square entirely except the two other vertices. Thus for any point
in the plane, there is a lattice point whose distance from it is less than 1. So to any 𝛼/𝛽,
there is a suitable 𝛾.
The value of 𝜚 is determined then by 𝜚 = 𝛼 − 𝛽𝛾. □
Remarks: (1) We see from the proof that the quotient 𝛾 and the remainder 𝜚 are not
unique in general; uniqueness holds if and only if 𝛼/𝛽 itself is a lattice point, i.e.
𝛽 ∣ 𝛼 (and the remainder is 0). Otherwise there are two, three, or four suitable
pairs 𝛾, 𝜚, depending on the position of 𝛼/𝛽.
(2) The proof yields an algorithm to find 𝛾 and 𝜚: we can choose 𝛾 as the closest
lattice point to 𝛼/𝛽. (Choose one if there exists more than one.) Algebraically, if
𝛼/𝛽 = 𝑟 + 𝑠𝑖, then choose 𝛾 = 𝑢 + 𝑣𝑖 where 𝑢 and 𝑣 are the closest integers to the
rational numbers 𝑟 and 𝑠. (Again, just choose in the event of a tie.) Then
2 2 2
| 𝛼 − 𝛾| = (𝑟 − 𝑢)2 + (𝑠 − 𝑣)2 ≤ ( 1 ) + ( 1 ) = 1 .
|𝛽 | 2 2 2
For Gaussian integers, we define the greatest common divisor immediately with
the special common divisor property seen in Definition 1.3.2 at the integers: it is a
common divisor that is a multiple of all common divisors.
Definition 7.4.9. The greatest common divisor (or gcd) of Gaussian integers 𝛼 and 𝛽
is 𝛿 if
(i) 𝛿 ∣ 𝛼, 𝛿 ∣ 𝛽
(ii) if 𝛾 satisfies 𝛾 ∣ 𝛼 and 𝛾 ∣ 𝛽, then 𝛾 ∣ 𝛿. ♣
We assume now that at least one of 𝛼 and 𝛽 is not zero, and denote the greatest
common divisor by (𝛼, 𝛽) or gcd(𝛼, 𝛽).
The existence of a greatest common divisor follows from the Euclidean algorithm
as in the proof of Theorem 1.3.3 (the procedure terminates in finitely many steps also
for Gaussian integers since the norms of the remainders form a strictly decreasing se-
quence of non-negative integers). The Euclidean algorithm is suitable for the practical
computation of the greatest common divisor.
226 7. Diophantine Equations
The greatest common divisor is unique apart from a unit factor, i.e. if 𝛿 is a gcd of
the Gaussian integers 𝛼 and 𝛽, then all greatest common divisors are the associates of
𝛿. (This follows from the definition of gcd.)
There are four units, so any two Gaussian integers (not both zero) have exactly four
greatest common divisors. Since they are associates, they behave identically concern-
ing divisibility. Also, there is no natural principle to distinguish one of them, as we
chose the positive value among the integers. Therefore the notation (𝛼, 𝛽) can mean
any of the four values.
The relevant further theorems and definitions in Section 1.3 are equally valid for
Gaussian integers.
Now we define the notions of Gaussian irreducibles and Gaussian primes on the
model of Definitions 1.4.1 and 1.4.2.
Definition 7.4.10. A Gaussian integer 𝜋 different from units (and zero) is called a
Gaussian irreducible if it can be factored into the product of two integers only so that
one of the factors is a unit:
𝜋 = 𝛼𝛽 ⟹ 𝛼 or 𝛽 is a unit. ♣
Definition 7.4.11. A Gaussian integer 𝜋 different from units and zero is called a Gauss-
ian prime if it can divide the product of two integers only if it divides at least one of the
factors:
𝜋 ∣ 𝛼𝛽 ⟹ 𝜋 ∣ 𝛼 or 𝜋 ∣ 𝛽. ♣
The analog of Theorem 1.4.3 is valid for Gaussian integers, and the proof is literally
the same:
Theorem 7.4.12. A Gaussian integer is a Gaussian prime if and only if it is a Gaussian
irreducible. ♣
We shall generally use the shorter term Gaussian prime also for a Gaussian irre-
ducible.
We are ready now to state and prove the analog of Theorem 1.5.1:
Theorem 7.4.13 (The Fundamental Theorem of Arithmetic). Every Gaussian integer
different from 0 and units is the product of finitely many Gaussian irreducibles and this
decomposition is unique apart from associates and the order of factors. ♣
Proof. The first proof of uniqueness for integers remains valid literally for Gaussian
integers (see Exercise 7.4.11 for the analog of the second proof).
We can apply the same arguments as at the integers for the decomposability with
two minor modifications: instead of “minimal positive non-trivial divisor” we need
“a(ny) non-trivial divisor of minimal norm”, and |𝑎𝑖 | should be replaced by 𝑁(𝛼𝑖 ). We
leave the details to the reader. □
Remark: As a summary, we can state that we arrived at the Fundamental Theorem
of Arithmetic almost identically both for integers and Gaussian integers. We proved
decomposability in both cases directly (using similar ideas), and deduced uniqueness
with the following steps:
7.4. Gaussian Integers 227
Proof. (i) As 𝜋 is different from 0 and units, we have 𝑁(𝜋) > 1, so 𝑁(𝜋) is the product
of positive prime numbers: 𝑁(𝜋) = 𝑝1 𝑝2 . . . 𝑝𝑟 . Then
𝜋 ∣ 𝜋𝜋 = 𝑁(𝜋) = 𝑝1 𝑝2 . . . 𝑝𝑟 ,
thus 𝜋 must divide some 𝑝 𝑖 , as well.
To prove uniqueness by contradiction, we assume 𝜋 ∣ 𝑝 and 𝜋 ∣ 𝑞 for some positive
prime numbers 𝑝 ≠ 𝑞. Since 𝑝 and 𝑞 are coprime (among the integers), we have 1 =
𝑝𝑢 + 𝑞𝑣 with suitable integers 𝑢 and 𝑣. Then 𝜋 ∣ 𝑝 and 𝜋 ∣ 𝑞 imply 𝜋 ∣ 𝑝𝑢 + 𝑞𝑣 = 1,
which is a contradiction.
(ii) If the prime number 𝑝 > 0 is not a Gaussian prime, then it is the product of at
least two Gaussian primes (by the Fundamental Theorem of Arithmetic):
(7.4.3) 𝑝 = 𝜋1 . . . 𝜋𝑟 , where 𝑟 ≥ 2.
Taking norms in (7.4.3), we obtain
(7.4.4) 𝑝2 = 𝑁(𝑝) = 𝑁(𝜋1 ) . . . 𝑁(𝜋𝑟 ).
Every 𝑁(𝜋𝑖 ) > 1 since 𝜋𝑖 is neither 0 nor a unit. The integer 𝑝2 has only one decompo-
sition into the product of two integers greater than 1: 𝑝2 = 𝑝 ⋅ 𝑝. Therefore, there are
only two factors on the right-hand side of (7.4.4), so the same is true for (7.4.3):
𝑝 = 𝜋 1 𝜋2 , where 𝑁(𝜋1 ) = 𝑁(𝜋2 ) = 𝑝.
Finally,
𝑝 = 𝜋1 𝜋2 and 𝑝 = 𝑁(𝜋1 ) = 𝜋1 𝜋1
imply 𝜋2 = 𝜋1 . □
(C) 𝜋 where 𝑁(𝜋) is a positive prime number of the form 4𝑘 + 1; to each such prime
number, there belong two Gaussian primes (apart from unit factors) that are com-
plex conjugates but not associates. ♣
Examples. −1 + 𝑖 = 𝑖(1 + 𝑖) and −7𝑖 are Gaussian primes.
Also 2 − 5𝑖 is a Gaussian prime since (2 − 5𝑖)(2 + 5𝑖) = 29 and 29 is a positive prime
number of the form 4𝑘 + 1.
Also 2 + 5𝑖 is a Gaussian prime that is not an associate of 2 − 5𝑖.
The factors of the decomposition 29 = (5 − 2𝑖)(5 + 2𝑖) can only be associates of the
previous two Gaussian primes (by the Fundamental Theorem of Arithmetic): 5 − 2𝑖 =
(−𝑖)(2 + 5𝑖) and 5 + 2𝑖 = 𝑖(2 − 5𝑖).
−37 is not a Gaussian prime, as 37 is a prime number, but not of the form 4𝑘 − 1.
Also 9 + 2𝑖 is not a Gaussian prime because (9 + 2𝑖)(9 − 2𝑖) = 85 is not a prime
number.
Proof. By Theorem 7.4.14, we obtain all Gaussian primes from the factorization of
positive prime numbers into the product of Gaussian primes. We get different decom-
positions when the positive prime number is (A) 2, has the form (B) 4𝑘 − 1, or (C)
4𝑘 + 1.
(A) Since 2 = (1 + 𝑖)(1 − 𝑖) = (−𝑖)(1 + 𝑖)2 , the only Gaussian prime divisor of 2 is
1 + 𝑖, apart from associates.
(B) Let 𝑞 be a positive prime number of the form 4𝑘 − 1. For a proof by contradic-
tion, we assume that 𝑞 is not a Gaussian prime. Then, by (ii) in Theorem 7.4.14, there
exists a Gaussian prime 𝜋 = 𝑎 + 𝑏𝑖 satisfying 𝑞 = 𝑁(𝜋) = 𝑎2 + 𝑏2 . This is impossible,
however, as the sum of two squares cannot be of the form 4𝑘 − 1.
(C) Let 𝑝 be a positive prime number of the form 4𝑘 + 1. We show first that 𝑝 is
not a Gaussian prime.
By Theorem 4.1.4, the congruence 𝑥2 ≡ −1 (mod 𝑝) is solvable, so 𝑝 ∣ 𝑐2 + 1 for
some integer 𝑐. Hence, 𝑝 divides the product (𝑐 + 𝑖)(𝑐 − 𝑖) among the Gaussian integers.
But
𝑐±𝑖 𝑐 1
= ± 𝑖
𝑝 𝑝 𝑝
are not Gaussian integers because their imaginary parts are not integers, thus none of
the factors 𝑐 + 𝑖 and 𝑐 − 𝑖 are divisible by 𝑝. Therefore, by definition, 𝑝 is not a Gaussian
prime.
This means, according to Theorem 7.4.14, that 𝑝 = 𝜋𝜋 where 𝜋 and 𝜋 are Gaussian
primes. By the Fundamental Theorem of Arithmetic, this is the only decomposition of
𝑝 into the product of Gaussian primes, apart from associates.
Finally, we have to show 𝜋 ≠ 𝜀𝜋 for some unit 𝜀. We can verify this by a simple
calculation checking all cases 𝜀 = 1, −1, 𝑖, and −𝑖 for 𝑝 = 𝑎 + 𝑏𝑖. It follows also from
Exercise 7.4.3. □
Exercises 7.4 229
Exercises 7.4
where no two Gaussian primes 𝜚𝑗 are associates and 𝜀 is a unit. For example, a standard
form of 4 is (−1)(1 + 𝑖)4 or (−1)(−1 + 𝑖)4 , etc. (We need the extra factor of a unit also
among the integers if we want to extend the standard form to negative integers: e.g. −9
can be represented only in the form (−1)32 or (−1)(−3)2 .)
By Theorem 7.4.15, a standard form of 𝑛 among the Gaussian integers is
𝛽 𝛽1 𝛽 𝛽𝑟 𝛾 𝛾
(7.5.4) 𝑛 = (−𝑖)𝛼 (1 + 𝑖)2𝛼 𝜋1 1 𝜋1 . . . 𝜋𝑟 𝑟 𝜋𝑟 𝑞1 1 . . . 𝑞𝑠 𝑠 ,
where 𝜋𝜇 𝜋𝜇 = 𝑝𝜇 . (No two Gaussian primes on the right-hand side of (7.5.4) are
associates.)
As 𝑥 + 𝑦𝑖 ∣ 𝑛, the standard form of 𝑥 + 𝑦𝑖, according to the Fundamental Theorem
of Arithmetic, is
𝑟 ′ ″
𝑠
′ 𝛽𝜇 𝛽𝜇 𝛾′
(7.5.5) 𝑥 + 𝑦𝑖 = 𝜀(1 + 𝑖)𝛼 ∏ (𝜋𝜇 𝜋𝜇 ) ∏ 𝑞𝜈𝜈
𝜇=1 𝜈=1
where 𝜀 is a unit and each Gaussian prime occurs with an exponent not greater than
in (7.5.4).
We construct a standard form of 𝑥 − 𝑦𝑖 by conjugating (7.5.5) and using 1 − 𝑖 =
(−𝑖)(1 + 𝑖):
𝑟 ″ ′
𝑠
′ ′ 𝛽𝜇 𝛽𝜇 𝛾′
(7.5.6) 𝑥 − 𝑦𝑖 = (𝜀(−𝑖)𝛼 )(1 + 𝑖)𝛼 ∏ (𝜋𝜇 𝜋𝜇 ) ∏ 𝑞𝜈𝜈 .
𝜇=1 𝜈=1
By the Fundamental Theorem of Arithmetic, (7.5.3) holds if and only if the exponent
of each Gaussian prime in (7.5.4) is the sum of the corresponding exponents in (7.5.5)
and (7.5.6), and the extra unit factor in (7.5.4) equals the product of the unit factors in
(7.5.5) and (7.5.6).
This gives the following equalities:
(7.5.7a) exponent of 1 + 𝑖: 2𝛼 = 𝛼′ + 𝛼′
(7.5.7b) exponent of 𝜋𝜇 : 𝛽𝜇 = 𝛽𝜇′ + 𝛽𝜇″
(7.5.7c) exponent of 𝜋𝜇 : 𝛽𝜇 = 𝛽𝜇″ + 𝛽𝜇′
(7.5.7d) exponent of 𝑞𝜈 : 𝛾𝜈 = 𝛾𝜈′ + 𝛾𝜈′
′
(7.5.7e) unit: (−𝑖)𝛼 = 𝜀𝜀(−𝑖)𝛼 .
Equality (7.5.7a) implies 𝛼′ = 𝛼, and then (7.5.7e) is true automatically for any 𝜀.
(7.5.7b) and (7.5.7c) mean the same condition that holds if and only if
𝛽𝜇′ = 0, 1, . . . , 𝛽𝜇 and 𝛽𝜇″ = 𝛽𝜇 − 𝛽𝜇′ , 𝜇 = 1, 2, . . . , 𝑟.
Finally, (7.5.7d) is valid if and only if 𝛾𝜈 is even and 𝛾𝜈′ = 𝛾𝜈 /2.
The above imply that (7.5.2) is solvable if and only if every 𝛾𝜈 is even.
The number of solutions equals the number of possible choices of 𝜀, 𝛼′ , 𝛽𝜇′ , 𝛽𝜇″ , and
𝛾𝜇′ . We can select these five values independently in 4, 1, 𝛽𝜇 + 1, 1, and 1 ways, thus the
𝑟
number of solutions of (7.5.2) is the product of these numbers, 4 ∏𝜇=1 (𝛽𝜇 + 1). □
232 7. Diophantine Equations
Proof. We verify only the easier direction that an integer of the form (7.5.8) cannot be
written as the sum of three squares. The proof of the converse is significantly harder.
We proceed by induction on 𝑘.
For 𝑘 = 0, we have to show that integers of the form 8𝑚 + 7 cannot be represented
as a sum of three squares. This holds since a square can have a residue of 0, 1, or 4
modulo 8, and the sum of three such remainders can never produce a remainder of 7.
We assume now that the assertion is true for some 𝑘 and deduce it for 𝑘 + 1. For a
proof by contradiction, let 𝑎, 𝑏, and 𝑐 be integers satisfying
(7.5.9) 4𝑘+1 (8𝑚 + 7) = 𝑎2 + 𝑏2 + 𝑐2 .
We note that Lemma 7.5.5 can also be easily deduced from Chevalley’s Theorem 3.6.1
or from Exercise 3.6.2 (see Exercise 7.5.19).
We turn to the proof of Theorem 7.5.3. For the sake of brevity, we call a positive integer
“nice” if it is the sum of four squares. Clearly, 1 and 2 are nice integers.
By Lemma 7.5.4, it is sufficient to show that every prime 𝑝 > 2 is nice.
There exists a nice multiple of 𝑝, e.g. 4𝑝2 . We take the smallest positive 𝑚 for which
𝑚𝑝 is nice, and let
(7.5.13) 𝑚𝑝 = 𝑎21 + 𝑎22 + 𝑎23 + 𝑎24 .
We have to prove 𝑚 = 1. We shall show that if 𝑚 > 1, then also 𝑚1 𝑝 is nice for
some 0 < 𝑚1 < 𝑚. This, however, contradicts the minimality of 𝑚, so 𝑚 = 1.
We verify first 𝑚 < 𝑝, so 𝑝 has a nice (positive) multiple less than 𝑝2 . By Lemma
7.5.5, (7.5.11) is solvable. Taking the system of residues of least absolute value mod-
𝑝 𝑝
ulo 𝑝, we get a solution 𝑥 and 𝑦 satisfying |𝑥| < 2 and |𝑦| < 2 . Then
𝑝 2
𝑣 = 12 + 𝑥2 + 𝑦2 + 02 is nice, 𝑝∣𝑣 0 < 𝑣 < 2( ) + 1 < 𝑝2 .
and
2
Next we show that 𝑚 must be odd. Otherwise, we can partition the four values 𝑎𝜈 into
two pairs whose elements have the same parity; say 𝑎1 and 𝑎2 are both odd or both
even, and the same holds for 𝑎3 and 𝑎4 . Then
𝑚 𝑎 + 𝑎2 2 𝑎 − 𝑎2 2 𝑎 + 𝑎4 2 𝑎 − 𝑎4 2
)𝑝 = ( 1
( ) +( 1 ) +( 3 ) +( 3 ) ,
2 2 2 2 2
which contradicts the minimality of 𝑚.
We shall consider now (7.5.13) modulo 𝑚. Let 𝑏1 , 𝑏2 , 𝑏3 , and 𝑏4 be the residues of
least absolute value modulo 𝑚 of 𝑎1 , 𝑎2 , 𝑎3 , and 𝑎4 , i.e.
𝑚−1
(7.5.14) 𝑏𝜈 ≡ 𝑎𝜈 (mod 𝑚) , |𝑏𝜈 | ≤ , 𝜈 = 1, 2, 3, 4.
2
Then
𝑏21 + 𝑏22 + 𝑏23 + 𝑏24 ≡ 𝑎21 + 𝑎22 + 𝑎23 + 𝑎24 ≡ 0 (mod 𝑚) ,
234 7. Diophantine Equations
thus
and we derive the divisibility by 𝑚 for the other three values of 𝑐 𝜈 similarly.
Dividing (7.5.16) by 𝑚2 , we obtain that 𝑚1 𝑝 is the sum of four squares. But 0 <
𝑚1 < 𝑚 contradicts the minimality of 𝑚. □
Remark: The method used in the proof was a variant of infinite descent. The name
will be clearer from the following formulation of our argument: If 𝑝 itself is not nice,
then considering a nice (positive) multiple 𝑚𝑝 of 𝑝, we find another nice multiple 𝑚1 𝑝
where 0 < 𝑚1 < 𝑚, then we find similarly a nice multiple 𝑚2 𝑝 where 0 < 𝑚2 < 𝑚1 , etc.
We get a strictly decreasing infinite sequence 𝑚 > 𝑚1 > 𝑚2 > ⋯ of positive integers
so we perform an infinite descent among the positive integers, which is impossible.
The infinite descent for positive integers resembles an induction proof by contra-
diction. For example, the second proof for the uniqueness of prime factorization in
Theorem 1.5.1 was basically an infinite descent.
Despite its connection to induction, infinite descent is based on a different princi-
ple: it uses the well-ordering property, i.e. every subset has a minimal element, and so
we cannot form a sequence of infinite descent. Thus if some property gets inherited in
an infinite descent, then no element of a well-ordered set can have this property.
Since the axiom of choice implies that every set can be well-ordered, infinite descent
can be applied more widely than induction.
Exercises 7.5 235
Exercises 7.5
1. Let 𝑛 be a fixed positive integer. In how many essentially different ways can a pos-
itive integer be represented as the sum of two squares? (For instance, the example
of 4050 after Theorem 7.5.1 has two such representations: 4050 = 452 + 452 =
92 + 632 .)
2. How many Gaussian integers have norm 98000?
3. Determine the largest 𝑟 such that there exist infinitely many sequences of 𝑟 con-
secutive integers each being the sum or difference of two squares.
4. Give a new proof to Exercise 4.1.5.
5. For which integers 𝑛 is the Diophantine equation 𝑥2 + 4𝑦2 = 𝑛 solvable, and what
is the number of solutions?
* 6. Which positive integers can be represented and in how many ways as the sum of
squares of two coprime integers?
* 7. (a) How many (pairwise incongruent) right triangles have integer side lengths
one of them being 𝑘?
(b) Solve the same problem if we assume that the side lengths are coprime.
8. Verify that the Diophantine equation 𝑥2 + 𝑦2 = 𝑛 has 4𝑑 ′ (𝑛) − 4𝑑 ″ (𝑛) solutions
where 𝑑 ′ (𝑛) and 𝑑 ″ (𝑛) are the numbers of positive divisors of the form 4𝑘 + 1 and
4𝑘 − 1, of the positive integer 𝑛.
* 9. How many representations has a positive integer as a sum of two squares, on aver-
age? In a precise formulation, we ask about the approximate behavior of the mean
value function
𝑟(1) + 𝑟(2) + ⋯ + 𝑟(𝑛)
𝑛
for large values of 𝑛, where 𝑟(𝑛) denotes the number of solutions of the Diophan-
tine equation 𝑥2 + 𝑦2 = 𝑛.
S* 10. Solve the Diophantine equation 𝑥2 + 4 = 𝑦3 .
S* 11. Which Gaussian integers are the sum of squares of two Gaussian integers?
12. In the proof of Theorem 7.5.1, we defined standard form for Gaussian integers, and
observed that a Gaussian integer can have several standard forms. Prove that the
number of standard forms of any Gaussian integer, different from 0 and units, is a
power of 4. (Two standard forms are considered the same if they differ only in the
order of factors, and we exclude the possibility that some Gaussian prime occurs
with exponent 0.)
13. True or false?
(a) If each of two positive integers is the sum of two squares, then so is their prod-
uct.
(b) If the product of two positive integers is the sum of two squares, then so is
each factor.
236 7. Diophantine Equations
(c) If both the product of two positive integers and one of the factors are sums of
two squares, then so is the other factor.
(d) If each of two positive integers is the sum of three squares, then so is their
product.
* 14. What is the probability that a positive integer is a sum of three squares?
15. Determine the smallest 𝑟 such that every sufficiently large positive integer is the
sum of at most 𝑟 odd squares?
16. Deduce the Four Squares Theorem from the Three Squares Theorem.
S 17. Which positive integers can be represented as a sum of four squares so that at least
two summands are equal?
18. Is the Diophantine equation 𝑥2 + 9𝑦2 + 𝑧2 + 𝑤2 = 1011 + 23 solvable?
19. Give two new proofs for Lemma 7.5.5 based on Chevalley’s Theorem 3.6.1 and on
Exercise 3.6.2.
20. Theorem 7.5.1 implies that every positive prime of the form 4𝑘 + 1 is the sum of
two squares. Give a new proof following the lines of the proof of Theorem 7.5.3.
* 21. The goal of this exercise is to present another proof for the Four Squares Theorem.
We shall rely on Lemmas 7.5.4 and 7.5.5 but will establish the existence of a small
nice multiple of 𝑝 using part (a) below instead of infinite descent.
(a) Thue’s lemma. We call two 𝑘-dimensional vectors with integer coordinates
congruent modulo a prime 𝑝 if the corresponding coordinates are congruent
modulo 𝑝. Let 𝐶 be a 𝑘 × 𝑘 matrix with integer elements and 𝑢1 , . . . , 𝑢𝑘 , 𝑣 1 ,
. . . , 𝑣 𝑘 positive integers satisfying
𝑢1 . . . 𝑢 𝑘 𝑣 1 . . . 𝑣 𝑘 > 𝑝 𝑘 .
Then there exist vectors
𝑥1 𝑧1
𝐱 = ( ⋮ ) ≠ 𝟎 and 𝐳 = ( ⋮ )
𝑥𝑘 𝑧𝑘
with integer coordinates such that
𝐶𝐱 ≡ 𝐳 (mod 𝑝) and |𝑥𝑖 | < 𝑢𝑖 , |𝑧𝑖 | < 𝑣 𝑖 , 𝑖 = 1, 2, . . . , 𝑘.
(b) Using a special case with 𝑘 = 2 of part (a) and relying on Lemma 7.5.5, prove
that any prime 𝑝 has a nice multiple less than 4𝑝.
(c) Finally, verify that if 2𝑝 or 3𝑝 is nice for a prime 𝑝 > 3, then 𝑝 itself is nice.
Waring stated in 1770 that “every natural number is the sum of 4 squares, 9 cubes,
19 fourth powers, etc.” This self-confident declaration hides serious deficiencies, espe-
cially concerning the last innocent word “etc.” First of all, it is hard to observe any rule
for the continuation of the three numbers 4, 9, and 19 and it is absolutely not clear that
these numbers can be continued to infinity at all. This requires the proof of: To any 𝑘,
there exists an 𝑟, depending only on 𝑘, such that every positive integer is the sum of 𝑟
terms of 𝑘th powers. This was first proved by Hilbert in 1909(!).
Today we already know how to continue Waring’s numbers apart from a minimal
uncertainty to be specified later. It is interesting that the problem of the 19 fourth
powers defied the siege longest, it was proved only in 1986, 63 years after Waring’s
proclamation.
Since a sum of 𝑘th powers can always be extended by an arbitrary number of terms
0𝑘 , we are interested in the smallest number of 𝑘th powers sufficient for the represen-
tation of every positive integer:
Definition 7.6.1. Let 𝑘 > 1. Then 𝑔(𝑘) is the minimal 𝑟 such that every positive integer
is the sum of 𝑟 terms of 𝑘th powers of non-negative integers. ♣
Example. 𝑔(2) = 4, since every positive integer is the sum of four squares by the Four
Squares Theorem and there exists a number, e.g. 7, that cannot be written as the sum
of three squares.
Theorem 7.6.2.
3 𝑘
(7.6.1) 𝑔(𝑘) ≥ 2𝑘 + ⌊( ) ⌋ − 2. ♣
2
Proof. To get a lower bound for 𝑔(𝑘), it is sufficient to find just one positive integer 𝑛
that requires many 𝑘th powers.
Let 𝑛 be the greatest integer of the form 𝑡2𝑘 − 1 that is less than 3𝑘 . Then we can
only use terms 1𝑘 and 2𝑘 to represent 𝑛, and clearly
𝑛 = 𝑡2𝑘 − 1 = 2⏟⎵
𝑘⎵
+⎵⏟⎵
⋯⎵+⎵⏟ 𝑘⎵
2𝑘 + 1⏟⎵+⎵⏟⎵
⋯⎵ 1𝑘
+⎵⏟
𝑡 − 1 terms 2𝑘 − 1 terms
The most important result for 𝑔(𝑘) is that (7.6.1) holds with equality in general:
There may be only finitely many 𝑘 for which 𝑔(𝑘) is greater than the right-hand side
of (7.6.1), and then its value is obtained from the worst 𝑛 less than 4𝑘 (thus also the
term 3𝑘 can be used), similar to the proof of Theorem 7.6.2. This might occur only if
(3/2)𝑘 is abnormally close to its ceiling, satisfying some special inequality. No integer
238 7. Diophantine Equations
less than 471000000 meets this requirement and it is almost certain that there are no
such exceptions at all, so
3 𝑘
𝑔(𝑘) = 2𝑘 + ⌊( ) ⌋ − 2
2
for every 𝑘. Accordingly, the right-hand side of (7.6.1) is the continuation of Waring’s
numbers. When 𝑘 = 2, 3, and 4 we obtain the values 4, 9, and 19.
Theorem 7.6.2 shows that some small integers 𝑛 need extremely many 𝑘th powers
to be represented. Therefore, it is worthwhile to analyze how many 𝑘th powers are
necessary to represent every sufficiently large 𝑛:
Definition 7.6.3. Let 𝑘 > 1. Then 𝐺(𝑘) is the minimal 𝑠 such that every sufficiently
large positive integer is a sum of 𝑠 terms of 𝑘th powers of non-negative integers. ♣
Example. 𝐺(2) = 4, as obviously 𝐺(2) ≤ 𝑔(2) = 4, and by the Three Squares Theorem,
infinitely many integers are not representable as the sum of three squares.
The next table summarizes the best known results for 𝑔(𝑘) and 𝐺(𝑘) for some small
values of 𝑘:
𝑘 2 3 4 5 6 7 8
𝑔(𝑘) 4 9 19 37 73 143 279
𝐺(𝑘) 4 4–7 16 6–17 9–24 8–31 32–39
The table reflects the great uncertainty about the exact values of 𝐺(𝑘) even for small
integers 𝑘 (e.g. 4–7 at 𝐺(3) means that we know no better bounds than 4 ≤ 𝐺(3) ≤ 7).
The exact values of 𝐺(𝑘) were determined only for 𝑘 = 2 and 4 so far.
We know, however, that 𝐺(𝑘) is much smaller than 𝑔(𝑘) if 𝑘 is large: e.g. 𝐺(𝑘) <
6𝑘 log 𝑘 for every 𝑘 > 1. The best known result is that to any 𝜀 > 0, there exists a
𝑘0 = 𝑘0 (𝜀) such that 𝐺(𝑘) < (1 + 𝜀)𝑘 log 𝑘 for every 𝑘 > 𝑘0 . Thus 𝐺(𝑘) is almost linear
in contrast with 𝑔(𝑘), which has an exponential order.
Now we get some lower bounds for 𝐺(𝑘).
Theorem 7.6.4. 𝐺(𝑘) ≥ 𝑘 + 1 for every 𝑘 > 1. ♣
Proof. For a proof by contradiction, we assume 𝐺(𝑘) ≤ 𝑘 for some 𝑘. Then there exists
𝑛0 such that every integer 𝑛 > 𝑛0 is a 𝑘-term sum of 𝑘th powers, i.e.
(7.6.3) 𝑛 = 𝑥1𝑘 + 𝑥2𝑘 + ⋯ + 𝑥𝑘𝑘 .
We fix (temporarily) a large positive integer 𝑀, and let 𝑓(𝑀) denote the number of
integers 𝑛 that are representable as 𝑘-term sums of 𝑘th powers and
(7.6.4) 0 ≤ 𝑛 ≤ 𝑀.
By our assumption,
(7.6.5) 𝑓(𝑀) ≥ 𝑀 − 𝑛0 .
We count how many sums 𝑥1𝑘 + ⋯ + 𝑥𝑘𝑘 can be formed from the integers listed in
(7.6.6); some of these sums may coincide, and many of them exceed 𝑀, so the number of
such formal sums is ≥ 𝑓(𝑀). Such a formal sum is equivalent to selecting 𝑘 elements
from the list (7.6.6) so that any element can be chosen arbitrarily many times (since
there may be equal terms in (7.6.3)), and the order of selection is irrelevant as the sum
remains the same if we permute its terms. Such a selection is called a combination of 𝑘
elements out of 𝑇 + 1, allowing repetitions, and there are (𝑇+𝑘
𝑘
) such combinations. To
be self-contained, we give a proof of this formula.
To characterize a combination, assume that we choose 𝑚𝑗 pieces of 𝑗 for every
0 ≤ 𝑗 ≤ 𝑇. We write 𝑚0 small circles ∘ for the 𝑚0 pieces of 0s followed by a delimiter
bar |, then draw 𝑚1 small circles ∘ for the 𝑚1 pieces of 1s followed again by a delimiter
bar |, etc. Finally we draw the last 𝑚𝑇 small circles ∘ for the 𝑚𝑇 pieces of terms 𝑇. For
𝑘 = 5 and 𝑀 = 75 , the sum 05 +15 +15 +35 +75 corresponds to the sequence ∘|∘∘||∘||||∘.
We established a bijection between the formal sums and the sequences of 𝑘 circles
and 𝑇 = ⌊ 𝑘√𝑀⌋ bars. Hence, the number of formal sums is equal to the number of
⌊ 𝑘√𝑀⌋ + 𝑘
these sequences, which is ( ).
𝑘
Summarizing, we have proved
𝑘 + ⌊ 𝑘√𝑀⌋
(7.6.7) 𝑓(𝑀) ≤ ( ).
𝑘
Inequalities (7.6.5) and (7.6.7) imply
𝑘 + ⌊ 𝑘√𝑀⌋
(7.6.8) 𝑀 − 𝑛0 ≤ ( ).
𝑘
In the expanded form
1 𝑘 𝑘 𝑘
(𝑘 + ⌊ √𝑀⌋)(𝑘 − 1 + ⌊ √𝑀⌋) . . . (1 + ⌊ √𝑀⌋)
𝑘!
of the right-hand side in (7.6.8), we can omit the floor signs, which does not decrease
the right-hand side in (7.6.8). Dividing both sides by 𝑀 so that each factor 𝑖 + 𝑘√𝑀 is
divided by 𝑘√𝑀, we obtain
𝑛0 1 𝑘 𝑘−1 1
(7.6.9) 1− ≤ (1 + 𝑘 ) (1 + 𝑘 ) . . . (1 + 𝑘 ) .
𝑀 𝑘! √𝑀 √𝑀 √𝑀
For 𝑀 → ∞, the left-hand side of (7.6.9) tends to 1 and the right-hand side tends to
1/𝑘!, which is a contradiction, since 𝑘 > 1. □
Remark: The proof yields that many integers 𝑛 are not representable as a 𝑘-term sum
5! −1 119
of 𝑘th powers (e.g. for 𝑘 = 5, this happens with probability at least = which
5! 120
is more than 99 percent!). At the same time, this was not a constructive proof because
it did not exhibit any 𝑛 which is not representable.
240 7. Diophantine Equations
We show now that the upper bound in Theorem 7.6.4 can be improved e.g. for
𝑘 = 6:
Theorem 7.6.5. 𝐺(6) ≥ 9. ♣
Exercises 7.6
5. If we represent the integers as signed sums of 𝑘th powers, then generally fewer
terms are sufficient than 𝑔(𝑘) or even 𝐺(𝑘). Show that the minimal number of
terms is three for 𝑘 = 2 and, moreover, each of the Diophantine equations
𝑥2 + 𝑦2 − 𝑧2 = 𝑛 and 𝑥2 − 𝑦2 − 𝑧2 = 𝑛 has infinitely many solutions for every
positive integer 𝑛.
Theorem 7.7.1 (Fermat’s Last Theorem). For integers 𝑘 > 2, the equation 𝑥𝑘 + 𝑦𝑘 = 𝑧𝑘
has no solutions in positive integers. ♣
The history of the conjecture started in 1637 when, reading a 1621 edition of Dio-
phantus’s book, Fermat added a note to the part about Pythagorean triples: “The sum
of two cubes is never a cube, the sum of two fourth powers is never a fourth power, etc.
I found a wonderful proof for this but the margin is too small to contain it.”
These few lines caused great excitement among both mathematicians and out-
siders for three and a half centuries. The problem seems innocent and can be under-
stood without any mathematical training; many amateurs tried to solve it, but in vain.
Professional mathematicians did not perform much better either.
It is easy to show (see Exercise 7.7.1) that if the conjecture is true for an exponent
𝑘, then it is true for every multiple of 𝑘. Hence, it is sufficient to settle the problem for
prime exponents 𝑘 and for 𝑘 = 4. Fermat did prove the case 𝑘 = 4, and more than 100
years later Euler succeeded with exponent 𝑘 = 3. This list was extended with a few
more values of 𝑘 in the first half of the nineteenth century.
The middle of the nineteenth century brought the first major breakthrough with
the introduction of “ideal numbers.” Today we call them ideals, and will discuss them
in Chapter 11. Several new criteria were developed that guaranteed that Fermat’s Last
Theorem is true if a prime exponent 𝑘 satisfies them. In principle, these criteria can
be numerically checked for any particular 𝑘, and many such computations were per-
formed, using computers in the last decades.
In spite of all these efforts and results, the conjecture was still verified only for
finitely many prime exponents as late as 1980. At the same time, many more general
conjectures were formulated, since it was expected that the solution for Fermat’s equa-
tion will follow from a theorem about a more general problem.
In 1983, Gerd Faltings achieved a sensational new result: For any fixed expo-
nent 𝑘, Fermat’s equation can have only finitely many primitive solutions, those with
(𝑥, 𝑦, 𝑧) = 1.
The true sensation, however, occurred in 1993 when Andrew Wiles published a
decisive solution after working for many years alone, in secret. It turned out that there
242 7. Diophantine Equations
was an error in the proof but Wiles, with the help of Richard Taylor, corrected it in
1994.
Thus today Fermat’s Last Theorem is no longer a famous unsolved problem but is
a valid theorem. The several hundred pages of Wiles’ proof are understandable only
by a very small group of top specialists, but we can hope for somewhat simpler proofs
later.
Fermat’s “wonderful proof” was probably either just a vague idea, or a wrong argu-
ment that assumed the validity of the Fundamental Theorem of Arithmetic in sets of
numbers where it is false (see Section 11.2 for more details). We can practically exclude
the possibility that somebody will find a genuinely elementary proof.
During the centuries of assiduous and intensive research on Fermat’s Last Theo-
rem, mathematicians elaborated many new, effective theories. Though they brought
only partial success in handling the original problem, they became indispensable in
some other fields of mathematics. This illustrates well that research on a given prob-
lem may help indirectly the development of the entirety of mathematics, too.
We shall prove below, following the historical order, the two easiest special cases
of Fermat’s Last Theorem for exponents 𝑘 = 4 and 3.
In both cases, we shall prove a slightly stronger result, since we can give an answer
to the original problem only by proving sharper theorems.
Fermat’s Last Theorem for 𝑘 = 4 follows from the following statement.
Lemma 7.7.3. The sum and difference of two non-zero squares cannot both be squares.
♣
Proof. We apply infinite descent (see the Remark after Theorem 7.5.3).
We want to show that the system of equations
(7.7.1a) 𝑥2 + 𝑦2 = 𝑧 2
(7.7.1b) 𝑥2 − 𝑦2 = 𝑤 2
themselves in the first case, and are the doubles of squares if the second condition
holds.
Thus if ℎ = 1, then 𝑐2 + 𝑎2 and 𝑐2 − 𝑎2 are squares, which contradicts Lemma 7.7.3.
If ℎ = 2, then
(7.7.10) 𝑐2 + 𝑎2 = 2𝑢2 and 𝑐2 − 𝑎2 = 2𝑣2
for some integers 𝑢 > 𝑣 > 0. Taking the sum and the difference of the equalities
(7.7.10) and cancelling the results by 2, we obtain
𝑐2 = 𝑢2 + 𝑣2 and 𝑎2 = 𝑢2 − 𝑣2 .
But this is impossible according to Lemma 7.7.3. □
To prove Fermat’s Last Theorem for the exponent 𝑘 = 3, we develop number theory
in the ring of Eulerian (or Eisenstein) integers, which behave similarly to Gaussian
integers.
Definition 7.7.4. By an Eulerian integer (or Eisenstein integer), we mean a complex
number 𝑎 + 𝑏𝜔 where 𝑎, 𝑏 are integers, and
2𝜋 2𝜋 1 √3
𝜔 = cos + 𝑖 sin =− +𝑖 . ♣
3 3 2 2
The complex numbers 𝜔 and 𝜔2 = −1 − 𝜔 are the primitive third roots of unity.
The factorization
(7.7.11) 𝑥3 = 𝑧3 − 𝑦3 = (𝑧 − 𝑦)(𝑧 − 𝑦𝜔)(𝑧 − 𝑦𝜔2 )
reveals the connection between Fermat’s equation 𝑥3 + 𝑦3 = 𝑧3 and the Eulerian in-
tegers. Our proof will be based on the investigation of an equation similar to (7.7.11)
and we shall rely heavily on the number theory of Eulerian integers.
Definition 7.7.5. The norm 𝑁(𝛼) of an Eulerian integer 𝛼 = 𝑎 + 𝑏𝜔 is the square of
the absolute value of 𝛼:
𝑁(𝛼) = |𝛼|2 = 𝛼𝛼 = (𝑎 + 𝑏𝜔)(𝑎 + 𝑏𝜔2 ) = 𝑎2 − 𝑎𝑏 + 𝑏2 . ♣
Proof. We have to modify the arguments used in Theorem 7.4.15 accordingly, thus we
indicate only the differences briefly.
By the analog of Theorem 7.4.14, we obtain all Eulerian primes from the factor-
ization of positive prime numbers. We get different types of decompositions when this
positive prime is (A) 3, (B) is of the form 3𝑡 − 1, or (C) is of the form 3𝑡 + 1.
(A) Since 3 = (−1)(𝑖√3)2 , the only Eulerian prime divisor of 3 is 𝑖√3, apart from
associates.
(B) The positive prime numbers of the form 3𝑡 − 1 are Eulerian primes: we have to
show that the norm of an Eulerian integer cannot be of this form, which can be justified
as seen at the Gaussian integers.
−3
(C) If 𝑝 is a positive prime number of the form 3𝑡 + 1, then ( 𝑝
) = 1 (see Exer-
2
cise 4.2.2c), thus 𝑝 ∣ 𝑐 + 3 for some integer 𝑐. We consider the factorization
𝑐2 + 3 = (𝑐 + 𝑖√3)(𝑐 − 𝑖√3) = (𝑐 + 1 + 2𝜔)(𝑐 − 1 − 2𝜔)
among the Eulerian integers, and follow the argument used for the Gaussian integers.
□
In the proof of Fermat’s Last Theorem for cubes, some important properties of the
Eulerian prime 𝑖√3 play an important role. For a convenient formulation, we introduce
congruences also among Eulerian integers:
Definition 7.7.8. Let 𝜇 ≠ 0, 𝛼, and 𝛽 Eulerian integers. We say that 𝛼 is congruent to
𝛽 modulo 𝜇, if 𝜇 ∣ 𝛼 − 𝛽. ♣
246 7. Diophantine Equations
We shall use the notation 𝛼 ≡ 𝛽 (mod 𝜇) or 𝛼 ≡ 𝛽 (𝜇) for short. The elementary
properties of congruences for integers are equally valid for Eulerian integers.
We summarize some important properties of the Eulerian prime 𝑖√3:
Proof. (i) By Theorem 7.7.6, the associates of 𝜆 are ±𝜆, ∓𝜔𝜆, and ±𝜔2 𝜆. Performing
the multiplications and applying the relations 𝜔2 = −1 − 𝜔 and 𝜔3 = 1, we obtain the
six Eulerian integers stated in the theorem.
(ii) The identity
𝑎 + 𝑏𝜔 = 𝑎 + 𝑏 − 𝑏(1 − 𝜔) = 𝑎 + 𝑏 − 𝑏𝜔2 𝜆
implies
𝑎 + 𝑏𝜔 ≡ 𝑎 + 𝑏 (mod 𝜆) .
Since 𝑎 + 𝑏 ≡ 0, 1, or −1 (mod 3) and 𝜆 ∣ 3,
𝑎 + 𝑏 ≡ 0, 1, or −1 (mod 𝜆).
This proves that any Eulerian integer 𝑎 + 𝑏𝜔 is congruent to 0, 1, or −1 modulo 𝜆.
We have to show that 0, 1, and −1 are pairwise incongruent modulo 𝜆, so 𝜆 does
not divide the difference ±1 or ±2 of any two of these three numbers. If 𝜆 ∣ ±1 or
𝜆 ∣ ±2, then 𝑁(𝜆) ∣ 1 or 𝑁(𝜆) ∣ 4, but this is impossible since 𝑁(𝜆) = 3.
(iii) This follows immediately from (ii) using the identity
𝛼3 − 𝛼 = 𝛼(𝛼 − 1)(𝛼 + 1).
(iv) If 𝛼 ≡ 1 (mod 𝜆), then 𝛼 = 1 + 𝛽𝜆 for a suitable Eulerian integer 𝛽. Cubing
both sides, we obtain
𝛼3 = 1 + 3𝛽𝜆 + 3𝛽 2 𝜆2 + 𝛽 3 𝜆3 .
2
From 3 = −𝜆 , we get
(7.7.12) 𝛼3 = 1 − 𝛽𝜆3 − 𝛽 2 𝜆4 + 𝛽 3 𝜆3 = 1 − 𝛽 2 𝜆4 + (𝛽 3 − 𝛽)𝜆3 .
Since 𝜆 ∣ 𝛽 3 − 𝛽 by (iii), (7.7.12) implies 𝛼3 ≡ 1 (mod 𝜆4 ).
We can proceed similarly in the case 𝛼 ≡ −1 (mod 𝜆) or deduce it by applying the
previous case to −𝛼 ≡ 1 (mod 𝜆). □
Remark: Several statements of Theorem 7.7.9 are valid for more general moduli instead
of 𝜆 (see Exercise 7.7.12):
(ii): The number of residue classes modulo any Eulerian integer 𝜇 ≠ 0 is 𝑁(𝜇).
Moreover, if 𝑁(𝜇) is a prime number 𝑝, then the integers in a complete residue system
in 𝐙 modulo 𝑝 form a complete residue system among the Eulerian integers modulo 𝜇.
(Theorem 7.7.9 contained the special case 𝜇 = 𝜆 and 𝑁(𝜆) = 3.)
7.7. Fermat’s Last Theorem 247
After the preparations we are ready to prove Fermat’s Last Theorem for the expo-
nent 𝑘 = 3.
Theorem 7.7.10. The equation 𝑥3 + 𝑦3 = 𝑧3 has no solutions where 𝑥, 𝑦, and 𝑧 are
non-zero integers. ♣
Since the Eulerian prime 𝜆 divides the left-hand side of (7.7.18), it must divide at
least one factor on the right-hand side, too. The pairwise differences of the three factors
are (𝜔 − 1)𝜓, (𝜔2 − 1)𝜓, and (𝜔2 − 𝜔)𝜓, which are all multiples of 𝜔 − 1 = 𝜀𝜆. This
implies that 𝜆 divides all three factors on the right-hand side of (7.7.18).
We verify now that the gcd of any two factors on the right-hand side of (7.7.18) is
𝜆. We check it for the first two factors; the other two pairs can be handled similarly.
Put 𝛿 = (𝜅 − 𝜓, 𝜅 − 𝜓𝜔). Then
𝛿 ∣ (𝜅 − 𝜓) − (𝜅 − 𝜓𝜔) = 𝜓(𝜔 − 1)
and
𝛿 ∣ 𝜔(𝜅 − 𝜓) − (𝜅 − 𝜓𝜔) = 𝜅(𝜔 − 1),
so
𝛿 ∣ (𝜓(𝜔 − 1), 𝜅(𝜔 − 1)) = (𝜔 − 1)(𝜅, 𝜓) = 𝜔 − 1 = 𝜀𝜆.
Combined with 𝜆 ∣ 𝛿, shown earlier, this gives 𝛿 = 𝜆.
Thus
𝜅−𝜓 𝜅 − 𝜓𝜔 𝜅 − 𝜓𝜔2
, , and
𝜆 𝜆 𝜆
are pairwise coprime. By the Fundamental Theorem of Arithmetic,
𝜅 − 𝜓 = 𝜀1 𝜆𝜈31
(7.7.19) 𝜅 − 𝜓𝜔 = 𝜀2 𝜆𝜈32
𝜅 − 𝜓𝜔2 = 𝜀3 𝜆𝜈33
where 𝜀1 , 𝜀2 , 𝜀3 are units and 𝜈1 , 𝜈2 , 𝜈3 are pairwise coprime Eulerian integers.
We check now the behavior of 𝜈 𝑖 concerning divisibility by 𝜆. Since 𝜈 𝑖 are pairwise
coprime, two of them, say 𝜈2 and 𝜈3 are not multiples of 𝜆. Let 𝑠 be the exponent of 𝜆
in the standard form of 𝜈1 . We claim that 𝑠 = 𝑛 − 1.
To verify it, we compare the exponents of 𝜆 on the two sides of (7.7.18). This ex-
ponent is 3𝑛 on the left-hand side. On the right-hand side, we know from (7.7.19) that
Exercises 7.7 249
each factor contains 𝜆 on the first power and 𝜈31 contains it with exponent 3𝑠. Hence,
3𝑛 = 3 + 3𝑠, so 𝑠 = 𝑛 − 1.
Thus
(7.7.20) 𝜈1 = 𝜆𝑛−1 𝛾1 where (𝛾1 , 𝜆) = 1.
Here 𝑛 − 1 ≥ 1 as 𝑛 ≥ 2.
In the next step we show that taking a suitable combination of the equations in
(7.7.19), we get an equality like (7.7.14) with 𝑛 − 1 instead 𝑛 and this completes the
proof.
We multiply the second equation in (7.7.19) by 𝜔 and the third equation by 𝜔2 , and
add to the first equation:
(7.7.21) (𝜅 − 𝜓) + 𝜔(𝜅 − 𝜓𝜔) + 𝜔2 (𝜅 − 𝜓𝜔2 ) = 𝜀1 𝜆𝜈31 + 𝜀4 𝜆𝜈32 + 𝜀5 𝜆𝜈33 ,
where 𝜀4 = 𝜀2 𝜔 and 𝜀5 = 𝜀3 𝜔2 are units. The left-hand side of (7.7.21) is
(7.7.22) (𝜅 − 𝜓) + 𝜔(𝜅 − 𝜓𝜔) + 𝜔2 (𝜅 − 𝜓𝜔2 ) = (1 + 𝜔 + 𝜔2 )(𝜅 − 𝜓) = 0.
By (7.7.20), (7.7.21), and (7.7.22) we obtain
0 = 𝜀1 𝜆3(𝑛−1)+1 𝛾13 + 𝜀4 𝜆𝜈32 + 𝜀5 𝜆𝜈33 .
Dividing by 𝜀5 𝜆 and rearranging the terms yields
(7.7.23) 𝜀6 𝜆3(𝑛−1) 𝛾13 = 𝜀7 𝜈32 − 𝜈33
where also 𝜀6 and 𝜀7 are units.
We claim 𝜀7 = ±1, so we can rewrite the term 𝜀7 𝜈32 as (±𝜈2 )3 . We consider (7.7.23)
modulo 𝜆3 . Since 𝑛 − 1 ≥ 1, 𝜆 ∤ 𝜈2 , and 𝜆 ∤ 𝜈3 , part (iv) of Theorem 7.7.9 implies
𝜀7 (±1) − (±1) ≡ 0 (mod 𝜆3 ) ,
so 𝜆3 divides 𝜀7 − 1 or 𝜀7 + 1. From
𝑁(𝜆3 ) ∣ 𝑁(𝜀7 ∓ 1), 𝑁(𝜆3 ) = 27, and 𝑁(𝜀7 ∓ 1) < 27,
we get 𝜀7 ∓ 1 = 0, thus 𝜀7 = ±1.
Therefore we can rewrite (7.7.23) as
𝜀6 𝜆3(𝑛−1) 𝛾13 = (±𝜈2 )3 − 𝜈33 .
This means that (7.7.14) holds with 𝑛 − 1 instead of 𝑛, and the conditions in (7.7.15)
are satisfied, with 𝜀, 𝛾, 𝜅, and 𝜓 replaced by 𝜀6 , 𝛾1 , ±𝜈2 , and 𝜈3 . □
Exercises 7.7
1. (a) Show that if 𝑘 ∣ 𝑚, and the sum of two positive 𝑘th powers is never a 𝑘th
power, then the sum of two positive 𝑚th powers cannot be an 𝑚th power.
(b) Explain why it is sufficient to prove Fermat’s Last Theorem for prime expo-
nents and for 𝑘 = 4.
2. How many solutions do the following equations have in positive integers?
250 7. Diophantine Equations
In the proof, we shall rely on Theorem 8.1.1 from the next chapter.
We see from (7.8.3) that a pair of positive integers 𝑥 and 𝑦 can give a solution only
if 𝑥/𝑦 is very close to √𝑚: (7.8.3) implies
As √𝑚 is irrational, it follows from Theorem 8.1.1 that (7.8.4) holds for infinitely many
pairs of integers 𝑥, 𝑦. Based on this fact, we prove that (7.8.2) has infinitely many
solutions. (Conditions (7.8.4) and (7.8.2) are not equivalent; only a small number of 𝑥
and 𝑦 satisfying (7.8.4) will be solutions of (7.8.2)).
I. Our first step is to show that there exists an integer 𝑡 ≠ 0 such that the Diophan-
tine equation
(7.8.5) 𝑥2 − 𝑚𝑦2 = 𝑡
(7.8.6) implies that all values 𝑐𝑗2 −𝑚𝑑𝑗2 are integers in the interval (−1−2√𝑚, 1+2√𝑚),
and none of them is 0 as √𝑚 is irrational. By the pigeonhole principle, there must be
an integer 𝑡 ≠ 0 in this interval for which
𝑐𝑗2 − 𝑚𝑑𝑗2 = 𝑡
holds for infinitely many pairs 𝑐𝑗 , 𝑑𝑗 . This means that the Diophantine equation (7.8.5)
has infinitely many solutions.
II. Now we prove that the quotients of suitable solutions of (7.8.5) yield solutions
for equation (7.8.1).
Let 𝑥 = 𝑎1 , 𝑦 = 𝑏1 and 𝑥 = 𝑎2 , 𝑦 = 𝑏2 be two solutions of (7.8.5), so
and assume
If (7.8.7a), (7.8.7b), and (7.8.8) hold, then the pairs 𝑎1 , 𝑏1 and 𝑎2 , 𝑏2 are called modulo |𝑡|
congruent solutions of (7.8.5).
7.8. Pell’s Equation 253
By (7.8.2),
(7.8.11) (𝑥0 + 𝑦0 √𝑚)−𝑛 = (𝑥0 − 𝑦0 √𝑚)𝑛 ,
thus an equivalent form of (7.8.10) is
𝑥 + 𝑦√𝑚 = ±(𝑥0 ± 𝑦0 √𝑚)𝑛 , 𝑛 = 0, 1, 2, . . . .
For 𝑛 = 0, we obtain the two trivial solutions.
254 7. Diophantine Equations
Proof. We shall apply several times the fact that the product of two solutions gives a
solution.
Assume that both 𝑥1 , 𝑦1 , and 𝑥2 , 𝑦2 are solutions of (7.8.1), i.e.
𝑥′ , 𝑦′ is a solution too, so
(7.8.16a) 𝑥′ + 𝑦′ √𝑚 > 1,
thus
by (7.8.15). According to (7.8.16b), the cases 𝑦′ = 0; 𝑥′ < 0, 𝑦′ > 0; and 𝑥′ > 0, 𝑦′ < 0
are impossible, and (7.8.16a) excludes 𝑥′ < 0, 𝑦′ < 0. Therefore 𝑥′ > 0, 𝑦′ > 0, but
then (7.8.14) contradicts the minimality of 𝑥0 + 𝑦0 √𝑚. □
Exercises 7.8 255
Exercises 7.8
7.9. Partitions
Definition 7.9.1. A partition of a positive integer 𝑛 is a representation of 𝑛 as a sum
of positive integers, allowing also a one-term sum. We consider only the essentially
different representations, where the order of the terms is irrelevant.
The number of partitions of 𝑛 is denoted by 𝑝(𝑛). ♣
𝑐𝑒𝑑√𝑛 1 𝜋√6
𝑝(𝑛) ∼ where 𝑐 = and 𝑑= .
𝑛 4√3 3
We often investigate special partitions where there are some restrictions on the sum-
mands or on their number: e.g. we prescribe that each summand should be odd or the
terms should be all distinct, etc.
The basic tools for handling partitions are generating functions. As an illustration,
we consider the money changing problem: In how many ways can we pay 𝑛 dollars with
banknotes of denomination less than (say) 50 dollars, including the rare two dollar
bills? We want partitions of 𝑛 into summands 1, 2, 5, 10, and 20 only. Let us denote the
number of such partitions by 𝑓(𝑛).
We rewrite the problem. Let 𝑢1 , . . . , 𝑢5 denote the numbers of 1, 2, 5, 10, and 20
dollar bills, when paying 𝑛 dollars. Then 𝑓(𝑛) is the number of non-negative integer
solutions of the Diophantine equation
(7.9.1) 1𝑢1 + 2𝑢2 + 5𝑢3 + 10𝑢4 + 20𝑢5 = 𝑛.
We show first that the series is absolutely convergent for |𝑥| < 1/2.
Since 0 ≤ 𝑢𝑖 ≤ 𝑛 for every 𝑖 in (7.9.1),
0 ≤ 𝑓(𝑛) ≤ (𝑛 + 1)5 .
It is easy to see that (𝑛 + 1)5 < 2𝑛 for 𝑛 large enough, thus, for |𝑥| < 1/2, the convergent
infinite geometric series
∞
∑ (2|𝑥|)𝑛
𝑛=0
is a majorant of the infinite series (7.9.2). Therefore 𝐹(𝑥) is absolutely convergent for
|𝑥| < 1/2. It can also be proved that this holds for |𝑥| < 1.
7.9. Partitions 257
We write 𝐹(𝑥) as a product of convergent geometric series, still assuming |𝑥| < 1/2:
As the power series expansion of a function around 0 is unique, we have to show that
multiplying the finitely many absolutely convergent series on the right-hand side of
(7.9.3) we get 𝑓(𝑛) as the coefficient of 𝑥𝑛 . We map a representation (7.9.1) of 𝑛 into a
product of the terms
𝑥ᵆ1 (𝑥2 )ᵆ2 (𝑥5 )ᵆ3 (𝑥10 )ᵆ4 (𝑥20 )ᵆ5 = 𝑥1ᵆ1 +2ᵆ2 +5ᵆ3 +10ᵆ4 +20ᵆ5 = 𝑥𝑛 .
Thus we established a bijection between the representations and the products, so after
performing the multiplication, the coefficient of 𝑥𝑛 is 𝑓(𝑛).
Using the summation formula for geometric series, we can write (7.9.3) into the
form
1
𝐹(𝑥) = (for |𝑥| < 1/2).
(1 − 𝑥)(1 − 𝑥2 )(1 − 𝑥5 )(1 − 𝑥10 )(1 − 𝑥20 )
We obtain the following more general result exactly the same way.
Theorem 7.9.2. Let 𝑎1 , 𝑎2 , . . . , 𝑎𝑟 be distinct positive integers, and let 𝑓(𝑛) denote the
number of partitions of the positive integer 𝑛 using no summands other than 𝑎1 , 𝑎2 , . . . ,
∞
𝑎𝑟 . Then the infinite series 1 + ∑𝑛=1 𝑓(𝑛)𝑥𝑛 is absolutely convergent for |𝑥| < 1/2, and
∞ 𝑟
1
1 + ∑ 𝑓(𝑛)𝑥𝑛 = ∏ . ♣
𝑛=1 𝑖=1
1 − 𝑥 𝑎𝑖
Theorem 7.9.3.
∞ ∞
1
(7.9.4) 𝑃(𝑥) = 1 + ∑ 𝑝(𝑛)𝑥𝑛 = ∏ (for |𝑥| < 1). ♣
𝑛=1 𝑖=1
1 − 𝑥𝑖
The infinite product on the right-hand side of (7.9.4) is the limit (as seen in Exer-
cises 5.6.6 and 5.6.7)
∞ 𝑟
1 1
∏ = lim ∏ .
𝑖=1
1 − 𝑥𝑖 𝑟→∞ 𝑖=1 1 − 𝑥𝑖
To prove Theorem 7.9.3, we apply Theorem 7.9.2 with 𝑎𝑖 = 𝑖, and then take the limit
when 𝑟 → ∞. We leave the details to the reader.
Besides generating functions, combinatorial arguments can be applied to parti-
tions. We can plot a partition 𝑛 = 𝑎1 + 𝑎2 + ⋯ + 𝑎𝑟 satisfying 𝑎1 ≥ 𝑎2 ≥ . . . ≥ 𝑎𝑟 as a
258 7. Diophantine Equations
scheme with 𝑎1 points in the first row, 𝑎2 points in the second row, etc., as the scheme
• • • • •
• • •
(7.9.5)
• • •
•
corresponds to the partition 12 = 5 + 3 + 3 + 1. It is obvious from the definition that
no row can be longer than the row above it.
Thus the rows correspond to the terms of the partition. We can look at the scheme
also according to its columns. So scheme (7.9.5) gives the partition 12 = 4+3+3+1+1.
The two interpretations of the schemes yield the result:
Theorem 7.9.4. Let 𝑔𝑟 (𝑛) and ℎ𝑟 (𝑛), be the number of partitions of 𝑛 where the number
of terms and the largest term is 𝑟, resp. Then 𝑔𝑟 (𝑛) = ℎ𝑟 (𝑛). ♣
Proof. Consider the schemes of 𝑛 points with exactly 𝑟 rows. Counting the points in
the scheme by rows, we get a partition of 𝑛 into 𝑟 terms. Considering the scheme by
columns, we have a partition of 𝑛 where the largest term is 𝑟. Doing this for all schemes,
we infer 𝑔𝑟 (𝑛) = ℎ𝑟 (𝑛). □
Proof. We shall establish an almost bijection between the partitions of 𝑛 into an even
or odd number of distinct summands.
Partitions into distinct terms correspond to schemes where the numbers of ele-
ments in the rows are strictly decreasing downwards, as the partition 23 = 7+6+5+3+2
is represented by
• • • • • • •
• • • • • •
(7.9.7) • • • • •
• • •
• •
7.9. Partitions 259
Let us call the edge of such a partition the longest line of points starting from the
upper-right corner and running 45 degrees from northeast to southwest. The edge of
scheme (7.9.7) consists of three points. The length of the edge depends on how long
the terms decrease one by one, and an edge may contain just a single point.
Let 𝑈 be the transformation that transfers the edge of a scheme under the last row,
creating a new last row provided that we again get a partition into distinct terms, so the
new scheme consists of rows with strictly decreasing numbers of points. Similarly, let
𝐸 be the transformation that transfers the last row of a scheme near the edge (obliquely,
as a new edge) provided this creates an appropriate new scheme. Applying 𝐸 to (7.9.7),
we obtain
• • • • • • • •
• • • • • • •
• • • • •
• • •
but 𝑈 cannot be applied.
We show that apart from a few exceptions, any scheme allows exactly one of 𝑈 and
𝐸 to be applied.
Let the number of points be 𝑢 in the last row and 𝑒 in the edge.
If 𝑢 ≤ 𝑒, then 𝑈 cannot be applied, but 𝐸 can, except if 𝑢 = 𝑒 and the last row and
the edge have a common point; in this case neither 𝑈, nor 𝐸 can be applied:
• • • • • • •
• • • • • •
(∗)
• • • • •
• • • •
If 𝑢 > 𝑒, then 𝐸 is impossible, but 𝑈 works, except if 𝑢 = 𝑒 + 1 and the last row
and the edge share a point; in this case neither 𝑈, nor 𝐸 can be applied:
• • • • • •
(∗∗) • • • • •
• • • •
= 1 − 𝑥 − 𝑥2 + 𝑥5 + 𝑥 − 𝑥 7 12
− 𝑥15 + . . . ,
by Theorem 7.9.5. This infinite series is absolutely convergent for |𝑥| < 1/2.
On the other hand, we can obtain 𝑉(𝑥) as an infinite product, convergent for |𝑥| <
1/2:
∞ 𝑟
(7.9.11) 𝑉(𝑥) = ∏(1 − 𝑥𝑖 ) = lim ∏(1 − 𝑥𝑖 ).
𝑟→∞
𝑖=1 𝑖=1
Thus multiplying the two power series on the left-hand side of (7.9.14), the coefficient
of 𝑥𝑛 is 0 for every 𝑛 ≥ 1 so
(7.9.15) 𝑝(𝑛) + 𝑝(𝑛 − 1)𝑣(1) + 𝑝(𝑛 − 2)𝑣(2) + ⋯ + 𝑝(1)𝑣(𝑛 − 1) + 𝑣(𝑛) = 0.
Substituting the values 𝑣(𝑗) determined in Theorem 7.9.5 into (7.9.15), we obtain the
recursion
(7.9.16) 𝑝(𝑛) = 𝑝(𝑛 − 1) + 𝑝(𝑛 − 2) − 𝑝(𝑛 − 5) − 𝑝(𝑛 − 7) + 𝑝(𝑛 − 12) + . . .
We can observe from the right-hand side of (7.9.16) that the recursion contains only
about 2√2𝑛/3 terms, so we can use it to compute 𝑝(𝑛) effectively even for relatively
large values of 𝑛, e.g.
𝑝(200) = 3972999029388.
Exercises 7.9
3. Which integers have an odd number of partitions into (pairwise) distinct terms?
4. What is the number of representations of 𝑛 as the sum of positive integers if we
consider two representations distinct if they differ in the order of terms?
5. Show that the number of partitions of 𝑛 into exactly 𝑟 terms is the same as the
number of partitions of 𝑛 − 𝑟 into at most 𝑟 terms.
6. Exhibit the generating function of ℎ𝑟 (𝑛) in Theorem 7.9.4.
7. (a) Let 𝑢(𝑛) be the number of partitions of 𝑛 into pairwise distinct positive inte-
gers, and 𝑤(𝑛) be the number of partitions into odd, but not necessarily dis-
tinct, positive integers. Prove 𝑢(𝑛) = 𝑤(𝑛).
(b) (Generalization of part (a).) Let 𝑢𝑘 (𝑛) be the number of partitions of 𝑛 where
no integer can occur 𝑘 times among the summands, and let 𝑤 𝑘 (𝑛) be the
number of partitions where none of the summands is a multiple of 𝑘. Then
𝑢𝑘 (𝑛) = 𝑤 𝑘 (𝑛).
8. Verify
∞ ∞
𝑥𝑟
∑ 𝑝(𝑛)𝑥𝑛 = ∑
𝑛=1 𝑟=1
(1 − 𝑥)(1 − 𝑥2 ) . . . (1 − 𝑥𝑟 )
for |𝑥| < 1/2.
** 9. Prove the identity
1
(−1)𝑘+1 𝑛, if 𝑛 = 2 (3𝑘2 ± 𝑘)
𝜎(𝑛) − 𝜎(𝑛 − 1) − 𝜎(𝑛 − 2) + 𝜎(𝑛 − 5) + 𝜎(𝑛 − 7) − ⋯ = {
0, otherwise.
Chapter 8
Diophantine Approximation
In this chapter we investigate how close irrational numbers can be to rational num-
bers. The closeness is expressed in terms of the denominator 𝑠 of the approximating
fraction. It turns out that a typical irrational number can be best approximated to an
order of magnitude 1/𝑠2 . To handle the problem, we also use continued fractions and
Minkowski’s basic theorem in the geometry of numbers. Finally, we deal with the dis-
tribution of fractional parts of certain sequences. Diophantine approximation is related
to Pell’s equation (we used Theorem 8.1.1 in the proof of Theorem 7.8.1), and further
applications will appear in the next chapter.
263
264 8. Diophantine Approximation
the assertion remains true also if we require (𝑟, 𝑠) = 1 for the approximating fractions
𝑟/𝑠.
To prove Theorem 8.1.1, we need
Theorem 8.1.2. Let 𝛼 be a real number and 𝑛 a positive integer. Then there exists at least
one fraction 𝑟/𝑠 satisfying
𝑟 1
(8.1.2) 1 ≤ 𝑠 ≤ 𝑛 and ||𝛼 − || < . ♣
𝑠 𝑛𝑠
Proof. The fractional part of a real number 𝑐 is {𝑐} = 𝑐 − ⌊𝑐⌋. For example, {3} = 0;
{2.9} = 0.9; {−2.9} = 0.1. Clearly, 0 ≤ {𝑐} < 1.
We consider the fractional parts
{𝛼}, {2𝛼}, . . . , {(𝑛 + 1)𝛼}.
They are in the interval [0, 1).
We partition the interval [0, 1) into 𝑛 subintervals of length 1/𝑛, each closed on the
left and open on the right. There are 𝑛 + 1 fractional parts {𝑗𝛼} and 𝑛 subintervals. By
the pigeonhole principle, there is a subinterval containing at least two fractional parts,
so the distance between them is less than 1/𝑛, so
1
(8.1.3) |{𝑗𝛼} − {𝑖𝛼}| <
𝑛
for some 1 ≤ 𝑖 < 𝑗 ≤ 𝑛 + 1. We can rewrite (8.1.3) as
1
(8.1.4) |(𝑗𝛼 − ⌊𝑗𝛼⌋) − (𝑖𝛼 − ⌊𝑖𝛼⌋)| = |(𝑗 − 𝑖)𝛼 − (⌊𝑗𝛼⌋ − ⌊𝑖𝛼⌋)| < .
𝑛
Let
𝑠 = 𝑗 − 𝑖 and 𝑟 = ⌊𝑗𝛼⌋ − ⌊𝑖𝛼⌋.
Then dividing (8.1.4) by 𝑠, we get the statement of the theorem. □
Theorem 8.1.3 can be verified similarly to the proof of Theorem 8.1.1; we require
now a 𝑘-dimensional version of Theorem 8.1.2:
Theorem 8.1.4. Let 𝛼1 , . . . , 𝛼𝑘 be real numbers and 𝑛 a positive integer. Then there exist
integers 𝑟1 , . . . , 𝑟 𝑘 , and 𝑠 satisfying
𝑟𝑗 1
1 ≤ 𝑠 ≤ 𝑛𝑘 and ||𝛼𝑗 − || < , 𝑗 = 1, 2, . . . , 𝑘. ♣
𝑠 𝑛𝑠
We leave the details of the proofs to the reader.
We state a sharper version of Theorem 8.1.1 without proof:
Theorem 8.1.5. For any irrational number 𝛼, there exist infinitely many fractions 𝑟/𝑠
satisfying
|𝛼 − 𝑟 | < 1 . ♣
| 𝑠 | √5𝑠2
Theorem 8.1.6. Let 𝜀 > 0 be arbitrary and 𝛼 = (1 + √5)/2. Then only finitely many
fractions 𝑟/𝑠 can satisfy
|𝛼 − 𝑟| 1
(8.1.6) | < . ♣
𝑠 | (√5 + 𝜀)𝑠2
Proof. To achieve a contradiction, assume that (8.1.6) holds for infinitely many 𝑟/𝑠.
The distance between fractions with a given denominator 𝑠 is (at least) 1/𝑠, and 𝑠 ≥ 1
266 8. Diophantine Approximation
implies
1 2
> ,
𝑠 (√5 + 𝜀)𝑠2
so for a given 𝑠, (8.1.6) can be valid with at most one 𝑟.
Hence, there must occur arbitrarily large integers among the denominators of the
infinitely many fractions 𝑟/𝑠 satisfying (8.1.6).
As 𝛼 is a root of equation 𝑥2 − 𝑥 − 1 = 0, we have 𝛼(𝛼 − 1) = 1. This helps us to
eliminate the square root in 𝛼 on the left-hand side of (8.1.6):
𝑟 𝑟 𝑟 𝑟2 𝑟 𝑟2
(8.1.7) (𝛼 − )((𝛼 − 1) + ) = 𝛼(𝛼 − 1) + (𝛼 − (𝛼 − 1)) − 2 = 1 + − 2 .
𝑠 𝑠 𝑠 𝑠 𝑠 𝑠
The right-hand side of (8.1.7) is a fraction with denominator 𝑠2 which is not zero
as 𝛼 is irrational, so its absolute value is at least 1/𝑠2 . Then, by (8.1.7),
|𝛼 − 𝑟| | 𝑟| 1
(8.1.8) | ⋅ (𝛼 − 1) + ≥ .
𝑠| | 𝑠 | 𝑠2
By (8.1.6), 𝑟/𝑠 is close to 𝛼, thus the second factor on the left-hand side of (8.1.8) is
about 2𝛼 − 1 = √5, which contradicts (8.1.6). To see this precisely, we start with the
upper estimate
|(𝛼 − 1) + 𝑟| 𝑟 1
(8.1.9) | ≤ (2𝛼 − 1) + || − 𝛼|| < √5 + .
𝑠| 𝑠 √5𝑠2
For 𝑠 large enough,
1
< 𝜀,
√5𝑠2
thus (8.1.9) implies
|(𝛼 − 1) + 𝑟|
(8.1.10) | < √5 + 𝜀.
𝑠|
Combining (8.1.8) and (8.1.10), we get
|𝛼 − 𝑟| 1
| >
𝑠 | (√5 + 𝜀)𝑠2
for 𝑠 large enough, which contradicts (8.1.6). □
Theorem 8.1.6 shows that Theorems 8.1.5 and 8.1.1 express the right order of mag-
nitude of best approximation for irrational numbers, since some irrational numbers 𝛼
cannot be approximated substantially better than guaranteed by these theorems.
Now we show that Theorems 8.1.5 and 8.1.1 give the right order of magnitude of
best approximation for irrational numbers also in the following sense: only few irra-
tional numbers can be approximated much better. To get a precise meaning of “few”,
we introduce the notion of measure zero:
Definition 8.1.7. A subset 𝐻 of the real numbers has measure zero (or is of measure
zero), if to any 𝜀 > 0 there exist countably many intervals of total length less than 𝜀 so
that their union covers 𝐻. ♣
8.1. Approximation of Irrational Numbers 267
It is easy to see that the set of rational numbers and every countable set has measure
zero, but there exist also sets of measure zero that have the cardinality of the continuum
(see Exercise 8.1.9).
Theorem 8.1.8. Let 𝜅 > 0 be a real number and 𝐻 the set of real numbers 𝛼 to which
there are infinitely many 𝑟/𝑠 satisfying
(8.1.11) |𝛼 − 𝑟 | < 1 .
| 𝑠 | 𝑠2+𝜅
Then 𝐻 has measure zero. ♣
Proof. Let
𝐻𝑖 = 𝐻 ∩ [𝑖, 𝑖 + 1), 𝑖 = 0, ±1, ±2, . . . .
The approximation property (8.1.11) depends only on the fractional part of 𝛼, so any
two sets 𝐻𝑖 are congruent. Thus it is enough to show that 𝐻0 has measure zero, since
∞
𝐻= 𝐻𝑖 ,
⋃
𝑖=−∞
and the union of countably many sets of measure zero has measure zero (see Exer-
cise 8.1.10c).
For a given integer 𝑠 > 1, let 𝐴𝑠 be the set of real numbers 0 ≤ 𝛼 < 1 for which
(8.1.11) holds with some 𝑟. Clearly, 𝐴𝑠 consists of the points in [0, 1) belonging to the
open intervals of radius 1/𝑠2+𝜅 around the points
0 1 𝑠
, , ... , ,
𝑠 𝑠 𝑠
so
𝑠−1
𝑟 1 𝑟 1 1 1
(8.1.12) 𝐴𝑠 = ( ( − , + )) [0, ) (1 − 2+𝜅 , 1).
⋃ 𝑠 𝑠2+𝜅 𝑠 𝑠2+𝜅 ⋃ 𝑠2+𝜅 ⋃ 𝑠
𝑟=1
Exercises 8.1
8. Determine all possible values of the following expression as 𝛼 and 𝛽 assume all real
numbers independently:
(a) {𝛼} + {𝛽} − {𝛼 + 𝛽}
(b) {𝛼}{𝛽} − {𝛼𝛽}
S* (c) {𝛼}2 − {𝛼2 }.
9. (a) Show that every countable subset of the real numbers has measure zero.
* (b) Consider those real numbers between 0 and 1 that do not contain the digit 1 in
their ternary (base 3) representation (this is the so-called Cantor set). Verify
that this set has the cardinality of the continuum, but still has measure zero.
10. Prove:
(a) A subset of a set of measure zero has measure zero.
(b) The union of finitely many sets of measure zero has measure zero.
(c) The union of countably many sets of measure zero has measure zero.
(d) The union of more than countably many sets of measure zero may, but does
not necessarily, have measure zero.
Consider the generally skew coordinate system with origin 𝑂 and axes parallel to
the sides of the fundamental parallelogram. Then the lattice points in 𝐿 have coordi-
nates (𝑖𝑎, 𝑗𝑏), and the lattice points in 𝐿𝑘 have coordinates
2𝑖 2𝑗
𝑎, 𝑏),
(
𝑘 𝑘
where 𝑎 and 𝑏 are the side lengths of the fundamental parallelogram in 𝐿 and 𝑖 and 𝑗
are arbitrary integers.
Since the pairs (𝑖, 𝑗) can give 𝑘2 residues on division by 𝑘 and 𝑁(𝑘) > 𝑘2 , the pi-
geonhole principle guarantees the existence of two distinct lattice points
2𝑖1 2𝑗1 2𝑖2 2𝑗2
𝑄1 = ( 𝑎, 𝑏) and 𝑄2 = ( 𝑎, 𝑏),
𝑘 𝑘 𝑘 𝑘
in 𝐿𝑘 satisfying
(8.2.2) 𝑘 ∣ 𝑖 1 − 𝑖2 and 𝑘 ∣ 𝑗1 − 𝑗2 .
As 𝐻 is symmetric about 𝑂, the mirror image
−2𝑖2 −2𝑗2
𝑄′2 = ( 𝑎, 𝑏)
𝑘 𝑘
of 𝑄2 is in 𝐻, and by convexity, the midpoint
2𝑖1 − 2𝑖2 2𝑗1 − 2𝑗2
𝐹=( 𝑎, 𝑏)
2𝑘 2𝑘
of the segment 𝑄1 𝑄′2 belongs to 𝐻. The divisibilities (8.2.2) imply 𝐹 = (𝑟𝑎, 𝑠𝑏) with
some integers 𝑟 and 𝑠, so 𝐹 is a lattice point in the original 𝐿. Since 𝑄1 ≠ 𝑄2 , 𝐹 ≠ 𝑂.
Thus we have proved that 𝐻 contains a lattice point of 𝐿 different from 𝑂.
We still have to verify the case ℎ = 4Δ. For a proof by contradiction, we assume
that the center 𝑂 is the only lattice point of 𝐿 in 𝐻. Let 𝑚 be the minimum of the
distances of lattice points 𝑃 ≠ 𝑂 from 𝐻. Since 𝐻 is closed, we have 𝑚 > 0. Thus we
can magnify 𝐻 so that even the resulting 𝐻 ′ contains no lattice point besides 𝑂. But
this is impossible because the area of 𝐻 ′ is greater than 4Δ. □
Second proof. We verify first a lemma which expresses an intuitively obvious fact: If
translating a bounded set in the plane with all lattice vectors we obtain pairwise disjoint
copies, then the area of the set cannot be greater than the area of the fundamental
parallelogram in the lattice.
Lemma 8.2.2. Let Δ be the area of the fundamental parallelogram in the lattice 𝐿 and 𝑡
the area of a bounded set 𝐾 in the plane. For a fixed lattice point 𝑂 and an arbitrary lattice
point 𝑃, let 𝐾𝑃 denote the copy of 𝐾 translated by the vector 𝑂𝑃, so 𝐾𝑂 = 𝐾. Assume that
the sets 𝐾𝑃 are disjoint. Then 𝑡 ≤ Δ. ♣
Proof. The essence of the proof is the observation: We enlarge the fundamental par-
allelogram (in all directions) by a large 𝑟, and place the resulting parallelogram 𝑀 so
that 𝑂 should be approximately in the center of 𝑀. Then the translated copies of 𝐾
by lattice points in 𝑀 cannot go much beyond 𝑀, so the total area of the translated
copies, which is about 𝑟2 𝑡, cannot be much bigger than the area of 𝑀, which is 𝑟2 Δ.
The statement now follows by taking the limit for 𝑟 → ∞.
272 8. Diophantine Approximation
Let us see all this precisely and in detail. Consider the generally skew coordinate
system, used already in the first proof of Theorem 8.2.1, with origin 𝑂 and axes parallel
to the sides of the fundamental parallelogram. Then the coordinates of lattice points
in 𝐿 are (𝑖𝑎, 𝑗𝑏), where 𝑎 and 𝑏 are the side lengths of the fundamental parallelogram
and 𝑖 and 𝑗 are arbitrary integers.
Let 𝑛 be an arbitrary integer and consider the (2𝑛 + 1)2 lattice points 𝑃𝑖𝑗 = (𝑖𝑎, 𝑗𝑏)
with |𝑖| ≤ 𝑛 and |𝑗| ≤ 𝑛. Let 𝑈𝑛 denote the union of the sets 𝐾𝑃 belonging to these
points 𝑃𝑖𝑗 . Then the area of 𝑈𝑛 is (2𝑛 + 1)2 𝑡. As 𝐾 is bounded, the coordinates of every
point in 𝐾 are less in absolute value than 𝑐𝑎 and 𝑐𝑏, with a suitable constant 𝑐 > 0.
Then 𝑈𝑛 is contained in a parallelogram 𝐺𝑛 where the coordinates of vertices are
(±𝑎(𝑛 + 𝑐), ±𝑏(𝑛 + 𝑐)),
so the area of 𝐺𝑛 is (2𝑛 + 2𝑐)2 Δ. Being a subset, the area of 𝑈𝑛 is not greater than the
area of 𝐺𝑛 , so
(2𝑛 + 1)2 𝑡 ≤ (2𝑛 + 2𝑐)2 Δ.
This implies
2𝑐 − 1 2
𝑡 ≤ (1 + ) Δ.
2𝑛 + 1
Taking the limit as 𝑛 → ∞, we obtain the desired inequality 𝑡 ≤ Δ. □
Turning to the proof of Theorem 8.2.1, it is sufficient to consider the case ℎ > 4Δ.
We shrink 𝐻 from 𝑂 by half and denote the resulting set by 𝐾. By the condition, the
area of 𝐾 is 𝑡 = ℎ/4 > Δ, so by Lemma 8.2.2, there exist two distinct lattice points 𝑄 and
𝑅 for which 𝐾𝑄 and 𝐾𝑅 share a common point. A translation by the vector 𝑄𝑂 maps
this common point into a common point 𝐴 of 𝐾𝑂 = 𝐾 and 𝐾𝑃 with a suitable lattice
point 𝑃 other than 𝑂. We show that 𝑃 is an element of 𝐻, thus proving the statement
of the theorem.
Let 𝐵 be the translate of 𝐴 by the vector 𝑃𝑂, 𝐶 the reflected image of 𝐵 through 𝑂,
and 𝐷 the midpoint of segment 𝐴𝐶.
Since 𝐴 ∈ 𝐾𝑃 , 𝐵 ∈ 𝐾. By the symmetry of 𝐾, 𝐶 ∈ 𝐾. As both 𝐴 and 𝐶 are in 𝐾, by
convexity, their midpoint 𝐷 is in 𝐾.
By the construction, 𝑃𝐴𝑂𝐶 is a parallelogram, since sides 𝑂𝐶 and 𝐴𝑃 are parallel
and equal. Therefore 𝐷 is the midpoint of the diagonal 𝑂𝑃, and the twofold magnifica-
tion around 𝑂 maps 𝐷 into 𝑃. Since this magnification takes 𝐾 into 𝐻, and 𝐷 is in 𝐾, 𝑃
must be in 𝐻. Thus we have proved that 𝐻 contains the lattice point 𝑃 different from
𝑂. □
Theorem 8.2.3. For any irrational number 𝛼, there exist infinitely many fractions 𝑟/𝑠
satisfying
(8.2.3) |𝛼 − 𝑟 | < 1 . ♣
| 𝑠 | 2𝑠2
8.2. Minkowski’s Theorem 273
Exercises 8.2
1. (a) Prove Minkowski’s theorem in space: Let 𝐿 be any parallelepiped lattice in the
space and 𝐻 a closed, convex set symmetric around a lattice point. Assume
that the volume of 𝐻 is at least 8Δ, where Δ is the volume of the fundamental
parallelepiped in the lattice. Then 𝐻 contains a lattice point different from its
center.
(b) Generalize the theorem for arbitrary dimensions.
2. Verify the following generalization of Minkowski’s theorem: If 𝐿 and 𝐻 meet the
requirements of Theorem 8.2.1 and the area of 𝐻 is at least 4𝑟Δ for some integer
𝑟 > 0, then 𝐻 contains at least 2𝑟 lattice points besides its center.
3. Prove that every positive prime of the form 3𝑘 + 1 can be written as 𝑥2 + 3𝑦2 with
suitable integers 𝑥 and 𝑦.
4. Let 𝑎11 , 𝑎12 , 𝑎21 , and 𝑎22 be integers satisfying
𝑎 𝑎12
𝐷 = [ 11 ] ≠ 0.
𝑎21 𝑎22
Prove that if 𝑏1 𝑏2 ≥ |𝐷| for the positive (real) numbers 𝑏1 and 𝑏2 , then the system
of inequalities
|𝑎11 𝑥1 + 𝑎12 𝑥2 | ≤ 𝑏1 , |𝑎21 𝑥1 + 𝑎22 𝑥2 | ≤ 𝑏2
has a non-trivial, i.e (𝑥1 , 𝑥2 ) ≠ (0, 0), solution in integers.
8.3. Continued Fractions 275
* 5. Verify that for any irrational numbers 𝛼1 and 𝛼2 there exist infinitely many pairs
𝑟1 /𝑠, 𝑟2 /𝑠 of rational numbers with a common denominator satisfying
𝑟𝑗
|𝛼 − |< 2⋅ 1 , 𝑗 = 1, 2.
| 𝑗 𝑠 | 3 𝑠3/2
If 𝛼1 ≠ 0, then let
1 1 1
𝑐1 = ⌊ ⌋ and 𝛼2 = { }, then 𝛼 = 𝑐 0 + 𝛼1 = 𝑐 0 + .
𝛼1 𝛼1 𝑐 1 + 𝛼2
If 𝛼2 ≠ 0, then we form the floor and fractional part of 1/𝛼2 , etc. In general, if 𝑐 0 , 𝑐 1 ,
. . . , 𝑐𝑛 and 𝛼1 , . . . , 𝛼𝑛+1 have already been determined and 𝛼𝑛+1 ≠ 0, then let
1 1
(8.3.2) 𝑐𝑛+1 = ⌊ ⌋ and 𝛼𝑛+2 = { },
𝛼𝑛+1 𝛼𝑛+1
so
1
(8.3.3) 𝛼 = 𝑐0 + .
1
𝑐1 +
1
𝑐2 +
1
⋱ 𝑐𝑛 + 𝑐𝑛+1 +𝛼𝑛+2
We call the multiple-decked fraction on the right-hand side of (8.3.3) a (finite) con-
tinued fraction, and for convenience, we denote it by 𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐𝑛 , 𝑐𝑛+1 + 𝛼𝑛+2 ).
We shall sometimes apply this notation for the right-hand side of (8.3.3) even if the
numbers 𝑐 𝑖 are not integers.)
If 𝛼𝑛+1 = 0, the algorithm terminates.
The integers 𝑐 0 , 𝑐 1 , . . . are called the digits in the continued fraction expansion of 𝛼.
Definition 8.3.1. By the continued fraction digits of a real number 𝛼, we mean the
(finite or infinite) sequence 𝑐 0 , 𝑐 1 , . . . defined by (8.3.1) and (8.3.2). ♣
It is clear from the definition that the digits are uniquely determined integers and
𝑐 𝑖 > 0 for 𝑖 ≥ 1.
276 8. Diophantine Approximation
Hence the continued fraction digits of √2 are 1, 2, 2, 2, . . . We introduce the (so far
formal) notation √2 = 𝐶(1, 2, 2, . . . ) and call this an infinite continued fraction.
Theorem 8.3.2. The sequence of continued fraction digits of 𝛼 is finite if and only if 𝛼 is
a rational number. ♣
We can rewrite it as
𝑎 𝑟 𝑎 𝑎
= 𝑞1 + 1 = ⌊ ⌋ + { }
𝑏 𝑏 𝑏 𝑏
so, using the notation of the continued fraction algorithm 𝑐 0 = 𝑞1 and 𝛼1 = 𝑟1 /𝑏.
If 𝑟1 ≠ 0, then the next step in the Euclidean algorithm is
𝑏 = 𝑟1 𝑞2 + 𝑟2 , 0 ≤ 𝑟2 < 𝑟1 ,
i.e.
1 𝑏 𝑟 𝑏 𝑏
= = 𝑞2 + 2 = ⌊ ⌋ + { },
𝛼1 𝑟1 𝑟1 𝑟1 𝑟1
thus 𝑐 1 = 𝑞2 and 𝛼2 = 𝑟2 /𝑟1 .
We obtain the same way that also the further continued fraction digits are the quo-
tients occurring in the Euclidean algorithm. □
In the sequel we assume that 𝛼 is irrational and use continued fractions to exhibit
rational numbers approximating 𝛼 well. They will be the initial finite sections of the in-
finite continued fraction expansion of 𝛼, i.e., the finite continued fractions formed from
the first 𝑛 + 1 continued fraction digits for 𝑛 ≥ 0. We denote these rational numbers
by 𝐶𝑛 (𝛼), so if 𝛼 = 𝐶(𝑐 0 , 𝑐 1 , . . . ), then
(8.3.4) 𝐶𝑛 (𝛼) = 𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐𝑛 ), 𝑛 = 0, 1, 2, . . . .
Theorem 8.3.3. Let 𝑐 0 , 𝑐 1 , . . . be the continued fraction digits of an irrational number
𝛼, and
𝑟
(8.3.5) 𝐶𝑛 (𝛼) = 𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐𝑛 ) = 𝑛 , where (𝑟𝑛 , 𝑠𝑛 ) = 1, 𝑠𝑛 > 0.
𝑠𝑛
Then
(8.3.6) |𝛼 − 𝑟𝑛 | < 1
| 𝑠𝑛 | 𝑠2𝑛
for any 𝑛. Moreover, if 𝑛 > 0, then at least one of the inequalities
This gives a natural meaning to the (till now formal) expression “infinite contin-
ued fraction” 𝛼 = 𝐶(𝑐 0 , 𝑐 1 , . . . ).
Lemma 8.3.4. Let 𝑐 0 , 𝑐 1 , 𝑐 2 , . . . be arbitrary real numbers, where 𝑐 𝑖 > 0 for 𝑖 ≥ 1, and
form the
Then
𝑟𝑛
(8.3.9) 𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐𝑛 ) =
𝑠𝑛
and
𝑟𝑛 𝑟 (−1)𝑛−1
(8.3.10) − 𝑛−1 = (𝑛 ≥ 1).
𝑠𝑛 𝑠𝑛−1 𝑠𝑛−1 𝑠𝑛
If the numbers 𝑐𝑛 are integers, then so are also 𝑟𝑛 and 𝑠𝑛 , further (𝑟𝑛 , 𝑠𝑛 ) = 1, and 𝑠𝑛+1 >
𝑠𝑛 for 𝑛 > 0. ♣
Remark: It follows from Lemma 8.3.4 that the sequences 𝑟𝑛 and 𝑠𝑛 defined by (8.3.5)
in Theorem 8.3.3 satisfy recursion (8.3.8a)–(8.3.8b), so the notations 𝑐𝑛 , 𝑟𝑛 , and 𝑠𝑛 in
Lemma 8.3.4 and Theorem 8.3.3 are in harmony.
So (8.3.9) holds.
Assume now that (8.3.9) is true for 𝑛 = 𝑚 ≥ 2, so
𝑟𝑚 𝑐 𝑟 +𝑟
𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐𝑚 ) = = 𝑚 𝑚−1 𝑚−2 ,
𝑠𝑚 𝑐𝑚 𝑠𝑚−1 + 𝑠𝑚−2
8.3. Continued Fractions 279
where 𝑟𝑚−1 , 𝑠𝑚−1 , 𝑟𝑚−2 , and 𝑠𝑚−2 depend only on 𝑐 0 , . . . , 𝑐𝑚−1 . Then
1
𝐶(𝑐 0 , . . . , 𝑐𝑚−1 , 𝑐𝑚 , 𝑐𝑚+1 ) = 𝐶(𝑐 0 , . . . , 𝑐𝑚−1 , 𝑐𝑚 + )
𝑐𝑚+1
1
(𝑐𝑚 + )𝑟
𝑐𝑚+1 𝑚−1
+ 𝑟𝑚−2
=
1
(𝑐𝑚 + )𝑠 + 𝑠𝑚−2
𝑐𝑚+1 𝑚−1
𝑐𝑚+1 (𝑐𝑚 𝑟𝑚−1 + 𝑟𝑚−2 ) + 𝑟𝑚−1
=
𝑐𝑚+1 (𝑐𝑚 𝑠𝑚−1 + 𝑠𝑚−2 ) + 𝑠𝑚−1
𝑐𝑚+1 𝑟𝑚 + 𝑟𝑚−1
=
𝑐𝑚+1 𝑠𝑚 + 𝑠𝑚−1
𝑟
= 𝑚+1
𝑠𝑚+1
so (8.3.9) holds also for 𝑛 = 𝑚 + 1.
II. We now verify (8.3.10). By (8.3.8a)–(8.3.8b),
𝑟𝑛 𝑠𝑛−1 − 𝑟𝑛−1 𝑠𝑛 = (𝑐𝑛 𝑟𝑛−1 + 𝑟𝑛−2 )𝑠𝑛−1 − 𝑟𝑛−1 (𝑐𝑛 𝑠𝑛−1 + 𝑠𝑛−2 )
= −(𝑟𝑛−1 𝑠𝑛−2 − 𝑟𝑛−2 𝑠𝑛−1 ).
Repeating this step for 𝑛 − 1, 𝑛 − 2, . . . , 2 instead of 𝑛, we obtain
(8.3.11) 𝑟𝑛 𝑠𝑛−1 − 𝑟𝑛−1 𝑠𝑛 = (−1)𝑛−1 (𝑟1 𝑠0 − 𝑟0 𝑠1 ) = (−1)𝑛−1 .
Dividing by 𝑠𝑛 𝑠𝑛−1 , we get (8.3.10).
III. In the case when every 𝑐 𝑖 is an integer, all but one of the statements are obvious
from the conditions, and (𝑟𝑛 , 𝑠𝑛 ) = 1 follows from (8.3.11). □
Proof of Theorem 8.3.3. As mentioned before, Lemma 8.3.4 implies that sequences
𝑟𝑛 and 𝑠𝑛 defined by (8.3.5) satisfy (8.3.8a)–(8.3.8b).
In the sequel we shall use that 𝛼 itself can be written as a finite continued fraction:
by (8.3.3),
(8.3.12) 𝛼 = 𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐𝑛 , 𝑐𝑛+1 + 𝛼𝑛+2 )
for any 𝑛, where 0 < 𝛼𝑛+2 < 1 by (8.3.2) and the irrationality of 𝛼.
To estimate the difference 𝛼 − 𝑟𝑛 /𝑠𝑛 , we shall apply Lemma 8.3.4 for 𝑐 0 , 𝑐 1 , . . . , 𝑐𝑛 ,
′
and 𝑐𝑛+1 = 𝑐𝑛+1 + 𝛼𝑛+2 (instead of 𝑐𝑛+1 ), and stop. Then we get
′
𝑟0 , 𝑟1 , . . . , 𝑟𝑛 , 𝑟𝑛+1 and 𝑠0 , 𝑠1 , . . . , 𝑠𝑛 , 𝑠′𝑛+1 ,
from (8.3.8a)–(8.3.8b), where
′ ′
𝑟𝑛+1 = 𝑐𝑛+1 𝑟𝑛 + 𝑟𝑛−1 = (𝑐𝑛+1 + 𝛼𝑛+2 )𝑟𝑛 + 𝑟𝑛−1 ,
𝑠′𝑛+1 = 𝑐𝑛+1
′
𝑠𝑛 + 𝑠𝑛−1 = (𝑐𝑛+1 + 𝛼𝑛+2 )𝑠𝑛 + 𝑠𝑛−1
280 8. Diophantine Approximation
Exercises 8.3
Theorem 8.4.1. The fractional parts of the multiples of any irrational number are ev-
erywhere dense in the interval [0, 1].
Formally, let 𝛼 be an irrational number and 𝑣 ∈ [0, 1]. Then for any 𝜀 > 0 there
exists an integer 𝑛 > 0 satisfying |{𝑛𝛼} − 𝑣| < 𝜀. ♣
Proof. By Theorem 8.1.1, there are infinitely many fractions 𝑟/𝑠 satisfying
|𝛼 − 𝑟 | < 1 , i.e. |𝑠𝛼 − 𝑟| <
1
.
| 𝑠 | 𝑠2 𝑠
Choose a fraction with 𝑠 > 1/𝜀 from them, so |𝑠𝛼 − 𝑟| < 𝜀. Let 𝑑 = |𝑠𝛼 − 𝑟| (thus 𝑑 < 𝜀),
and consider the fractional parts
(8.4.1) {𝑠𝛼}, {2𝑠𝛼}, {3𝑠𝛼}, . . . , {𝑚𝑠𝛼}
where 𝑚 = ⌊1/𝑑⌋ (we can obviously assume 𝜀 < 1, so 𝑚 ≥ 1).
Consider first the case 𝑠𝛼 − 𝑟 > 0. Then for every 1 ≤ 𝑖 ≤ 𝑚, we have
0 < 𝑖𝑠𝛼 − 𝑖𝑟 = 𝑖(𝑠𝛼 − 𝑟) = 𝑖𝑑 < 1, i.e. {𝑖𝑠𝛼} = 𝑖𝑑.
This means that the fractional parts listed in (8.4.1) form a monotone increasing se-
quence where the distance between consecutive elements is 𝑑 < 𝜀, and also the dis-
tances between the first element and 0, and between the last element and 1 are less
than 𝜀. This implies that there is an element in the sequence that is closer to 𝑣 than 𝜀
(in fact, closer than 𝜀/2).
We can handle the case 𝑠𝛼 − 𝑟 < 0 similarly: then {𝑖𝑠𝛼} = 1 − 𝑖𝑑 for 1 ≤ 𝑖 ≤ 𝑚, so
the fractional parts in (8.4.1) form a monotone decreasing sequence where the distance
between consecutive elements, between the first element and 1, and between the last
element and 0 are all less than 𝜀. □
Now we consider the variant of the problem of Theorem 8.4.1 for higher dimen-
sions. The simplest case is when 𝛼1 and 𝛼2 are irrational numbers and we investigate
the distribution of the points 𝑃𝑛 = ({𝑛𝛼1 }, {𝑛𝛼2 }) in the unit square.
282 8. Diophantine Approximation
Similar to the proof of Theorem 8.4.1, we obtain from Theorem 8.1.3 that for any
𝜀 > 0 there exist integers 𝑟1 , 𝑟2 , and 𝑠 > 0 satisfying
|𝑠𝛼1 − 𝑟1 | < 𝜀 and |𝑠𝛼2 − 𝑟2 | < 𝜀.
This means that 𝑃𝑠 = ({𝑠𝛼1 }, {𝑠𝛼2 }) is close to a vertex of the unit square. Similar to the
proof of Theorem 8.4.1, it follows that 𝑃𝑠 , 𝑃2𝑠 , 𝑃3𝑠 , . . . lie densely on the line connecting
𝑃𝑠 with this vertex.
It is not true, however, that the points 𝑃𝑛 are dense everywhere in the unit square
for every 𝛼1 and 𝛼2 . Take 𝛼2 = 𝛼1 + 1. Then {𝑛𝛼1 } = {𝑛𝛼2 } for every 𝑛, so each point 𝑃𝑛
is on the line 𝑦 = 𝑥.
The condition for everywhere dense distribution can be formulated with the help
of linear independence.
Theorem 8.4.2. For real numbers 𝛼1 , . . . , 𝛼𝑘 , the points
𝑃𝑛 = ({𝑛𝛼1 }, {𝑛𝛼2 }, . . . , {𝑛𝛼𝑘 }), 𝑛 = 1, 2, 3, . . .
are everywhere dense in the 𝑘-dimensional unit cube if and only if 1, 𝛼1 , . . . , 𝛼𝑘 are linearly
independent over the rational field. ♣
The notion of uniform distribution and the criterion of Weyl can be extended to
higher dimensions.
Relying on Weyl’s condition, we show that the multiples of an irrational number
are uniformly distributed.
Theorem 8.4.5. If 𝛼 is an irrational number, then 𝛼, 2𝛼, . . . , 𝑛𝛼, . . . are uniformly dis-
tributed. ♣
for any integer 𝑚 ≥ 0. The sum on the left-hand side of (8.4.2) is a geometric series of
𝑛 terms and with quotient 𝑒2𝜋𝑖𝑚𝛼 ≠ 1, as 𝛼 is irrational. Hence
𝑛 2𝜋𝑖𝑚𝛼
| 1 ∑ 𝑒2𝜋𝑖𝑚𝑡𝛼 | = |𝑒 | ⋅ |𝑒2𝜋𝑖𝑚𝑛𝛼 − 1| 1⋅2
|𝑛 | 2𝜋𝑖𝑚𝛼
≤ 2𝜋𝑖𝑚𝛼
→ 0,
𝑡=1
𝑛|𝑒 − 1| 𝑛|𝑒 − 1|
as 𝑛 → ∞. □
Exercises 8.4
S 1. Examine whether or not the fractional parts of the sequences below are everywhere
dense in the interval [0, 1]:
(a) (1 + √2)𝑛
(b) √𝑛
(c) √𝑛2 + 1
(d) √2𝑛2 + 1
(e) sin(𝑛𝜋/180)
(f) sin 𝑛
(g) log10 𝑛.
* 2. Show the existence of a real number 𝛼 such that the fractional parts of
𝛼, 𝛼2 , 𝛼3 , ... , 𝛼𝑛 , . . .
are everywhere dense in [0, 1].
S 3. Prove that the condition of linear independence given in Theorem 8.4.2 is neces-
sary for the points 𝑃𝑛 to be everywhere dense in the 𝑘-dimensional unit cube.
4. Verify the following statements.
(a) If the fractional parts of a sequence are everywhere dense in [0, 1], then we
can rearrange them into a uniformly distributed sequence.
(b) Any uniformly distributed sequence can be rearranged into one that is not
uniformly distributed.
284 8. Diophantine Approximation
5. True or false?
(a) Any subsequence of a uniformly distributed sequence has uniform distribu-
tion.
(b) If we add the same real number to every element of a uniformly distributed
sequence, the new sequence will have uniform distribution.
(c) If we multiply every element of a uniformly distributed sequence by the same
non-zero real number, the new sequence will have uniform distribution.
(d) The sum of two uniformly distributed sequences is uniformly distributed.
(e) The product of two uniformly distributed sequences is uniformly distributed.
(f) The square of a uniformly distributed sequence is uniformly distributed.
(g) The square of a uniformly distributed sequence can never be uniformly dis-
tributed.
6. Demonstrate that the following sequences are not uniformly distributed:
(a) log10 𝑛
(b) sin 𝑛.
7. Prove that if a natural number 𝑡 is not a power of 10, then there exists a positive
integer 𝑛 such that the first five digits of 𝑡𝑛 are 54321 in the decimal system.
Chapter 9
Algebraic and
Transcendental Numbers
Remarks: (1) We had to exclude the polynomial 𝑓 = 0, since every complex number
is a root of it.
285
286 9. Algebraic and Transcendental Numbers
(2) If 𝛼 is a root of a polynomial with rational coefficients, than multiplying this poly-
nomial by the least common multiple of the denominators in the coefficients, we
get a polynomial with integer coefficients having 𝛼 as a root. Thus we arrive at
the same notion if in Definition 9.1.1 we replace “rational coefficients” by “integer
coefficients”.
(3) The situation changes dramatically, however, if we require real or complex coef-
ficients instead of rational or integer ones: Every complex number is a root of a
non-zero polynomial with real coefficients (which are thus complex coefficients),
see Exercise 9.1.7.
(4) Instead of “algebraic number” we can say also “algebraic number over the ra-
tionals” (or “algebraic element over the rational field”) as we can generalize the
notion to algebraic elements over other fields than the rationals (see Definition
10.1.4).
Further examples occur in Exercises 9.1.1 and 9.1.2. With the help of theorems in
Section 9.3, we will be able to construct many types of algebraic numbers. The non-
algebraic numbers are called transcendental.
Theorem 9.1.3. There exist transcendental numbers, moreover almost all complex num-
bers are transcendental: the algebraic numbers are countable, whereas the cardinality of
transcendental numbers is continuum. ♣
Proof. Since the cardinality of complex numbers is that of the continuum, all state-
ments follow if we verify that the algebraic numbers are countable, so we can order the
algebraic numbers in a sequence.
The algebraic numbers are the roots of non-zero polynomials with integer coeffi-
cients, so first we put these polynomials into a sequence. Then we obtain a sequence of
all algebraic numbers by taking all (complex) roots of these polynomials that had not
yet been listed as roots of previous polynomials. Let 𝑓 = 𝑎0 + 𝑎1 𝑥 + ⋯ + 𝑎𝑛 𝑥𝑛 be an
arbitrary non-zero polynomial with integer coefficients where 𝑎𝑛 ≠ 0, and define 𝐻(𝑓)
as
For example,
𝐻(𝑓) = 1 ⟺ 𝑓 = ±1
𝐻(𝑓) = 2 ⟺ 𝑓 = ±2, ±𝑥
(9.1.1) 𝐻(𝑓) = 3 ⟺ 𝑓 = ±3, ±𝑥 ± 1, ±2𝑥, ±𝑥2
𝐻(𝑓) = 4 ⟺ 𝑓 = ±4, ±𝑥 ± 2, ±2𝑥 ± 1, ±3𝑥,
± 𝑥2 ± 1, ±𝑥2 ± 𝑥, ±2𝑥2 , ±𝑥3 .
It is clear from the definition of 𝐻(𝑓) that for any 𝑘 there exist only finitely many 𝑓
satisfying 𝐻(𝑓) = 𝑘. Therefore we get a suitable sequence by taking one after another
the polynomials with 𝐻(𝑓) = 1, 2, 3, . . . From this we get a sequence of all algebraic
numbers. The first few elements are, using the order of polynomials in (9.1.1),
1 1
0, 1, −1, 2, −2, , − , 𝑖, −𝑖, . . .
2 2
The non-zero constant polynomials have no roots, 0 comes from 𝑥, ±1 comes from
𝑥 ∓ 1, etc., the constant multiples, products or divisors of previous polynomials provide
no new roots. Thus we can restrict ourselves to polynomials 𝑓 satisfying 𝑛 > 0, 𝑎𝑛 > 0,
(𝑎0 , 𝑎1 , . . . , 𝑎𝑛 ) = 1, and being irreducible over the rational field. □
Exercises 9.1
Proof. Let
𝑓 = 𝑎 0 + 𝑎1 𝑥 + ⋯ + 𝑎 𝑛 𝑥 𝑛 , 𝑎𝑛 ≠ 0
𝑛
𝑔 = 𝑏0 + 𝑏1 𝑥 + ⋯ + 𝑏𝑛 𝑥 , 𝑏𝑛 ≠ 0.
The notation 𝑚𝛼 can refer in the sequel to any minimal polynomial of 𝛼. This can
cause no problem by Theorem 9.2.2.
We summarize the most important properties of minimal polynomials in
Theorem 9.2.3. (i) Let 𝑔 ∈ 𝐐[𝑥]. Then 𝑔(𝛼) = 0 ⟺ 𝑚𝛼 ∣ 𝑔.
(ii) 𝑚𝛼 is irreducible over 𝐐.
(iii) If 𝑓 is irreducible over 𝐐 and 𝑓(𝛼) = 0, then 𝑓 is a minimal polynomial of 𝛼. ♣
Proof. (i) We first assume 𝑚𝛼 ∣ 𝑔, i.e. 𝑔 = ℎ𝑚𝛼 , for some ℎ ∈ 𝐐[𝑥]. Then
𝑔(𝛼) = ℎ(𝛼)𝑚𝛼 (𝛼) = ℎ(𝛼) ⋅ 0 = 0.
Conversely, we assume 𝑔(𝛼) = 0. Applying the division algorithm for 𝑔 and 𝑚𝛼 , we get
𝑔 = 𝑚𝛼 ℎ + 𝑟, where ℎ, 𝑟 ∈ 𝐐[𝑥], and deg 𝑟 < deg 𝑚𝛼 or 𝑟 = 0.
Then
0 = 𝑔(𝛼) = 𝑚𝛼 (𝛼)ℎ(𝛼) + 𝑟(𝛼) = 0 + 𝑟(𝛼) = 𝑟(𝛼).
The case deg 𝑟 < deg 𝑚𝛼 contradicts the definition of minimal polynomial, so only
𝑟 = 0 is possible, so 𝑚𝛼 ∣ 𝑔.
(ii) For a proof by contradiction, assume 𝑚𝛼 = 𝑔ℎ, where 𝑔 and ℎ are polynomials
with rational coefficients of smaller degree than 𝑚𝛼 . Then as there are no zero divisors
in the complex field,
0 = 𝑚𝛼 (𝛼) = 𝑔(𝛼)ℎ(𝛼) ⟹ 𝑔(𝛼) = 0 or ℎ(𝛼) = 0,
which contradicts the definition of minimal polynomial.
(iii) By part (i), 𝑚𝛼 ∣ 𝑓. This implies 𝑚𝛼 = 𝑐 or 𝑓 = 𝑐𝑚𝛼 for some constant 𝑐,
since 𝑓 is irreducible. The first case is impossible, and the second case says that 𝑓 is a
minimal polynomial. □
Definition 9.2.4. The degree of an algebraic number 𝛼 is the degree of its minimal
polynomial: deg 𝛼 = deg 𝑚𝛼 . ♣
290 9. Algebraic and Transcendental Numbers
Exercises 9.2
1. What is the connection between the degrees of the numbers in Exercise 9.1.2 and
the degree of 𝛼?
2. Determine the degree of the algebraic numbers
7
(a) √ 12
(b) cos 20∘
3 3
(c) √ 3−√ 9
(d) √7 − 4√3
4
(e) √ 2 + √2
4 4
(f) √ 2 + √2 + √ 8.
3. Prove that 𝛼 is an algebraic number of degree 2 if and only if 𝛼 = 𝑟 + √𝑠, where 𝑟
and 𝑠 are rational numbers and 𝑠 is not the square of a rational number.
4. Demonstrate that the algebraic numbers of degree 𝑛 are everywhere dense
(a) on the real number line for 𝑛 ≥ 1
(b) on the complex plane for 𝑛 ≥ 2.
5. Let 𝑓 be a polynomial with rational coefficients of degree 𝑛 ≥ 1 and 𝛼1 , . . . , 𝛼𝑛 its
(complex) roots, counted with multiplicity.
𝑛
(a) Verify ∑𝑖=1 deg 𝛼𝑖 ≤ 𝑛2 .
(b) When does (a) hold with equality?
𝑛
(c) Show that if (a) holds with strict inequality, then ∑𝑖=1 deg 𝛼𝑖 ≤ 𝑛2 − 2𝑛 + 2.
9.3. Operations with Algebraic Numbers 291
Example. We can express the sum of squares of 𝑥𝑖 with elementary symmetric poly-
nomials 𝜎𝑗 as
𝑥12 + 𝑥22 + ⋯ + 𝑥𝑘2 = (𝑥1 + ⋯ + 𝑥𝑘 )2 − 2(𝑥1 𝑥2 + 𝑥1 𝑥3 + ⋯) = 𝜎12 − 2𝜎2 .
Proof of Theorem 9.3.1. We saw in Exercise 9.1.2 that the negative of an algebraic
number and the reciprocal of a non-zero algebraic number are algebraic. Thus it is
enough to verify that the sum and product of two algebraic numbers are algebraic.
Assume that the algebraic numbers 𝛼 and 𝛽 are roots of polynomials with rational
coefficients
𝑚 𝑛
𝑓 = ∏(𝑥 − 𝛼𝑖 ) and 𝑔 = ∏(𝑥 − 𝛽𝑗 ),
𝑖=1 𝑗=1
We can verify similarly that 𝛼𝛽 is algebraic: now we have to consider the polyno-
mial
𝑚 𝑛 𝑚
𝑥
∏ ∏(𝑥 − 𝛼𝑖 𝛽𝑗 ) = ∏ 𝛼𝑛𝑖 𝑔( ).
𝑖=1 𝑗=1 𝑖=1
𝛼𝑖
If 𝛼 ≠ 0, then we can assume that no 𝛼𝑖 is zero, and if 𝛼 = 0, then it is obvious that
𝛼𝛽 = 0 is algebraic. □
Proof. Since products and reciprocals of algebraic numbers are algebraic and 1 is al-
gebraic, the statement holds for integer exponents. The statement for fractional expo-
nents follows from the fact that roots of algebraic numbers with integer exponents are
algebraic (see Exercise 9.1.2f). □
This implies that if an integer 𝑛 is not a power of 10 with an integer exponent, then
log10 𝑛 is transcendental (see Exercise 9.3.7).
Theorem 9.3.5 is true also for complex exponents 𝛽, when the power generally has
infinitely many values. This makes possible a simple verification of the transcendence
of 𝑒𝜋 (see Exercise 9.3.4b), whereas we cannot answer the weaker question of whether
𝑒+𝜋, 𝑒−𝜋, 𝑒𝜋, 𝑒/𝜋, and 𝜋𝑒 are irrational, though most of them must be transcendental,
see Exercise 9.3.4a.
We saw in Theorem 9.3.4 (and in Exercise 9.1.2f) that the algebraic numbers are
closed under taking roots with integer exponents. Another formulation of this fact is
that if 𝛼 is an algebraic number, then the roots of the polynomial 𝑥𝑘 −𝛼 having algebraic
coefficients are algebraic. This holds not only for such polynomials of special form, but
for any polynomials with algebraic coefficients.
Theorem 9.3.6. If the coefficients of a polynomial 𝑓 ≠ 0 are algebraic numbers, then all
(complex) roots of 𝑓 are algebraic, as well. ♣
Proof. We shall use again the Fundamental Theorem 9.3.2 of Symmetric Polynomials.
We shall see another proof in Section 10.2.
Let 𝑓 = 𝛼 + 𝛽𝑥 + ⋯ + 𝜉𝑥𝑛 , where 𝛼, 𝛽, . . . , 𝜉 are algebraic numbers, and let 𝛼𝑖 , 𝛽𝑗 ,
. . . , 𝜉𝑘 denote the other roots of the minimal polynomials of 𝛼, 𝛽, . . . , 𝜉, (𝛼1 = 𝛼, etc.).
Consider the polynomial
ℎ = ∏ (𝛼𝑖 + 𝛽𝑗 𝑥 + ⋯ + 𝜉𝑘 𝑥𝑛 ).
𝑖,𝑗,. . .,𝑘
Since 𝑓 is a factor of ℎ, all roots of 𝑓 are roots also of ℎ. Thus it is sufficient to verify
that ℎ has rational coefficients.
Let 𝑐𝑟 be a coefficient of ℎ. Similar to the arguments in the proof of Theorem 9.3.1,
𝑐𝑟 is a symmetric polynomial 𝐹𝑟 with variables 𝛼𝑖 , where the coefficients of 𝐹𝑟 are ob-
tained from the numbers 𝛽𝑗 , . . . , 𝜉𝑘 by addition, subtraction, and multiplication. By
Theorem 9.3.2, 𝐹𝑟 is a polynomial in elementary symmetric polynomials of variables
𝛼𝑖 . Using Viète’s formulas connecting the roots and coefficients of the minimal poly-
nomial 𝑚𝛼 , we get that these elementary symmetric polynomials are rational numbers.
Thus we eliminated the numbers 𝛼𝑖 from 𝑐𝑟 . Repeating the same argument for 𝛽𝑗 , etc.,
we obtain that 𝑐𝑟 is a rational number. □
Summarizing the statements of Theorems 9.3.1 and 9.3.6, the algebraic numbers
form an algebraically closed field.
Exercises 9.3
1. (a) Verify that the sum of an algebraic number and a transcendental number is
transcendental.
(b) Give examples of two transcendental numbers whose sum is (a) transcenden-
tal (b) algebraic.
(c) Investigate similar questions for products instead of sums.
Exercises 9.3 295
Proof. For a proof by contradiction, we assume that for every 𝑐 > 0 there exists a
rational number 𝑟/𝑠 (with 𝑠 > 0) satisfying
|𝛼 − 𝑟 | < 𝑐 .
| 𝑠 | 𝑠𝑛
This means
𝑟
(9.4.2) lim 𝑠𝑛𝑖 (𝛼 − 𝑖 ) = 0
𝑖→∞ 𝑠𝑖
9.4. Approximation of Algebraic Numbers 297
for a suitable sequence of rational numbers 𝑟 𝑖 /𝑠𝑖 (where 𝑠𝑖 > 0). A direct consequence
is
𝑟 𝑟
(9.4.3) lim (𝛼 − 𝑖 ) = 0 or lim 𝑖 = 𝛼.
𝑖→∞ 𝑠𝑖 𝑖→∞ 𝑠𝑖
We consider a copy of 𝑚𝛼 with integer coefficients, and denote its complex roots
by 𝛼1 = 𝛼, 𝛼2 , . . . , 𝛼𝑛 . Then
𝑛
(9.4.4) 𝑚𝛼 = 𝑎0 + 𝑎1 𝑥 + ⋯ + 𝑎𝑛 𝑥𝑛 = 𝑎𝑛 ∏(𝑥 − 𝛼𝑗 ),
𝑗=1
The left-hand side of (9.4.5) is a rational number with denominator 𝑠𝑛𝑖 , and is not
0, as 𝑚𝛼 has no rational roots. Thus the absolute value of the left-hand side in (9.4.5)
is at least 1/𝑠𝑛𝑖 . Multiplying (9.4.5) by 𝑠𝑖𝑛 we get
𝑛
𝑟 𝑟
(9.4.6) 1 ≤ ||𝑠𝑖𝑛 𝑎𝑛 (𝛼 − 𝑖 ) ∏( 𝑖 − 𝛼𝑗 )||.
𝑠𝑖 𝑗=2 𝑠𝑖
Combining this with (9.4.2), we see that the right-hand side of (9.4.6) tends to 0 for
𝑖 → ∞, which is an obvious contradiction. □
is transcendental. The decimal digits at places 𝑘! are 1, all other digits are 0. ♣
Equation (9.4.7) defines a real number, as we see from the decimal representa-
tion form, it also follows from the convergence of the infinite series since the infinite
∞
geometric series ∑𝑘=1 10−𝑘 is its majorant.
298 9. Algebraic and Transcendental Numbers
Proof. We show that the partial sums of the infinite series (9.4.7) approximate 𝛼 very
well.
We write the 𝑚th partial sum as 𝑟𝑚 /𝑠𝑚 , where (𝑟𝑚 , 𝑠𝑚 ) = 1 and 𝑠𝑚 > 0. The
common denominator is 10𝑚! , and
𝑚
1 10𝐴 + 1
∑ = ,
𝑘=1
10 𝑘! 10𝑚!
This implies
(9.4.8) |𝛼 − 𝑟𝑚 | < 10 .
| 𝑠𝑚 | 9𝑠𝑚+1
𝑚
Assume now that 𝛼 is algebraic and its degree is 𝑛. Since 𝛼 is not a periodic decimal
fraction, 𝛼 is irrational, so 𝑛 ≥ 2. By Theorem 9.4.1 there is a constant 𝑐(𝛼) > 0 such
that (9.4.1) holds for every rational number 𝑟/𝑠. Then this is true also for 𝑟𝑚 /𝑠𝑚 , so
Theorem 9.4.3 (Thue’s Theorem). Let 𝛼 be a real algebraic number of degree 𝑛 ≥ 3 and
𝑐 an arbitrarily large constant. Then the inequality
|𝛼 − 𝑟| 𝑐
(9.4.10) | <
𝑠 | 𝑠𝑛
is satisfied only by finitely many rational numbers 𝑟/𝑠. ♣
Theorem 9.4.4 (Roth’s Theorem). Let 𝛼 be an algebraic number and 𝜅 > 0 arbitrary.
Then the inequality
(9.4.11) |𝛼 − 𝑟 | < 1
| 𝑠 | 𝑠2+𝜅
is satisfied only by finitely many rational numbers 𝑟/𝑠. ♣
Remarks: (1) Roth’s theorem is clearly much stronger than Thue’s, but Thue’s theo-
rem already has important consequences for Diophantine equations (see Theo-
rem 9.4.5).
9.4. Approximation of Algebraic Numbers 299
(2) By Roth’s theorem, the exceptional set 𝐻 in Theorem 8.1.8 consists purely of tran-
scendental numbers. But Theorem 8.1.8 also demonstrates that (besides all alge-
braic numbers) most transcendental numbers can be approximated very
badly.
Proof. Assume that infinitely many pairs of integers (𝑦 𝑖 , 𝑧𝑖 ) satisfy (9.4.12). Since for
a given 𝑦 there can be at most 𝑛 values of 𝑧,
(9.4.13) lim |𝑦 𝑖 | = ∞,
𝑖→∞
Substituting 𝑧𝑖 /𝑦 𝑖 , we get
𝑛
𝑧𝑖 𝑧
(9.4.17) 𝑓( ) = 𝑎𝑛 ∏( 𝑖 − 𝛼𝑗 ).
𝑦𝑖 𝑗=1
𝑦𝑖
By (9.4.15), the left-hand side of (9.4.17) tends to 0 for 𝑖 → ∞, thus, taking a suitable
subsequence of the indices 𝑖, the limit of some factor on the right-hand side has to be
0. Suppose it is the first factor on the right-hand side, and for convenience we use the
notation of the original sequence for the subsequence. So
𝑧 𝑧
(9.4.18) lim ( 𝑖 − 𝛼1 ) = 0 or lim 𝑖 = 𝛼1 .
𝑖→∞ 𝑦 𝑖 𝑖→∞ 𝑦 𝑖
300 9. Algebraic and Transcendental Numbers
Let 𝑑 denote the limit in (9.4.19). Due to the irreducibility of 𝑓, the numbers 𝛼𝑗 are
distinct, hence 𝑑 ≠ 0. Then
𝑛
(9.4.20) |𝑎 ∏( 𝑧𝑖 − 𝛼 )| > | 𝑑 |
| 𝑛 𝑦𝑖 𝑗 | |2|
𝑗=2
for 𝑖 large enough. Finally, from (9.4.14), (9.4.17), and (9.4.20) we obtain
| 𝑏 | | 𝑧𝑖 |
| 𝑛 | = |𝑓 ( )|
| 𝑦𝑖 | | 𝑦 𝑖 |
| 𝑛
𝑧 |
= ||𝑎𝑛 ∏ ( 𝑖 − 𝛼𝑗 )||
| 𝑗=1 𝑦 𝑖 |
𝑧 | | |
𝑛
| 𝑧
= |𝛼1 − 𝑖 | ⋅ ||𝑎𝑛 ∏ ( 𝑖 − 𝛼𝑗 )||
| 𝑦 𝑖 | | 𝑗=2 𝑦 𝑖 |
| 𝑧 | |𝑑|
> |𝛼1 − 𝑖 | ⋅ || || ,
| 𝑦𝑖 | 2
if 𝑖 is sufficiently large, so
| 𝑧 | | 2𝑏 1 |
(9.4.21) |𝛼1 − 𝑖 | < | ⋅ 𝑛 | .
| 𝑦 𝑖 | | 𝑑 𝑦𝑖 |
Since 𝛼1 is an algebraic number of degree 𝑛, (9.4.21) contradicts Theorem 9.4.3. □
If instead of Theorem 9.4.3 we rely on Theorem 9.4.4, then we can prove by similar
arguments that a much wider class of Diophantine equations cannot have infinitely
many solutions (see Exercise 9.4.3).
Exercises 9.4
(iii) 𝛼𝑘
(iv) 1/𝛼.
(b) Prove that there are infinitely many Liouville numbers, moreover, they have
the cardinality of the continuum.
2. Demonstrate that the statement of Theorem 9.4.5 remains valid for a polynomial
𝑓 of degree at least three with integer coefficients if we replace irreducibility over
𝐐 with one of the weaker conditions:
(a) 𝑓 has no divisor of degree 1 or 2 among polynomials with rational coefficients.
(b) If 𝑏 = 0, then 𝑓 has no rational roots, and if 𝑏 ≠ 0, then 𝑓 has no multiple
(complex) roots.
3. Let 𝑔(𝑦, 𝑧) be the polynomial in two variables defined in Theorem 9.4.5, and ℎ(𝑦, 𝑧)
be any polynomial in two variables of degree at most 𝑛−3 with integer coefficients.
Using Theorem 9.4.4, prove that the Diophantine equation 𝑔(𝑦, 𝑧) = ℎ(𝑦, 𝑧) cannot
have infinitely many solutions.
S 4. Show that if a polynomial is irreducible over 𝐐, then it cannot have multiple (com-
plex) roots.
9.5. Transcendence of 𝑒
First we show that 𝑒 (the base of natural logarithm) and 𝜋 are irrational numbers, then
we prove that 𝑒 is transcendental. We note that an improvement of the method can
yield the transcendence of 𝜋. An important consequence of this is that we cannot get
by Euclidean constructions a square having the same area as a given circle.
Theorem 9.5.1. 𝑒 is an irrational number. ♣
This means that the integer 𝑏! 𝑒 − 𝑛𝑏 lies between 0 and 1/𝑏, which is an obvious con-
tradiction. □
Proof. For a proof by contradiction, we assume 𝜋 = 𝑎/𝑏, where 𝑎 and 𝑏 are positive
integers.
Let 𝑛 be a large positive integer and 𝑓 be the polynomial of degree 2𝑛
𝑥𝑛 (1 − 𝑥)𝑛
𝑓(𝑥) = .
𝑛!
We consider the integral
1
𝐼 = 𝑎2𝑛+1 ∫ sin(𝜋𝑥)𝑓(𝑥) 𝑑𝑥.
0
Since 𝑓(𝑥) = 𝑓(1 − 𝑥), 𝑓(𝑚) (𝑥) = (−1)𝑚 𝑓(𝑚) (1 − 𝑥) for every 𝑚, thus 𝑓(𝑚) (0) =
(−1)𝑚 𝑓(𝑚) (1). Therefore it is sufficient to deal with 𝑥 = 0.
Another form of 𝑓 is
1
𝑓(𝑥) = (𝑐 𝑥𝑛 + 𝑐𝑛+1 𝑥𝑛+1 + ⋯ + 𝑐 2𝑛 𝑥2𝑛 )
𝑛! 𝑛
with integer coefficients 𝑐 𝑖 . Hence
0, if 0 ≤ 𝑚 < 𝑛 or 𝑚 > 2𝑛
𝑓(𝑚) (0) = { 𝑐𝑚 𝑚!
= 𝑐𝑚 (𝑛 + 1)(𝑛 + 2) . . . 𝑚, if 𝑛 ≤ 𝑚 ≤ 2𝑛
𝑛!
which proves (9.5.2).
9.5. Transcendence of 𝑒 303
and we have to show that it is an integer. Since 𝑓 is a polynomial of degree 2𝑛, 𝑓(2𝑛+1) (𝑥)
= 0, thus 𝐼2𝑛+1 = 0. Hence 𝐼2𝑛+1 , and so 𝐼 are integers, proving (A). □
Theorem 9.5.3. 𝑒 is a transcendental number. ♣
The sum in the second line of (9.5.9) is 0 by (9.5.4), thus (9.5.9) is equivalent to
𝑛 𝑠 𝑛
(9.5.10) ∑ 𝑎𝑠 𝑒𝑠 ∫ 𝑒−𝑥 𝑓(𝑥) 𝑑𝑥 = − ∑ 𝑎𝑠 [𝑓(𝑠) + 𝑓′ (𝑠) + ⋯ + 𝑓(𝑘) (𝑠)].
𝑠=0 0 𝑠=0
and all its derivatives assume integer values at 𝑗, so 𝑔(𝑚) (𝑗) is an integer for every inte-
ger 𝑚. Writing 𝑔(𝑥) as
𝑑𝑡 (𝑥 − 𝑗)𝑡 + 𝑑𝑡+1 (𝑥 − 𝑗)𝑡+1 + ⋯ + 𝑑𝑟 (𝑥 − 𝑗)𝑟
𝑔(𝑥) = ,
𝑡!
we obtain
0, if 0 ≤ 𝑚 < 𝑡 or 𝑚 > 𝑟
(9.5.12) 𝑔(𝑚) (𝑗) = { 𝑑𝑚 𝑚!
= 𝑑𝑚 (𝑡 + 1)(𝑡 + 2) . . . 𝑚, if 𝑡 ≤ 𝑚 ≤ 𝑟.
𝑡!
Since
(𝑥 − 1)𝑝 ℎ1 (𝑥)
𝑓(𝑥) = 𝑝 ⋅ ,
𝑝!
where the polynomial ℎ1 (𝑥) has integer coefficients, applying (9.5.12) for 𝑔(𝑥) = 𝑓(𝑥)/𝑝,
𝑡 = 𝑝, 𝑗 = 1, and ℎ(𝑥) = ℎ1 (𝑥), we obtain that 𝑓(𝑚) (1) is an integer divisible by 𝑝 for
every 𝑚. Similarly,
(9.5.13) 𝑝 ∣ 𝑓(𝑚) (𝑗), 𝑗 = 1, 2, . . . , 𝑛, 𝑚 = 0, 1, 2, . . . .
Finally, writing 𝑓(𝑥) as
𝑥𝑝−1 ℎ0 (𝑥)
𝑓(𝑥) = ,
(𝑝 − 1)!
where the polynomial ℎ0 (𝑥) has integer coefficients, and applying (9.5.12) for 𝑔(𝑥) =
𝑓(𝑥), 𝑡 = 𝑝 − 1, 𝑗 = 0 and ℎ(𝑥) = ℎ0 (𝑥), we obtain that also 𝑓(𝑚) (0) is an integer for
every 𝑚, and
(9.5.14) 𝑝 ∤ 𝑓(𝑝−1) (0) = (−1)𝑛𝑝 (𝑛! )𝑝 , but 𝑝 ∣ 𝑓(𝑚) (0), if 𝑚 ≠ 𝑝 − 1,
this holds because (9.5.12) implies 𝑓(𝑚) (0) = 0 for 𝑚 < 𝑝−1, and the product 𝑓(𝑚) (0) =
𝑑𝑚 𝑝 . . . 𝑚 contains a factor 𝑝 for 𝑚 ≥ 𝑝.
By (9.5.13) and (9.5.14), we see that every term of the sum on the right-hand side
of (9.5.10) is an integer, and each is divisible by 𝑝 except the term 𝑎0 𝑓(𝑝−1) (0). Thus
the right-hand side of (9.5.10) is an integer not divisible by 𝑝, so it cannot be 0.
Now we show that the left-hand side of (9.5.10) has absolute value less than 1 for
𝑝 large enough. If 0 < 𝑥 < 𝑛, then
| 𝑥𝑝−1 (𝑥 − 1)𝑝 . . . (𝑥 − 𝑛)𝑝 | 𝑛(𝑛+1)𝑝−1
|𝑒−𝑥 | < 1 and |𝑓(𝑥)| = | |< ,
| (𝑝 − 1)! | (𝑝 − 1)!
hence
𝑛 𝑠 𝑛 𝑝
𝑒𝑛 (∑𝑠=0 |𝑎𝑠 |)(𝑛𝑛+1 )
(9.5.15) | ∑ 𝑎 𝑒𝑠 ∫ 𝑒−𝑥 𝑓(𝑥) 𝑑𝑥| ≤ .
| 𝑠 | (𝑝 − 1)!
𝑠=0 0
The right-hand side of (9.5.15) is of the form 𝐴⋅𝐵 𝑝 /(𝑝−1)!, where 𝐴 and 𝐵 are constants.
This expression tends to 0 for 𝑝 → ∞, so it will be less than 1 if 𝑝 is large enough.
Thus we have verified that the left-hand side of (9.5.10) has absolute value less
than 1, whereas the right-hand side is a nonzero integer. Thus the assumption (9.5.4)
led to a contradiction, and so 𝑒 cannot be an algebraic number. □
306 9. Algebraic and Transcendental Numbers
Exercises 9.5
1. Let 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑛 < . . . be a sequence of positive integers where 𝑎𝑛 ∣ 𝑎𝑛+1 for
every 𝑛 and every positive integer 𝑘 is a divisor of at least one 𝑎𝑛 . Show that the
∞
infinite series ∑𝑛=1 1/𝑎𝑛 is convergent and its sum is an irrational number.
2. Let 𝑟 denote a rational number. Prove:
(a) sin 1 and cos 1 are irrational.
* (b) If 0 < 𝑟 ≤ 𝜋, then at least one of sin 𝑟 and cos 𝑟 is irrational.
(c) If 0 < 𝑟 < 𝜋/2, then tan 𝑟 is irrational.
(The angles are given in radians. Do not rely on the fact stated before without proof
that sin 𝑛 is transcendental if 𝑛 is an integer. For trigonometric functions of angles
being rational measured in degrees, see Exercise 9.6.11.)
* 3. Refining the proof of Theorem 9.5.2, show that 𝜋2 is irrational.
For convenience, minimal polynomials will have leading coefficient 1 in this sec-
tion.
Examples. E1 A rational number 𝑟 is an algebraic integer if and only if 𝑟 is an integer
(this was our starting point in creating the definition of algebraic integers).
3 3
E2 √ 2 is an algebraic integer, but √ 1/2 is not, since their minimal polynomials are
𝑥3 − 2 and 𝑥3 − (1/2).
E3 The Gaussian integers discussed in Section 7.4 are algebraic integers. Moreover,
considering the Gaussian rationals, those complex numbers 𝑎 + 𝑏𝑖 where 𝑎 and 𝑏
are rational, exactly the Gaussian integers are algebraic integers among them (see
Exercise 9.6.3 a,f). A similar statement is true also for Eulerian integers and the
9.6. Algebraic Integers 307
Remarks: (1) We can use Theorem 9.6.2 to show that a complex root of unity is an
algebraic integer without referring to the cyclotomic polynomials: An 𝑛th root of
unity is a root of 𝑥𝑛 − 1 having integer coefficients and leading coefficient 1.
(2) As we mentioned, we cannot use Theorem 9.6.2 to prove that a given number is
not an algebraic integer. If 𝛼 is a root of even infinitely many polynomials with
rational coefficients where not all coefficients are integers and the leading co-
efficients are 1, we have no information about whether or not 𝛼 is an algebraic
integer. For example, 1 is an algebraic integer, but it is a root of polynomials
𝑓𝑛 = (𝑥 − 1)(𝑥 − 1/2)𝑛 (𝑛 = 1, 2, . . . ), each having rational coefficients not all of
which are integers and leading coefficient is 1. We can construct similar examples
for any algebraic integer. To verify that an algebraic number is not an algebraic
integer, we need its minimal polynomial.
Now we discuss the connection of algebraic integers to operations. The next theo-
rem summarizes the analogs of Theorems 9.3.1, 9.3.4, and 9.3.6 for algebraic integers.
Theorem 9.6.3. (i) The algebraic integers form a subring of the complex numbers, so
sums, differences, and products of algebraic integers are algebraic integers, as well,
(though this is not true for quotients in general).
(ii) Powers of algebraic integers with rational exponents are algebraic integers.
(iii) If the coefficients of a polynomial 𝑓 are algebraic integers and its leading coefficient
is 1, then its roots are algebraic integers. ♣
308 9. Algebraic and Transcendental Numbers
Proof. We can adapt the proofs seen for algebraic numbers in Theorems 9.3.1, 9.3.4,
and 9.3.6: we just replace the phrases “algebraic number” with “algebraic integer”,
“rational number” with “integer”, and “with rational coefficients” with “with integer
coefficients and leading coefficient 1.” (Disregard, of course, the parts about recipro-
cals. In adapting the proof of Theorem 9.3.6 note that 𝜉 = 1, so we do not need the 𝜉𝑘 .)
We leave to the reader to check each step in detail. □
Exercises 9.6
1. Show that if 𝛼 is an algebraic integer, then so are 𝛼, 2Re(𝛼), 2Im(𝛼), and |𝛼|.
2. Which are algebraic integers?
5 7
(a) √ 5 + (√ 7/2)
(b) (1 + √3)/2
(c) (1 + 𝑖√3)/2
(d) cos 1∘ .
3. Let 𝛼 = 𝑎 + 𝑏𝑖 be a complex number, where 𝑎 and 𝑏 are real numbers. True or
false?
(a) If 𝑎 and 𝑏 are algebraic integers, then so is 𝛼.
(b) If 𝑎 is an algebraic integer, then so is 𝛼.
(c) If 𝑎 and |𝛼| are algebraic integers, then so is 𝛼.
(d) If 𝛼 is an algebraic integer, then so are 𝑎 and 𝑏.
(e) If 𝛼 and 𝑎 are algebraic integers, then so is 𝑏.
(f) If 𝛼 is an algebraic integer and 𝑎 and 𝑏 are rational numbers, then 𝑎 and 𝑏 are
integers.
(g) If 𝛼 + 3𝛽 and 5𝛼 + 7𝛽 are algebraic integers, then so are 𝛼 and 𝛽.
(h) If 𝛼 + 𝛽 and 𝛼𝛽 are algebraic integers, then so are 𝛼 and 𝛽.
4. Investigate the variant of Fermat’s Last Theorem for algebraic integers: For an ex-
ponent 𝑛 ≥ 3, is the equation 𝑥𝑛 + 𝑦𝑛 = 𝑧𝑛 solvable in non-zero algebraic integers?
S 5. Let 𝑓 be a polynomial with rational coefficients where not all coefficients are in-
tegers and the leading coefficient is 1, and consider its (complex) roots. True or
false?
(a) At least one root of 𝑓 is not an algebraic integer.
(b) No root of 𝑓 is an algebraic integer.
(c) If 𝑓 is irreducible over 𝐐, then no root of 𝑓 is an algebraic integer.
(d) If exactly one of the roots of 𝑓 is not an algebraic integer, then 𝑓 has a rational
root.
6. Prove that every algebraic number is the quotient of two algebraic integers, more-
over, we can require that either of them is an (ordinary) integer.
Exercises 9.6 309
7. How can we see from the minimal polynomial of an algebraic integer 𝛼 that also
1/𝛼 is an algebraic integer?
8. Verify.
(a) For any algebraic integer 𝛼 there exist infinitely many algebraic integers 𝛽
such that 𝛼/𝛽 is an algebraic integer.
(b) For an algebraic integer 𝛼 ≠ 0 there exist infinitely many algebraic integers 𝛽
where 1/𝛽 is not, but 𝛼/𝛽 is, an algebraic integer if and only if 1/𝛼 is not an
algebraic integer.
(c) For any algebraic integer 𝛼 ≠ 0 there exist only finitely many integers 𝑏 for
which 𝛼/𝑏 is an algebraic integer.
9. Is there a complex number of absolute value one that is not a root of unity, but still
is (a) an algebraic number ∗ (b) an algebraic integer?
* 10. (a) Verify that if 𝑛 ≥ 2, then the real algebraic integers of degree 𝑛 are everywhere
dense in the real number line.
(b) Are the algebraic integers of degree 𝑛 everywhere dense on the complex plane
if (b1) 𝑛 = 2 (b2) 𝑛 = 4?
11. (a) Let 𝑟 be a real number. Prove that at least one of 𝑟 and cos 𝑟∘ is irrational,
except if 𝑟 is an integer divisible by 60 or 90.
(b) Formulate and prove similar statements for sine and tangent.
Chapter 10
The simple algebraic extensions of the rational field are called algebraic number fields.
In this chapter we deal with such extensions and with the arithmetic properties of al-
gebraic integers in them. We discuss algebraic integers of quadratic fields in detail. As
special cases, we have already seen Gaussian and Eulerian integers in Chapter 7, and
applied them to handle the Diophantine equations 𝑥2 + 𝑦2 = 𝑛 and 𝑥3 + 𝑦3 = 𝑧3 . We
continue studying algebraic number fields in the next chapter with the help of ideals.
The general introductory section about extensions is valid for any (commutative)
field, but we shall apply these notions and facts for subfields of the complex numbers
only. In this chapter we shall often rely on some basic notions and theorems from linear
algebra, mostly related to the dimension of vector spaces.
The usual notation for this relation is 𝑀 ∣ 𝐿 or 𝑀/𝐿, but as this might be confused
with some other notion, we shall use the notation 𝑀 ∶ 𝐿.
If 𝑀 is an extension of 𝐿, then 𝑀 is also a vector space over 𝐿 under the naturally
arising operations. These vector space operations come from the field operations of 𝑀:
we add two vectors in 𝑀 as two elements of the field 𝑀, and multiply a vector in 𝑀 by
a scalar in 𝐿 so that we form the product of these two elements in the field 𝑀.
We have a special name and notation for the dimension of 𝑀 as a vector space over
the field 𝐿:
Definition 10.1.2. If 𝑀 is an extension of 𝐿, then the dimension of 𝑀 as a vector
space over 𝐿 is called the degree of the extension and is denoted by deg(𝑀 ∶ 𝐿). If this
dimension is finite, we say that the extension is finite (or has a finite degree). ♣
311
312 10. Algebraic Number Fields
An important fact is that the degree of a chain of extensions is the product of the
degrees of the links:
Theorem 10.1.3 (Tower Theorem). If deg(𝑁 ∶ 𝑀) < ∞ and deg(𝑀 ∶ 𝐿) < ∞ in the
chain of extensions 𝐿 ⊆ 𝑀 ⊆ 𝑁, then
(10.1.1) deg(𝑁 ∶ 𝐿) = deg(𝑁 ∶ 𝑀) ⋅ deg(𝑀 ∶ 𝐿). ♣
We note that the theorem can be extended to infinite degrees: If at least one of
deg(𝑁 ∶ 𝑀) and deg(𝑀 ∶ 𝐿) is infinite, then deg(𝑁 ∶ 𝐿) is infinite and (10.1.1) remains
valid in the more refined sense when the degrees mean the cardinalities of the bases.
Proof. We denote the elements of 𝐿, 𝑀, and 𝑁 with Greek letters, minuscules, and
capitals, respectively.
Let 𝑏1 , . . . , 𝑏𝑛 be a basis in the vector space 𝑀 ∶ 𝐿, and let 𝐶1 , . . . , 𝐶𝑘 be a basis in
𝑁 ∶ 𝑀. We are done if we verify that the 𝑘𝑛 vectors
(10.1.2) 𝑏𝑖 𝐶𝑗 , 𝑖 = 1, 2, . . . , 𝑛, 𝑗 = 1, 2, . . . , 𝑘
form a basis in 𝑁 ∶ 𝐿.
We show first that the vectors in (10.1.2) are linearly independent in 𝑁 ∶ 𝐿. Con-
sider a linear combination
𝑛 𝑘
(10.1.3) ∑ ∑ 𝜆𝑖𝑗 (𝑏𝑖 𝐶𝑗 ) = 0
𝑖=1 𝑗=1
with scalars 𝜆𝑖𝑗 ∈ 𝐿. Transforming the left-hand side of (10.1.3) using identities in the
field 𝑁, we obtain
𝑘 𝑛
(10.1.4) ∑ ( ∑ 𝜆𝑖𝑗 𝑏𝑖 )𝐶𝑗 = 0.
𝑗=1 𝑖=1
Now we apply the fact that 𝑏1 , . . . , 𝑏𝑛 are linearly independent in 𝑀 ∶ 𝐿. Then (10.1.5)
yields that every 𝜆𝑖𝑗 = 0. Thus we have proved that 𝑏𝑖 𝐶𝑗 are linearly independent in
𝑁 ∶ 𝐿.
Now we demonstrate that 𝑏𝑖 𝐶𝑗 span 𝑁 ∶ 𝐿. As 𝐶1 , . . . , 𝐶𝑘 span 𝑁 ∶ 𝑀, therefore
every 𝑈 ∈ 𝑁 has a representation
(10.1.6) 𝑈 = 𝑣 1 𝐶1 + ⋯ + 𝑣 𝑘 𝐶𝑘
with some 𝑣𝑗 ∈ 𝑀. Also, 𝑏1 , . . . , 𝑏𝑛 span 𝑀 ∶ 𝐿, thus every 𝑣𝑗 is a linear combination
of the vectors 𝑏𝑖 :
(10.1.7) 𝑣𝑗 = 𝛼1𝑗 𝑏1 + ⋯ + 𝛼𝑛𝑗 𝑏𝑛 , 𝛼𝑖𝑗 ∈ 𝐿, 1 ≤ 𝑖 ≤ 𝑛, 1 ≤ 𝑗 ≤ 𝑘.
10.1. Field Extensions 313
The minimal polynomial and degree of an algebraic element are defined analo-
gously to Definitions 9.2.1 and 9.2.4:
The minimal polynomial and the degree depend not only on 𝜗 but also on over
which field 𝐿 we consider 𝜗. For example the minimal polynomial of √2 over 𝐐 is
𝑥2 − 2, but over 𝐑 it is 𝑥 − √2. It can be shown that modifying 𝑀 does not influence
the minimal polynomial of 𝜗.
Accordingly, in the notation 𝑚𝜗,𝐿 and deg𝐿 𝜗 of the minimal polynomial and de-
gree we have to indicate also the field 𝐿 (in the case 𝐿 = 𝐐 of algebraic numbers we
keep the previous fieldless notations 𝑚𝜗 and deg 𝜗).
The analogues of Theorems 9.2.2 and 9.2.3 remain valid for minimal polynomials
of algebraic elements.
The proofs are exactly the same as for Theorems 9.2.2 and 9.2.3.
The following fact is useful information about the structure of certain extensions.
Proof. Let deg(𝑀 ∶ 𝐿) = 𝑛, and let 1 denote the common identity element of the
fields 𝐿 and 𝑀. Then for any 𝑣 ∈ 𝑀, the number of elements 1, 𝑣, 𝑣2 , . . . , 𝑣𝑛 is greater
314 10. Algebraic Number Fields
than the dimension of the vector space 𝑀 ∶ 𝐿, thus they are linearly dependent. This
means
𝛼0 + 𝛼 1 𝑣 + ⋯ + 𝛼 𝑛 𝑣 𝑛 = 0
for some scalars 𝛼0 , . . . , 𝛼𝑛 ∈ 𝐿 not all 0. So 𝑣 is a root of the non-zero polynomial
𝑓 = 𝛼0 + 𝛼1 𝑥 + ⋯ + 𝛼𝑛 𝑥𝑛 , i.e. 𝑣 is an algebraic element over 𝐿. □
Remarks: (1) We obtained also deg𝐿 𝑣 ≤ deg(𝑀 ∶ 𝐿) from the proof. We shall show a
stronger result, deg𝐿 𝑣 ∣ deg(𝑀 ∶ 𝐿), in Theorem 10.2.5.
(2) The converse of Theorem 10.1.7 is false. For example, let 𝐿 be the rational field and
𝑀 the field of all algebraic numbers (over 𝐐). Then every element in 𝑀 is algebraic
over 𝐿 (by definition), but deg(𝑀 ∶ 𝐿) = ∞, because deg(𝑀 ∶ 𝐿) = 𝑛 < ∞ would
imply by the previous remark that every algebraic number has degree at most 𝑛,
which contradicts the existence of algebraic numbers of arbitrarily large degrees
(Section 9.2, Example E4).
Exercises 10.1
This set is called a simple extension of the field 𝐐 with 𝜗, and is denoted by 𝐐(𝜗). If 𝜗
is an algebraic number, then we speak about a simple algebraic extension. ♣
Theorem 10.2.2. 𝐐(𝜗) is the smallest subfield in the complex field containing 𝜗 and the
rational field, so
(i) 𝐐(𝜗) is a subfield in 𝐂
(ii) 𝜗 ∈ 𝐐(𝜗), 𝐐 ⊆ 𝐐(𝜗)
(iii) if 𝐹 is a subfield in 𝐂 and 𝜗 ∈ 𝐹, 𝐐 ⊆ 𝐹, then 𝐐(𝜗) ⊆ 𝐹. ♣
Proof. (i) We have to show that sums, differences, products, and, if the divisor is not
0, quotients of elements in (10.2.1) are in (10.2.1). Clearly,
𝑔1 (𝜗) 𝑔2 (𝜗) 𝑔(𝜗)
+ = ,
ℎ1 (𝜗) ℎ2 (𝜗) ℎ(𝜗)
where 𝑔 = 𝑔1 ℎ2 + 𝑔2 ℎ1 and ℎ = ℎ1 ℎ2 are polynomials with rational coefficients and
ℎ(𝜗) = ℎ1 (𝜗)ℎ2 (𝜗) ≠ 0, since there are no zero divisors in the complex field. The
statements for differences, products, and quotients can be verified similarly.
(ii) If 𝑔 = 𝑥 and ℎ = 1, then 𝑔(𝜗)/ℎ(𝜗) = 𝜗, so 𝜗 ∈ 𝐐(𝜗). If 𝑟 is a rational number,
then choosing polynomials 𝑔 = 𝑟 and ℎ = 1, we have 𝑔(𝜗)/ℎ(𝜗) = 𝑟, thus 𝑟 ∈ 𝐐(𝜗).
(iii) If a subfield 𝐹 of the complex numbers contains 𝜗 and 𝐐, then the sums of
any products formed from 𝜗 and rational numbers and the quotients of such sums are
316 10. Algebraic Number Fields
We show that if 𝜗 is an algebraic number, then the elements of 𝐐(𝜗) have a simpler
representation.
As an example, consider the extension 𝐐(√2) of the rational field with √2. This
is the set 𝐹 of numbers 𝑎0 + 𝑎1 √2, where 𝑎𝑖 ∈ 𝐐, since 𝐹 is a field containing √2 and
the rational numbers, and it is obviously the smallest field having this property. This
means that compared to the form of elements in Definition 10.2.1, we need neither
division, nor powers of √2 with exponents greater than 1.
3 3
If instead of √2, we consider the extension 𝐐( √ 5) with √ 5, then we need only
3
powers of √ 5 with exponents at most 2, since the higher powers can be expressed by
these and with suitable rational numbers.
In the general case, we have:
Theorem 10.2.3. If 𝜗 is an algebraic number of degree 𝑛, then the elements of 𝐐(𝜗) can
be uniquely represented in the form
𝑎0 + 𝑎1 𝜗 + ⋯ + 𝑎𝑛−1 𝜗𝑛−1
with rational numbers 𝑎𝑖 . In other words, to every 𝛼 ∈ 𝐐(𝜗) there exists exactly one
polynomial 𝑓 ∈ 𝐐[𝑥] satisfying
𝛼 = 𝑓(𝜗) and deg 𝑓 ≤ 𝑛 − 1 or 𝑓 = 0. ♣
Proof. I. First we show that there is no need for denominators in (10.2.1), i.e. if 𝑔, ℎ ∈
𝐐[𝑥] and ℎ(𝜗) ≠ 0, then 𝑔(𝜗)/ℎ(𝜗) = 𝑡(𝜗) for some polynomial 𝑡 ∈ 𝐐[𝑥].
We perform the following equivalent transformations (relying on the condition
ℎ(𝜗) ≠ 0 and on Theorem 9.2.3(i)):
𝑔(𝜗)/ℎ(𝜗) = 𝑡(𝜗) ⟺ 𝑔(𝜗) = ℎ(𝜗)𝑡(𝜗) ⟺ (𝑔 − ℎ𝑡)(𝜗) = 0 ⟺
⟺ 𝑚𝜗 ∣ 𝑔 − ℎ𝑡 ⟺ 𝑔 = ℎ𝑡 + 𝑚𝜗 𝑠, where 𝑠 ∈ 𝐐[𝑥].
Thus we have to verify the existence of polynomials 𝑡 and 𝑠 with rational coefficients
satisfying
(10.2.3) 𝑔 = ℎ𝑡 + 𝑚𝜗 𝑠.
Equality (10.2.3) looks like a linear Diophantine equation, where 𝑡 and 𝑠 are the vari-
ables, with integers replaced here by polynomials with rational coefficients. The nec-
essary and sufficient condition for the solvability of a linear Diophantine equation was
discussed in Theorem 1.3.6, and in the proof we relied only on a consequence of the
Euclidean algorithm, i.e. we needed only the division algorithm. Since there is a divi-
sion algorithm for polynomials over a field, therefore the condition of solvability is the
same for Diophantine equations with polynomials. Thus we have to show (ℎ, 𝑚𝜗 ) ∣ 𝑔
for the solvability of (10.2.3).
The polynomial 𝑚𝜗 is irreducible over 𝐐, so (ℎ, 𝑚𝜗 ) = 1 or 𝑚𝜗 . But the latter
would imply ℎ(𝜗) = 0, so only (ℎ, 𝑚𝜗 ) = 1 is possible and (ℎ, 𝑚𝜗 ) ∣ 𝑔. This means, as
10.2. Simple Algebraic Extensions 317
we have seen before, that (10.2.3) is solvable and we obtain a polynomial 𝑡 satisfying
𝑡(𝜗) = 𝑔(𝜗)/ℎ(𝜗).
II. We have proved so far that every 𝛼 ∈ 𝐐(𝜗) can be written as 𝛼 = 𝑡(𝜗) with
a suitable polynomial 𝑡 ∈ 𝐐[𝑥]. Now we show that 𝛼 = 𝑓(𝜗) can be gotten with a
polynomial 𝑓 ∈ 𝐐[𝑥] where deg 𝑓 ≤ 𝑛 − 1 or 𝑓 = 0.
Apply the division algorithm to 𝑡 and 𝑚𝜗 . We claim that we can choose the re-
mainder as 𝑓. If
𝑡 = 𝑞𝑚𝜗 + 𝑓, where deg 𝑓 ≤ 𝑛 − 1 or 𝑓 = 0,
then
𝛼 = 𝑡(𝜗) = 𝑞(𝜗)𝑚𝜗 (𝜗) + 𝑓(𝜗) = 0 + 𝑓(𝜗) = 𝑓(𝜗).
III. We show that 𝑓 is unique. Assume that the polynomials 𝑓1 and 𝑓2 with rational
coefficients satisfy
𝑓1 (𝜗) = 𝑓2 (𝜗) and deg 𝑓𝑖 ≤ 𝑛 − 1 or 𝑓𝑖 = 0, 𝑖 = 1, 2.
Then the polynomial 𝑓3 = 𝑓1 − 𝑓2 has rational coefficients, 𝑓3 (𝜗) = 0, and deg 𝑓3 < 𝑛
or 𝑓3 = 0. Since deg 𝜗 = 𝑛, only 𝑓3 = 0 is possible. So 𝑓1 = 𝑓2 and the polynomial 𝑓 in
the theorem is unique. □
Theorem 10.2.3 expresses that the elements 1, 𝜗, . . . , 𝜗𝑛−1 form a basis in the vec-
tor space 𝐐(𝜗) over 𝐐. Thus the dimension of this vector space, i.e. the degree of the
extension 𝐐(𝜗) ∶ 𝐐 is equal to the degree of the algebraic number 𝜗. We restate this
important fact as a theorem:
Theorem 10.2.4. If 𝜗 is an algebraic number, then deg(𝐐(𝜗) ∶ 𝐐) = deg 𝜗. ♣
(10.2.4) 𝐐 ⊆ 𝐐(𝛼) ⊆ 𝑀.
The condition deg(𝑀 ∶ 𝐐) = 𝑘 < ∞ implies that both links in the chain of extensions
(10.2.4) are of finite degree, so we can apply the Tower Theorem 10.1.3. This yields
deg(𝐐(𝛼) ∶ 𝐐) ∣ 𝑘. By Theorem 10.1.7, 𝛼 is an algebraic number, so by Theorem 10.2.4,
we have deg(𝐐(𝛼) ∶ 𝐐) = deg 𝛼. Thus deg 𝛼 ∣ 𝑘. □
Now we give new proofs of Theorems 9.3.1 and 9.3.6. For convenience, we restate
them with new numbers.
Theorem 10.2.6. The algebraic numbers form a subfield in the complex field. ♣
Proof. Let 𝛼 and 𝛽 be two algebraic numbers. We have to show that 𝛼 + 𝛽, 𝛼 − 𝛽, 𝛼𝛽,
and 𝛼/𝛽 (𝛽 ≠ 0) are algebraic.
We extend 𝐐 with 𝛼, and then extend the resulting field 𝐾 = 𝐐(𝛼) with 𝛽. This
field 𝑁 = 𝐾(𝛽) contains both 𝛼 and 𝛽, thus it must contain also their sum, difference,
product, and quotient.
Consider the chain of extensions 𝐐 ⊆ 𝐾 ⊆ 𝑁 where 𝐾 = 𝐐(𝛼) and 𝑁 = 𝐾(𝛽).
Here
deg(𝐾 ∶ 𝐐) = deg 𝛼 and deg(𝑁 ∶ 𝐾) = deg𝐾 𝛽 ≤ deg 𝛽,
so deg(𝑁 ∶ 𝐾) < ∞ by the tower theorem. By Theorem 10.1.7, all elements in 𝑁, thus
𝛼 + 𝛽, 𝛼 − 𝛽, 𝛼𝛽, and 𝛼/𝛽 are algebraic numbers. □
𝐐 ⊆ 𝐾0 ⊆ 𝐾1 ⊆ ⋯ ⊆ 𝐾𝑛 ⊆ 𝐾𝑛+1 .
Every link is an extension with an algebraic number over the previous field, thus every
link has a finite degree. Thus by the tower theorem, the extension 𝐾𝑛+1 ∶ 𝐐 is finite,
so every element in 𝐾𝑛+1 , including 𝛾, is algebraic over 𝐐. □
Exercises 10.2 319
Exercises 10.2
1. Prove that for a complex number 𝜗 and rational number 𝑟 ≠ 0, the extension 𝐐(𝜗)
is equal to
(a) 𝐐(𝑟 + 𝜗)
(b) 𝐐(𝑟𝜗)
(c) 𝐐(1/𝜗) (if 𝜗 ≠ 0).
2. Let 𝛼 ∈ 𝐐(𝜗). Verify.
(a) 𝐐(𝛼) ⊆ 𝐐(𝜗).
(b) If 𝜗 is algebraic, then 𝐐(𝛼) = 𝐐(𝜗) if and only if deg 𝛼 = deg 𝜗.
* (c) If 𝜗 is transcendental, 𝐐(𝛼) = 𝐐(𝜗) if and only if
𝑎0 + 𝑎 1 𝜗
𝛼= , where 𝑎𝑖 , 𝑏𝑖 ∈ 𝐐 and 𝛼 ∉ 𝐐.
𝑏0 + 𝑏1 𝜗
3. True or false?
(a) 𝐐(𝜗) = 𝐐(𝜗).
(b) If |𝜗|2 is a rational number, then 𝐐(𝜗) = 𝐐(𝜗).
(c) If 𝐐(𝜗) = 𝐐(𝜗), then |𝜗|2 is a rational number.
(d) If 𝐐(𝜗) ⊆ 𝐐(𝜗), then 𝐐(𝜗) = 𝐐(𝜗).
(e) 𝐐(𝜗) = 𝐐(𝜗 + 𝜗2 ).
3 3
4. Represent the following numbers in the form 𝑎0 + 𝑎1 √ 2 + 𝑎2 √ 4 with rational
numbers 𝑎0 , 𝑎1 , and 𝑎2 :
3 3
(a) ( √ 4 + 3√ 2)2
1
(b)
3
√2
3
1+√ 2
(c) .
3
1 + 2√ 2
5. Determine the degree of the algebraic numbers
S (a) √7 + 3𝑖
5
(b) 𝑖 √ 3
7 7
(c) √ 3+√ 1/3
4
(d) √ 2 + √2.
6. Write in a simpler form:
3 3
(a) 𝐐( √ 54) ⧵ 𝐐( √ 16)
6 9
(b) 𝐐( √ 7) ∩ 𝐐( √ 7)
4 4
(c) 𝐐( √ 5) ∩ 𝐐(𝑖 √ 5).
320 10. Algebraic Number Fields
Theorem 10.3.1. All extensions of 𝐐 of degree 2 are of the form 𝐐(√𝑡), where 𝑡 is a
positive or negative squarefree integer and 𝑡 ≠ 1. Different values of 𝑡 induce different
extensions. ♣
Remark: We speak about real or imaginary quadratic extensions according to 𝑡 > 0 or
𝑡 < 0. In the imaginary case, we can take either of the two values of √𝑡 since these are
negatives of each other and 𝐐(𝜗) = 𝐐(−𝜗) for every 𝜗; in the sequel we let √𝑡 be the
value of the square root in the upper half plane: √𝑡 = 𝑖√|𝑡|.
We assume first that 𝑐 is odd. Then the first divisibility in (10.3.5) implies 𝑐 ∣ 𝑎, and
thus we get 𝑐2 ∣ 𝑎2 −(𝑎2 −𝑡𝑏2 ) = 𝑡𝑏2 . Since 𝑡 is squarefree, we infer by the Fundamental
Theorem of Arithmetic that 𝑐2 ∣ 𝑏2 , hence 𝑐 ∣ 𝑏. Therefore 𝑐 ∣ (𝑎, 𝑏, 𝑐) = 1, so 𝑐 = 1.
Conversely, it is obvious that 𝑐 = 1 satisfies (10.3.5) for any integers 𝑡, 𝑎, and 𝑏.
Now let 𝑐 be even, 𝑐 = 2𝑘. Then the first divisibility in (10.3.5) implies 𝑘 ∣ 𝑎,
so 𝑘2 ∣ 𝑎2 − (𝑎2 − 𝑡𝑏2 ) = 𝑡𝑏2 . Similar to the odd case, now 𝑘 ∣ 𝑏, and therefore
𝑘 ∣ (𝑎, 𝑏, 𝑐) = 1, so 𝑘 = 1, and 𝑐 = 2. So the second divisibility in (10.3.5) means
(*) 𝑎2 − 𝑡𝑏2 ≡ 0 (mod 4), where at least one of 𝑎 and 𝑏 is odd due to (𝑎, 𝑏, 𝑐) = 1,
10.3. Quadratic Fields 323
and 𝑡 ≢ 0 (mod 4) as 𝑡 is squarefree. From these conditions and using that modulo 4
a square is 0 or 1 depending on its parity, we see that the congruence (*) holds if and
only if both 𝑎 and 𝑏 are odd and 𝑡 ≡ 1 (mod 4).
Thus we have verified that conditions (10.3.5) and (10.3.6a))–(10.3.6b) are equiva-
lent, and have completed the proof of the theorem. □
We denote the set of algebraic integers in 𝐐(√𝑡) by 𝐼(√𝑡). Thus Theorem 10.3.2
states
(10.3.7a) 𝐼(√𝑡) = { 𝑐 + 𝑑√𝑡 ∣ 𝑐, 𝑑 ∈ 𝐙 } , if 𝑡 ≢ 1 (mod 4)
and
1 + √𝑡
(10.3.7b) 𝐼(√𝑡) = { 𝑐 + 𝑑 ∣ 𝑐, 𝑑 ∈ 𝐙 } , if 𝑡 ≡ 1 (mod 4).
2
As 𝐼(√𝑡) is the intersection of the ring of all algebraic integers and the field 𝐐(√𝑡),
𝐼(√𝑡) is a subring in the complex field. It is commutative, free of zero divisors, and
has an identity element, but is not a field since it contains only the integers among
the rational numbers. Thus—similarly to the Gaussian and Eulerian integers —it is
worthwhile to investigate some basic number theoretical questions in 𝐼(√𝑡).
The notions of divisibility, units, greatest common divisor, irreducible and prime
elements can be defined in 𝐼(√𝑡) exactly as we did for Gaussian integers (see Defini-
tions 7.4.4, 7.4.6, 7.4.9, 7.4.10, and 7.4.11, in which the adjective “Gaussian” should be
omitted).
The norm plays an important role in the number theory of 𝐼(√𝑡):
Theorem 10.3.4. (A) The following conditions are equivalent for an element 𝜀 ∈ 𝐼(√𝑡):
(i) 𝜀 is a unit
(ii) 𝜀 ∣ 1
(iii) |𝑁(𝜀)| = 1.
(C) If 𝑡 < 0 and 𝑡 ≠ −1, −3, then 𝐼(√𝑡) has just two units, namely ±1. ♣
324 10. Algebraic Number Fields
Proof. (A): (i)⟹(ii): If 𝜀 divides every element in 𝐼(√𝑡), then in particular it must
divide 1.
(ii)⟹(i): If 𝜀 ∣ 1, so 𝜀𝛽 = 1 with some 𝛽 ∈ 𝐼(√𝑡), then 𝜀(𝛽𝛼) = 𝛼, so 𝜀 ∣ 𝛼 for any
𝛼 ∈ 𝐸(√𝑡), and 𝜀 is a unit.
(ii)⟹(iii): If 𝜀 ∣ 1, then 𝑁(𝜀) ∣ 𝑁(1) = 1, so 𝑁(𝜀) = ±1.
(iii)⟹(ii): If 𝜀 = 𝑎 + 𝑏√𝑡 and
𝑁(𝜀) = (𝑎 + 𝑏√𝑡)(𝑎 − 𝑏√𝑡) = ±1,
then 𝑎 − 𝑏√𝑡 ∈ 𝐼(√𝑡) implies 𝜀 ∣ 1.
(B) If 𝑡 > 0, then Pell’s equation 𝑥2 − 𝑡𝑦2 = 1 has infinitely many solutions in
integers 𝑥, 𝑦 (Theorem 7.8.1), so the corresponding elements 𝛼 = 𝑥 + 𝑦√𝑡 ∈ 𝐼(√𝑡)
have 𝑁(𝛼) = 1, and thus are units.
(C) If 𝑡 < 0, 𝑡 ≢ 1 (mod 4), then the elements of 𝐼(√𝑡) are of the form 𝛼 = 𝑎 + 𝑏√𝑡,
where 𝑎, 𝑏 are integers. For 𝑡 ≠ −1,
𝑁(𝛼) = 𝑎2 + |𝑡|𝑏2 = 1
can hold only with 𝑏 = 0 and 𝑎 = ±1, so 𝛼 = ±1.
If 𝑡 < 0, 𝑡 ≡ 1 (mod 4), then 𝛼 can have the form (𝑢/2) + (𝑣/2)√𝑡, too, where 𝑢 and
𝑣 are odd integers. Then we have to check
𝑢2 + |𝑡|𝑣2
(10.3.8) 𝑁(𝛼) = =1 or 𝑢2 + |𝑡|𝑣2 = 4.
4
If |𝑡| > 3 and 𝑢, 𝑣 are odd, then
𝑢2 + |𝑡|𝑣2 > 1 + 3 ⋅ 1 = 4,
thus (10.3.8) cannot hold. □
Remarks: (1) For many values of 𝑡, condition (A)(iii) in Theorem 10.3.4 means 𝑁(𝜀)
= 1, as 𝑁(𝜀) = −1 cannot occur. This is the case for every 𝑡 < 0, because the norm
of every element is non-negative. But we have this situation e.g. for all positive
𝑡 ≡ 3 (mod 4), since then every element in 𝐼(√𝑡) has the form 𝛼 = 𝑎 + 𝑏√𝑡 with
integer 𝑎, 𝑏, and 𝑁(𝛼) = 𝑎2 − 𝑡𝑏2 ≢ −1 (mod 4).
(2) Related to part (B) in Theorem 10.3.4, we can characterize the units of 𝐼(√𝑡) for
𝑡 > 0 as follows. If 𝑡 ≢ 1 (mod 4), then all units are the elements 𝑥 +𝑦√𝑡 obtained
from the integer solutions of equations 𝑥2 − 𝑡𝑦2 = ±1. If 𝑡 ≡ 1 (mod 4), then
besides these (𝑥 + 𝑦√𝑡)/2 are units, where 𝑥, 𝑦 are odd solutions of 𝑥2 − 𝑡𝑦2 = ±4.
We can describe these solutions relying on Theorem 7.8.2 (see also the hint to
Exercise 7.8.3).
Now we turn to the problem of unique prime factorization, i.e. what can be said
concerning the Fundamental Theorem of Arithmetic? The statement about decom-
posability is valid in all 𝐼(√𝑡): Every element in 𝐼(√𝑡) not 0 or a unit can be written as a
product of irreducible elements of 𝐼(√𝑡). This can be verified using the absolute value
of the norm as we saw in the proof of Theorem 7.4.13 for Gaussian integers.
10.3. Quadratic Fields 325
Theorem 10.3.5. The Fundamental Theorem of Arithmetic is true in 𝐼(√2), but is false
in 𝐼(√−5) and in 𝐼(√10). ♣
We can extend the notion of norm to the elements of 𝐐(√2): for 𝑎, 𝑏 ∈ 𝐐 let
𝑁(𝑎 + 𝑏√2) = (𝑎 + 𝑏√2)(𝑎 − 𝑏√2) = 𝑎2 − 2𝑏2 .
Then clearly, 𝑁(𝜉)𝑁(𝜓) = 𝑁(𝜉𝜓) for any 𝜉, 𝜓 ∈ 𝐐(√2).
Thus, dividing (10.3.9) by 𝛽, we get an equivalent condition:
𝛼 𝜚 𝜚
(10.3.10) =𝛾+ and ||𝑁( )|| < 1.
𝛽 𝛽 𝛽
We can formulate (10.3.10) as follows: Given 𝛼/𝛽, we need a 𝛾 ∈ 𝐼(√2) satisfying
(10.3.11) |𝑁( 𝛼 − 𝛾)| < 1.
| 𝛽 |
6 = 2 ⋅ 3 = (1 + √−5)(1 − √−5).
We have to check that 2, 3, 1 + √−5, and 1 − √−5 are irreducible in 𝐼(√−5), and that
3, for example, is not an associate of 1 ± √−5.
The latter statement is obvious, since the only units in 𝐼(√−5) are ±1 by part (C)
of Theorem 10.3.4.
We verify the irreducibility of 2, we can proceed similarly for the other three num-
bers.
For a proof by contradiction, assume 2 = 𝛼𝛽, where neither 𝛼 nor 𝛽 is a unit in
𝐼(√−5). Then 4 = 𝑁(2) = 𝑁(𝛼)𝑁(𝛽), and 𝑁(𝛼) ≠ 1, 𝑁(𝛽) ≠ 1, so 𝑁(𝛼) = 𝑁(𝛽) = 2 (as
the norm is non-negative in 𝐼(√−5)).
Let 𝛼 = 𝑎 + 𝑏√−5. Now 𝑎 and 𝑏 are integers as −5 ≢ 1 (mod 4). Then clearly
𝑁(𝛼) = 𝑎2 + 5𝑏2 = 2 is impossible. This contradiction justifies that 2 is irreducible in
𝐼(√−5).
𝐼(√10): Note that −9 has two essentially distinct decompositions into the product
of irreducible elements:
1 ± √10 ±1 ±1
= ± √10 ∉ 𝐼(√10).
±3 3 3
We have to show that all factors in (10.3.12) are irreducible. If ±3 or 1 ± √10 were
not irreducible, then similar to the argument seen at 𝐼(√−5), there would be an 𝛼 =
𝑎 + 𝑏√10 with integers 𝑎 and 𝑏 having 𝑁(𝛼) = 𝑎2 − 10𝑏2 = ±3. This is impossible,
however, as 𝑎2 ≢ ±3 (mod 5). □
R1 It is not known whether the Fundamental Theorem holds in infinitely many 𝐼(√𝑡)
with 𝑡 > 0.
R2 All values 𝑡 > 0 are known where we can perform the division algorithm in 𝐼(√𝑡)
using the absolute value of the norm (see part (iii) in Theorem 10.3.6 below). Thus
the Fundamental Theorem is true in 𝐼(√𝑡) for these values of 𝑡. There exist, how-
ever, other positive integers 𝑡, too, e.g. 𝑡 = 14, 22, 23, or 31, when the Fundamental
Theorem holds.
10.3. Quadratic Fields 327
We have had the complete answer for imaginary quadratic fields since 1968:
I1 The Fundamental Theorem is true in exactly nine 𝐼(√𝑡) with 𝑡 < 0, those listed in
part (i) of Theorem 10.3.6. Two of the nine cases are the Gaussian and Eulerian
integers discussed earlier.
I2 The division algorithm using the norm works in exactly five cases out of the nine
(see part (ii) of Theorem 10.3.6). It can be shown for the other four cases, that
there is no division algorithm with any conceivable measure instead of the norm.
We return to the precise meaning and proof of this statement in Section 11.3.
We summarize the results indicated in I1, I2, and R2 without proof in
Theorem 10.3.6. (i) If 𝑡 < 0, then the Fundamental Theorem of Arithmetic holds in
𝐼(√𝑡) if and only if
𝑡 = −1, −2, −3, −7, −11, −19, −43, −67, −163.
(ii) We can perform the division algorithm in 𝐼(√𝑡) with respect to the norm for exactly
the first five of the nine values 𝑡 < 0 listed in (i).
(iii) If 𝑡 > 0, we can perform the division algorithm in 𝐼(√𝑡) with respect to the absolute
value of the norm if and only if
𝑡 = 2, 3, 5, 6, 7, 11, 13, 17, 19, 21, 29, 33, 37, 41, 57, 73. ♣
We ask for the proof of statement (ii) of Theorem 10.3.6 in Exercise 10.3.4.
Finally, we present two theorems about irreducible and prime elements in 𝐼(√𝑡).
The first result is valid in any 𝐼(√𝑡) independent of the validity of the Fundamental
Theorem. Accordingly, we must be careful about the distinction between irreducible
and prime, since they are not equivalent due to the lack of the Fundamental Theorem.
The second result is about quadratic fields where the Fundamental Theorem is true,
so here the two types of elements coincide.
Theorem 10.3.7. Let 𝑝 > 2 be a prime number and (𝑝, 𝑡) = 1. Then 𝑝 is a prime in
𝑡
𝐼(√𝑡) if and only if ( 𝑝 ) = −1. ♣
𝑡
Proof. First we demonstrate that if ( 𝑝 ) = −1, then 𝑝 is a prime in 𝐼(√𝑡).
We assume 𝑝 ∣ 𝛼𝛽, and want to show that at least one of 𝑝 ∣ 𝛼 and 𝑝 ∣ 𝛽 must hold.
Divisibility 𝑝 ∣ 𝛼𝛽 implies
𝑝2 = 𝑁(𝑝) ∣ 𝑁(𝛼)𝑁(𝛽).
Since 𝑝 is a prime in 𝐙, 𝑝 divides at least one of the factors in the product 𝑁(𝛼)𝑁(𝛽),
𝑡
say 𝑝 ∣ 𝑁(𝛼). Using ( 𝑝 ) = −1, we shall infer 𝑝 ∣ 𝛼.
Let 𝛼 = 𝑎 + 𝑏√𝑡. We treat first the case 𝑡 ≢ 1 (mod 4). Then 𝑎 and 𝑏 are integers.
Thus 𝑝 ∣ 𝑁(𝛼) = 𝑎2 − 𝑡𝑏2 can be written as
(10.3.13) 𝑎2 ≡ 𝑡𝑏2 (mod 𝑝) .
328 10. Algebraic Number Fields
(ii) Every prime 𝜋 in 𝐼(√𝑡) has exactly one multiple 𝑝 among the positive prime numbers
(of 𝐙).
(iii) Every positive prime number 𝑝 is either a prime in 𝐼(√𝑡), or is a product of exactly
two primes having norm ±𝑝 and being conjugates in the following sense, (cf. Defini-
tion 10.4.1): Let 𝜋1 = 𝑎 + 𝑏√𝑡, then 𝜋2 = ±(𝑎 − 𝑏√𝑡).
𝑡
(iv) If 𝑝 > 2 is a prime number, (𝑝, 𝑡) = 1, and ( 𝑝 ) = −1, then 𝑝 is a prime in 𝐼(√𝑡).
𝑡
(v) If 𝑝 > 2 is a prime, (𝑝, 𝑡) = 1, and ( 𝑝 ) = 1, then 𝑝 is the product of two non-associate
primes in 𝐼(√𝑡).
(vi) If 𝑡 is odd, then the behavior of 2 is the following:
(a) If 𝑡 ≡ 3 (mod 4), then 2 is the product of two associate primes (i.e. 2 is an
associate of a prime square);
(b) If 𝑡 ≡ 1 (mod 8), then 2 is the product of two non-associate primes;
(c) If 𝑡 ≡ 5 (mod 8), then 2 is a prime.
(vii) If a prime number 𝑝 divides 𝑡, then 𝑝 is a product of two associate primes (i.e. 𝑝 is
an associate of a prime square).
(viii) The associates of primes listed in parts (iv)–(vii) provide all primes in 𝐼(√𝑡). ♣
10.3. Quadratic Fields 329
Proof. (i) A prime is necessarily irreducible—see the proof of Theorem 1.4.3. The
converse follows from the Fundamental Theorem of Arithmetic, see Exercise 1.5.8 (or
Theorem 11.3.1).
(ii) and (iii) can be verified in exactly the same way that Theorem 7.4.14 was proved.
(iv) follows from Theorem 10.3.7.
For (v)–(vii), we first determine whether or not 𝑝 and 2, are primes in 𝐼(√𝑡).
For (v), this follows from Theorem 10.3.7.
(vi) If 𝑡 ≡ 3 (mod 4), then
2 ∣ 𝑡2 − 𝑡 = (𝑡 + √𝑡)(𝑡 − √𝑡), but 2 ∤ 𝑡 ± √𝑡,
so 2 is not a prime.
If 𝑡 ≡ 1 (mod 8), then
1−𝑡 1 + √𝑡 1 − √𝑡 1 ± √𝑡
2∣ = ⋅ , but 2∤ ,
4 2 2 2
so 2 is not a prime.
If 𝑡 ≡ 5 (mod 8) and 2 were not a prime, then 2 would have a divisor
𝑢 + 𝑣√𝑡
𝛼= ∈ 𝐼(√𝑡),
2
where 𝑢 and 𝑣 are integers of the same parity, satisfying
𝑁(𝛼) = ±2, so 𝑢2 − 𝑡𝑣2 = ±8.
However, 𝑢2 − 𝑡𝑣2 cannot be of the form 16𝑘 + 8, a contradiction.
(vii) Since
𝑝 ∣ 𝑡 = √𝑡 ⋅ √𝑡, but 𝑝 ∤ √𝑡
(this holds also for 𝑝 = 2), 𝑝 cannot be a prime.
The previous observations imply that in cases (v), (vi)(a), (vi)(b), and (vii), 𝑝 and
2, are not primes. So by (iii), 𝑝 and 2, can be written as a product of two primes
𝜋1 = 𝑎 + 𝑏√𝑡 and 𝜋2 = ±(𝑎 − 𝑏√𝑡).
Here 𝑎 and 𝑏 are integers if 𝑡 ≢ 1 (mod 4), and 𝑎 = 𝑢/2, 𝑏 = 𝑣/2 for some integers 𝑢
and 𝑣 of the same parity if 𝑡 ≡ 1 (mod 4).
Since |𝑁(𝜋1 )| = |𝑁(𝜋2 )| = 𝑝 (or 2), |𝑁(𝜋1 /𝜋2 )| = 1. Thus 𝜋1 and 𝜋2 are associates
if and only if
𝜋1 𝑎 + 𝑏√𝑡 𝑎2 + 𝑡𝑏2 2𝑎𝑏
(10.3.14) = = + √𝑡 ∈ 𝐼(√𝑡).
𝜋2 ±(𝑎 − 𝑏√𝑡) 𝑝 𝑝
Exercises 10.3
10.4. Norm
In this section, we extend the notion of norm to every extension 𝐐(𝜗), where 𝜗 is an
algebraic number. First, for every element 𝛼 ∈ 𝐐(𝜗), we have to introduce the notions
of conjugates of 𝛼 over 𝐐 and of relative conjugates of 𝛼 with respect to 𝐐(𝜗).
Definition 10.4.1. The complex roots of a minimal polynomial of an algebraic number
𝛼 are called the conjugates of 𝛼 over 𝐐. ♣
Thus a relative conjugate 𝑓(𝜗 (𝑗) ) is an element in 𝐐(𝜗 (𝑗) ). The extension 𝐐(𝜗 (𝑗) )
does not coincide with 𝐐(𝜗) in general, so the relative conjugates of 𝛼 are mostly not
contained in 𝐐(𝜗).
In Definition 10.4.2 the relative conjugates 𝑓(𝜗 (𝑗) ) seem to depend not only on 𝛼
and the extension 𝐐(𝜗), but also on the choice of 𝜗, since a given extension can be
generated by many different elements. Theorem 10.4.3, however, will guarantee that
this is not the case: If 𝐐(𝜗) = 𝐐(𝜓), then the relative conjugates of 𝛼 will be the same
whether they were constructed using 𝜗 or 𝜓.
Examples. E5 All relative conjugates of a rational number 𝑟 are itself for any ex-
tension 𝐐(𝜗). The constant polynomial 𝑓 = 𝑟 meets the requirements 𝑓(𝜗) = 𝑟,
deg 𝑓 < deg 𝜗 or 𝑓 = 0, thus 𝑓(𝜗 (𝑗) ) = 𝑟 for every 𝑗.
E6 Let 𝜗 = 𝑖, then its conjugates are 𝜗 (1) = 𝑖 and 𝜗 (2) = −𝑖. Thus the relative
conjugates of an element 𝛼 = 𝑎 + 𝑏𝑖 (𝑎, 𝑏 ∈ 𝐐) of 𝐐(𝑖) are
𝑎 + 𝑏𝑖 = 𝛼 and 𝑎 + 𝑏(−𝑖) = 𝑎 − 𝑏𝑖 = 𝛼.
This means that if 𝛼 is not a rational number, then its relative conjugates are the
same as its conjugates over 𝐐. We have the same result also for 𝐐(√−3), 𝐐(√2),
and for quadratic fields in general.
4
E7 If 𝜗 = √ 3, then its conjugates are ±𝜗 and ±𝑖𝜗. The polynomial representing
𝛼 = √3 ∈ 𝐐(𝜗) according to Theorem 10.2.3 is 𝑓 = 𝑥2 , since √3 = (𝜗)2 . Thus
the relative conjugates of √3 are
The examples indicate that the relative conjugates of 𝛼 ∈ 𝐐(𝜗) are the same as the
conjugates of 𝛼 over 𝐐, each counted with a suitable multiplicity:
Theorem 10.4.3. Let 𝛼 be an element of degree 𝑘 in the extension 𝐐(𝜗) of degree 𝑛. Then
we get the relative conjugates of 𝛼 by taking each conjugate of 𝛼 over 𝐐 with multiplicity
𝑛/𝑘. ♣
The theorem implies that the relative conjugates remain the same if we replace 𝜗
by another generating element of 𝐐(𝜗), so the relative conjugates depend only on 𝛼
and the extension itself.
Theorem 10.4.3 gives a new proof for deg 𝛼 being a divisor of the extension 𝐐(𝜗)
(cf. Theorem 10.2.5).
Proof. Let
𝑛 𝑘
𝑚𝜗 = ∏(𝑥 − 𝜗 (𝑗) ), where 𝜗 (1) = 𝜗, and 𝑚𝛼 = ∏(𝑥 − 𝛼(𝑠) ), where 𝛼(1) = 𝛼,
𝑗=1 𝑠=1
where 𝛼(1) = 𝛼, 𝛼(2) , . . . , 𝛼(𝑘) are the conjugates of 𝛼 over 𝐐 and 𝑎0 is the constant
term in the minimal polynomial of 𝛼 with leading coefficient 1.
(ii) 𝛼, 𝛽 ∈ 𝐐(𝜗) ⟹ 𝑁(𝛼𝛽) = 𝑁(𝛼)𝑁(𝛽).
(iii) If 𝛼 is an algebraic integer, then 𝑁(𝛼) is an ordinary integer. ♣
Proof. The first equality in (i) follows immediately from Theorem 10.4.3, and the sec-
ond equality is a direct consequence of Viète’s formula about the product of roots of
the polynomial 𝑚𝛼 . This form of 𝑁(𝛼) in (i) implies (iii).
To verify (ii), let
𝛼 = 𝑓1 (𝜗), 𝛽 = 𝑓2 (𝜗), and 𝛼𝛽 = 𝑓3 (𝜗).
Then 𝜗 is a root of ℎ = 𝑓3 − 𝑓1 𝑓2 ∈ 𝐐[𝑥], so 𝑚𝜗 ∣ ℎ. This implies that all other roots of
𝑚𝜗 , i.e. all conjugates 𝜗 (𝑗) of 𝜗 are roots of ℎ too, so
0 = ℎ(𝜗 (𝑗) ) = 𝑓3 (𝜗 (𝑗) ) − 𝑓1 (𝜗 (𝑗) )𝑓2 (𝜗 (𝑗) ), 𝑗 = 1, 2, . . . , 𝑛.
Multiplying the equalities 𝑓3 (𝜗 (𝑗) ) = 𝑓1 (𝜗 (𝑗) )𝑓2 (𝜗 (𝑗) ), we obtain
𝑛 𝑛 𝑛
𝑁(𝛼𝛽) = ∏ 𝑓3 (𝜗 (𝑗) ) = (∏ 𝑓1 (𝜗 (𝑗) ))(∏ 𝑓2 (𝜗 (𝑗) )) = 𝑁(𝛼)𝑁(𝛽). □
𝑗=1 𝑗=1 𝑗=1
Exercises 10.4
2. Let 𝜗 (1) = 𝜗, 𝜗 (2) , . . . , 𝜗 (𝑛) denote the conjugates of an algebraic number 𝜗 over 𝐐.
Verify.
(a) If deg 𝜗 = 2, then 𝐐(𝜗 (1) ) = 𝐐(𝜗 (2) ).
(b) If 𝜗 is a non-real complex number and deg 𝜗 is odd, then 𝐐(𝜗 (𝑗) ) ≠ 𝐐(𝜗 (𝑘) )
for some 𝑗 and 𝑘.
(c) If 𝜗 is a non-real complex number and deg 𝜗 = 3, then 𝑗 ≠ 𝑘 implies 𝐐(𝜗 (𝑗) ) ∩
𝐐(𝜗 (𝑘) ) = 𝐐.
4
3. Find the relative conjugates and norm of the elements in 𝐐( √ 2)
4
(a) 1 + √ 2
(b) 1 + √2
4 4
(c) 1 + √ 2 + √2 + √ 8.
4. Prove that an element 𝜀 is a unit in the ring 𝐼(𝜗) of all algebraic integers of 𝐐(𝜗) if
and only if 𝑁(𝜀) = ±1.
Remark: There are infinitely many units in 𝐼(𝜗) except when 𝐐(𝜗) is an imaginary
quadratic field or 𝐐(𝜗) = 𝐐.
5. Verify.
(a) There exists a Gaussian rational which is not a Gaussian integer, but its norm
is an integer.
(b) There exists an element 𝛼 in every quadratic field 𝐐(𝜗) that is not an algebraic
integer, but 𝑁(𝛼) is an integer.
Our goal is to prove that every extension 𝐐(𝜗) possesses an integral basis.
Let 𝜗 be an algebraic number of degree 𝑛. We consider the extension 𝐐(𝜗). To
make a clear distinction, bases of the vector space 𝐐(𝜗) over 𝐐 will be called v-bases,
and the integral bases among them will be referred to as i-bases.
We examine first how to determine whether 𝑛 elements of 𝐐(𝜗) form a v-basis. Let
𝛼1 , . . . , 𝛼𝑛 ∈ 𝐐(𝜗),
(10.5.3a) 𝛼𝑖 = 𝑓𝑖 (𝜗), where 𝑓𝑖 ∈ 𝐐[𝑥], deg 𝑓𝑖 ≤ 𝑛 − 1 or 𝑓𝑖 = 0, 𝑖 = 1, . . . , 𝑛
so
(10.5.3b)
𝛼𝑖 = 𝑎0𝑖 + 𝑎1𝑖 𝜗 + ⋯ + 𝑎𝑛−1,𝑖 𝜗𝑛−1 , 𝑎𝑘𝑖 ∈ 𝐐, 0 ≤ 𝑘 ≤ 𝑛 − 1, 1 ≤ 𝑖 ≤ 𝑛.
Consider the linear transformation 𝒜 of the vector space 𝐐(𝜗) that maps the elements
1, 𝜗, . . . , 𝜗𝑛−1 of the v-basis to the vectors 𝛼1 , . . . , 𝛼𝑛 , in this order. Then the matrix of
the transformation 𝒜 in the v-basis 1, 𝜗, . . . , 𝜗𝑛−1 is
𝑎 𝑎02 ... 𝑎0𝑛
⎛ 01 ⎞
𝑎 𝑎12 ... 𝑎1𝑛
(10.5.4) 𝐴 = ⎜ 11 ⎟
⎜ ⋮ ⋮ ⋱ ⋮ ⎟
⎝𝑎𝑛−1,1 𝑎𝑛−1,2 ... 𝑎𝑛−1,𝑛 ⎠
where 𝑎𝑘𝑖 are the rational numbers in (10.5.3b).
We know from elementary linear algebra that the vectors 𝛼1 , . . . , 𝛼𝑛 form a v-basis
if and only if matrix 𝒜 has an inverse, or det 𝐴 ≠ 0.
Observe that the numbers 𝛼1 , . . . , 𝛼𝑛 can be expressed as
𝛼 1
⎛ 1⎞ ⎛ ⎞
𝛼2 𝜗
(10.5.3c) ⎜ ⎟ = 𝐴𝑇 ⎜ ⎟
⎜⋮⎟ ⎜ ⋮ ⎟
⎝𝛼𝑛 ⎠ ⎝𝜗𝑛−1 ⎠
where 𝐴𝑇 denotes the transpose of the matrix 𝐴.
To verify the existence of an i-basis, we shall use the discriminant which is the
square of the determinant of a matrix closely related to 𝐴.
Let 𝑉 be the Vandermonde matrix generated by the conjugates of 𝜗 over 𝐐:
1 1 1 ... 1
⎛ ⎞
𝜗
⎜ (1) 𝜗 (2) 𝜗 (3) ... 𝜗 (𝑛) ⎟
(10.5.5) 𝑉 = 𝑉(𝜗 (1) , 𝜗 (2) , . . . , 𝜗 (𝑛) ) = ⎜ 𝜗(1)
2 2
𝜗(2) 2
𝜗(3) ... 2 ⎟
𝜗(𝑛)
⎜ ⎟
⎜ ⋮ ⋮ ⋮ ⋱ ⋮ ⎟
𝑛−1 𝑛−1 𝑛−1 𝑛−1
⎝𝜗(1) 𝜗(2) 𝜗(3) ... 𝜗(𝑛) ⎠
10.5. Integral Basis 337
and
(10.5.6) 𝐴̃ = 𝐴𝑇 𝑉.
Then the 𝑗th element in row 𝑖 of the matrix 𝐴̃ is the inner product of row 𝑖 in 𝐴 and
column 𝑗 in 𝑉, or
𝑛−1
(10.5.7) 𝑎0𝑖 + 𝑎1𝑖 𝜗 (𝑗) + ⋯ + 𝑎𝑛−1,𝑖 𝜗(𝑗) .
By (10.5.3a)–(10.5.3b), the sum in (10.5.7) is just the 𝑗th relative conjugate 𝑓𝑖 (𝜗 (𝑗) ) of
𝛼𝑖 .
The discriminant Δ(𝛼1 , . . . , 𝛼𝑛 ) of the numbers 𝛼1 , . . . , 𝛼𝑛 is the square of the de-
terminant of matrix 𝐴:̃
Definition 10.5.2. Consider the extension 𝐐(𝜗), where deg 𝜗 = 𝑛, and let 𝜗 (1) = 𝜗,
𝜗 (2) , . . . , 𝜗 (𝑛) denote the conjugates of 𝜗. The discriminant Δ(𝛼1 , . . . , 𝛼𝑛 ) of the numbers
𝛼1 , . . . , 𝛼𝑛 is the square of the determinant of the matrix 𝐴,̃ i.e. using (10.5.3a)–(10.5.7),
2
|𝑓1 (𝜗 (1) ) 𝑓1 (𝜗 (2) ) . . . 𝑓1 (𝜗 (𝑛) )|
|𝑓 (𝜗 ) 𝑓2 (𝜗 (2) ) . . . 𝑓2 (𝜗 (𝑛) )||
Δ(𝛼1 , . . . , 𝛼𝑛 ) = (det(𝐴𝑇 𝑉))2 = || 2 (1) . ♣
| ⋮ ⋮ ⋱ ⋮ ||
|𝑓𝑛 (𝜗 (1) ) 𝑓𝑛 (𝜗 (2) ) . . . 𝑓𝑛 (𝜗 (𝑛) )|
Proof. (i) The discriminant is a symmetric polynomial in the variables 𝜗 (𝑗) . Inter-
changing two 𝜗 (𝑗) means interchanging two columns in the determinant, which gives
a sign change for the determinant, so its square remains the same. This implies in the
usual way (as in the proofs of Theorems 9.3.1, 9.3.6, or 10.4.3) that the discriminant is
a rational number.
If every 𝛼𝑖 is an algebraic integer, then their conjugates, and so their relative conju-
gates, are algebraic integers. The discriminant is computed from the relative conjugates
using addition, subtraction, and multiplication. As the algebraic integers form a ring,
the discriminant is an algebraic integer, too. Hence the discriminant is both a rational
number and an algebraic integer, so it is necessarily an integer.
(ii) By the rule of multiplication of determinants,
Δ(𝛼1 , . . . , 𝛼𝑛 ) = (det 𝐴)2 (det 𝑉)2 .
338 10. Algebraic Number Fields
Since the generating elements 𝜗 (𝑗) of the Vandermonde determinant 𝑉 are all distinct,
det 𝑉 ≠ 0. Thus
Δ(𝛼1 , . . . , 𝛼𝑛 ) ≠ 0 ⟺ det 𝐴 ≠ 0.
And as we showed earlier, 𝛼1 , . . . , 𝛼𝑛 is a v-basis if and only if det 𝐴 ≠ 0.
(iii) By (10.5.3c),
𝛼 1 𝛽 1
⎛ 1⎞ ⎛ ⎞ ⎛ 1⎞ ⎛ ⎞
𝛼2 𝜗 𝛽2 𝜗
⎜ ⎟ = 𝐴𝑇 ⎜ ⎟ and ⎜ ⎟ = 𝐵𝑇 ⎜ ⎟
⎜⋮⎟ ⎜ ⋮ ⎟ ⎜⋮⎟ ⎜ ⋮ ⎟
⎝𝛼𝑛 ⎠ ⎝𝜗𝑛−1 ⎠ ⎝𝛽𝑛 ⎠ ⎝𝜗𝑛−1 .⎠
Thus
𝛽 𝛼 1
⎛ 1⎞ ⎛ 1⎞ ⎛ ⎞
𝛽2 𝛼2 𝜗
⎜ ⎟ = 𝐶 ⎜ ⎟ = 𝐶𝐴𝑇 ⎜ ⎟
⎜⋮⎟ ⎜⋮⎟ ⎜ ⋮ ⎟
⎝𝛽𝑛 ⎠ ⎝𝛼𝑛 ⎠ ⎝𝜗𝑛−1 ,⎠
so 𝐵𝑇 = 𝐶𝐴𝑇 by the uniqueness of matrix 𝐵 belonging to the numbers 𝛽 𝑖 . This implies
Δ(𝛽1 , . . . , 𝛽𝑛 ) = (det(𝐵 𝑇 𝑉))2 = (det(𝐶𝐴𝑇 𝑉))2
= (det 𝐶)2 (det(𝐴𝑇 𝑉))2 = (det 𝐶)2 Δ(𝛼1 , . . . , 𝛼𝑛 ). □
Proof. We establish first a few properties of i-bases that will help to find an i-basis
among the v-bases.
If 𝜔1 , . . . , 𝜔𝑛 is an i-basis, then every 𝜔𝑖 is an algebraic integer, since every coeffi-
cient is an integer in the representation
𝜔𝑖 = 0 ⋅ 𝜔1 + ⋯ + 1 ⋅ 𝜔𝑖 + ⋯ + 0 ⋅ 𝜔𝑛 .
If 𝜔1 , . . . , 𝜔𝑛 is an i-basis and 𝛽1 , . . . , 𝛽𝑛 is a v-basis of algebraic integers, then every 𝛽 𝑖
is a linear combination with integer coefficients of the basis vectors 𝜔𝑗 , so
𝛽 𝜔
⎛ 1⎞ ⎛ 1⎞
𝛽2 𝜔2
⎜ ⎟ = 𝐶⎜ ⎟
⎜⋮⎟ ⎜⋮⎟
⎝𝛽𝑛 ⎠ ⎝𝜔𝑛 ⎠
with a suitable invertible matrix 𝐶 with integer elements. Then Theorem 10.5.3(iii)
implies
Δ(𝛽1 , . . . , 𝛽𝑛 ) = Δ(𝜔1 , . . . , 𝜔𝑛 )(det 𝐶)2 .
Since det 𝐶 is a non-zero integer, (det 𝐶)2 ≥ 1, so
|Δ(𝛽1 , . . . , 𝛽𝑛 )| ≥ |Δ(𝜔1 , . . . , 𝜔𝑛 )|.
This says that the absolute value of the discriminant of an i-basis is less than or equal
to the absolute value of the discriminant of any v-basis consisting of algebraic integers.
Accordingly, a v-basis can be an i-basis only if its elements are algebraic integers
and the absolute value of its discriminant is minimal among all v-bases of this type.
10.5. Integral Basis 339
We verify that there exists a v-basis with this property, and it is also an i-basis.
We show first that there are v-bases consisting of algebraic integers. Let 𝛾1 , . . . , 𝛾𝑛
be an arbitrary v-basis. By Exercise 9.6.6, every 𝛾 𝑖 can be written as 𝛾 𝑖 = 𝛼𝑖 /𝑐 𝑖 , where
𝛼𝑖 is an algebraic integer and 𝑐 𝑖 ≠ 0 is an ordinary integer. Then clearly 𝛼1 , . . . , 𝛼𝑛 is a
v-basis.
Consider all v-bases of algebraic integers. The discriminant of each is a non-zero
integer, by Theorem 10.5.3(i)–(ii). Choose a v-basis 𝜔1 , . . . , 𝜔𝑛 that has a discriminant
of minimal absolute value. We prove that 𝜔1 , . . . , 𝜔𝑛 is an i-basis. Thus, we have to
verify that 𝛼 ∈ 𝐐(𝜗) is an algebraic integer if and only if every 𝑟𝑗 is an integer in repre-
sentation (10.5.2)
𝛼 = 𝑟1 𝜔1 + 𝑟2 𝜔2 + ⋯ + 𝑟𝑛 𝜔𝑛 , 𝑟𝑗 ∈ 𝐐, 𝑗 = 1, 2, . . . , 𝑛.
Assume first that 𝑟1 , . . . , 𝑟𝑛 are integers. Since every 𝜔𝑖 is an algebraic integer and the
𝑛
algebraic integers form a ring, 𝛼 = ∑𝑗=1 𝑟𝑗 𝜔𝑗 is an algebraic integer.
Conversely, let 𝛼 ∈ 𝐐(𝜗) be an algebraic integer. Assume that, say, 𝑟1 is not an
integer in representation (10.5.2)
𝛼 = 𝑟1 𝜔1 + 𝑟2 𝜔2 + ⋯ + 𝑟𝑛 𝜔𝑛 .
Let
𝛽1 = 𝛼 − ⌊𝑟1 ⌋𝜔1 = {𝑟1 }𝜔1 + 𝑟2 𝜔2 + ⋯ + 𝑟𝑛 𝜔𝑛 and 𝛽𝑗 = 𝜔𝑗 for 2 ≤ 𝑗 ≤ 𝑛.
Then the numbers 𝛽1 , . . . , 𝛽𝑛 are algebraic integers, and
𝛽 𝜔
⎛ 1⎞ ⎛ 1⎞
𝛽2 𝜔2
⎜ ⎟ = 𝐶⎜ ⎟
⎜⋮⎟ ⎜⋮⎟
⎝𝛽𝑛 ⎠ ⎝𝜔𝑛 ⎠
where
{𝑟 } 𝑟2 𝑟3 ... 𝑟𝑛
⎛ 1 ⎞
0 1 0 ... 0
⎜ ⎟
𝐶=⎜ 0 0 1 ... 0⎟
⎜ ⋮ ⋮ ⋮ ⋱ ⋮⎟
⎝ 0 0 0 ... 1⎠
By Theorem 10.5.3(iii),
Δ(𝛽1 , . . . , 𝛽𝑛 ) = Δ(𝜔1 , . . . , 𝜔𝑛 )(det 𝐶)2 = Δ(𝜔1 , . . . , 𝜔𝑛 ){𝑟1 }2 ,
and 0 < {𝑟1 } < 1 implies
0 < |Δ(𝛽1 , . . . , 𝛽𝑛 )| < |Δ(𝜔1 , . . . , 𝜔𝑛 )|,
which contradicts the minimality of |Δ(𝜔1 , . . . , 𝜔𝑛 )|. □
Remarks: (1) We see from the proof that the absolute values of the discriminants are
the same for any two integral bases in 𝐐(𝜗). It can be shown that the discrimi-
nants themselves are equal, see Exercise 10.5.2b. This common value is called the
discriminant of the extension 𝐐(𝜗).
(2) The proof above shows only the existence of an integral basis, and is not suitable
to construct one explicitly.
340 10. Algebraic Number Fields
(3) We can exhibit an integral basis in a quadratic field by Theorem 10.3.2, but for
extensions of higher degree, it is hard to find an integral basis. It can be shown
that if 𝜗 is a 𝑝th primitive complex root of unity for a prime 𝑝 > 2, then 1, 𝜗, . . . ,
𝜗𝑝−2 form an integral basis in 𝐐(𝜗).
Exercises 10.5
Ideals
Ideals play a central role in ring theory, but we restrict ourselves to the number theo-
retic relations. We establish a necessary and sufficient condition for the validity of the
Fundamental Theorem of Arithmetic, and show that it always holds in principal ideal
domains and Euclidean rings. Then we build number theory for ideals, and prove that
unique prime factorization is true among the ideals of algebraic integers in an algebraic
number field. As an application, we illustrate through an example that ideals can help
to handle Diophantine equations even if the Fundamental Theorem of Arithmetic is
false for the algebraic integers of the corresponding extension.
341
342 11. Ideals
E2 The set of polynomials having a given complex number 𝛼 among their roots in
the ring of polynomials with rational coefficients.
E3 The set of polynomials having an even constant term in the ring of polynomials
with integer coefficients.
E4 In any ring, the ring itself and the one-element subset containing the zero alone.
These are called trivial ideals. A field has just the two trivial ideals (see Exer-
cise 11.1.3).
Thus the principal ideal (𝑎) consists of the multiples of 𝑎 formed by elements of 𝑅.
The phrases “generated by 𝑎” and “ideal” in the definition are justified by
Theorem 11.1.3. The principal ideal (𝑎) is the smallest ideal containing 𝑎, i.e.
(i) (𝑎) is an ideal in 𝑅
(ii) 𝑎 ∈ (𝑎)
(iii) if 𝐼 is an ideal in 𝑅 and 𝑎 ∈ 𝐼, then (𝑎) ⊆ 𝐼. ♣
Proof. (i) We verify that the non-empty set { 𝑟𝑎 ∣ 𝑟 ∈ 𝑅 } satisfies Definition 11.1.1.
To avoid ambiguity in the formulas, we use square brackets for the usual meaning of
parentheses, and keep round parentheses for denoting ideals.
𝑟1 𝑎 + 𝑟2 𝑎 = [𝑟1 + 𝑟2 ]𝑎, −[𝑟𝑎] = [−𝑟]𝑎, and [𝑟1 𝑎]𝑟2 = 𝑟2 [𝑟1 𝑎] = [𝑟2 𝑟1 ]𝑎.
(ii) 𝑎 = 1𝑎 ∈ { 𝑟𝑎 ∣ 𝑟 ∈ 𝑅 }.
(iii) If ideal 𝐼 contains 𝑎, then by (B) in Definition 11.1.1, it must also contain 𝑟𝑎
for every 𝑟 ∈ 𝑅, so (𝑎) ⊆ 𝐼. □
We used the identity element and the commutative law in verifying (ii) and (i), and
we did not need the lack of zero divisors.
Examples. The two trivial ideals (in Example E4) are principal ideals, generated by
the identity and zero: 𝑅 = (1) and {0} = (0).
The ideals in examples E1 and E2 are principal ideals: The multiples of 𝑚 in 𝐙
constitute the principal ideal (𝑚); the polynomials satisfying 𝑓(𝛼) = 0 in 𝐐[𝑥] consti-
tute (0) or (𝑚𝛼 ) according to 𝛼 being transcendental or algebraic (𝑚𝛼 is the minimal
polynomial of 𝛼).
11.1. Ideals and Factor Rings 343
The ideal in example E3, however, is not a principal ideal. Let 𝐼 denote this set
of polynomials with integer coefficients having an even constant term, and assume
𝐼 = (𝑓) for some 𝑓. Then 𝑓 is a divisor of every element in 𝐼, including 2. Therefore
only 𝑓 = ±1 or ±2 are possible. However, (±1) contains all polynomials with integer
coefficients, whereas (±2) is the polynomials where every coefficient is even. Hence
these principal ideals are not equal to 𝐼. This contradiction shows that 𝐼 is not a prin-
cipal ideal.
The proof of Theorem 11.1.5 is similar to that seen in Theorem 11.1.3, so we leave
the details to the reader.
Examples. Clearly, every principal ideal is a finitely generated ideal, generated by a
single element.
Also, the ideal 𝐼 in Example E3 is finitely generated: 𝐼 = (2, 𝑥).
In the ring 𝑈 of all algebraic integers,
𝑘
𝐾 = { 𝜉 √2 ∣ 𝜉 ∈ 𝑈, 𝑘 = 2, 3, 4, . . . }
is an ideal, but cannot be generated by finitely many elements (see Exercise 11.1.4).
If 𝜗 is an algebraic number, then every ideal in 𝐼(𝜗) is finitely generated (see Ex-
ercise 11.1.10). (As earlier, 𝐼(𝜗) denotes the ring of algebraic integers in the extension
𝐐(𝜗).)
Finally we present the construction of factor rings with respect to ideals (or, for
short, modulo ideals). This is a generalization of the ring of modulo 𝑚 residue classes
(see Section 2.8).
We saw in Example E1 after Definition 11.1.1 that the multiples of 𝑚 form an ideal 𝐼
in the ring 𝐙. The residue class modulo 𝑚 containing the integer 𝑎 (the one represented
by 𝑎) has the form
(11.1.1) 𝑎 + 𝐼 = { 𝑎 + 𝑖 ∣ 𝑖 ∈ 𝐼 }.
344 11. Ideals
We defined addition and multiplication for residue classes using their representatives.
Using (11.1.1), this means
(11.1.2) [𝑎 + 𝐼] + [𝑏 + 𝐼] = [𝑎 + 𝑏] + 𝐼 and [𝑎 + 𝐼][𝑏 + 𝐼] = 𝑎𝑏 + 𝐼.
We had to verify that (11.1.2) defines operations for the classes, i.e. the resulting class
is unique, it does not depend on the choice of the representatives taken from the two
classes. Analyzing the proof, it turns out that uniqueness is guaranteed by 𝐼 being an
ideal. Thus we arrive at the generalization:
Theorem 11.1.6. Let 𝐼 be an ideal in a ring 𝑅. Then the residue classes (11.1.1) modulo 𝐼
are disjoint subsets in 𝑅 and their union equals 𝑅. Further, they form a ring with respect
to the addition and multiplication defined by (11.1.2). This ring is called the factor ring
of 𝑅 modulo 𝐼, and is denoted by 𝑅/𝐼. ♣
Accordingly, the ring of residue classes modulo 𝑚 is the factor ring 𝐙/(𝑚) of the
integers modulo the principal ideal (𝑚).
We leave the proof of Theorem 11.1.6 to the reader. One has to use the ideal prop-
erties of 𝐼 to show that the classes (11.1.1) cover 𝑅, any two of them either coincide or
are distinct, and the operations in 𝑅/𝐼 are uniquely defined. The commutative, asso-
ciative, and distributive laws in 𝑅/𝐼 follow from the ones in 𝑅, the zero element of 𝑅/𝐼
is the residue class 0 + 𝐼, that is the ideal 𝐼 itself, and the negative of a residue class 𝑎 + 𝐼
is the residue class [−𝑎] + 𝐼.
Example. We analyze the factor ring 𝐐[𝑥]/(𝑥2 − 2) of the ring of polynomials with
rational coefficients modulo the principal ideal of polynomials divisible by 𝑥2 − 2.
We can apply similar considerations to those we used when we constructed the
ring of residue classes modulo 𝑚 at the integers, which is in fact the factor ring 𝐙/(𝑚).
Polynomials fall into the same residue class modulo the principal ideal (𝑥2 − 2) if they
give the same remainder on division by 𝑥2 − 2. Thus every residue class can be charac-
terized uniquely by a remainder, i.e. by a polynomial 𝑎 + 𝑏𝑥 (with rational coefficients)
of degree at most one (including the 0 polynomial representing the ideal itself).
Computations in the factor ring are actually done with these remainders, so to
multiply two residue classes we multiply the corresponding remainders and take the
remainder of the product on division by 𝑥2 −2 (just as the product of 7 and 6 modulo 15
is 12). Thus we perform addition as
[𝑎 + 𝑏𝑥] + [𝑐 + 𝑑𝑥] = [𝑎 + 𝑐] + [𝑏 + 𝑑]𝑥,
and the rule for multiplication is
𝑎 + 𝑏𝑥][𝑐 + 𝑑𝑥] = 𝑎𝑐 + [𝑎𝑑 + 𝑏𝑐]𝑥 + 𝑏𝑑𝑥2 =
= 𝑎𝑐 + [𝑎𝑑 + 𝑏𝑐]𝑥 + 2𝑏𝑑 + 𝑏𝑑[𝑥2 − 2] = [𝑎𝑐 + 2𝑏𝑑] + [𝑎𝑑 + 𝑏𝑐]𝑥,
Similar to this example, we can characterize 𝐐(𝜗) as a factor ring for any algebraic
number 𝜗, the field 𝐐(𝜗) is isomorphic to 𝐐[𝑥]/(𝑚𝜗 ). See Exercise 11.1.9.
Exercises 11.1 345
Exercises 11.1
Which of the sets form an ideal in the ring of Gaussian integers? Which of them
are principal ideals? Find a generating element for each of them.
2. Consider the sets of polynomials 𝑓 with integer coefficients having the properties:
(a) 𝑓(1/2) = 0
(b) 𝑓(√2) = 𝑓(√3) = 0
(c) 𝑓(√2) = 𝑓(√3)
(d) 𝑓(3) is even
(e) the leading coefficient of 𝑓 is even or 𝑓 = 0.
Which of the sets are ideals in the ring 𝐙[𝑥], and what is the minimal number of
generators?
3. Prove that a non-zero, commutative ring with identity element and no zero divisors
is a field if and only if it has only trivial ideals.
(a) How many elements are there in the factor rings modulo the ideals below, and
which of them are fields:
(a1): (2)
346 11. Ideals
(a2): (3)
(a3): (2 + 𝑖)?
* (b) Answer these questions in general for an arbitrary principal ideal in 𝐺.
(a) Show that the ideal (2, 1 + √−5) is not a principal ideal in 𝐼(√−5).
(b) How many elements are there in the factor rings modulo the ideals below, and
which of them are fields:
(b1): (2, 1 + √−5)
(b2): (1 + √−5)
(b3): (11)?
* 9. (a) Let 𝜗 be an algebraic number. Prove that the field 𝐐(𝜗) is isomorphic to the
factor ring 𝐐[𝑥]/(𝑚𝜗 ).
(b) Let 𝐿 be an arbitrary commutative field and 𝑓 an irreducible polynomial over
𝐿. Construct a field 𝑀 satisfying the properties:
(i) 𝑀 has a subfield 𝐿∗ isomorphic to 𝐿
(ii) If we obtain the coefficients of the polynomial 𝑓∗ ∈ 𝐿∗ [𝑥] from the co-
efficients of 𝑓 using the isomorphism 𝐿 → 𝐿∗ , then 𝑓∗ has a root 𝜗 ∈ 𝑀
(iii) 𝑀 = 𝐿∗ (𝜗).
Remark: This construction enables extending 𝐿 by a—not yet existing(!)—root
of an irreducible polynomial even if no field containing 𝐿 is given.
* 10. (a) Let 𝜗 be an algebraic number and 𝐾 ≠ 0 an ideal in 𝐼(𝜗). Show that the factor
ring 𝐼(𝜗)/𝐾 has finitely many elements.
(b) Verify that in 𝐼(𝜗) there is no infinite strictly increasing chain of ideals
𝐴1 ⊂ 𝐴2 ⊂ ⋯ ⊂ 𝐴𝑗 ⊂ . . . .
Proof. Using the definition of principal ideals, we can rewrite the three conditions in
(i) as
𝑎 is a divisor of 𝑏
𝑏 occurs among the multiples of 𝑎
all multiples of 𝑏 occur among the multiples of 𝑎,
so the three conditions are equivalent.
(ii) (𝑎) = (𝑏) means by part (i) that both 𝑎 ∣ 𝑏 and 𝑏 ∣ 𝑎 hold, or equivalently, that
𝑎 and 𝑏 are associates (see Theorem 1.1.5/(iii)). □
which set is just the principal ideal (3). It is true in general among the integers that if
𝑑 = gcd{𝑎, 𝑏}, then (𝑎, 𝑏) = (𝑑). In an arbitrary ring, the situation is slightly more
complicated.
Proof. (i) From (𝑎, 𝑏) = (𝑑) we have 𝑎 ∈ (𝑎, 𝑏) = (𝑑), so 𝑑 ∣ 𝑎, and similarly 𝑑 ∣ 𝑏, so
𝑑 is a common divisor of 𝑎 and 𝑏.
Let now 𝑐 be an arbitrary common divisor, so 𝑐 ∣ 𝑎 and 𝑐 ∣ 𝑏. By Theorem 11.2.1,
𝑎 ∈ (𝑐) and 𝑏 ∈ (𝑐). Since (𝑎, 𝑏) is the smallest ideal containing 𝑎 and 𝑏, (𝑑) = (𝑎, 𝑏) ⊆
(𝑐), so, using Theorem 11.2.1 again, 𝑐 ∣ 𝑑.
(ii) If 𝑑 = gcd{𝑎, 𝑏}, then 𝑑 ∣ 𝑎 and 𝑑 ∣ 𝑏. This means that 𝑎 and 𝑏 are in the ideal
(𝑑), hence (𝑑) must be at least as large as the smallest ideal containing 𝑎 and 𝑏. So
(𝑎, 𝑏) ⊆ (𝑑).
The next example shows that equality does not necessarily hold. Among the poly-
nomials with integer coefficients, the greatest common divisor of 2 and 𝑥 is 1, but
(2, 𝑥) ≠ (1). We saw in the previous section that (2, 𝑥) is not even a principal ideal.
We shall give another type of counterexample in Exercise 11.2.4c.
(iii) If (𝑎, 𝑏) = (𝑑), then 𝑑 = gcd{𝑎, 𝑏} as was proved in (i) and we have 𝑑 ∈ (𝑎, 𝑏),
so 𝑑 = 𝑎𝑢 + 𝑏𝑣 with suitable elements of 𝑅, by definition.
For the converse, we assume 𝑑 = gcd{𝑎, 𝑏} and 𝑑 = 𝑎𝑢 + 𝑏𝑣. The first condition
implies (𝑎, 𝑏) ⊆ (𝑑) by (ii), the second condition means 𝑑 ∈ (𝑎, 𝑏), so (𝑑) ⊆ (𝑎, 𝑏), so
(𝑎, 𝑏) = (𝑑). □
Remark: There are many rings where Theorem 11.2.2 can be reduced to
(11.2.1) 𝑑 = gcd{𝑎, 𝑏} ⟺ (𝑎, 𝑏) = (𝑑).
For example, the ring of integers has this property, as we sketched before stating the
theorem. Similar considerations show that (11.2.1) holds in every ring with a division
algorithm.
shows that (11.2.2) is closely related to the number theory of the ring 𝐼(𝜚).
11.2. Elementary Connections to Number Theory 349
The product on the left-hand side is a 𝑝th power. We might try the tactics successful
many times earlier to show that each factor is itself a 𝑝th power in 𝐼(𝜚), and use the
𝑝
resulting 𝑝 equations 𝑥 + 𝑦𝜚𝑗 = 𝛼𝑗 to arrive at a contradiction (assuming a non-trivial
solution 𝑥, 𝑦, 𝑧).
We know in the integers that if the factors of a product are pairwise coprime and
the product is a 𝑝th power, then each factor is an associate of a 𝑝th power. The same
holds for Gaussian or Eulerian integers, and in general, in every ring where the Fun-
damental Theorem of Arithmetic is valid. However, this is no longer true in the lack
of the Fundamental Theorem: 32 = (2 + √−5)(2 − √−5) in 𝐼(√−5), and though the
factors on the right-hand side are coprime, they are not associates of squares (in fact,
they are irreducible).
Thus, our attempt above to prove Fermat’s Last Theorem can be promising only
if the Fundamental Theorem of Arithmetic is true in 𝐼(𝜚). It can be shown, however,
that this is not the case for 𝑝 > 19, and so other approaches have to be applied.
We mention as a historical curiosity that Lamé, a member of the French Academy,
gave an erroneous proof in 1847 of Fermat’s Last Theorem along the lines of the argu-
ment above, taking the Fundamental Theorem for granted for 𝐼(𝜚). (It is conceivable
that Fermat’s “wonderful proof”—if it existed at all—was based on a similar mistake.)
It was Liouville, who pointed out the gap in Lamé’s argument (at that time Liouville
was not yet aware in which cases the Fundamental Theorem holds). Lamé made an-
other mistake by not considering that even if the factors on the left-hand side of (11.2.4)
are pairwise coprime and the Fundamental Theorem is true, we cannot infer that they
are necessarily 𝑝th powers, only that they are associates of 𝑝th powers. And since there
are infinitely many units in 𝐼(𝜚) for 𝑝 > 3, this minor inattentiveness causes another
hardly repairable gap in Lamé’s argument.
At roughly the same time, the German Kummer followed a similar path, but he
realized the importance of the Fundamental Theorem in 𝐼(𝜚), and observed that it does
not always hold. He knew also that if any two elements have a greatest common divisor,
then one can deduce the Fundamental Theorem easily. This gave him the idea to adjoin
ideal numbers to the rings 𝐼(𝜚) where the Fundamental Theorem was false: these were
intended to make up the missing greatest common divisors in 𝐼(𝜚). Kummer hoped
that any two elements will have a gcd in this enlarged set and also the Fundamental
Theorem will hold.
Kummer based the construction of ideal numbers on the following property of
the greatest common divisor. We know in the integers that if gcd{𝑎, 𝑏} = 𝑑, then the
multiples of 𝑑 are just the numbers of the form 𝑎𝑢 + 𝑏𝑣, and as we indicated, the same
applies also for every 𝐼(𝜗). Thus, Kummer defined the ideal number belonging to a
fixed pair 𝛼 and 𝛽 as the set of numbers
{ 𝛼𝜉 + 𝛽𝜓 ∣ 𝜉, 𝜓 ∈ 𝐼(𝜗) }.
350 11. Ideals
In modern terminology, this is just the ideal (𝛼, 𝛽) generated by 𝛼 and 𝛽. If 𝛼 and 𝛽 have
a greatest common divisor 𝛿, then this set is the multiples of 𝛿, and so we can identify
it with 𝛿. If, however, gcd{𝛼, 𝛽} does not exist, then this ideal number can compensate
the lack of the greatest common divisor. Then Kummer built number theory among
the ideal numbers (i.e. ideals), and achieved significant progress concerning Fermat’s
Last Theorem. (We shall discuss number theory for ideals in Section 11.4.)
Exercises 11.2
1. Verify that the following subsets form a principal ideal in the ring of integers, and
exhibit a generating element for each of them.
(a) (30, 50, 75)
(b) (20) ∩ (30).
2. Consider the ring 𝐺 of Gaussian integers.
(a) In how many ways can we generate a given non-zero principal ideal with a
single element?
(b) How many principal ideals contain 22 + 6𝑖?
3. Let 𝑅 be an integral domain with identity and 𝑎, 𝑏 ∈ 𝑅. Demonstrate
𝑎 + 𝑏 ∈ (𝑎) ∩ (𝑏) ⟺ (𝑎) = (𝑏).
Remark: We saw several examples where the uniqueness part of the Fundamental The-
orem was false (see Theorems 10.3.5 and 10.3.6, and the paragraphs about Fermat’s Last
Theorem in Section 11.2). But we can easily find a ring where there is a problem with
decomposability: there are no irreducible elements at all in the ring 𝑈 of all algebraic
integers (see Exercise 11.3.1), so no element can be written as a product of irreducible
elements.
Now we show that if every ideal in 𝑅 is a principal ideal, then the Fundamental
Theorem of Arithmetic is valid in 𝑅.
Definition 11.3.2. An integral domain 𝑅 with identity is a principal ideal domain, if
every ideal in 𝑅 is a principal ideal. ♣
Theorem 11.3.3. The Fundamental Theorem of Arithmetic is true in every principal
ideal domain. ♣
Proof. We verify that a principal ideal domain satisfies conditions (i) and (ii) of The-
orem 11.3.1.
11.3. Unique Factorization, Principal Ideal Domains, and Euclidean Rings 353
a contradiction.
(ii) We verify that any two elements 𝑎 and 𝑏 have a greatest common divisor.
Since (𝑎, 𝑏) is a principal ideal, we know (𝑎, 𝑏) = (𝑑) and Theorem 11.2.2 implies
𝑑 = gcd{𝑎, 𝑏}.
The existence of a greatest common divisor yields (ii): see the proof for Theo-
rem 1.3.4 given in the solution of Exercise 1.3.11, the proof of Theorem 1.3.9, and fi-
nally, part II in the proof of Theorem 1.4.3. □
Remarks: (1) There exist rings that are not principal ideal domains, but for which the
Fundamental Theorem still holds, the simplest example being 𝐙[𝑥]. On the one
hand, we saw in Section 11.1 that (2, 𝑥) is not a principal ideal in 𝐙[𝑥]. On the
other hand, the Fundamental Theorems in 𝐙 and in 𝐐[𝑥] imply its validity also in
𝐙[𝑥]: It follows from a basic lemma of Gauss used in the proof of Theorem 9.6.2
that a polynomial 𝑓 is irreducible over 𝐙 if and only if 𝑓 is either a constant that
is a prime number, or the coefficients of 𝑓 are coprime (not necessarily pairwise)
and 𝑓 is irreducible over 𝐐.
(2) Among the algebraic number fields, the principal ideal domains are exactly the
same as the ones where the Fundamental Theorem holds: A ring 𝐼(𝜗) is a princi-
ple ideal domain if and only if the Fundamental Theorem is true in it (see Exer-
cise 11.3.9b).
We turn to the general formulation of the division algorithm and prove that if
there is a division algorithm in 𝑅, then 𝑅 is a principal ideal domain, and so (by Theo-
rem 11.3.3,) the Fundamental Theorem of Arithmetic is true in 𝑅.
Definition 11.3.4. An integral domain 𝑅 with identity is a Euclidean ring, if we can
assign to every 𝑐 ∈ 𝑅 a non-negative integer 𝑓(𝑐) such that 𝑓(𝑐) = 0 ⟺ 𝑐 = 0 and to
every 𝑎, 𝑏 ∈ 𝑅, 𝑏 ≠ 0 there exist 𝑞, 𝑟 ∈ 𝑅 satisfying
(11.3.1) 𝑎 = 𝑏𝑞 + 𝑟 and 𝑓(𝑟) < 𝑓(𝑏). ♣
Remarks: (1) An equivalent definition of Euclidean rings is if we assign only to the
non-zero elements 𝑐 ∈ 𝑅 a non-negative integer 𝑓(𝑐), and in (11.3.1) we allow the
possibility that 𝑟 = 0 (besides 𝑓(𝑟) < 𝑓(𝑏)).
354 11. Ideals
(2) We do not have to assume in Definition 11.3.4 that 𝑅 has an identity because this
follows from the division algorithm (see Exercise 11.3.6).
(3) We investigated several rings with a division algorithm earlier; see most examples
below. In them, the function 𝑓 had further useful properties, such as 𝑓(𝑎𝑏) =
𝑓(𝑎)𝑓(𝑏) or at least 𝑓(𝑎) ≤ 𝑓(𝑎𝑏). However, we do not have to require such prop-
erties in the definition of Euclidean rings.
Examples. E1 For the integers, we can choose 𝑓(𝑐) = |𝑐|, i.e. we will have |𝑟| < |𝑏|.
We note that in this case, the quotient and the remainder are generally not unique,
as for 𝑎 = 33 and 𝑏 = 5, we can satisfy (11.3.1) in two ways:
33 = 6 ⋅ 5 + 3 = 7 ⋅ 5 + (−2).
In Theorems 1.2.1 and 1.2.1A, we required the stronger conditions 0 ≤ 𝑟 < |𝑏| and
−|𝑏|/2 < 𝑟 ≤ |𝑏|/2, instead of |𝑟| < |𝑏|, to guarantee the uniqueness of quotient
and remainder. This uniqueness, however, has no impact on the proof of the
Fundamental Theorem.
E2 For Gaussian or Eulerian integers, we can take 𝑓(𝑐) = 𝑁(𝑐). (We saw during the
proof of Theorem 7.4.8 that the quotient and the remainder are not unique in
general.)
E4 In a polynomial ring over a field, we can perform a division algorithm with respect
to the degree. To satisfy Definition 11.3.4 formally, we define 𝑓(0) = 0 and 𝑓(𝑐) =
1 + deg 𝑐 for 𝑐 ≠ 0.
Remark: The converse of Theorem 11.3.5 is false as there exist principal ideal domains
which are not Euclidean rings. Some examples are
Exercises 11.3
(a) Verify that that there is just one irreducible element in 𝑊 apart from asso-
ciates.
(b) If we try to adapt the argument for proving the existence of infinitely many
prime numbers in the integers (see Theorem 5.1.1), why does it not work in
𝑊?
(c) Show that 𝑊 is a Euclidean ring.
(d) Determine all ideals in 𝑊.
∞
4. Let 𝐼1 ⊆ 𝐼2 ⊆ . . . be arbitrary ideals in a ring 𝑅. Demonstrate that also ⋃𝑗=1 𝐼𝑗 is
an ideal in 𝑅.
S 5. Let 𝑅 be an integral domain with identity. Prove that the polynomial ring 𝑅[𝑥] is a
principal ideal domain if and only if 𝑅 is a field.
6. Show that there is no need to require in Definition 11.3.4 of Euclidean rings that 𝑅
has an identity, since this follows from the other conditions.
8. Verify that in the integers, the division algorithm can be performed not only with
respect to the absolute value, but also using the following function 𝑓:
1 + ⌊log2 |𝑐|⌋, if 𝑐 ≠ 0
𝑓(𝑐) = {
0, if 𝑐 = 0,
so
S* 10. Let 𝑡 be a negative squarefree integer. Show that the algebraic integers of the imag-
inary quadratic field 𝐐(√𝑡) form a Euclidean ring if and only if 𝑡 = −1, −2, −3,
−7, or −11.
11.4. Divisibility of Ideals 357
Thus the product of two ideals is the set of all possible sums (of arbitrarily many
terms) of products where the factors are taken from 𝐴 and 𝐵.
We summarize some important properties of multiplication of ideals in
Theorem 11.4.2. (i) The product 𝐴𝐵 of ideals 𝐴 and 𝐵 is the smallest ideal containing
all elements 𝑎𝑏, where 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵.
(ii) The product of finitely generated ideals is finitely generated, as well.
(iii) The product of principal ideals is a principal ideal.
(iv) 𝐴𝐵 ⊆ 𝐴 ∩ 𝐵.
(v) The multiplication of ideals in a ring 𝑅 is a commutative and associative operation,
with identity element (1) = 𝑅:
(11.4.2) 𝐴𝐵 = 𝐵𝐴, (𝐴𝐵)𝐶 = 𝐴(𝐵𝐶), (1)𝐴 = 𝐴(1) = 𝐴.
Only the identity has an inverse and
𝐴𝐵 = (0) ⟺ 𝐴 = (0) or 𝐵 = (0). ♣
(iii) Applying the proof of (ii) for the special case 𝑘 = 𝑚 = 1, we get (𝛼)(𝛽) = (𝛼𝛽).
𝑛
(iv) Since 𝐴 is an ideal, 𝑎𝑖 𝑏𝑖 ∈ 𝐴 for any 𝑎𝑖 ∈ 𝐴 and 𝑏𝑖 ∈ 𝐵, and thus ∑𝑖=1 𝑎𝑖 𝑏𝑖 ∈ 𝐴,
so 𝐴𝐵 ⊆ 𝐴. We get 𝐴𝐵 ⊆ 𝐵 similarly.
(v) The properties in (11.4.2) follow immediately from the definition of multipli-
cation of ideals and from the ring properties of 𝑅.
The inverse of the identity 𝑅 = (1) is itself. Conversely, if the ideal 𝐼 has an inverse,
so 𝐽𝐼 = 𝑅 for some ideal 𝐽, then 𝑅 ⊆ 𝐼 by (iv) and so 𝐼 = 𝑅.
If 𝐴 = (0) or 𝐵 = (0), then every sum in the definition of 𝐴𝐵 is 0, thus 𝐴𝐵 = (0).
If, however, there exist non-zero elements 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵, then 𝑎𝑏 ≠ 0 since 𝑅 is free
of zero divisors. As 𝑎𝑏 ∈ 𝐴𝐵, 𝐴𝐵 ≠ (0). □
Remarks: (1) The products 𝑎𝑏 with 𝑎 ∈ 𝐴 and 𝑏 ∈ 𝐵 do not form an ideal in general
(see Exercise 11.4.1a). This is the reason why we had to take sums of such products
in the definition of 𝐴𝐵.
(2) We defined only multiplication for ideals so far. Addition can be defined, see
Remark 4 after Theorem 11.4.5. Some of the usual nice properties do not hold for
it (only the zero element has a negative), and so the ideals in 𝑅 do not form a ring
for this addition and multiplication.
Examples. E1 Let 𝑅 = 𝐙[𝑥], and let 𝐴 and 𝐵 be the sets of polynomials having con-
stant terms divisible by 2 and 3. Then 𝐴𝐵 is the set of polynomials with constant
term divisible by 6:
𝐴𝐵 = (2, 𝑥)(3, 𝑥) = (6, 2𝑥, 3𝑥, 𝑥2 )
= (6, 2𝑥, 3𝑥 − 2𝑥, 𝑥2 ) = (6, 2𝑥, 𝑥, 𝑥2 ) = (6, 𝑥).
11.4. Divisibility of Ideals 359
E2 Let 𝑅 = 𝐸(√−5), 𝐴 = (3, 1+ √−5), and 𝐵 = (3, 1− √−5). Then 𝐴𝐵 is the principal
ideal (3):
𝐴𝐵 = (3, 1 + √−5)(3, 1 − √−5) = (9, 3 + 3√−5, 3 − 3√−5, 6)
= (9 − 6, 3 + 3√−5, 3 − 3√−5, 6) = (3).
In the sequel we deal only with rings 𝑅 where multiplication of ideals obeys the
cancellation law:
(11.4.4) 𝐴𝐵 = 𝐴𝐶, 𝐴 ≠ (0) ⟹ 𝐵 = 𝐶,
and the converse of (11.4.3) is true:
(11.4.5) 𝐵 ∣ 𝐴 ⟺ 𝐴 ⊆ 𝐵.
We shall show in Section 11.5 that the rings 𝐼(𝜗) constituting the main direction of our
investigation meet requirements (11.4.4) and (11.4.5).
Now we define the greatest common divisor of two ideals in the usual way as a
common divisor that is a multiple of every common divisor:
Definition 11.4.4. An ideal 𝐷 is the greatest common divisor of ideals 𝐴 and 𝐵 if
(i) 𝐷 ∣ 𝐴, 𝐷 ∣ 𝐵
(ii) if 𝐶 ∣ 𝐴 and 𝐶 ∣ 𝐵 for some ideal 𝐶, then 𝐶 ∣ 𝐷. ♣
Theorem 11.4.5. Any two ideals 𝐴 and 𝐵 have a unique greatest common divisor 𝐷 and
(11.4.6) 𝐷 = { 𝑎 + 𝑏 ∣ 𝑎 ∈ 𝐴, 𝑏 ∈ 𝐵 }. ♣
Proof. Based on (11.4.5), we can characterize the greatest common divisor by con-
tainment: it is the smallest ideal containing 𝐴 and 𝐵. We can verify easily (see Exer-
cise 11.4.4a) that 𝐷 defined by (11.4.6) is the unique ideal with this property. □
360 11. Ideals
Remarks: (1) We can consider 𝐷 as the ideal generated by 𝐴 and 𝐵. Thus the notation
𝐷 = (𝐴, 𝐵) agrees with the usual notation both for greatest common divisor and
generated ideal.
(2) If 𝐴 and 𝐵 are principal ideals, 𝐴 = (𝛼) and 𝐵 = (𝛽), then their greatest common
divisor by (11.4.6) is 𝐷 = { 𝑟𝛼 + 𝑠𝛽 ∣ 𝑟, 𝑠 ∈ 𝑅 }, which is just the ideal (𝛼, 𝛽).
This shows again that an ideal generated by two elements can be considered as a
generalization of the notion of greatest common divisor.
(3) If 𝐴 and 𝐵 are finitely generated ideals,
𝐴 = (𝛼1 , . . . , 𝛼𝑘 ) and 𝐵 = (𝛽1 , . . . , 𝛽𝑚 ),
then their greatest common divisor by (11.4.6) is
𝐷 = (𝛼1 , 𝛼2 , . . . , 𝛼𝑘 , 𝛽1 , 𝛽2 , . . . , 𝛽𝑚 ),
so the union of generators of 𝐴 and 𝐵 form a (possible) generating system of 𝐷.
(4) By (11.4.6), we can interpret 𝐷 also as the sum of ideals 𝐴 and 𝐵. We empha-
size once again that the ideals of 𝑅 do not form a ring for this addition and the
multiplication introduced in Definition 11.4.1 (see Exercise 11.4.4b).
Now we turn to the notion, properties, and relation of irreducible and prime ideals.
The definitions of irreducible and prime are analogous to the previous definitions
of irreducible and prime. The only unit among the ideals of 𝑅 is (1) = 𝑅, since this is
the only ideal dividing every ideal (see Exercise 11.4.2e).
Ideals satisfying (11.4.9) are called maximal ideals (also in rings where (11.4.5) is
not valid).
Proof. We follow the lines of the proof of Theorem 1.4.3. We can assume that 𝑃 is a
non-trivial ideal.
First we assume that 𝑃 is a prime ideal, and want to show that it is also irreducible.
Consider a product representation 𝑃 = 𝐴𝐵; we have to verify 𝐴 = (1) or 𝐵 = (1).
Since 𝑃 = 𝐴𝐵, so also 𝑃 ∣ 𝐴𝐵. As 𝑃 is a prime ideal, we infer 𝑃 ∣ 𝐴 or 𝑃 ∣ 𝐵.
If 𝑃 ∣ 𝐴, then 𝐴 = 𝑃𝐶 = 𝐴𝐵𝐶 with a suitable ideal 𝐶. Combining it with the
equality 𝐴 = 𝐴(1), we obtain 𝐴𝐵𝐶 = 𝐴(1). Cancelling by 𝐴 ≠ 0, we get 𝐵𝐶 = (1). This
implies 𝐵 = (1) (and 𝐶 = (1)).
If 𝑃 ∣ 𝐵, then we obtain 𝐴 = (1) similarly.
Now we assume that 𝑃 is irreducible, and show that it is a prime ideal. Starting
from divisibility 𝑃 ∣ 𝐴𝐵, we have to verify that at least one of 𝑃 ∣ 𝐴 and 𝑃 ∣ 𝐵 holds.
If 𝑃 ∣ 𝐴, we are done. If 𝑃 ∤ 𝐴, then (𝑃, 𝐴) = (1) since 𝑃 is irreducible.
Since 𝑃 ∣ 𝑃𝐵 and 𝑃 ∣ 𝐴𝐵, we infer 𝑃 ∣ (𝑃𝐵, 𝐴𝐵). By Exercise 11.4.4c, we obtain
(𝑃𝐵, 𝐴𝐵) = (𝑃, 𝐴)𝐵 = (1)𝐵 = 𝐵, and so 𝑃 ∣ 𝐵. □
Exercises 11.4
S 9. True or false?
(a) If 𝛼 is an irreducible element in 𝑅, then (𝛼) is an irreducible ideal.
(b) If (𝛼) is an irreducible ideal, then 𝛼 is an irreducible element in 𝑅.
(c) If 𝛼 is a prime element in 𝑅, then (𝛼) is a prime ideal.
(d) If (𝛼) is a prime ideal, then 𝛼 is a prime element in 𝑅.
10. (a) Show by an example that ideals of 𝐙[𝑥] do not obey the cancellation law
(11.4.4): 𝐴𝐵 = 𝐴𝐶, 𝐴 ≠ (0) ⇏ 𝐵 = 𝐶.
(b) Prove that we can cancel by a non-zero principal ideal in any integral domain
𝑅 with identity: If 𝐴 = (𝛼) ≠ (0), then 𝐴𝐵 = 𝐴𝐶 ⇒ 𝐵 = 𝐶.
11. Consider the ring 𝑅 of polynomials with non-negative rational exponents and real
coefficients (3 + 7𝑥4/7 + 11𝑥5/3 is such a polynomial).
(a) Verify that the elements without term 𝑥0 (i.e. having constant term 0) form an
ideal 𝐼 in 𝑅.
(b) Demonstrate that 𝐼 can be decomposed into the product of two ideals only as
𝐼 = (1)𝐼 = 𝐼(1) = 𝐼 ⋅ 𝐼.
Remark: The ideal 𝐼 meets the requirements (11.4.8) and (11.4.9) concerning
irreducible ideals, but it has also a non-trivial factorization 𝐼 = 𝐼 ⋅ 𝐼 (which
shows that 𝑅 does not obey the cancellation law (11.4.4)). Due to this and
similar singularities, we generally discuss irreducibility (and other number-
theoretic notions) only for ideals of rings where (11.4.4) and (11.4.5) are valid.
12. Let 𝑅 be an integral domain with identity (but we do not require (11.4.4) and
(11.4.5) now). Among the non-trivial ideals, we define maximal and prime ideals
by (11.4.9) and (11.4.12). We call a non-trivial ideal 𝑄 quasi-irreducible if 𝑄 = 𝐴𝐵
implies 𝐴 = 𝑄 or 𝐵 = 𝑄 (or both, cf. the previous exercise).
(a) Prove that every prime ideal is quasi-irreducible.
(b) Exhibit a quasi-irreducible ideal that is not a prime ideal.
(c) Verify that every maximal ideal is also a prime ideal and hence quasi-irreduc-
ible.
(d) Give an example of a prime ideal, that is not maximal.
(e) Demonstrate that 𝐼 is a maximal ideal if and only if the factor ring 𝑅/𝐼 is a
field, and 𝐼 is a prime ideal if and only if 𝑅/𝐼 contains no zero divisors.
Remark: We introduced quasi-irreducible ideals just for the exercise, but maximal
and prime ideals in this interpretation play an important role in arbitrary rings (as
is suggested by part (e)).
decomposition is unique apart from the order of factors. Rings with this property are
called Dedekind rings.
First we verify a result of independent interest about the product of polynomials
with algebraic integer coefficients (Theorem 11.5.1). It is a generalization of a basic
lemma of Gauss for polynomials with rational coefficients (see Exercise 11.5.9) that
occurred in the proof of Theorem 9.6.2 and was referred to in Remark 1 after the proof
of Theorem 11.3.3. We apply Theorem 11.5.1 to show that to every ideal 𝐴 ≠ (0) of
𝐼(𝜗) there exists an ideal 𝐵 ≠ (0) such that 𝐴𝐵 is a principal ideal (Theorem 11.5.5).
As a consequence, we obtain the cancellation law for ideals (Theorem 11.5.6), and the
equivalence of divisibility and the (opposite) containment of ideals (Theorem 11.5.7);
we required these properties in the previous section when discussing general number-
theoretic notions for ideals. Then we prove unique prime factorization for ideals (The-
orem 11.5.8). Finally, we establish the surprising result that every ideal of 𝐼(𝜗) can be
generated by at most two elements (Theorem 11.5.9).
Theorem 11.5.1. Let
𝑓(𝑥) = 𝛼0 + 𝛼1 𝑥 + ⋯ + 𝛼𝑚 𝑥𝑚 and 𝑔(𝑥) = 𝛽0 + 𝛽1 𝑥 + ⋯ + 𝛽𝑛 𝑥𝑛
be polynomials with algebraic integer coefficients and consider their product
𝑓(𝑥)𝑔(𝑥) = 𝛾0 + 𝛾1 𝑥 + ⋯ + 𝛾𝑚+𝑛 𝑥𝑚+𝑛 .
Assume that some algebraic integer 𝛿 divides all coefficients of the product:
(11.5.1) 𝛿 ∣ 𝛾𝑘, 𝑘 = 0, 1, . . . , 𝑚 + 𝑛.
Then
𝛿 ∣ 𝛼𝑖 𝛽𝑗 , 𝑖 = 0, 1, . . . , 𝑚, 𝑗 = 0, 1, . . . , 𝑛. ♣
0 = 𝜆0 𝜆𝑟−1
𝑟 + 𝜆1 𝜆𝑟−2
𝑟 (𝜆𝑟 𝜉1 ) + ⋯ + 𝜆𝑟−1 (𝜆𝑟 𝜉1 )
𝑟−1
+ (𝜆𝑟 𝜉1 )𝑟 .
This means that 𝜆𝑟 𝜉1 is a root of the polynomial
𝜆0 𝜆𝑟−1
𝑟 + 𝜆1 𝜆𝑟−2
𝑟 𝑥 + ⋯ + 𝜆𝑟−1 𝑥
𝑟−1
+ 𝑥𝑟
with algebraic integer coefficients and leading coefficient one. Hence, 𝜆𝑟 𝜉1 is an alge-
braic integer by Theorem 9.6.3/(iii). □
11.5. Dedekind Rings 365
Lemma 11.5.3. Dividing a polynomial with algebraic integer coefficients by any of its
root factors, we obtain a polynomial with algebraic integer coefficients again. (A root
factor of a polynomial 𝑓 is a linear polynomial 𝑥 − 𝛼 where 𝑓(𝛼) = 0.) ♣
Proof of Lemma 11.5.3. Let ℎ be the polynomial in (11.5.2). We show that the coef-
ficients of
ℎ(𝑥)
ℎ1 (𝑥) =
𝑥 − 𝜉1
are algebraic integers.
We proceed by induction on the degree 𝑟 of ℎ.
The statement is true for 𝑟 = 1 because then ℎ1 (𝑥) is the constant polynomial 𝜆1 .
Assume now that the statement holds for every polynomial of degree not greater
than 𝑟 − 1. Consider the polynomial
𝑠(𝑥) = ℎ(𝑥) − 𝜆𝑟 (𝑥 − 𝜉1 )𝑥𝑟−1 .
Clearly, the degree of 𝑠(𝑥) is at most 𝑟 − 1, 𝑠(𝜉1 ) = 0, and 𝜆𝑟 𝜉1 is an algebraic integer by
Lemma 11.5.2, so the coefficients of 𝑠(𝑥) are algebraic integers.
By the induction hypothesis, the coefficients of
𝑠(𝑥) ℎ(𝑥)
𝑠1 (𝑥) = = − 𝜆𝑟 𝑥𝑟−1 = ℎ1 (𝑥) − 𝜆𝑟 𝑥𝑟−1
𝑥 − 𝜉1 𝑥 − 𝜉1
are algebraic integers. Since 𝜆𝑟 is an algebraic integer, we obtain that ℎ1 (𝑥) has alge-
braic integer coefficients. □
Lemma 11.5.4. The product of the leading coefficient and arbitrarily many roots of a
polynomial with algebraic integer coefficients is an algebraic integer. ♣
By (11.5.1), the polynomial on the left-hand side of (11.5.4) has algebraic integer coef-
ficients. Thus an arbitrary product
𝛼𝑚 𝛽𝑛
(11.5.5) 𝜉𝑖1 . . . 𝜉𝑖𝑟 𝜂𝑗1 . . . 𝜂𝑗𝑠
𝛿
is an algebraic integer by Lemma 11.5.4.
Using the root factor decomposition, we get any coefficient 𝛼𝑖 of 𝑓 by adding some
terms of the form ±𝛼𝑚 𝜉𝑖1 . . . 𝜉𝑖𝑟 , and we have a similar result for 𝑔. Therefore every
𝛼𝑖 𝛽𝑗 can be written as
The following result of Kronecker plays a central role in studying ideals of 𝐼(𝜗):
It makes it possible to get at least partial answers for many questions by reducing the
problems to principal ideals, as these have a much more transparent structure.
Theorem 11.5.5. To every ideal 𝐴 ≠ (0) in 𝐼(𝜗) there exists an ideal 𝐵 ≠ (0) such that
𝐴𝐵 is a principal ideal. ♣
Remark: It turns out from the proof that we can choose 𝐵 ≠ (0) to yield 𝐴𝐵 = (𝑐) with
an integer 𝑐. This can also be easily deduced from the statement of the theorem (see
Exercises 11.5.1 and 11.5.2).
𝐺(𝑥) is a symmetric polynomial in variables 𝜗𝑗 , so the same applies for its coeffi-
cients. By the fundamental theorem of symmetric polynomials and the Viète formulas
for the minimal polynomial of 𝜗, we infer (in the usual way we have seen several times)
that 𝐺(𝑥) has rational coefficients.
As the coefficients of 𝐺(𝑥) are obtained from the algebraic integers 𝛼𝜈 and their
algebraic integer relative conjugates with the help of addition and multiplication, the
coefficients of 𝐺(𝑥) are algebraic integers. Since they are also rational, they must be
integers,
𝐺(𝑥) = 𝑎0 + 𝑎1 𝑥 + ⋯ + 𝑎𝑘𝑛 𝑥𝑘𝑛 , 𝑎𝑠 ∈ 𝐙, 𝑠 = 0, 1, . . . , 𝑘𝑛.
Let
𝑛
𝐺(𝑥)
𝐻(𝑥) = = ∏ 𝐹 (𝑥).
𝐹1 (𝑥) 𝑗=2 𝑗
Since the coefficients of every 𝐹𝑗 (𝑥) are algebraic integers, 𝐻(𝑥) has algebraic integer
coefficients. Further, the coefficients of 𝐺(𝑥) and 𝐹1 (𝑥) are in 𝐐(𝜗), and the division
algorithm has terms that are in the field containing the coefficients, so the coefficients
of 𝐻(𝑥) belong to 𝐐(𝜗). Combining the two observations, we see that the coefficients
of 𝐻(𝑥) are in 𝐼(𝜗),
𝐻(𝑥) = 𝛽0 + 𝛽1 𝑥 + ⋯ + 𝛽 𝑘𝑛−𝑘 𝑥𝑘𝑛−𝑘 .
We show that
𝐵 = (𝛽0 , 𝛽1 , . . . , 𝛽 𝑘𝑛−𝑘 ) and 𝑐 = gcd{𝑎0 , 𝑎1 , . . . , 𝑎𝑘𝑛 }
satisfy 𝐴𝐵 = (𝑐).
As 𝑐 is the greatest common divisor of the coefficients of 𝐺 ≠ 0, 𝑐 ≠ 0 (and so
clearly 𝐵 ≠ (0)).
We verify first 𝐴𝐵 ⊆ (𝑐). By the definition of 𝑐, it divides every coefficient of the
polynomial 𝐺(𝑥) = 𝐹1 (𝑥)𝐻(𝑥). Then, by Theorem 11.5.1, 𝑐 divides every product 𝛼𝑖 𝛽𝑗 ,
so 𝛼𝑖 𝛽𝑗 ∈ (𝑐), hence 𝐴𝐵 ⊆ (𝑐).
To prove the reverse containment (𝑐) ⊆ 𝐴𝐵, observe that 𝐺(𝑥) = 𝐹1 (𝑥)𝐻(𝑥), so
𝑎0 + 𝑎1 𝑥 + ⋯ + 𝑎𝑘𝑛 𝑥𝑘𝑛 = (𝛼0 + 𝛼1 𝑥 + ⋯ + 𝛼𝑘 𝑥𝑘 )(𝛽0 + 𝛽1 𝑥 + ⋯ + 𝛽 𝑘𝑛−𝑘 𝑥𝑘𝑛−𝑘 )
implies
𝑎𝑠 = ∑ 𝛼𝑖 𝛽𝑗 ∈ 𝐴𝐵, 𝑠 = 0, 1, . . . , 𝑘𝑛.
𝑖+𝑗=𝑠
By Theorem 1.3.5, which refers to a property of the gcd for integers, we have
𝑘𝑛
𝑐 = ∑ 𝑎𝑠 𝑢𝑠
𝑠=0
Proof. By Theorem 11.5.5, given an ideal 𝐴 ≠ (0) there exists an ideal 𝐷 ≠ (0) such
that 𝐴𝐷 is a principal ideal, so 𝐴𝐷 = (𝜓) for some (0 ≠)𝜓 ∈ 𝐸(𝜗) (moreover, 𝜓 can be
chosen to be an integer).
Multiplying 𝐴𝐵 = 𝐴𝐶 by 𝐷, we obtain (𝜓)𝐵 = (𝜓)𝐶. Then 𝐵 = 𝐶 follows by
Exercise 11.4.10b. □
Theorem 11.5.7. For ideals of 𝐼(𝜗), 𝐵 ∣ 𝐴 ⟺ 𝐴 ⊆ 𝐵. ♣
Proof. We saw in Exercise 11.4.2c that the implication ⇒ holds in any integral domain
with identity.
For the converse, assume 𝐴 ⊆ 𝐵. We may clearly restrict ourselves to the case
𝐵 ≠ (0). By Theorem 11.5.5, multiplying 𝐵 ≠ (0) by a suitable ideal 𝐷 ≠ (0), the
product is a principal ideal: 𝐵𝐷 = (𝜓). Then 𝐴𝐷 ⊆ 𝐵𝐷 = (𝜓).
Every ideal in 𝐼(𝜗), including 𝐴𝐷, is finitely generated. By the condition 𝐴𝐷 ⊆ (𝜓),
every generator is divisible by 𝜓:
𝐴𝐷 = (𝜂1 𝜓, . . . , 𝜂𝑠 𝜓) = (𝜓)(𝜂1 , . . . , 𝜂𝑠 ).
Denoting the ideal (𝜂1 , . . . , 𝜂𝑠 ) by 𝐾, we obtain
𝐴𝐷 = (𝜓)𝐾 = 𝐵𝐷𝐾.
Cancelling 𝐷 ≠ (0), we get
𝐴 = 𝐵𝐾, so 𝐵 ∣ 𝐾. □
By Theorems 11.5.6 and 11.5.7, the ideals of 𝐼(𝜗) obey the cancellation law, and
divisibility is equivalent to containment (in the opposite direction). Accordingly, the
results of Section 11.4 depending on these properties are valid for ideals in 𝐼(𝜗). We
stress among them the equivalence of irreducible and prime ideals (Theorem 11.4.8).
This will have a crucial role in the proof of the next theorem: We show that the Fun-
damental Theorem of Arithmetic holds for the ideals of 𝐼(𝜗).
Theorem 11.5.8. Every ideal in 𝐼(𝜗) different from (0) and (1) is the product of finitely
many irreducible ideals, and the decomposition is unique apart from the order of factors.
♣
Proof. We follow closely the argument in the proof of sufficiency in Theorem 11.3.1.
Decomposability. Let 𝐴 be a non-trivial ideal. We show first that 𝐴 has a divisor
among the irreducible ideals.
If 𝐴 itself is irreducible, then we are done.
Otherwise, 𝐴 = 𝐴1 𝐵1 , where 𝐴1 ≠ (1), 𝐵1 ≠ (1). Then 𝐴 ⊂ 𝐴1 with strict contain-
ment, since if 𝐴 = 𝐴1 , then cancelling 𝐴 in 𝐴(1) = 𝐴 = 𝐴𝐵1 would imply (1) = 𝐵1 .
If 𝐴1 is irreducible, then it is an irreducible divisor of 𝐴. Otherwise, 𝐴1 = 𝐴2 𝐵2 ,
where 𝐴2 ≠ (1), 𝐵2 ≠ (1). Then 𝐴1 ⊂ 𝐴2 (with strict containment).
Continuing the procedure similarly, we get a strictly ascending chain of ideals
𝐴 ⊂ 𝐴1 ⊂ 𝐴2 ⊂ ⋯ ⊂ 𝐴𝑗 ⊂ . . . .
It cannot be infinite by Exercise 11.1.10b, so some 𝐴𝑖 must be irreducible.
11.5. Dedekind Rings 369
Example. Factor the principal ideal (6) in 𝐼(√−5) into a product of irreducible ideals.
We saw earlier that 6 has two essentially distinct representations as a product of
irreducible elements in 𝐼(√−5):
6 = 2 ⋅ 3 = [1 + √−5][1 − √−5].
Accordingly, the principal ideal (6) has two decompositions into the product of princi-
pal ideals:
(6) = (2)(3) = (1 + √−5)(1 − √−5).
Each factor can be written as a product of two irreducible ideals:
(2) = (2, 1 + √−5)(2, 1 − √−5) = (2, 1 + √−5)2
(3) = (3, 1 + √−5)(3, 1 − √−5)
(1 + √−5) = (2, 1 + √−5)(3, 1 + √−5)
(1 − √−5) = (2, 1 − √−5)(3, 1 − √−5).
Thus the principal ideal (6) has the following factorization into the product of irre-
ducible ideals:
(6) = (2, 1 + √−5)2 (3, 1 + √−5)(3, 1 − √−5).
The irreducible ideals arise from the two decompositions of 6 into irreducible factors:
we can interpret the ideal (3, 1 + √−5) as a “hiding common divisor ideal number” in
the factors 3 and 1 + √−5, and in fact, we refined the two distinct decompositions of 6
into a common decomposition of the principal ideal (6) with the help of these hidden
factors.
370 11. Ideals
Because of the equivalence of irreducible and prime ideals, we shall use the name
prime ideal for both notions in the sequel.
We can introduce the standard form of ideals by Theorem 11.5.8: If 𝐴 ≠ (0) and
𝐴 ≠ (1), then
𝑟
𝛼 𝛼𝑟 𝛼
𝐴 = 𝑃1 1 . . . 𝑃𝑟 = ∏ 𝑃𝑖 𝑖 ,
𝑖=1
where 𝑃1 , . . . , 𝑃𝑟 are distinct prime ideals and 𝛼1 , . . . , 𝛼𝑟 are positive integers.
The standard forms for the greatest common divisor (see Definition 11.4.4. and
Theorem 11.4.5) and the least common multiple (see Exercise 11.4.5) of ideals have the
same well-known formulas as for integers: Every prime ideal occurring in the ideals
has to be taken with the minimal or maximal exponent, respectively, and 𝑃 0 = (1). The
proof is the same as for integers.
As an application of Theorems 11.5.5 and 11.5.8, we prove that every ideal in 𝐼(𝜗)
is almost a principal ideal:
Theorem 11.5.9. Every ideal in 𝐼(𝜗) can be generated by at most two elements. ♣
Then
𝐶𝑗 ∣ 𝐶, so 𝐶 ⊂ 𝐶𝑗 , but 𝐶 ≠ 𝐶𝑗 .
Choose 𝛾1 , . . . , 𝛾𝑟 satisfying
𝛾𝑗 ∈ 𝐶𝑗 , but 𝛾𝑗 ∉ 𝐶, 𝑗 = 1, 2, . . . , 𝑟.
We prove
1+𝛼𝑖
(11.5.9a) 𝛾𝑗 ∈ 𝑃𝑖 if 𝑗 ≠ 𝑖
𝛼𝑖
(11.5.9b) 𝛾 𝑖 ∈ 𝑃𝑖
1+𝛼𝑖
(11.5.9c) 𝛾 𝑖 ∉ 𝑃𝑖 .
1+𝛼 1+𝛼 1+𝛼𝑖
If 𝑗 ≠ 𝑖, then 𝑃𝑖 𝑖 ∣ 𝐶𝑗 implies 𝐶𝑗 ⊆ 𝑃𝑖 𝑖 , and so 𝛾𝑗 ∈ 𝑃𝑖 , since 𝛾𝑗 ∈ 𝐶𝑗 . This
verifies (11.5.9a), and (11.5.9b) can be shown similarly.
11.5. Dedekind Rings 371
1+𝛼𝑖
We prove (11.5.9c) by contradiction. If 𝛾 𝑖 ∈ 𝑃𝑖 , then combining it with
(11.5.9a), we obtain
𝑟
1+𝛼𝑡
(11.5.10) 𝛾𝑖 ∈ 𝑃𝑡 .
⋂
𝑡=1
Condition (i) holds, as only the prime ideals 𝑃𝑖 appear also in the standard form of 𝐴𝐵.
Since 𝐴 ∣ 𝐴𝐵, the exponent of 𝑃𝑖 in the standard form of 𝐴𝐵 is at least 𝛼𝑖 . Thus to
show (ii), we have to verify that the exponent of 𝑃𝑖 in the standard form of (𝛾) is exactly
𝛼𝑖 , or
𝛼𝑖
(iii) 𝑃𝑖 ∣ (𝛾), but
1+𝛼𝑖
(iv) 𝑃𝑖 ∤ (𝛾).
Exercises 11.5
Definition 11.6.1. The ideals 𝐴 ≠ (0) and 𝐵 ≠ (0) are equivalent if there exist principal
ideals (𝛼) ≠ (0) and (𝛽) ≠ (0) such that
(𝛼)𝐴 = (𝛽)𝐵. ♣
Notation: 𝐴 ∼ 𝐵.
In the sequel we always assume that ideals (including the principal ideals) are not
zero.
We summarize some simple but important properties of equivalence in
Theorem 11.6.2. (i) The relation ∼ in Definition 11.6.1 is reflexive, symmetric, and
transitive, so it is an equivalence relation.
(ii) 𝐴 ∼ 𝐵, 𝐶 ∼ 𝐷 ⟹ 𝐴𝐶 ∼ 𝐵𝐷.
(iii) 𝐴 ∼ 𝐵 ⟺ 𝐴𝐶 ∼ 𝐵𝐶.
(ii) If 𝐴 ∼ 𝐵 and 𝐶 ∼ 𝐷, or
then
(𝛼𝜚)𝐴𝐶 = (𝛽𝜉)𝐵𝐷.
The equivalence relation ∼ partitions the non-zero ideals of 𝐼(𝜗) into disjoint
classes. We state the following fundamental result without proof:
It is easy to verify that the Fundamental Theorem of Arithmetic holds for the ele-
ments of 𝐼(𝜗) if and only if ℎ(𝜗) = 1 (see Exercise 11.6.2).
We show now that any (non-zero) ideal in 𝐼(𝜗) raised to the power ℎ(𝜗) is always
a principal ideal:
Theorem 11.6.4. Let ℎ(𝜗) be the number of ideal classes of 𝐸(𝜗) and let 𝐴 ≠ (0) be an
ideal. Then 𝐴ℎ(𝜗) is a principal ideal. ♣
Proof. We follow the proof of the Euler–Fermat Theorem 2.4.1. Let ℎ(𝜗) = ℎ and
(11.6.1) 𝐴1 , 𝐴 2 , . . . , 𝐴 ℎ
(𝜚)𝐴𝐴𝑖 = (𝜏)𝐴𝐴𝑗 ,
(11.6.4) 𝐴ℎ 𝐴1 𝐴2 . . . 𝐴ℎ ∼ 𝐵1 𝐵2 . . . 𝐵ℎ = 𝐴1 𝐴2 . . . 𝐴ℎ
We close the chapter with an illustration that shows that ideals may be suitable to
handle Diophantine equations even if the Fundamental Theorem of Arithmetic is false
for the algebraic integers of the corresponding number field.
We show that the ideals (𝑥 + √−17) and (𝑥 − √−17) are coprime. Assume that a prime
ideal 𝑃 is their common divisor. Then 𝑃 divides (𝑦)3 , and as 𝑃 is a prime ideal, it divides
(𝑦), as well. Switching to the corresponding inclusions,
Then
√−17[[𝑥 − √−17] − [𝑥 + √−17]] = 2 ⋅ 17 = 34 ∈ 𝑃
holds.
We show that 𝑦 and 34 are coprime in the integers.
If 17 ∣ 𝑦, then we see from the original equation that 17 divides 𝑥. Then 𝑥2 + 17
and 𝑦3 are divisible by exactly the first and at least the third powers of 17, which is
impossible.
If 2 ∣ 𝑦, then 𝑥 is odd, and the residues of the two sides modulo 8 of the equation
are 2 and 0, which cannot hold.
Thus we have proved that 𝑦 and 34 are coprime. Then 1 = 𝑦𝑢 + 34𝑣 for some
integers 𝑢 and 𝑣. Since 34 and 𝑦 are elements of 𝑃, 1 lies in 𝑃, so 𝑃 = (1), which
contradicts the definition of a prime ideal.
Thus the two (principal) ideals on the left-hand side of (11.6.6) are coprime. It
follows from the unique prime factorization for ideals (Theorem 11.5.8) that both ideals
are cubes of ideals, and so
(11.6.7) (𝑥 + √−17) = 𝐴3 .
where 𝜀 is a unit in 𝐼(√−17). The only units in 𝐼(√−17) are ±1, which are cubes them-
selves and the elements of 𝐼(√−17) are of the form 𝑎 + 𝑏√−17 with integer 𝑎 and 𝑏,
since −17 ≡ −1 (mod 4). Therefore (11.6.8) is equivalent to
𝑥 + √−17 = 𝛽 3 = [𝑎 + 𝑏√−17]3 .
Cubing and comparing the imaginary parts gives
1 = 3𝑎2 𝑏 − 17𝑏3 = 𝑏[3𝑎2 − 17𝑏2 ].
This implies 𝑏 = ±1, but we get no integer values for 𝑎. Thus the Diophantine equation
𝑥2 + 17 = 𝑦3 has no solution. □
Exercises 11.6
1. Verify that the ideals (2, √−6) and (3, √−6) are equivalent in 𝐸(√−6).
2. Prove that the Fundamental Theorem of Arithmetic holds for the elements of 𝐼(𝜗)
if and only if ℎ(𝜗) = 1.
S 3. Assume that the integers 𝑘 > 0 and ℎ = ℎ(𝜗) are coprime. Prove:
(a) 𝐴𝑘 ∼ 𝐵 𝑘 ⟹ 𝐴 ∼ 𝐵.
(b) If 𝐴𝑘 is a principal ideal, then so is 𝐴.
4. Solve the Diophantine equations:
(a) 𝑥2 + 5 = 𝑦3
(b) 17𝑥2 + 1 = 𝑦3
(c) 𝑥2 + 74 = 𝑦3
S (d) 𝑥2 + 35 = 𝑦3 .
Chapter 12
Combinatorial Number
Theory
The intersection of number theory and combinatorics is a relatively young area (at least
compared to other branches of number theory) as its classical results, the theorems of
Schur and Van der Waerden, are barely a century old. The field is extremely rich both
in content and methods and its far-reaching questions can be attacked by ingenious
elementary ideas combined with delicate arguments of analysis, algebra, and proba-
bility theory. Its continuous dynamic progress has been motivated greatly by the work
of Paul Erdős, and nearly all problems discussed in this chapter are connected to him.
377
378 12. Combinatorial Number Theory
“My favorite problems”, and since some people in the audience are not mathematicians,
I will speak about elementary geometry and number theory.
“Let us start with elementary number theory. I will tell you now two problems. I
raised the first one in 1931, so long ago, that I am not certain whether it was before or
after Christ. By the way, an old joke of mine is that I am two and a half billion years
old. To prove it, the age of Earth was two billion years when I was a child, and now it is
well known to be 4.6 billion years. Obviously, the difference is my age, and once I gave
a talk in Los Angeles with the title “My First Two Billion Years in Mathematics”, and
the students made a figure with a diagram “Earth born, Erdős born, dinosaur born”,
and drew a picture where I was riding a dinosaur.
“But putting the joke aside, the problem is the following, I pay 500 dollars for a
proof or disproof, maybe there is some chalk around, can I get some chalk please, be-
cause I am captured by the wire [of the microphone], thank you very much, thus here
is the problem:
“Let be given a sequence of integers: 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑘 ≤ 𝑛, and assume that all
subset sums
𝑘
∑ 𝜀𝑗 𝑎𝑗 , 𝜀𝑗 = 0 or 1,
𝑗=1
are distinct. Such numbers are for example the powers of two: 1, 2, 4, 8, 16, . . . , since
every baby knows that each number has a unique representation as the sum of [dis-
tinct] powers of two. Now the 500 dollar problem is to determine max 𝑘, i.e. maximally
how many numbers can be given up to 𝑛 so that all these sums should be distinct.”
For powers of two (including 20 = 1), we have 𝑘 = 1 + ⌊log2 𝑛⌋, and at first glance
one could think that this gives the maximum. This is false, however: for 𝑛 = 221
Conway and Guy found a sequence that was denser by one element, for which 𝑘 = 2 +
⌊log2 𝑛⌋. This implies that such a sequence exists for every 𝑛 ≥ 221 , see Exercise 12.1.12.
It is unknown whether further improvements are possible or not.
On the other hand, Erdős proved that the maximum cannot be much bigger than
log2 𝑛:
Theorem 12.1.1. Assume that all sums formed from distinct integers 1 ≤ 𝑎1 < 𝑎2 <
⋯ < 𝑎𝑘 ≤ 𝑛 are distinct. Then
(12.1.1) 𝑘 ≤ log2 𝑛 + log2 log2 𝑛 + 1,
and ( for 𝑛 > 8)
log2 log2 𝑛
(12.1.2) 𝑘 ≤ log2 𝑛 + + 2. ♣
2
Combined with the lower bound max𝑘 > log2 𝑛, the estimates guarantee the as-
ymptotic equality max𝑘 ∼ log2 𝑛 with fairly good error terms. The sharper estimate
(12.1.2) is a joint result of Erdős and Leo Moser, and this is the best upper bound cur-
rently known (apart from the fact that the number 2 at the end of the formula can be
replaced by a slightly smaller constant, see Exercise 12.1.13).
12.1. All Sums Are Distinct 379
Thus the maximum wanted by Erdős falls between the two bounds
log2 log2 𝑛
(12.1.3) ⌊log2 𝑛⌋ + 2 ≤ max 𝑘 ≤ log2 𝑛 + + 2.
2
The 500 dollar prize was offered by Erdős to clarify whether or not the difference
max 𝑘 − log2 𝑛 remains bounded as 𝑛 grows to infinity. This problem is still unsolved.
𝑘
Proof. We can form 2𝑘 sums 𝑢𝑗 from the numbers 𝑎𝑖 (also 𝑍 = ∑𝑖=1 𝑎𝑖 and the empty
sum 0 appear among the integers 𝑢𝑗 ). Each 𝑢𝑗 falls into the interval [0, 𝑛𝑘 − 1] (if
𝑘 > 1). According to the assumption, the values 𝑢𝑗 are distinct, hence the number of
these sums must be less than or equal to the number of integers in the interval, i.e.
(12.1.4) 2𝑘 ≤ 𝑛𝑘.
Taking logarithms, we obtain
(12.1.5) 𝑘 ≤ log2 𝑛 + log2 𝑘.
Now we will establish an upper bound to the second term on the right-hand side of
(12.1.5) in terms of 𝑛. Since clearly 𝑘 ≤ 𝑛, therefore log2 𝑘 ≤ log2 𝑛, so (12.1.5) implies
(12.1.6) 𝑘 ≤ 2 log2 𝑛.
Taking logarithms again, we have
(12.1.7) log2 𝑘 ≤ 1 + log2 log2 𝑛,
and substituting this into (12.1.5) we arrive at (12.1.1).
To prove the stronger result, we shall make use of the fact that the sums 𝑢𝑗 are
not evenly distributed in the interval [0, 𝑛𝑘 − 1], but their major part clusters around
the mean. We shall get the precise formulation using elementary probability theory
(though everything could be discussed even without this, but the essential point will
be seen much better with a probabilistic view).
Consider the random variable 𝜂 that assumes each of the 2𝑘 sums 𝑢𝑗 with proba-
bility 2−𝑘 . Denoting expectation by 𝐸, standard deviation by 𝐷, and probability by 𝑃,
Chebyshev’s inequality
(12.1.8) 𝑃(|𝜂 − 𝐸(𝜂)| < 𝑐𝐷(𝜂)) > 1 − 𝑐−2
says that the number of sums 𝑢𝑗 in the interval with center 𝐸(𝜂) and length 2𝑐𝐷(𝜂) is
at least 1 − 𝑐−2 times the number of all values 𝑢𝑗 . We shall repeat the argument used
to verify (12.1.1) for this interval (with a suitable 𝑐).
Turning to the details, the expectation is 𝐸(𝜂) = 𝑍/2, since pairing the comple-
mentary sums 𝑢𝑗 , the sum of every pair is 𝑍. To compute the variance, we introduce
the random variables 𝜉𝑖 , 𝑖 = 1, 2, . . . , 𝑘, where 𝜉𝑖 assumes each of the values 𝑎𝑖 and 0
with probability 1/2. Then the variables 𝜉𝑖 are independent and their sum is 𝜂, so we
get
𝑘 𝑘
1 𝑘𝑛2
𝐷2 (𝜂) = ∑ 𝐷2 (𝜉𝑖 ) = ∑ 𝑎2𝑖 < .
𝑖=1
4 𝑖=1 4
380 12. Combinatorial Number Theory
We now apply Chebyshev’s inequality (12.1.8) with 𝑐 = 2 for 𝐸(𝜂) = 𝑍/2 and 𝐷(𝜂) <
𝑛√𝑘/2. We obtain that at least 75% of the 2𝑘 (distinct) sums 𝑢𝑗 are in the interval with
center 𝑍/2 and of length 2𝑛√𝑘. Therefore
3 ⋅ 2𝑘 8𝑛√𝑘
(12.1.9) ≤ 2𝑛√𝑘 or 2𝑘 ≤
4 3
(compared to the similar estimate in (12.1.4), the factor 𝑘 on the right-hand side has
changed to √𝑘).
Taking logarithms in (12.1.9), we obtain
log2 𝑘 8
(12.1.10) 𝑘 < log2 𝑛 + + log2 ( ) .
2 3
Inequality (12.1.10) clearly implies (12.1.6) (for 𝑛 > 8), thus also (12.1.7) is valid,
which substituted into (12.1.10) gives us (12.1.2). □
Sets with distinct subset sums give rise to another interesting problem of Erdős:
Theorem 12.1.2. If all sums formed from distinct integers 1 ≤ 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑘 are
distinct, then
𝑘
1
(12.1.11) ∑ < 2. ♣
𝑎
𝑖=1 𝑗
The example of powers of two shows that 2 cannot be replaced by a smaller number
on the right-hand side of (12.1.11) (if there is no bound on 𝑘). For 𝑘 fixed, the maximal
sum of reciprocals is attained exactly if we take the first 𝑘 powers of 2 (1, 2, 4, . . . 2𝑘−1 );
this will be clear from the second and third proofs. If we allow also infinite sets then the
theorem remains valid in the form that the sum of reciprocals is less than or equal to 2,
and equality holds only in case we take all powers of two. This result can be verified
by a suitable modification of any of the proofs below.
The statement of Theorem 12.1.2 was conjectured by Erdős, and was first proved
by Ryavec using a series of ingenious tricks (see the first proof). This proof, however,
relies quite strongly on analysis, and it is hard to see why it works. Many years later
two further proofs were given that use only high school mathematics and their ideas
(differing also from each other) are very natural (see the second and third proofs created
by Bruen and Borwein, and Peter Frenkel; the third proof was found by Frenkel when
he was still a high school student). This example shows that in combinatorial number
theory it is sometimes possible to achieve new results using completely elementary
methods.
The first proof is the most difficult, but besides keeping the chronological order, it
is worth to wade through this argument first to enjoy the natural beauty of the second
and third proofs even better.
Performing the multiplication, we obtain terms 𝑥𝑚 where 𝑚 is the sum of some distinct
exponents 𝑎𝑖 (here 1 = 𝑥0 represents the empty sum). According to the assumption,
all terms 𝑥𝑚 are distinct, hence for 0 < 𝑥 < 1 the product (12.1.12) is less than the sum
of the infinite geometric series
1
1 + 𝑥 + 𝑥2 + ⋯ + 𝑥𝑛 + ⋯ = ,
1−𝑥
so
1
(12.1.13) (1 + 𝑥𝑎1 )(1 + 𝑥𝑎2 ) . . . (1 + 𝑥𝑎𝑘 ) <
, if 0 < 𝑥 < 1.
1−𝑥
Now we apply the following trick: Take the (natural) log of both sides, divide by 𝑥, and
integrate from 0 to 1:
𝑘 1 1
log(1 + 𝑥𝑎𝑖 ) log(1 − 𝑥)
(12.1.14) ∑∫ 𝑑𝑥 < − ∫ 𝑑𝑥.
𝑖=1 0
𝑥 0
𝑥
We make a substitution in the integrals on the left-hand side:
𝑑𝑦
𝑥𝑎𝑖 = 𝑦, then 𝑑𝑦 = 𝑎𝑖 𝑥𝑎𝑖 −1 𝑑𝑥, hence 𝑑𝑥 = ,
𝑎𝑖 𝑥𝑎𝑖 −1
and thus
1 1 1
log(1 + 𝑥𝑎𝑖 ) log(1 + 𝑦) 1 log(1 + 𝑦)
(12.1.15) ∫ 𝑑𝑥 = ∫ 𝑎𝑖 −1
𝑑𝑦 = ∫ 𝑑𝑦.
0
𝑥 0 𝑥𝑎 𝑖 𝑥 𝑎𝑖 0 𝑦
Using (12.1.15), we can rewrite (12.1.14) as
𝑘 1 1
1 log(1 + 𝑦) log(1 − 𝑥)
(12.1.16) (∑ ) ∫ 𝑑𝑦 < − ∫ 𝑑𝑥.
𝑎
𝑖=1 𝑖 0
𝑦 0
𝑥
1 log(1+𝑥)
To complete the proof, we will show that the integral 𝐴 = ∫0 𝑥
𝑑𝑥 on the left-
1 log(1−𝑥)
hand side is half of 𝐵 = − ∫0 𝑥
𝑑𝑥 on the right-hand side. Taking
1 1
log(1 + 𝑥) log(1 − 𝑥) log(1 − 𝑥2 )
𝐴−𝐵 =∫ ( + ) 𝑑𝑥 = ∫ 𝑑𝑥,
0
𝑥 𝑥 0
𝑥
and substituting 𝑡 = 𝑥2 , 𝑑𝑡 = 2𝑥𝑑𝑥, we obtain
1 1
log(1 − 𝑡) 1 log(1 − 𝑡) 1 𝐵
𝐴−𝐵 =∫ 𝑑𝑡 = ∫ 𝑑𝑡 = − 𝐵, so 𝐴= . □
0
𝑥 ⋅ 2𝑥 2 0 𝑡 2 2
Remark: We can also finish the proof by computing the integrals in (12.1.16); we expand
the integrands into power series and integrate term by term (which is allowed given our
present conditions):
− log(1 − 𝑥) 𝑥 𝑥2 𝑥𝑗−1
=1+ + +⋯+ + ... ,
𝑥 2 3 𝑗
thus
1 ∞
log(1 − 𝑥) 𝑥2 𝑥3 𝑥𝑗 1 1 𝜋2
(12.1.17) 𝐵 = − ∫ 𝑑𝑥 = [𝑥 + + + ⋯ + 2 + ... ] = ∑ 2 = .
0
𝑥 4 9 𝑗 0
𝑗=1
𝑗 6
382 12. Combinatorial Number Theory
Similarly,
1
log(1 + 𝑥) 𝑥2 𝑥3 𝑥𝑗 1
𝐴=∫ 𝑑𝑥 = [𝑥 − + − ⋯ + (−1)𝑗+1 2 + . . . ] =
0
𝑥 4 9 𝑗 0
(12.1.18) ∞ ∞ ∞ ∞
1 1 1 2 1 𝜋2
= ∑ (−1)𝑗+1 = ∑ − 2 ∑ = (1 − ) ∑ = .
𝑗=1
𝑗2 𝑗=1 𝑗2 𝑡=1
(2𝑡)2 4 𝑗=1 𝑗2 12
So 𝐴 = 𝐵/2.
Second proof. According to the condition, the 2𝑖 − 1 non-empty sums formed from
the numbers 𝑎1 , 𝑎2 , . . . , 𝑎𝑖 give distinct positive integers for every 𝑖, 1 ≤ 𝑖 ≤ 𝑘, hence
the largest of these sums is at least 2𝑖 − 1, so
(12.1.19) 𝑎1 + 𝑎2 + ⋯ + 𝑎𝑖 ≥ 2𝑖 − 1, 𝑖 = 1, 2, . . . , 𝑘.
𝑏𝑖 = 2𝑖−1 , 𝑖 = 1, 2, . . . , 𝑘,
(12.1.20) 𝑎1 + 𝑎2 + ⋯ + 𝑎𝑖 ≥ 𝑏1 + 𝑏2 + ⋯ + 𝑏𝑖 , 𝑖 = 1, 2, . . . , 𝑘.
1 1 1 1
(12.1.21) +⋯+ ≤ +⋯+
𝑎1 𝑎𝑘 𝑏1 𝑏𝑘
1 1 1 1
1+ + + ⋯ + 𝑘−1 = 2 − 𝑘−1 < 2.
2 4 2 2
We shall prove the (stronger) statement that (12.1.21) holds with equality only if
𝑎𝑖 = 𝑏𝑖 , 𝑖 = 1, 2, . . . , 𝑘, hence the maximal sum of reciprocals is obtained for 𝑎𝑖 = 2𝑖−1 .
We show that (12.1.20) implies (12.1.21) for any real numbers
1 1 1 1 1 1
(12.1.21a) − + − +⋯+ − ≥0
𝑏1 𝑎1 𝑏2 𝑎2 𝑏 𝑘 𝑎𝑘
(12.1.20a) 𝑐 𝑖 = 𝑎1 − 𝑏1 + 𝑎2 − 𝑏2 + ⋯ + 𝑎𝑖 − 𝑏𝑖 ≥ 0, 𝑖 = 1, 2, . . . , 𝑘.
12.1. All Sums Are Distinct 383
We can transform the left-hand side of (12.1.21a) to get (in Steps 2 and 3 we apply the
so-called Abelian summation)
(12.1.23)
1 1 1 1 1 1 𝑎 − 𝑏1 𝑎2 − 𝑏2 𝑎 − 𝑏𝑘
− + − +⋯+ − = 1 + +⋯+ 𝑘
𝑏1 𝑎1 𝑏2 𝑎2 𝑏𝑘 𝑎𝑘 𝑎1 𝑏 1 𝑎2 𝑏2 𝑎𝑘 𝑏 𝑘
𝑐1 𝑐2 − 𝑐1 𝑐 𝑘 − 𝑐 𝑘−1
= + +⋯+
𝑎1 𝑏1 𝑎2 𝑏2 𝑎𝑘 𝑏𝑘
1 1 1 1
= 𝑐1 ( − ) + 𝑐2 ( − ) + ...
𝑎1 𝑏1 𝑎2 𝑏2 𝑎2 𝑏2 𝑎3 𝑏3
1 1 𝑐
+ 𝑐 𝑘−1 ( − )+ 𝑘 .
𝑎𝑘−1 𝑏𝑘−1 𝑎𝑘 𝑏𝑘 𝑎𝑘 𝑏𝑘
In the sum obtained at the end of (12.1.23), the numbers 𝑐 𝑖 ≥ 0 are multiplied by
positive numbers according to (12.1.20a) and (12.1.22), so this sum is non-negative, as
claimed.
We obtained also that we have equality in (12.1.21) if and only if every 𝑐 𝑖 = 0,
which implies by (12.1.20a) that 𝑎𝑖 = 𝑏𝑖 for every 𝑖. This means that if all sums are
distinct then the maximal sum of reciprocals is attained for 𝑎𝑖 = 2𝑖−1 , as indicated. □
Third proof. We shall use only (12.1.19), established in the beginning of the second
proof, and will show that if it holds for positive integers 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑘 , then the
sum of reciprocals is less than 2.
If for every 𝑖 we have equality in (12.1.19), then 𝑎𝑖 = 2𝑖−1 , and the sum of recipro-
cals is 2 − 1/2𝑘−1 < 2.
If we do not have equality in (12.1.19) for every 𝑖, then modifying one or two values
of 𝑎𝑖 we shall increase the sum of reciprocals whereas (12.1.19) remains valid. It will be
clear from the process that in finitely many steps we shall have equality in (12.1.19) for
every 𝑖. This completes the proof that the sum of reciprocals is maximal for 𝑎𝑖 = 2𝑖−1
(which is somewhat stronger than the original assertion of the theorem).
Let 𝑟 be the smallest number for which we have strict inequality in (12.1.19) ( 𝑟 = 1
is possible), so
𝑎1 + 𝑎2 + ⋯ + 𝑎𝑖 = 2𝑖 − 1, 𝑖 = 1, 2, . . . , 𝑟 − 1, and
(12.1.24) 𝑟
𝑎1 + 𝑎2 + ⋯ + 𝑎𝑟 > 2 − 1.
We distinguish two cases: (A) We have strict inequality in (12.1.19) for every 𝑖 > 𝑟
and (B) There exists an 𝑖 > 𝑟, for which (12.1.19) holds with equality.
(A) We put 𝑎′𝑟 = 𝑎𝑟 − 1 and the other integers 𝑎𝑖 remain unchanged. The sum of
reciprocals is clearly larger (since 1/𝑎′𝑟 > 1/𝑎𝑟 ), but (12.1.19) remained valid, as the left-
hand side of (12.1.19) decreased by 1 for 𝑖 ≥ 𝑟, so the inequality is preserved (possibly
with ≥ instead of >).
We have to show that our new numbers form a positive increasing sequence. For
𝑟 = 1, we have 𝑎1 > 1 from (12.1.24), hence 𝑎′1 > 0. For 𝑟 > 1, we have to exhibit
𝑎′𝑟 = 𝑎𝑟 − 1 > 𝑎𝑟−1 , so 𝑎𝑟 ≥ 𝑎𝑟−1 + 2. Using (12.1.24) again,
𝑎𝑟 = (𝑎1 + ⋯ + 𝑎𝑟 ) − (𝑎1 + ⋯ + 𝑎𝑟−1 ) ≥ 2𝑟 − (2𝑟−1 − 1) = (2𝑟−1 − 1) + 2 = 𝑎𝑟−1 + 2.
384 12. Combinatorial Number Theory
(B) Let 𝑠 be the smallest number greater than 𝑟 for which we have equality in
(12.1.19) (𝑠 = 𝑟 + 1 is possible), so
𝑎1 + 𝑎2 + ⋯ + 𝑎𝑖 > 2𝑖 − 1, 𝑖 = 𝑟, 𝑟 + 1, . . . , 𝑠 − 1, and
(12.1.25) 𝑠
𝑎1 + 𝑎2 + ⋯ + 𝑎𝑠 = 2 − 1.
Put 𝑎′𝑟 = 𝑎𝑟 − 1, 𝑎𝑠′ = 𝑎𝑠 + 1, and let the other integers 𝑎𝑖 be unchanged. Then
(12.1.19) is still valid, because for 𝑟 ≤ 𝑖 ≤ 𝑠 − 1 the left-hand side of (12.1.19) became
smaller by 1, hence the inequality still holds (some > may be replaced by ≥), and for
𝑖 ≥ 𝑠 (and also for 𝑖 < 𝑟) the left-hand side of (12.1.19) was not affected.
We show that the sum of reciprocals has increased, so
1 1 1 1
+ < ′ + ′,
𝑎𝑟 𝑎𝑠 𝑎𝑟 𝑎𝑠
or
𝑎𝑟 + 𝑎𝑠 (𝑎 − 1) + (𝑎𝑠 + 1)
< 𝑟 .
𝑎𝑟 𝑎𝑠 (𝑎𝑟 − 1)(𝑎𝑠 + 1)
As the numerators are equal, this is equivalent to the converse inequality for the de-
nominators (all occurring numbers are positive), and a calculation gives 𝑎𝑟 − 1 < 𝑎𝑠
which clearly holds.
Finally, we can show that our numbers form a positive, strictly increasing sequence
in a similar way as seen in case (A).
It is clear from the algorithm that applying the steps a finite number of times we
get that there should be equality in (12.1.19) also for 𝑖 = 𝑟. Then we repeat the whole
process with the first value 𝑖 > 𝑟 for which there is a strict inequality in (12.1.19) till
we get equality for this value 𝑖. This proves that in finitely many steps we arrive at the
state when we have equality everywhere in (12.1.19), as stated. □
Exercises 12.1
In the exercises 1 ≤ 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑘 ≤ 𝑛 denote integers satisfying various condi-
tions.
1. (a) Find the maximum of 𝑘 (in terms of 𝑛), if no 𝑎𝑖 is the sum of (more than one)
distinct integers 𝑎𝑗 .
* (b) Let 𝑎1 < 𝑎2 < . . . be an infinite sequence of positive integers such that no 𝑎𝑖 is
the sum of (more than one) distinct integers 𝑎𝑗 . Let 𝐴(𝑛) denote the number
of elements in the sequence not exceeding 𝑛. Prove lim𝑛→∞ 𝐴(𝑛)/𝑛 = 0.
2. Assume that no 𝑎𝑖 can be written as 𝑎𝑗 + 𝑎𝑗+1 . Let 𝑓(𝑛) be the maximum of 𝑘 with
this condition. Show that lim𝑛→∞ 𝑓(𝑛)/𝑛 = 2/3.
S 3. We examine the number of representations of an integer 𝑡 as a sum of consecutive
elements 𝑎𝑖 , i.e in the form 𝑡 = 𝑎𝑖 + 𝑎𝑖+1 + ⋯ + 𝑎𝑗 (there is no restriction on the
number of terms and we allow 𝑖 = 𝑗). Let 𝐿(𝑘) be the maximal number of solutions
of the equation 𝑡 = 𝑎𝑖 + 𝑎𝑖+1 + ⋯ + 𝑎𝑗 taken for all possible systems 𝑎𝑖 and 𝑡 (also
𝑛 can be arbitrary). Verify 𝐿(𝑘) = ⌈𝑘/2⌉.
Exercises 12.1 385
4. Assume [𝑎𝑖 , 𝑎𝑗 ] > 𝑛 for every 𝑖 ≠ 𝑗 (where [ ] stands for the least common multi-
ple). Prove that the sum of reciprocals of the numbers 𝑎𝑖 is less than (a) 2 (b) 3/2.
Remark: Schinzel and Szekeres showed that the maximal sum of reciprocals is
31/30, and this occurs only for the numbers 2, 3, 5, and 𝑛 = 5.
𝑘−1
1
5. Show ∑ < 1 (for any integers 𝑎𝑖 ).
𝑖=1
[𝑎𝑖 , 𝑎𝑖+1 ]
6. Assume that 𝑎𝑖 + 𝑎𝑗 is never a square. Let 𝑔(𝑛) be the maximum of 𝑘 with this
condition.
(a) Verify
1 𝑔(𝑛) 𝑔(𝑛) 1
≤ lim inf and lim sup ≤ .
3 𝑛→∞ 𝑛 𝑛→∞ 𝑛 2
* (b) Improve the lower bound to 11/32 in the previous inequality.
Remark: In 2002 Endre Szemerédi proved that lim𝑛→∞ 𝑔(𝑛)/𝑛 = 11/32.
* 7. Assume that 𝑎𝑖 − 𝑎𝑗 is never a square (for 𝑖 ≠ 𝑗). Let ℎ(𝑛) be the maximum of 𝑘
with this condition. Verify ℎ(𝑛) ≥ 𝑛0.7 if 𝑛 is large enough.
Remark: This result is due to Ruzsa. Sárközy and Fürstenberg proved that (in con-
trast to the sum problem in the previous exercise) lim𝑛→∞ ℎ(𝑛)/𝑛 = 0, but the exact
order of magnitude of ℎ(𝑛) in not known.
* 8. Assume that the products formed from arbitrarily many (distinct) numbers 𝑎𝑖 are
distinct. Let 𝑠(𝑛) be the maximum of 𝑘 with this condition. Prove
|𝑠(𝑛) − 𝜋(𝑛)| < 2𝑛2/3 ,
where 𝜋(𝑛) is the number of primes not exceeding 𝑛.
Remark: Erdős proved that there exist positive constants 𝑐 1 and 𝑐 2 such that for
every 𝑛 large enough
√𝑛 √𝑛
𝜋(𝑛) + 𝑐 1 < 𝑠(𝑛) < 𝜋(𝑛) + 𝑐 2 .
log 𝑛 log 𝑛
A related question is a multiplicative variant of the (additive) Sidon problem (to be
investigated in the next section), when we require only products 𝑎𝑖 𝑎𝑗 composed of
two factors (𝑖 < 𝑗) to be distinct. Erdős showed that (for suitable positive constants
𝑐 3 and 𝑐 4 , and for every 𝑛 large enough)
𝑛3/4 𝑛3/4
𝜋(𝑛) + 𝑐 3 3/2
< max 𝑘 < 𝜋(𝑛) + 𝑐 4 .
(log 𝑛) (log 𝑛)3/2
𝑎𝑖
11. Show that if 𝑘 is a prime, then ≥ 𝑘 for some 𝑖 and 𝑗.
(𝑎𝑖 , 𝑎𝑗 )
Remark: The result is true also for every 𝑘. This long-standing unsolved conjecture
of R. L. Graham was proved (for 𝑘 large enough) by Mario Szegedy in 1985, when
he was still a university student.
12. Assume that for 𝑛 = 2𝑗 there exist 𝑘 = 2 + ⌊log2 𝑛⌋ integers 𝑎𝑖 between 1 and 𝑛 so
that all subset sums are distinct. Show that the same holds also for every 𝑛 ≥ 2𝑗 .
13. How far can be improve the upper bound (12.1.2) in Theorem 12.1.1 if we use an
optimal 𝑐 in Chebyshev’s inequality in the proof?
In the opposite direction, it is much less clear how we can get the order of magni-
tude √𝑛. The example of powers of two yields log2 𝑛, and the greedy algorithm guar-
3
antees only √𝑛 (see Exercise 12.2.1). But a nice elementary construction of Erdős pro-
vides √𝑛/2 elements (see Exercise 12.2.2), and as mentioned, we can lift the coefficient
of √𝑛 to 1.
Let us start constructing really big Sidon sets. We do this for some special 𝑛 first,
and then use the result to handle general 𝑛.
Theorem 12.2.1. Let 𝑝 be an arbitrary positive prime and 𝑛 = 𝑝2 + 𝑝 + 1. There exists
a Sidon set in the interval [1, 𝑛] that has ⌈√𝑛⌉ = 𝑝 + 1 elements. ♣
Proof. We use some basic facts about finite fields and a bit of linear algebra.
Consider the finite field 𝐹3 of 𝑝3 elements and its subfield 𝐹1 of 𝑝 elements. Let Δ
be a generator of the cyclic multiplicative group of 𝐹3 , so
3 −1
(12.2.1) 𝐹3 = {0, Δ, Δ2 , . . . , Δ𝑝 = 1}.
The non-zero elements of 𝐹1 form a subgroup of the multiplicative group of 𝐹3 . This
cyclic subgroup is generated by Δ𝑛 , where 𝑛 = (𝑝3 − 1)/(𝑝 − 1) = 𝑝2 + 𝑝 + 1. Thus
3 −1
𝐹1 = {0, Δ𝑛 , Δ2𝑛 , . . . , Δ(𝑝−1)𝑛 = Δ𝑝 = 1}.
Consider 𝐹3 as a vector space over 𝐹1 . By the above, Δ and Δ𝑗 in 𝐹3 are linearly depen-
𝑖
so
(Θ + 𝛾 𝑖 )(Θ + 𝛾𝑗 ) − 𝛾(Θ + 𝛾 𝑘 )(Θ + 𝛾𝑚 ) = 0
for some 𝛾 ∈ 𝐹1 . Since the degree of Θ is 3 over 𝐹1 , it cannot be a root of a polynomial
of degree at most 2. Therefore only 𝛾 = 1 and {𝛾 𝑖 , 𝛾𝑗 } = {𝛾 𝑘 , 𝛾𝑚 } are possible which
means that the corresponding pairs of integers 𝑎𝑖 are the same, as stated.
The proof runs the same way if 𝑎𝑝+1 = 0 occurs among the four integers 𝑎𝑖 . □
Remark: Theorem 12.2.2 and its proof remain valid if 𝑝 is a prime power. All this is
closely related to finite projective planes.
Theorem 12.2.3. If 𝑛 is large enough, then the interval [1, 𝑛] contains a Sidon set having
at least 𝑛1/2 − 𝑛0.27 elements. ♣
Proof. Consider the biggest prime 𝑝 less than or equal to 𝑝2 + 𝑝 + 1 ≤ 𝑛 and perform
the previous construction of 𝑝 + 1 elements for 𝑝2 + 𝑝 + 1. By Theorem 5.5.4(A), there
is a prime between 𝑛1/2 − 𝑛0.27 and 𝑛1/2 if 𝑛 is large enough, so 𝑝 > 𝑛1/2 − 𝑛0.27 , thus
verifying the theorem for a general 𝑛. □
Remark: In the transition to an arbitrary 𝑛, we used that the primes occur densely. If
we know that there is a prime between 𝑁 and 𝑁 + 𝑁 𝑐 for 𝑁 large enough, then the
error term in our theorem can be reduced to 𝑛𝑐/2 . As we experienced in Section 5.5, the
question of the size of the gaps between consecutive primes is a very hard problem.
For other proofs of Theorem 12.2.3, see Exercises 12.2.3 and 12.2.4.
Now we turn to the sharp upper bound of the size of Sidon sets.
Theorem 12.2.4. A Sidon set in the interval [1, 𝑛] has at most 𝑛1/2 +𝑛1/4 +1 elements. ♣
We now count the pairs {𝑎𝑖 , 𝑎𝑗 }, 𝑖 > 𝑗 that fall into such an interval. We count them
with the suitable multiplicity, so each pair is counted as many times as the number of
intervals that contain it. Let 𝐷 be the total number of such pairs. Then
𝑛+𝑡 𝑛+𝑡 2 𝑛+𝑡
𝐴 𝐴 𝐴
(12.2.5) 𝐷 = ∑ ( 𝑖) = ∑ 𝑖 − ∑ 𝑖 .
𝑖=1
2 𝑖=1
2 𝑖=1
2
On the other hand, if the difference 𝑎𝑖 − 𝑎𝑗 in a pair is 𝑑, then it falls into exactly 𝑡 − 𝑑
intervals. By the Sidon property, every such 𝑑 can occur at most once, so
𝑡−1
𝑡(𝑡 − 1)
(12.2.6) 𝐷 ≤ ∑ (𝑡 − 𝑑) = .
𝑑=1
2
12.2. Sidon Sets 389
Using (12.2.4) and the inequality for arithmetic and quadratic means, we can estimate
the left-hand side of (12.2.7) from below:
𝑛+𝑡 2
𝑛+𝑡 𝑛+𝑡 (∑𝑖=1 𝐴𝑖 ) 𝑡 2 𝑠2
(12.2.8) ∑ 𝐴2𝑖 − ∑ 𝐴𝑖 ≥ − 𝑡𝑠 = − 𝑡𝑠.
𝑖=1 𝑖=1
𝑛+𝑡 𝑛+𝑡
From (12.2.7) and (12.2.8), we infer
𝑛 𝑛
𝑠2 − 𝑠 ( + 1) − ( + 1) (𝑡 − 1) ≤ 0.
𝑡 𝑡
Solving this quadratic inequality, we get
𝑛 1 𝑛2 𝑛 3
𝑠≤ + + √𝑛 + 𝑡 + 2 − − .
2𝑡 2 4𝑡 2𝑡 4
Choosing 𝑡 = ⌊𝑛3/4 ⌋ + 1, we arrive at the statement of the theorem. □
Second proof. We shall estimate the sum of certain differences 𝑎𝑖 −𝑎𝑗 from both sides.
Let
(12.2.9) 𝐾= ∑ (𝑎𝑖 − 𝑎𝑗 ),
0<𝑖−𝑗≤𝑟
Combining (12.2.11) and (12.2.12) and multiplying by 2/𝑟2 , we obtain the inequality
𝑤2 < 𝑛 + 𝑛/𝑟. Taking a square root and substituting (12.2.10), we get
𝑟+1 𝑛
𝑠< + 𝑛+ .
2 √ 𝑟
Now we turn to infinite Sidon sets. Erdős showed in 1955 that an infinite Sidon
set is necessarily less dense; it cannot be of about the maximal finite size, i.e. √𝑛 in
interval [1, 𝑛] for every 𝑛:
Theorem 12.2.5. Let 𝐴(𝑛) denote the number of elements in an infinite sequence 𝐴 up
to 𝑛. If 𝐴 is an infinite Sidon set, then
𝐴(𝑛) 𝐴(𝑛)
lim inf = 0, moreover lim inf < ∞. ♣
𝑛→∞ √𝑛 𝑛→∞ √𝑛/ log 𝑛
Proof. Let 𝑁 be a large integer and 𝐴𝑖 the number of elements of 𝐴 in the interval
[(𝑖 − 1)𝑁 + 1, 𝑖𝑁], so
Hence
𝑁 𝑁
1
2𝑁 > ∑ 𝐴𝑖 (𝐴𝑖 − 1) ≥ ∑ (𝐴2 − 1),
𝑖=1
2 𝑖=1 𝑖
so
𝑁
(12.2.13) ∑ 𝐴2𝑖 < 5𝑁.
𝑖=1
We shall estimate
𝑁
𝐴𝑖
𝑆=∑
𝑖=1 √𝑖
from both directions. On the one hand, applying Cauchy’s inequality and (12.2.13), we
obtain
√
√ 𝑁 𝑁
1
(12.2.14) 𝑆 ≤ √( ∑ 𝐴2𝑖 ) ( ∑ ) ≈ √5𝑁 log 𝑁.
𝑖
√ 𝑖=1 𝑖=1
12.2. Sidon Sets 391
𝑖𝑁
(12.2.16) 𝐴(𝑖𝑁) > 𝑐 , 𝑖 = 1, 2, . . . , 𝑁,
√ log(𝑖𝑁)
for some 𝑐 > 0, then (12.1.15) implies
𝑁−1 𝑁−1
√𝑖𝑁 𝑐√𝑁 1 𝑐
(12.2.17) 𝑆>𝑐 ∑ = ∑ ≈ √𝑁 log 𝑁.
𝑖=1 2(𝑖 + 1)√𝑖 log 𝑁 2 √8 log 𝑁 𝑖=1
𝑖 + 1 √8
Since (12.1.17) contradicts (12.1.14) for 𝑐 > √40, (12.1.16) cannot hold for 𝑐 > √40,
which proves the statement of the theorem. □
Theorem 12.2.5 does not assert that an infinite Sidon set could not be now and then
as dense as a finite one. In fact, Erdős and later Krückeberg constructed an infinite
Sidon set that has nearly √𝑛 elements in the interval [1, 𝑛] for infinitely many integers
𝑛 (see Exercise 12.2.5).
If we want to construct an infinite Sidon set that is sufficiently dense in every finite
3
initial segment, then the greedy algorithm provides one having always at least √𝑛 ele-
ments up to 𝑛 (see Exercise 12.2.1). It is surprising that it took a long time to surpass
this order of magnitude: Ajtai, Komlós, and Szemerédi proved in 1981 the existence
3
of an infinite Sidon set that has at least 𝑐 √𝑛 log 𝑛 elements up to every (sufficiently
3
large) 𝑛 with a suitable positive constant 𝑐. Even this was just slightly better than √𝑛
obtained by the greedy algorithm. In 1997 Ruzsa improved the bound significantly to
𝑐𝑛√2−1−𝜀 , though even this is far from the order of magnitude 𝑛1/2−𝜀 conjectured by
Erdős (where 𝜀 is an arbitrarily small positive number).
Finally, we consider infinite sequences where the Sidon property is replaced by
a weaker condition: the number of representations of positive integers as 𝑎𝑖 + 𝑎𝑗 is
bounded (this bound is 1 for Sidon sets). We show that we can achieve the order of
magnitude 𝑛1/2−𝜀 for such sequences:
Theorem 12.2.6. For every 𝜖 > 0 there exist an integer 𝑚 and an infinite sequence 𝐴 =
{1 ≤ 𝑎1 < 𝑎2 < ⋯} such that
𝐴(𝑛)
lim inf 1/2−𝜖 > 0,
𝑛→∞ 𝑛
and every positive integer has at most 𝑚 representations in the form 𝑎𝑖 + 𝑎𝑗 . ♣
Theorem 12.2.6 is due to Erdős and Rényi. Their proof was among the first prob-
abilistic constructions in number theory: Introducing a suitable probability space on
392 12. Combinatorial Number Theory
the set of sequences of positive integers, they verified that (with respect to this proba-
bility) almost all sequences meet the requirements. We shall use this type of argument
to prove Theorem 12.6.3.
The elementary proof below to Theorem 12.2.6 is due to Ruzsa.
Proof. We shall use a number system with varying bases, so we write integers in the
form
𝑐 0 + 𝑐 1 𝑘1 + 𝑐 2 𝑘1 𝑘2 + ⋯ + 𝑐 𝑖 𝑘1 . . . 𝑘𝑖 + ⋯ ,
where 𝑘1 , 𝑘2 , . . . are integers greater than 1 (these are the varying bases) and the digits
are 0 ≤ 𝑐 𝑖 < 𝑘𝑖+1 . We choose the bases as a slowly increasing sequence to satisfy
for some small positive 𝛿. We also fix a finite Sidon set 𝑆 𝑖 of maximal size between 0
and 𝑘𝑖 /2 for every 𝑖 (we may clearly assume that the smallest element is 0 in 𝑆 𝑖 ).
We can construct the required infinite set as follows. We take integers with digits
from the corresponding Sidon sets, i.e. 𝑐 𝑖 ∈ 𝑆 𝑖+1 , and at most 𝑡 digits can differ from 0.
Adding two such numbers, there occurs no carrying, so every integer can be writ-
ten as the sum of two such numbers in at most 2𝑡 ways (at every place the digits can be
interchanged between the two numbers), so 𝑚 = 2𝑡 . We shall guarantee the required
density by a suitable choice of 𝛿 and 𝑡.
For any 𝑛
(12.2.19) 𝑘1 𝑘2 . . . 𝑘𝑗 ≤ 𝑛 < 𝑘1 𝑘2 . . . 𝑘𝑗 𝑘𝑗+1
for some 𝑗. Our sequence definitely contains all the integers with digits
(12.2.20) 𝑐 0 = 𝑐 1 = ⋯ = 𝑐𝑗−𝑡−1 = 0 and 𝑐 𝑖 ∈ 𝑆 𝑖+1 , 𝑖 = 𝑗 − 𝑡, . . . , 𝑗 − 1.
We shall show that the number of these integers alone is greater than 𝑛1/2−𝜀 , if we
choose a sufficiently small 𝛿 and a sufficiently large 𝑡.
Let us see the details. Let 𝑘1 = 𝑟 and
𝑖−1
(12.2.21) 𝑘𝑖 = ⌊𝑟(1+𝛿) ⌋
𝑘𝑖 (1 + 𝛿)𝑖−1 − log𝑟 4
(12.2.22) |𝑆 𝑖 | > √ > 𝑟ℎ𝑖 , where ℎ𝑖 = .
3 2
Let 𝐾 denote the number of integers satisfying (12.2.20). Then it is enough to show
1
(12.2.23) 𝐾 > 𝑛1/2−𝜀 , or log𝑟 𝐾 > ( − 𝜀) log𝑟 𝑛
2
for every sufficiently large 𝑛. We estimate log𝑟 𝑛 from above with the help of (12.2.19)
and (12.2.21):
(1 + 𝛿)𝑗+1
(12.2.24) log𝑟 𝑛 < log𝑟 (𝑘1 𝑘2 . . . 𝑘𝑗+1 ) ≤ 1 + (1 + 𝛿) + ⋯ + (1 + 𝛿)𝑗 < .
𝛿
Exercises 12.2 393
Now we estimate log𝑟 𝐾 from below. Since 𝐾 = |𝑆𝑗−𝑡+1 | ⋅ ⋯ ⋅ |𝑆𝑗 |, (12.2.22) yields
(1 + 𝛿)𝑗−𝑡 + ⋯ + (1 + 𝛿)𝑗−1 − 𝑡 log𝑟 4
log𝑟 𝐾 >
2
𝑗−𝑡 𝑡
(12.2.25) (1 + 𝛿) ((1 + 𝛿) − 1) 𝑡 log𝑟 4
= −
2𝛿 2
(1 + 𝛿)𝑗 𝑡 log 𝑟4
= (1 − (1 + 𝛿)−𝑡 ) − .
2𝛿 2
By (12.2.24) and (12.2.25),
2 log𝑟 𝐾 (1 + 𝛿)𝑗 (1 − (1 + 𝛿)−𝑡 ) − 𝑡𝛿 log𝑟 4
>
log𝑟 𝑛 (1 + 𝛿)𝑗+1
(12.2.26)
1 − (1 + 𝛿)−𝑡 𝑡𝛿 log𝑟 4
= − .
1+𝛿 (1 + 𝛿)𝑗+1
Now we choose a sufficiently small 𝛿, and then a sufficiently large 𝑡 so that the first term
in the last row of (12.2.26) is greater than 1−𝜀. As 𝛿 and 𝑡 are fixed, the numerator of the
second term is a constant whereas the denominator tends to infinity with 𝑗 → ∞, hence
the second term is less than 𝜀 if 𝑗 (i.e. if 𝑛) is large enough. So the entire expression is
greater than 1 − 2𝜀, which proves (12.2.23). □
Exercises 12.2
3
1. Show that the greedy algorithm yields a Sidon set between 1 and 𝑛 of at least √𝑛
elements.
2. Let 𝑝 > 0 be a prime and 𝑎𝑖 = 1 + 2𝑖𝑝 + ⟨𝑖2 mod 𝑝⟩, 𝑖 = 0, 1, . . . , 𝑝 − 1, where
⟨𝑖2 mod 𝑝⟩ denotes the least non-negative residue of 𝑖2 modulo 𝑝. Verify that this
is a Sidon set in [1, 𝑛] of size √𝑛/2 for 𝑛 = 2𝑝2 .
S* 3. Let 𝑝 > 0 be a prime. There exist 𝑝 integers 𝑎𝑖 such that the sums 𝑎𝑖 + 𝑎𝑗 , 𝑖 ≤ 𝑗,
are (not just distinct, but are) pairwise incongruent modulo 𝑝2 − 1.
Remark: An equivalent formulation is that the differences 𝑎𝑖 − 𝑎𝑗 , 𝑖 ≠ 𝑗, are (not
just distinct, but are) pairwise incongruent modulo 𝑝2 − 1. There are 𝑝2 − 𝑝 such
differences and 𝑝2 − 2 non-zero residues modulo 𝑝2 − 1. This means that nearly
all residues can be represented as a difference 𝑎𝑖 − 𝑎𝑗 . We can see from the proof
that the missing residues are the multiples of 𝑝+1. We can deduce Theorem 12.2.3
also from this exercise just as we did it from Theorem 12.2.2. (The same holds also
for the next exercise.)
S* 4. Let 𝑝 > 0 be prime. There exist 𝑝 − 1 integers 𝑎𝑖 such that the differences 𝑎𝑖 − 𝑎𝑗 ,
𝑖 ≠ 𝑗, are (not just distinct, but are) pairwise incongruent modulo 𝑝2 − 𝑝.
5. Construct a Sidon set satisfying 𝐴(𝑛) > (1/√2−𝜀)√𝑛 for every 𝜀 > 0 with infinitely
many 𝑛 (i.e. lim sup𝑛→∞ 𝐴(𝑛)/√𝑛 ≥ 1/√2).
Remark: It is unknown whether the same holds with 1 instead of 1/√2.
394 12. Combinatorial Number Theory
6. Sums of more terms. Let ℎ ≥ 2 be a fixed integer, and consider sequences in the
interval [1, 𝑛] such that the ℎ-fold sums are all distinct. (The Sidon sets are the
special case ℎ = 2.)
* (a) Prove the existence of a sequence having about 𝑛1/ℎ elements.
(b) Show that there is a constant 𝑐 = 𝑐(ℎ) depending only on ℎ such that every
sequence has at most 𝑐(ℎ)𝑛1/ℎ elements.
Remark: It is an unsolved problem whether, similar to the Sidon sets, we can reduce
𝑐(ℎ) to 1 + 𝜀, i.e. the maximal size is asymptotically 𝑛1/ℎ for ℎ > 2. The proof of
Theorem 12.2.4 does not work since we cannot switch sums to differences if ℎ ≠ 2.
7. Show that there exists an infinite sequence of integers 𝑎1 < 𝑎2 < ⋯ such that
every non-zero integer has a unique representation as 𝑎𝑖 − 𝑎𝑗 .
8. Two infinite sequences of positive integers 𝐴 and 𝐵 form a good pair if the sums
𝑎 + 𝑏 (𝑎 ∈ 𝐴, 𝑏 ∈ 𝐵) are distinct. We get a good pair if we cut a Sidon set into two
parts. Show that there exist denser good pairs, too: Construct a good pair such that
both 𝐴(𝑛) > 𝑐√𝑛 and 𝐵(𝑛) > 𝑐√𝑛 for every 𝑛 with a suitable constant 𝑐 > 0.
12.3. Sumsets
In this section we deal with sets of the type 𝐴 + 𝐴 = {𝑎𝑖 + 𝑎𝑗 ∣ 𝑎𝑖 , 𝑎𝑗 ∈ 𝐴}, where the
elements of 𝐴 are either integers in the interval [0, 𝑛 − 1] or residue classes modulo 𝑝
for some prime 𝑝. Let the number of elements in 𝐴 be |𝐴| = 𝑘.
𝑘+1
The size of 𝐴+𝐴 is maximal if 𝐴 is a Sidon set when |𝐴+𝐴| = ( ). We examine
2
now first the opposite extreme: What is the minimal value of |𝐴 + 𝐴|? If the elements
of 𝐴 are integers, then in conformity with expectations, the minimum occurs when 𝐴
consists of consecutive terms of an arithmetic progression, so min |𝐴 + 𝐴| = 2𝑘 − 1
(see Exercise 12.3.1). We get a similar result also if 𝐴 ⊆ 𝐙𝑝 (so the elements of 𝐴 are
modulo 𝑝 residue classes), we verify this (by no means obvious) fact in Theorem 12.3.1.
This result was found by Cauchy, but was rediscovered 120 years later independently by
Davenport and Chowla. We give two proofs and present several interesting applications
of the theorem and method in Exercises 12.3.3–12.3.8.
Our second topic concerning sumsets is a dual of the Sidon property in a certain
sense. For finite Sidon sets, the main goal was to find large sets 𝐴 such that every integer
has at most one representation in the form 𝑎𝑖 + 𝑎𝑗 . Now we are looking for small sets
𝐴 such that every integer in the interval [0, 𝑛 − 1] has at least one representation in
the form 𝑎𝑖 + 𝑎𝑗 . Sets 𝐴 with this property are called (additive) bases (of second order).
Theorem 12.3.3 provides lower and upper bounds for the minimal number of elements
in a basis.
Let us turn to determine the minimum of |𝐴 + 𝐴| if 𝐴 ⊆ 𝐙𝑝 . More generally, we
shall find the minimal number of elements in sets 𝐴 + 𝐵 = { 𝑎 + 𝑏 ∣ 𝑎 ∈ 𝐴, 𝑏 ∈ 𝐵 } as a
function of |𝐴| and |𝐵|. This is not just in order to have a more general result, but—as
so often in mathematics—this generalization gives the key to the proof of the original
statement.
12.3. Sumsets 395
First proof. To get a contradiction, we assume that for some 𝑝 there exist 𝐴 and 𝐵 for
which (12.3.1) is false. Let us call such a pair of sets ugly.
We consider an ugly pair 𝐴, 𝐵 with |𝐴| = 𝑘, |𝐵| = 𝑟, where 𝑟 is minimal. We shall
construct an ugly pair 𝐴′ , 𝐵 ′ with |𝐴′ | = 𝑘′ , |𝐵 ′ | = 𝑟′ , and 𝑟′ < 𝑟, which contradicts the
minimality of 𝑟. This means that there cannot be ugly pairs.
If 𝑘+𝑟−1 > 𝑝, then delete 𝑘+𝑟−1−𝑝(< 𝑟) elements from 𝐵, denote the remaining
set by 𝐵′ , and let 𝐴′ = 𝐴. Clearly,
|𝐴′ + 𝐵 ′ | ≤ |𝐴 + 𝐵| < min(𝑝, 𝑘 + 𝑟 − 1) = 𝑝 = min(𝑝, 𝑘′ + 𝑟′ − 1),
so 𝐴′ , 𝐵 ′ is an ugly pair and (0 <)𝑟′ < 𝑟, which is impossible. Therefore 𝑘 + 𝑟 − 1 ≤ 𝑝.
Clearly 𝑘 ≥ 𝑟 ≥ 2, since if 𝑘 < 𝑟, then interchanging the roles of 𝐴 and 𝐵 contradicts
the minimality of 𝑟, and if 𝑟 = 1, then (12.3.1) holds with equality, so 𝐴, 𝐵 is not an ugly
pair. As 𝑟 ≥ 2 and 𝑘 + 𝑟 − 1 ≤ 𝑝, 𝑘 < 𝑝.
We may assume 0 ∈ 𝐵, since adding the same value to every element in 𝐵 causes
no changes in |𝐴|, |𝐵|, and |𝐴 + 𝐵|.
We show that if 𝑏 ≠ 0 is any fixed element in 𝐵, then 𝐴 + 𝑏 = { 𝑎 + 𝑏 ∣ 𝑎 ∈ 𝐴 } ⊈ 𝐴.
Otherwise, we have 𝐴 + 𝑏 = 𝐴, and so the sums of elements on the two sides are the
same:
∑ 𝑎 = ∑ (𝑎 + 𝑏) = 𝑘𝑏 + ∑ 𝑎, so 𝑘𝑏 = 0,
𝑎∈𝐴 𝑎∈𝐴 𝑎∈𝐴
which is impossible as 𝑘 < 𝑝 and 𝑏 ≠ 0.
Thus there exist 𝑎1 ∈ 𝐴 and 𝑏1 ∈ 𝐵 such that 𝑎1 + 𝑏1 ∉ 𝐴. Let
𝐴′ = 𝐴 ∪ { 𝑎1 + 𝑏 ∣ 𝑏 ∈ 𝐵, 𝑎1 + 𝑏 ∉ 𝐴 } and 𝐵 ′ = { 𝑏 ∣ 𝑎1 + 𝑏 ∈ 𝐴 }.
Then clearly 𝑘′ + 𝑟′ = 𝑘 + 𝑟 and 0 < 𝑟′ < 𝑟 (since 0 ∈ 𝐵 ′ , but 𝑏1 ∉ 𝐵 ′ ). We show
𝐴′ + 𝐵 ′ ⊆ 𝐴 + 𝐵. Let 𝑎′ + 𝑏′ ∈ 𝐴′ + 𝐵′ . If 𝑎′ ∈ 𝐴, then 𝑎′ + 𝑏′ ∈ 𝐴 + 𝐵. If 𝑎′ = 𝑎1 + 𝑏,
then
𝑎′ + 𝑏′ = (𝑎1 + 𝑏) + 𝑏′ = (𝑎1 + 𝑏′ ) + 𝑏 ∈ 𝐴 + 𝐵,
since 𝑎1 + 𝑏′ ∈ 𝐴 by the definition of 𝐵′ . Therefore
|𝐴′ + 𝐵 ′ | ≤ |𝐴 + 𝐵| < min(𝑝, 𝑘 + 𝑟 − 1) = 𝑘 + 𝑟 − 1 = 𝑘′ + 𝑟′ − 1 = min(𝑝, 𝑘′ + 𝑟′ − 1),
so the pair 𝐴′ , 𝐵 ′ is ugly, and 𝑟′ < 𝑟, providing the contradiction. □
For 𝑎 ∈ 𝐴, let
Then deg 𝑔𝑎 ≤ 𝑟 − 1, but 𝑔𝑎 (𝑏) = 𝑓(𝑎, 𝑏) = 0 for every 𝑏 ∈ 𝐵, so 𝑔𝑎 has at least 𝑟 roots.
This is possible only if every coefficient of 𝑔𝑎 is 0. This means that every 𝑎 ∈ 𝐴 is a
root of each polynomial ℎ𝑖 of degree at most 𝑘 − 1, so each ℎ𝑖 has at least 𝑘 roots, which
implies ℎ𝑖 = 0 (i.e. every coefficient is 0). Therefore 𝑓 = 0 by (12.3.2). □
Second proof of Theorem 12.3.1. We assume that (12.3.1) is false for some 𝐴 and 𝐵.
As in the first proof, we may restrict ourselves to 𝑘 + 𝑟 − 1 ≤ 𝑝 (where |𝐴| = 𝑘 and
|𝐵| = 𝑟). Let 𝐶 = 𝐴 + 𝐵, so |𝐶| ≤ 𝑘 + 𝑟 − 2 < 𝑝. Let
Now we turn to the second topic of the section. Repeating the definition, an ad-
ditive basis of order 2 in [0, 𝑛 − 1] is a set 𝐴 of non-negative integers such that every
integer 0 ≤ 𝑟 ≤ 𝑛 − 1 is the sum of two elements in 𝐴, i.e. 𝑟 = 𝑎𝑖 + 𝑎𝑗 (𝑎𝑖 , 𝑎𝑗 ∈ 𝐴).
12.3. Sumsets 397
𝑘+1
If |𝐴| = 𝑘, then there are ( ) sums 𝑎𝑖 + 𝑎𝑗 , and if 𝐴 is a basis, then there are at
2
least 𝑛 distinct integers among them, so
𝑘+1 1
( ) ≥ 𝑛, hence 𝑘 > √2𝑛 − .
2 2
On the other hand, if 𝑛 is a square, 𝑛 = 𝑠2 , then the integers less than 𝑛 have (at most)
two digits in the number system with base 𝑠, so they can be written in the form 𝑖 + 𝑠𝑗,
where 0 ≤ 𝑖, 𝑗 ≤ 𝑠 − 1. This means that
𝐴 = {0, 1, . . . , 𝑠 − 1, 𝑠, 2𝑠, . . . , (𝑠 − 1)𝑠}
is a basis of second order having 2𝑠 = 2√𝑛 elements. If 𝑛 is not a square, then we do
the same for the smallest square greater than 𝑛, and so 𝑠 = ⌈√𝑛⌉.
These observations yield estimates for the minimal size of a basis:
1
(12.3.4) √2𝑛 − < min 𝑘 < 2√𝑛 + 2.
2
We show in the next theorem that the coefficients of √𝑛 can be slightly improved
in both bounds:
Theorem 12.3.3. Let 𝑓(𝑛) denote the minimal number of additive bases of second order
in [0, 𝑛 − 1]. Then
289
(12.3.5) √𝑛 − 2 < 𝑓(𝑛) < (√3.5 + 𝜀)√𝑛
√ 144
if 𝑛 is large enough, depending on 𝜀 > 0. ♣
This is the currently known best upper bound due to Katalin Fried. The lower
estimate comes from a simplified version of Moser’s method. Moser’s original bound
is somewhat better.
Proof. For the upper estimate, we observe that the construction using number systems
establishes the basis as the union of two arithmetic progressions. As a variant of this
idea, our basis will be the union of five arithmetic progressions.
Let 𝑡 be a positive integer, and consider the following five disjoint arithmetic pro-
gressions:
𝐵 = {𝑏0 , . . . , 𝑏𝑡 } = { 𝑗 ∣ 0 ≤ 𝑗 ≤ 𝑡 }
𝐶 = {𝑐 0 , . . . , 𝑐 3𝑡−1 } = { 2𝑡 + 1 + 𝑗(𝑡 + 1) ∣ 0 ≤ 𝑗 ≤ 3𝑡 − 1 }
𝐷 = {𝑑0 , . . . , 𝑑𝑡 } = { 3𝑡2 + 5𝑡 + 1 + 𝑗 ∣ 0 ≤ 𝑗 ≤ 𝑡 }
𝐸 = {𝑒 0 , . . . , 𝑒 𝑡 } = { 6𝑡2 + 12𝑡 + 3 + 𝑗𝑡 ∣ 0 ≤ 𝑗 ≤ 𝑡 }
𝐹 = {𝑓0 , . . . , 𝑓𝑡 } = { 10𝑡2 + 18𝑡 + 5 + 𝑗𝑡 ∣ 0 ≤ 𝑗 ≤ 𝑡 }
The differences of the progressions in order are 1, 𝑡 + 1, 1, 𝑡, and 𝑡, and they have 𝑡 + 1,
3𝑡, 𝑡 + 1, 𝑡 + 1, and 𝑡 + 1 elements.
Let 𝐴𝑡 be the union of the five sets, so |𝐴𝑡 | = 7𝑡 + 4. We verify that 𝐴𝑡 is a basis of
second order for 𝑛 = 14𝑡2 + 24𝑡 + 7, so every integer up to 14𝑡2 + 24𝑡 + 6 is the sum of
two elements in 𝐴𝑡 .
398 12. Combinatorial Number Theory
Thus
ℎ2 (𝑥) + ℎ(𝑥2 )
(12.3.7) 𝑔(𝑥) = ∑ 𝑥𝑎𝑖 +𝑎𝑗 = .
1≤𝑖≤𝑗≤𝑘
2
𝑟
The coefficient of 𝑥 in 𝑔(𝑥) is the number of representations of 𝑟 in the form 𝑎𝑖 + 𝑎𝑗
where 𝑖 ≤ 𝑗. Since every 0 ≤ 𝑟 ≤ 𝑛 − 1 can be written as 𝑎𝑖 + 𝑎𝑗 , the coefficient of 𝑥𝑟 is
at least 1, so
2𝑛−2
(12.3.8) 𝑔(𝑥) = 1 + 𝑥 + ⋯ + 𝑥𝑛−1 + ∑ 𝑢𝑚 𝑥𝑚 , where 𝑢𝑚 ≥ 0.
𝑚=0
where we shall determine the constant 𝜈 > 0 explicitly, which substituted back into
(12.3.9) will give the lower bound claimed in the theorem.
Let 𝐵 = 𝜏𝑘 and 𝐿 = (1 − 𝜏)𝑘 be the number of those elements in 𝐴 for which
𝑎𝑖 > (𝑛 − 1)/2 and 𝑎𝑖 ≤ (𝑛 − 1)/2, (so 𝐵 + 𝐿 = 𝑘 and 𝜏 is the ratio of the big elements
𝑎𝑖 in this basis).
2𝑛−2
Observe that 𝑆 ′ = ∑𝑚=𝑛 𝑢𝑚 is just the number of sums 𝑎𝑖 + 𝑎𝑗 , 𝑖 ≤ 𝑗, that are
greater than 𝑛 − 1. If both 𝑎𝑖 and 𝑎𝑗 are larger than (𝑛 − 1)/2, then 𝑎𝑖 + 𝑎𝑗 > 𝑛 − 1, so
We now substitute a complex 𝑛th root of unity 𝜚 ≠ 1 into 𝑥 in (12.3.8). Then the
sum 1 + 𝜚 + ⋯ + 𝜚𝑛−1 in (12.3.8) is 0, so
2𝑛−2
𝑔(𝜚) = ∑ 𝑢𝑚 𝜚𝑚 .
𝑚=0
since |𝜚| = 1, so
|ℎ(𝜚2 )| 𝑘
(12.3.13) ≤ ,
2 2
which will be negligible compared to the minuend |ℎ2 (𝜚)|/2 having an order of magni-
tude 𝑘2 .
Thus we seek a lower bound for
𝑘
(12.3.14) |ℎ(𝜚)| = || ∑ 𝜚𝑎𝑖 ||.
𝑖=1
Recall that we have to cope basically with the case when the small elements are domi-
nant, i.e. 𝐿 = (1 − 𝜏)𝑘 is big. Accordingly, in (12.3.14) we separate the parts belonging
to the small and large elements 𝑎𝑖 :
𝐿 𝑘 𝐿 𝑘
|ℎ(𝜚)| = || ∑ 𝜚𝑎𝑖 + ∑ 𝜚𝑎𝑖 || ≥ || ∑ 𝜚𝑎𝑖 || − || ∑ 𝜚𝑎𝑖 || ≥
𝑖=1 𝑖=𝐿+1 𝑖=1 𝑖=𝐿+1
(12.3.15)
𝐿 𝑘 𝐿
≥ || ∑ 𝜚𝑎𝑖 || − ∑ |𝜚𝑎𝑖 | = || ∑ 𝜚𝑎𝑖 || − 𝐵.
𝑖=1 𝑖=𝐿+1 𝑖=1
Exercises 12.3
(b) Generalize part (a) for 𝑛 subsets instead of two and for a polynomial 𝐺 in 𝑛
variables.
S* 6. Let 𝑝 > 2 be a prime, and let 𝐶 and 𝐷 be two subsets of the same size in 𝐙𝑝 . Show
that we can pair the elements of 𝐶 and 𝐷 so that the sums of the two elements in
the pairs are all distinct.
7. Formulate and prove the generalization of Theorem 12.3.1 for more than two sets.
8. We consider Exercise 3.6.6 and its generalizations in the plane and in higher di-
mensions.
* (a) Give a new proof to Exercise 3.6.6 based on Exercise 12.3.7.
(b) Verify that we can always find, among any five points of the usual square lat-
tice in the plane, two points such that their midpoint is a lattice point.
(c) Let 𝑓(𝑛) be the smallest integer such that among any 𝑓(𝑛) lattice points in the
plane, we can always find 𝑛 whose center of gravity is a lattice point. Show
𝑓(𝑛) ≥ 4𝑛 − 3.
Remark: The old conjecture 𝑓(𝑛) = 4𝑛 − 3 was proved in 2004.
(d) Let 𝑓(𝑛, 𝑑) be the smallest integer such that among any 𝑓(𝑛, 𝑑) points in the
usual 𝑑 dimensional lattice, we can always find 𝑛 whose center of gravity is a
lattice point. Prove
(i) 2𝑑 (𝑛 − 1) + 1 ≤ 𝑓(𝑛, 𝑑)) ≤ 𝑛𝑑 (𝑛 − 1) + 1
(ii) 𝑓(𝑛𝑚, 𝑑) ≤ 𝑓(𝑛, 𝑑) + 𝑛(𝑓(𝑚, 𝑑) − 1).
Remark: The upper bound in (i) can be greatly improved to 𝑐 𝑑 𝑛 where 𝑐 𝑑 is a
constant depending only on 𝑑. The lower bound is sharp for 𝑑 = 1 and 𝑑 = 2
(see part (a) and the remark after part (c)). However, the lower bound can be
improved for every 𝑑 > 2 if 𝑛 ≥ 3 is odd (the lower bound gives the right value
for every 𝑑 if 𝑛 = 2𝑘 , see below). The exact value of 𝑓(𝑛, 𝑑) is known for 𝑛 > 2
and 𝑑 > 2 only in the cases
𝑓(3, 3) = 19, 𝑓(3, 4) = 41, 𝑓(3, 5) = 91, and 𝑓(2𝑘 , 𝑑) = (2𝑘 −1)2𝑑 +1.
9. Let 𝑝 be a prime, 𝐴 ⊆ 𝐙𝑝 , and assume that the difference of two distinct elements
of 𝐴 is never a square in 𝐙𝑝 (so 𝑎𝑖 − 𝑎𝑗 , 𝑖 ≠ 𝑗, is always a quadratic non-residue
mod 𝑝). Prove |𝐴| < √𝑝.
10. A set 𝐴 of non-negative integers is called a basis of order ℎ for the interval [0, 𝑛 − 1]
if every integer 0 ≤ 𝑟 ≤ 𝑛 − 1 is the sum of ℎ elements of 𝐴. Let 𝑔(ℎ, 𝑛) denote the
minimal possible size of such a basis. Verify
√ℎ! 𝑛 − ℎ + 1 < 𝑔(ℎ, 𝑛) < ℎ√ℎℎ 𝑛 + ℎ.
ℎ
We deal first with the graph theoretical background. We start with the following
well-known puzzle: Among any six people there are either three so that any two know
each other, or there are three where no two know each other (the acquaintance is sup-
posed to be mutual).
Rewording in terms of graph theory, we consider a complete graph (or clique) of
six nodes corresponding to the six people, and an edge is colored red if its endpoints
know each other, and is colored blue otherwise. Then the statement says that however
we color the edges of a complete graph of six nodes, there is a monochromatic triangle.
To prove this, we pick a node 𝐴. Considering the five edges starting from 𝐴, (at
least) three of them must be of the same color, say red. Let 𝐵, 𝐶, and 𝐷 be the other
endpoints of these edges. If there is a red edge between two of them, say edge 𝐵𝐶 is
red, then 𝐴𝐵𝐶 is a red triangle, otherwise 𝐵𝐶𝐷 is a blue triangle.
We can generalize this puzzle: We color the edges of a complete graph of 𝑛 nodes
with 𝑡 colors, and instead of a monochromatic triangle we want to find a complete
graph of 𝑘 nodes with edges of the same color (the original problem is a special case
𝑡 = 2, 𝑘 = 3). Ramsey’s fundamental theorem asserts that we always have such a
subgraph if 𝑛 (depending on 𝑘 and 𝑡) is large enough :
Theorem 12.4.1 (Ramsey’s Theorem). For any 𝑡 and 𝑘 there exists an integer 𝑅(𝑘, 𝑡)
such that if 𝑛 ≥ 𝑅(𝑘, 𝑡) and we color the edges of a complete graph of 𝑛 nodes with 𝑡
colors, then there is a complete subgraph of 𝑘 nodes with edges of the same color. ♣
In the sequel 𝑅(𝑘, 𝑡) will denote the minimal integer with this property.
Solving the puzzle, we verified 𝑅(3, 2) ≤ 6, and it is easy to check that we have
here equality (see Exercise 12.4.1). We can read from the proof that 𝑅(3, 𝑡) ≤ 3𝑡!, more-
over 𝑅(3, 𝑡) ≤ ⌈𝑒𝑡! ⌉, where 𝑒 = 2.71 . . . is the base of the natural logarithm (see Ex-
ercise 12.4.2). We can improve the constant multiplier to 𝑒 − 1/24 with more refined
methods, but probably this is very far from the actual value of 𝑅(3, 𝑡). We know the
exact values of Ramsey numbers 𝑅(𝑘, 𝑡) only in very few cases, e.g. 𝑅(3, 3) = 17, and
there is generally a large gap between the lower and upper estimates.
Proof. For a clearer exposition, we prove first the case 𝑘 = 3 by induction on 𝑡, and
turn to a general 𝑘 afterwards. (The proof of Schur’s Theorem will require only the case
𝑘 = 3.)
I. We can start the induction either with 𝑡 = 1 (clearly, 𝑅(3, 1) = 3), or with 𝑡 = 2,
as we verified 𝑅(3, 2) ≤ 6 earlier. The idea used to prove the latter can serve as a general
induction step.
Assume that 𝑛 = 𝑅(3, 𝑡 − 1) exists, and color the edges of a complete graph of 𝑁
nodes with 𝑡 colors. If 𝑁 ≥ 1 + 𝑡(𝑛 − 1) + 1, then considering 𝑡(𝑛 − 1) + 1 edges starting
from a node 𝐴, there will be at least 𝑛 among them of the same color, say red, by the
pigeonhole principle. If there is a red edge between two other endpoints of these edges,
e.g. between 𝐵 and 𝐶, then 𝐴𝐵𝐶 is a red triangle. Otherwise, the 𝑛 endpoints form a
complete graph whose edges are colored with 𝑡 − 1 colors, so it contains a monochro-
matic triangle by the induction hypothesis.
12.4. Schur’s Theorem 405
II. To prove the general case, it is worthwhile to formulate a more refined version
of the problem. For a simpler wording, the size of a graph is its number of nodes, the
colors are the integers 1, 2, . . . , 𝑡, and a graph of color 𝑗 is a complete graph where every
edge has color 𝑗. Then the modified statement is:
For any 𝑡 and 𝑘1 , . . . , 𝑘𝑡 , there exists an 𝑛 = 𝑅∗ (𝑘1 , 𝑘2 , . . . , 𝑘𝑡 ) such that if we color
the edges of a complete graph of 𝑛 nodes arbitrarily with colors 1, 2, . . . , 𝑡, then there
results a complete subgraph of size 𝑘𝑗 and of color 𝑗 for some 𝑗. (𝑅∗ (𝑘1 , 𝑘2 , . . . , 𝑘𝑡 ) is
the smallest 𝑛 with this property.)
The two problems can easily be deduced from each other: clearly, 𝑅(𝑘, 𝑡) =
𝑅∗ (𝑘, . . . , 𝑘), and on the other hand, 𝑅∗ (𝑘1 , . . . , 𝑘𝑡 ) ≤ 𝑅(𝑘, 𝑡), where 𝑘 = max(𝑘1 , . . . , 𝑘𝑡 ).
If every 𝑘𝑖 = 1 or 2, then the modified statement is trivial. We claim that induction
yields
𝑡
(12.4.1) 𝑅∗ (𝑘1 , . . . , 𝑘𝑡 ) ≤ 1 + ∑ [𝑅∗ (𝑘1 , . . . , 𝑘𝑗 − 1, . . . , 𝑘𝑡 ) − 1] + 1.
𝑗=1
Let us color the edges of a complete graph of size 𝑁 with 𝑡 colors, where 𝑁 is the value on
the right-hand side of (12.4.1). Considering the edges starting from a node 𝐴, there will
be at least 𝑅∗ (𝑘1 , . . . , 𝑘𝑗 − 1, . . . , 𝑘𝑡 ) among them of color 𝑗 for some 𝑗 by the pigeonhole
principle. The other endpoints of these edges form a complete graph that contains a
suitable monochromatic complete subgraph by the induction hypothesis. If the color
of the subgraph is 𝑖 ≠ 𝑗, then we have a complete graph of size 𝑘𝑖 and color 𝑖, so we are
done. If its color is 𝑗, then we have a graph of size 𝑘𝑗 − 1, and together with 𝐴 it forms
a complete graph of size 𝑘𝑗 and color 𝑗. □
Theorem 12.4.2 (Schur’s Theorem). For any 𝑡 there exists an 𝑛 = 𝑆(𝑡) with the property
that coloring the numbers 1, 2, . . . , 𝑛 + 1 with 𝑡 colors arbitrarily, there will be some 𝑎 and
𝑏 of the same color such that 𝑎 + 𝑏 has this color (we allow 𝑎 = 𝑏). ♣
In the sequel 𝑆(𝑡) will denote the smallest such 𝑛. That is, 𝑆(𝑡) is the biggest wrong
integer: 1, 2, . . . , 𝑆(𝑡) can still be colored with 𝑡 colors so that the equation 𝑥 + 𝑦 = 𝑧
has no monochromatic solution. (In Ramsey’s Theorem, 𝑅(𝑘, 𝑡) is the minimal good
integer; we keep the traditional notation in both cases.)
Clearly, 𝑆(1) = 1, and we easily infer 𝑆(2) = 4. Besides these, the only values
known exactly are 𝑆(3) = 13 and 𝑆(4) = 44. We discuss some lower and upper bounds
for Schur numbers 𝑆(𝑡) in Exercise 12.4.3.
Proof. We show 𝑆(𝑡) < 𝑅(3, 𝑡), so the required property holds for an arbitrary coloring
of 1, 2, . . . , 𝑅(3, 𝑡). Consider the complete graph having these numbers as nodes, and
the graph-color of edge (𝑖, 𝑗) is defined as the number-color of |𝑖 −𝑗|. Then by Ramsey’s
Theorem, there results a monochromatic triangle in the graph, so the edges (𝑖, 𝑗), (𝑗, 𝑚),
and (𝑖, 𝑚) have the same graph-color for some 𝑖 < 𝑗 < 𝑚. This means that the integers
𝑎 = 𝑗 − 𝑖, 𝑏 = 𝑚 − 𝑗, and 𝑎 + 𝑏 = 𝑚 − 𝑖 have the same number-color. □
406 12. Combinatorial Number Theory
Now we turn to the connection between Schur’s Theorem and Fermat’s Last The-
orem.
Consider the congruence 𝑥𝑡 +𝑦𝑡 ≡ 𝑧𝑡 (mod 𝑝). If it has only trivial solutions where
𝑥𝑦𝑧 ≡ 0 (mod 𝑝) for infinitely many primes 𝑝, then Fermat’s Last Theorem follows for
the exponent 𝑡. Indeed, if we have a counterexample of non-zero integers 𝑎, 𝑏, and
𝑐 satisfying 𝑎𝑡 + 𝑏𝑡 = 𝑐𝑡 , then they provide a non-trivial solution of the congruence
for every prime 𝑝 > max(|𝑎|, |𝑏|, |𝑐|). But this contradicts that there are only trivial
solutions for infinitely many primes.
It turns out, however, that this idea does not lead to a proof of Fermat’s Last The-
orem:
Theorem 12.4.3. The congruence 𝑥𝑡 + 𝑦𝑡 ≡ 𝑧𝑡 (mod 𝑝) has a non-trivial (i.e. 𝑥𝑦𝑧 ≢ 0
(mod 𝑝)) solution for every prime 𝑝 large enough (depending on 𝑡). ♣
Proof. Let 𝑝 − 1 > 𝑆(𝑡) and 𝑔 be a primitive root mod 𝑝. We color the integers 1, 2,
. . . , 𝑝 − 1 with colors 0, 1, . . . , 𝑡 − 1 as follows: An integer gets color 𝑟 if it is congruent
mod 𝑝 to one of the numbers 𝑔𝑟 , 𝑔𝑟+𝑡 , 𝑔𝑟+2𝑡 , . . . .
By Schur’s Theorem, there is a monochromatic triple 𝑎, 𝑏, 𝑎 + 𝑏, so
𝑎 ≡ 𝑔𝑠𝑡+𝑟 , 𝑏 ≡ 𝑔ᵆ𝑡+𝑟 , 𝑎 + 𝑏 ≡ 𝑔𝑣𝑡+𝑟 (mod 𝑝)
for some 𝑟, 𝑠, 𝑢, and 𝑣. Hence
𝑔𝑠𝑡+𝑟 + 𝑔ᵆ𝑡+𝑟 ≡ 𝑔𝑣𝑡+𝑟 (mod 𝑝) .
Cancelling 𝑔𝑟 (which is coprime to 𝑝), we obtain
(𝑔𝑠 )𝑡 + (𝑔ᵆ )𝑡 ≡ (𝑔𝑣 )𝑡 (mod 𝑝) ,
so 𝑥 = 𝑔𝑠 , 𝑦 = 𝑔ᵆ , 𝑧 = 𝑔𝑣 is a non-trivial solution of the congruence. □
Schur raised also another problem concerning colorings of natural numbers, that
was first solved by Van der Waerden. We state this result without proof:
Theorem 12.4.4 (Van der Waerden’s Theorem). Coloring the positive integers with two
colors, there are arbitrarily long ( finite) monochromatic arithmetic progressions. ♣
In fact, Van der Waerden proved the following finite variant involving more colors
with a very tricky induction:
Theorem 12.4.4A (Van der Waerden’s Theorem). For any 𝑡 and 𝑘 there exists an 𝑛 =
𝑤(𝑘, 𝑡) such that coloring the integers 1, 2, . . . , 𝑛 with 𝑡 colors arbitrarily, there is a mono-
chromatic arithmetic progression of 𝑘 terms.
Similar to the Ramsey numbers 𝑅(𝑘, 𝑡) and Schur numbers 𝑆(𝑡), there is a big gap
between the lower and upper estimates for the (minimal) Van der Waerden numbers
𝑤(𝑘, 𝑡). The only exact values known are
𝑤(3, 2) = 9 𝑤(4, 2) = 35 𝑤(5, 2) = 178 𝑤(6, 2) = 1132
𝑤(3, 3) = 27 𝑤(4, 3) = 293 𝑤(3, 4) = 76
and trivially 𝑤(𝑘, 1) = 𝑘 and 𝑤(2, 𝑡) = 𝑡 + 1. For two colors, lower estimates of 𝑤(𝑘) =
𝑤(𝑘, 2) are discussed in Exercise 12.4.11.
Exercises 12.4 407
On the other hand, we can color the positive integers with two colors so that no
infinite monochromatic arithmetic progression arises, moreover we can show that no
infinite red and not even a three-term blue arithmetic progression occurs (see Exer-
cise 12.4.7).
We conclude the section by mentioning a substantial generalization of Van der
Waerden’s Theorem. This famous conjecture of Erdős and Turán resisted all attempts
for many decades, and was solved finally by Szemerédi. He thus deserved the biggest
prize (1000 US dollars) offered and paid by Erdős for a solution of a mathematical prob-
lem. (Very recently, a $10000 problem of Erdős was solved, too, see the story after
Theorem 5.5.4.) Szemerédi got an Abel Prize, one of the most prestigious honors in
mathematics, in 2012 for his many fundamental contributions to number theory, com-
binatorics, and computer science.
Let us look at the conjecture of Erdős and Turán. Van der Waerden’s Theorem
states that coloring the natural numbers, or its sufficiently long initial segment, there
will occur a long monochromatic arithmetic progression, but provides no information
about its color. We feel, of course, that this should be the most frequent color, i.e. one
having the largest density. Erdős and Turán had the idea that, independent of any
coloring, if we take a sufficiently dense subsequence of the natural numbers, then it
will contain a long arithmetic progression. The precise formulation of their conjecture
is
Theorem 12.4.5 (Szemerédi’s Theorem). Consider a subset of {1, 2, . . . , 𝑛} of maximal
size that does not contain a 𝑘-term arithmetic progression, and denote the number of its
elements by 𝑟 𝑘 (𝑛). Then lim𝑛→∞ 𝑟 𝑘 (𝑛)/𝑛 = 0 for any fixed 𝑘. ♣
This implies Van der Waerden’s Theorem: Coloring the integers 1, 2, . . . , 𝑛 with 𝑡
colors, some color must occur at least 𝑛/𝑡 times. If 𝑛 is large enough, then 1/𝑡 is bigger
than 𝑟 𝑘 (𝑛)/𝑛 tending to 0, so 𝑛/𝑡 > 𝑟 𝑘 (𝑛), thus there must occur a 𝑘-term arithmetic
progression of that color.
Another formulation of Szemerédi’s Theorem is that any sequence of natural num-
bers having positive upper density must contain arbitrarily long (finite) arithmetic pro-
gressions. Erdős extended his conjecture for even less dense sequences, thinking that
it is sufficient that the sum of reciprocals of elements be divergent. It was a great sur-
prise in 2004 when the conjecture was verified for the sequence of primes (so there are
arbitrarily long arithmetic progressions among the primes, see also Section 5.1), but
the general conjecture is still open.
Exercises 12.4
An equivalent formulation is that we cover the integers with residue classes of distinct
moduli (greater than 1): Every integer 𝑡 is an element of at least one of the residue
classes
(12.5.2) 𝑎1 (mod 𝑚1 ) , . . . , 𝑎𝑘 (mod 𝑚𝑘 ) , 1 < 𝑚1 < ⋯ < 𝑚 𝑘 ,
so 𝑡 ≡ 𝑎𝑖 (mod 𝑚𝑖 ) for at least one 𝑖.
Such systems of arithmetic progressions or congruences are called covering con-
gruences.
A simple example is
(12.5.3) 0 (mod 2) , 0 (mod 3) , 1 (mod 4) , 1 (mod 6) , 11 (mod 12) .
This is the minimal number of moduli, and these are the only possible moduli for
five congruences (see Exercise 12.5.4).
Erdős invented covering congruences to solve a seemingly remote problem, see
Theorem 12.5.2. There arise many questions concerning covering congruences. The
two oldest and at the same time most interesting ones are:
• Can all moduli be odd? This problem is still unsolved.
• Can all moduli be arbitrarily large, i.e. does there exist for any 𝐿 covering con-
gruences whose moduli are greater than 𝐿?
This was verified for values of 𝐿 which reached 𝐿 = 40 in 2008. In an extremely
long and tricky construction by Nielsen, just explaining the notation took several pages.
It was a great surprise, however, when it turned out that the answer is negative,
and there is an upper bound for the smallest modulus in covering congruences. Hough
presented this result in 2013 at a conference in honor of the centennial of Erdős’ birth.
It is a natural question to investigate exact or disjoint covering when the arith-
metic progressions in (12.5.1), or equivalently, the residue classes in (12.5.2) are dis-
joint, i.e. every integer satisfies exactly one congruence in (12.5.2).
The next theorem shows that this is not possible:
Theorem 12.5.1. The set of non-negative integers cannot be obtained as the disjoint
union of finitely many arithmetic progressions with distinct differences greater than 1. ♣
We present two proofs. The first relies on elementary analysis with complex num-
bers. The second formulates an interesting equivalent statement about regular poly-
gons and verifies it using geometric arguments.
(𝑧𝑎1 + 𝑧𝑎1 +𝑚1 + 𝑧𝑎1 +2𝑚1 + . . . ) + ⋯ + (𝑧𝑎𝑘 + 𝑧𝑎𝑘 +𝑚𝑘 + 𝑧𝑎𝑘 +2𝑚𝑘 + . . . ) =
= 1 + 𝑧 + 𝑧2 + ⋯ + 𝑧𝑛 + . . . .
410 12. Combinatorial Number Theory
(We used the fact that the series can be rearranged arbitrarily because it is absolutely
convergent for |𝑧| < 1.)
Summing the infinite geometric series, we obtain
𝑘
1 1
(12.5.4) ∑ 𝑧 𝑎𝑖 = .
𝑖=1
1 − 𝑧 𝑚𝑖 1−𝑧
If the complex variable 𝑧 tends to an 𝑚𝑖 th complex root of unity (on a path in the region
|𝑧| < 1), then the corresponding term 𝑧𝑎𝑖 /(1 − 𝑧𝑚𝑖 ) on the left-hand side of (12.5.4) will
be unbounded. Thus, if 𝑧 → 𝑤 = cos(2𝜋/𝑚𝑘 ) + 𝑖 sin(2𝜋/𝑚𝑘 ), then the last term on
the left-hand side is unbounded, whereas the other terms and the right-hand side are
bounded, since 𝑤 is not an 𝑚𝑖 th root of unity for 𝑖 < 𝑘 due to the maximality of 𝑚𝑘 .
This yields the desired contradiction. □
Second proof. Assume again that (12.5.1) is a disjoint union. As the arithmetic pro-
gressions are periodic modulo the least common multiple 𝑀 = [𝑚1 , . . . , 𝑚𝑘 ] of their
differences, our assumption is equivalent to the condition that each of the integers 1,
2, . . . , 𝑀 is an element of exactly one arithmetic progression.
We draw a regular 𝑀-gon, and label its vertices 1, 2, . . . , 𝑀 in that order. We choose
distinct colors to the covering arithmetic progressions, and paint the vertices covered
by a given arithmetic progression with its color. For example, if 𝑀 = 12 and the color
of the arithmetic progression 1 (mod 4) is red, then the vertices 1, 5, and 9 will be red.
The vertices covered by the arithmetic progression 𝑎𝑖 (mod 𝑚𝑖 ) form a regular
polygon of 𝑛𝑖 = 𝑀/𝑚𝑖 sides (allowing for when the polygon degenerates into a segment
or a point for 𝑛𝑖 = 2 and 1, resp.). Clearly, 𝑛1 > 𝑛2 > ⋯ > 𝑛𝑘 .
In this geometric formulation, we assumed the existence of a regular 𝑀-gon where
the vertices can be colored with 𝑘 > 1 colors so that the monochromatic vertices form
regular (possibly degenerate) polygons of different numbers of sides.
We shall use a simple geometric fact, namely that the sum of vectors from the
center of a regular 𝑛-gon to its vertices is zero for 𝑛 > 1 (including the degenerate case
𝑛 = 2). Indeed, rotating the sum vector 𝐯 around the center by angle 2𝜋/𝑛does not
change, since the polygon was mapped onto itself. On the other hand, 𝐯 gets rotated
by the given angle, so it can be only the zero vector.
For a clearer exposition, assume first 𝑛𝑘 = 1. Let 𝐬 and 𝐬𝑖 , 𝑖 = 1, . . . , 𝑘 be the sums
of vectors leading from the center to the vertices of the 𝑀-gon and the 𝑛𝑖 -gons formed
𝑘
from the vertices of color 𝑖. Then obviously 𝐬 = ∑𝑖=1 𝐬𝑖 , but by the previous remark,
𝐬 = 𝐬𝟏 = ⋯ = 𝐬𝑘−1 = 𝟎, whereas 𝐬𝑘 ≠ 𝟎, which is a contradiction.
We can handle the general case with a refinement of the argument. Let 𝑡 be fixed,
and consider the transformation that maps vertex 𝑗 of the regular 𝑀-gon into the vertex
𝑡𝑗 (mod 𝑀), 𝑗 = 1, . . . , 𝑀. We show that the images of the originally monochromatic
vertices cover the vertices of a regular polygon with the same multiplicity. E.g. if 𝑀 =
12 and 𝑡 = 2, then the images of 1, 5, 9 corresponding to the arithmetic progression
1 (mod 4) will be 2, 10, 6 in this order, so we get the regular triangle 2, 6, 10; for 2
(mod 3), vertices 2, 5, 8, 11 are mapped into 4, 10, 4, 10, so the images cover the regular
12.5. Covering Congruences 411
2-gon 4, 10 twice; finally, for 4 (mod 6), vertices 4, 10 go to 8, 8, thus we have a 1-gon
with double multiplicity.
This is the case also in general. For 𝑎𝑖 (mod 𝑚𝑖 ), the vertices 𝑎𝑖 + 𝑗𝑚𝑖 , 𝑗 = 0, 1, . . . ,
𝑛𝑖 − 1, are mapped into 𝑡𝑎𝑖 + 𝑗𝑡𝑚𝑖 (mod 𝑀). Considering this arithmetic progression
with difference 𝑡𝑚𝑖 modulo 𝑚, and arranging its elements into a suitable order, we
see that starting from 𝑡𝑎𝑖 we get vertices of distance (𝑡𝑚𝑖 , 𝑀) = (𝑡, 𝑛𝑖 )𝑚𝑖 between the
neighbors, and each vertex occurs (𝑡, 𝑛𝑖 ) times. So the images cover the vertices of a
regular polygon with the same multiplicity, and we get a 1-gon if and only if 𝑛𝑖 ∣ 𝑡.
Based on this, we choose 𝑡 = 𝑛𝑘 . Repeating our argument about the sums of
vectors from the center to the vertices, we get that the sum vector is zero for the images
of the 𝑛𝑖 -gons for 𝑖 < 𝑘 and of the original 𝑀-gon, but it is not zero for the images of the
𝑛𝑘 -gon. Thus we arrived at the same contradiction as in the special case 𝑛𝑘 = 1. □
Now we turn to Romanoff’s problem which was solved by Erdős using covering
congruences.
Theorem 12.5.2. There are infinitely many odd numbers that cannot be written as a
sum of a power of two and an odd integer. ♣
Exercises 12.5
2. Show that replacing a modulus 𝑚𝑖 by one of its divisors (different from 1 and the
other moduli), the new congruences keep the covering property.
3. Consider minimal covering congruences, where deleting any congruence will de-
stroy the covering property. Demonstrate that each 𝑚𝑖 divides the least common
multiple of the other moduli 𝑚𝑗 .
4. Prove that two, three, or four residue classes cannot form covering congruences,
and for five residue classes only the moduli in (12.5.3) are possible.
6. We can infuse life into the notion of disjoint covering congruences (DCC) if we
allow the repetition of moduli: 𝑎𝑖 (mod 𝑚𝑖 ), 𝑖 = 1, . . . , 𝑘, where 1 < 𝑚1 ≤ . . . ≤ 𝑚𝑘 ,
and every integer is an element of exactly one residue class. Verify the statements
about DCC:
𝑘
(a) ∑𝑖=1 1/𝑚𝑖 = 1
(b) 𝑚𝑘 = 𝑚𝑘−1
(c) to every 𝑘 there exist DCC satisfying 𝑚1 < 𝑚2 < ⋯ < 𝑚𝑘−1 .
7. Prove that infinitely many even numbers cannot be written as a sum of a power
of three and a prime. In general, to every odd number 𝑎 > 1 and to every even
number 𝑏 > 2 there exist infinitely many even and odd numbers, resp., that cannot
be written in the form 𝑎𝑛 + 𝑝 and 𝑏𝑛 + 𝑝, where 𝑝 is a prime.
Let 𝐵𝑘 be the set of integers 𝑟𝑑𝑘 where 𝑟 satisfies (12.6.9), and let
∞ ∞
(𝑘 − 1)𝑎𝑘 (𝑘 + 1)𝑎𝑘+1
(12.6.10) 𝐵= 𝐵𝑘 = { 𝑟𝑑𝑘 ∣ ≤𝑟< }.
⋃ ⋃ 𝑑𝑘 𝑑𝑘
𝑘=1 𝑘=1
Let us examine the terms on the right-hand side of (12.6.12) one by one.
By (12.6.10), the smallest element in 𝐵𝑘+1 is at least 𝑘𝑎𝑘+1 , so 𝐵𝑘+1 has a role in
𝐵(𝑛) only if
𝑛
(12.6.13) 𝑘𝑎𝑘+1 ≤ 𝑛, or 𝑎𝑘+1 ≤ .
𝑘
Even in this case, 𝑛 < (𝑘 + 1)𝑎𝑘+1 by (12.6.7), hence at most the multiples of 𝑑𝑘+1
between 𝑘𝑎𝑘+1 and (𝑘 + 1)𝑎𝑘+1 count in 𝐵𝑘+1 (𝑛), so
(𝑘 + 1)𝑎𝑘+1 − 𝑘𝑎𝑘+1 𝑎 𝑛
(12.6.14) 𝐵𝑘+1 (𝑛) ≤ + 1 = 𝑘+1 + 1 ≤ +1
𝑑𝑘+1 𝑑𝑘+1 𝑘𝑑𝑘−1
(we used (12.6.5) and (12.6.13) for the last inequality).
Similarly, 𝐵𝑘 (𝑛) counts the multiples of 𝑑𝑘 between (𝑘 − 1)𝑎𝑘 and 𝑛, so
𝑛 − (𝑘 − 1)𝑎𝑘 𝑛 − (𝑘 − 1)𝑎𝑘
(12.6.15) 𝐵𝑘 (𝑛) ≤ +1≤ + 1.
𝑑𝑘 𝑑𝑘−1
Also,
𝑘𝑎𝑘 − (𝑘 − 2)𝑎𝑘−1 𝑘𝑎𝑘
(12.6.16) |𝐵𝑘−1 | ≤ +1≤ + 1.
𝑑𝑘−1 𝑑𝑘−1
As 𝑊(𝑛) = ⌊log2 𝑛⌋, 𝑊(𝑛)𝑀(𝑛)/𝑛 < 𝑐, which is just slightly worse than (12.6.2).
The set 𝑊𝑠 = {𝑠, 𝑠2 , 𝑠3 , . . . } consisting of the powers of any integer 𝑠 > 1 has a CEC.
Proof. Since 2 is a primitive root mod 9, it is a primitive root mod 3𝑟 for every 𝑟 (see
part Y2 in the proof of Theorem 3.3.5). This means that if (3, 𝑛) = 1, there exists 𝑘,
0 < 𝑘 ≤ 𝜑(3𝑟 ) < 3𝑟 , satisfying 𝑛 ≡ 2𝑘 (mod 3𝑟 ). If 3 ∣ 𝑛, then we have 𝑛 − 1 ≡ 2𝑘
(mod 3𝑟 ). Thus for every 𝑛 and 𝑟, there exist 𝑣 and 0 < 𝑘 < 3𝑟 satisfying
(12.6.23) 𝑛 = 2𝑘 + 3𝑟 𝑣 or 𝑛 = 2𝑘 + 3𝑟 𝑣 + 1.
Accordingly, the complement 𝑀 will consist of suitable integers of the form 3𝑟 𝑣 and
3𝑟 𝑣 + 1.
For a given 𝑛, we first choose 𝑟 and then check which values of 𝑣 are needed.
𝑟 𝑟
Since 𝑘 < 3𝑟 implies 2𝑘 < 23 , 𝑣 is positive in (12.6.23) if 23 ≤ 𝑛. Therefore we
choose 𝑟 to satisfy
𝑟 𝑟+1
(12.6.24) 23 ≤ 𝑛 < 23 .
416 12. Combinatorial Number Theory
𝑟+1
𝑣 ≤ 3𝑟 𝑣 < 𝑛 < 23 ,
so let
∞
𝑟+1
(12.6.25) 𝑀= 𝑀𝑟 , where 𝑀𝑟 = { 3𝑟 𝑣, 3𝑟 𝑣 + 1 ∣ 0 < 𝑣 < 23 }.
⋃
𝑟=1
𝑟+1
(12.6.26) 𝐾 = { 3𝑟 𝑣 ∣ 0 < 𝑟, 0 < 𝑣 < 23 }.
Then
We divide 𝐾 into two parts 𝐾1 and 𝐾2 depending on 𝑣 ≤ 𝑇 and 𝑣 > 𝑇, resp., where
we choose a suitable 𝑇 later (as a function of 𝑛).
In 𝐾1 , there are 𝑇 possible values for 𝑣, and at most log3 𝑛 values for 𝑟, so
𝑟+1
By (12.6.26), 𝑇 < 𝑣 < 23 in 𝐾2 , so
𝑛 3 𝑛
|𝐾2 | < ∑ = ⋅ 𝑟 ,
𝑟≥𝑟0
3𝑟 2 30
9 𝑛
(12.6.30) |𝐾2 | < ⋅ .
2 log2 𝑇
By (12.6.27), (12.6.28), and (12.6.30), we have 𝑀(𝑛) < 2𝑇 log3 𝑛+9𝑛/ log2 𝑇. Choos-
ing 𝑇 = ⌊𝑛/(log2 𝑛)2 ⌋ for example, we arrive at (12.6.22). □
12.6. Additive Complements 417
Now we find a rare complement to the primes. The best known result is due to
Erdős:
Theorem 12.6.3. The set 𝑃 of the prime numbers has a complement 𝑅 satisfying
2
(12.6.31) 𝑅(𝑛) < 𝑐 log 𝑛
(where 𝑐 is an explicitly computable constant and log denotes the natural logarithm). ♣
Since 𝑃(𝑛) = 𝜋(𝑛) ∼ 𝑛/ log 𝑛, then 𝑃(𝑛)𝑅(𝑛)/𝑛 < 𝑐 log 𝑛, which is significantly
weaker than (12.6.2). Ruzsa verified that (12.6.2) is not attainable, so 𝑃 has no CEC.
The main line of the proof. We construct a probability space that consists of certain
sequences 𝑅 of positive integers, show that any sequence 𝑅 is a complement of 𝑃 with
2
probability 1, and 𝑅(𝑛) ∼ 𝑐 log 𝑛 holds with probability 1. This implies that there ex-
ists an 𝑅 meeting the requirements of the theorem. (This argument verifies only the
existence of a suitable sequence without explicitly constructing one. Moreover it guar-
antees that nearly all sequences are suitable, which should be understood, of course,
as a function of the probability in question.)
Let 0 ≤ 𝛼𝑖 ≤ 1, 𝑖 = 1, 2, . . . be real numbers. Then there exists a probability space
consisting of certain sequences 𝑅 of positive integers, where the probability of 𝑛 ∈ 𝑅
is 𝛼𝑛 for every positive integer 𝑛 and the events 𝑛 ∈ 𝑅 and 𝑚 ∈ 𝑅 are independent
for any 𝑛 ≠ 𝑚. We can imagine this as choosing the integers 1, 2, . . . in the sequences
independently with probabilities 𝛼1 , 𝛼2 , . . .
Let
(12.6.32) 𝛼𝑖 = min(1, 𝑑(log 𝑖)/𝑖),
where we will specify the constant 𝑑 > 0 later.
We sketch first a proof that a sequence 𝑅 is a complement of 𝑃 with probability 1.
Let 𝑄𝑛 be the event that 𝑛 cannot be written as 𝑛 = 𝑝 + 𝑟, where 𝑝 is a prime
and 𝑟 ∈ 𝑅, and we denote the probability of 𝑄𝑛 by 𝑞𝑛 . 𝑅 will be a complement of 𝑃 if
and only if only finitely many events 𝑄𝑛 occur. By the Borel–Cantelli lemma this has
probability 1 if the infinite series of probabilities 𝑞𝑛 is convergent, or
∞
(12.6.33) 𝑆 = ∑ 𝑞𝑛 < ∞.
𝑛=1
−𝑥
By (12.6.34) and 1 − 𝑥 ≤ 𝑒 , the sum 𝑆 in (12.6.33) obeys
∞ ∞ ∞
− ∑𝑝<𝑛 𝛼𝑛−𝑝
(12.6.35) 𝑆 = ∑ 𝑞𝑛 = ∑ ∏(1 − 𝛼𝑛−𝑝 ) ≤ ∑ 𝑒 .
𝑛=1 𝑛=1 𝑝<𝑛 𝑛=1
418 12. Combinatorial Number Theory
with a suitable constant ℎ if 𝑛 is large enough. Hence the quantity in (12.6.36) is less
than −𝑑ℎ log 𝑛, so by (12.6.35),
∞ ∞
𝑆 < ∑ 𝑒−𝑑ℎ log 𝑛 = ∑ 𝑛−𝑑ℎ ,
𝑛=1 𝑛=1
Finally, we state Lorentz’s result about complements of general sets without proof:
Theorem 12.6.4. For any 𝐴, there exists a complement 𝐵 satisfying
𝑛
log 𝐴(𝑖)
𝐵(𝑛) < 10 ∑ . ♣
𝑖=𝑎1
𝐴(𝑖)
Exercises 12.6
1. Generalize the example at the beginning of this section to a number system with
an arbitrary base 𝑐 > 1 instead of 10 and for an arbitrary grouping of the places
instead of the even-odd distribution. Verify that these sets 𝐴 and 𝐵 are always
complements, and compute lim inf𝑛→∞ 𝐴(𝑛)𝐵(𝑛)/𝑛.
2. Let 𝑊 be the set of powers of 2 and 𝑃1 = { 𝑝, 𝑝 + 1 ∣ 𝑝 is a prime }, so we include
the numbers 𝑝 + 1 into 𝑃1 . Are 𝑊 and 𝑃1 complements?
Exercises 12.6 419
3. Decide for each of the following conditions whether or not it is necessary or suf-
ficient for the set 𝐴 = {𝑎1 < 𝑎2 < . . . } to have a finite complement, so every
sufficiently large integer is the sum of an element in 𝐴 and an element in 𝐵 for
some suitable finite set 𝐵.
(a) 𝑎𝑖+1 − 𝑎𝑖 is bounded.
(b) 𝐴 contains an infinite arithmetic progression.
(c) lim inf𝑛→∞ 𝐴(𝑛)/𝑛 > 0.
(d) lim𝑛→∞ 𝐴(𝑛)/𝑛 = 1.
* 4. Let 𝐴 consist of the numbers 𝑎𝑘 = 6𝑘 + 𝑘, and 𝐵 consist of the multiples of 𝑑𝑘
between 6𝑘 (1 − 1/𝑘) and 6𝑘+1 , where 𝑑𝑘 is an integer of the form 2𝑖 3𝑗 satisfying
𝑑𝑘 < 𝑘−5 log6 𝑘, but also 𝑑𝑘 ∼ 𝑘 and 𝑑𝑘+1 ≥ 𝑑𝑘 . Verify that 𝐴 and 𝐵 are completely
economical complements.
5. Show that Theorem 12.6.4 guarantees a complement 𝑆 to the primes with 𝑆(𝑛) <
3
𝑐 log 𝑛 (which is thus weaker than Theorem 12.6.3).
6. Prove that any infinite set 𝐴 has a complement 𝐵 of density zero, i.e. 𝐵(𝑛)/𝑛 → 0,
as 𝑛 → ∞.
Answers and Hints
1.1.
1. The six digit number is 1001 times the three digit number, and 1001 is divisible by
91.
2. Show that in the product 𝑎2 − 𝑏2 = (𝑎 − 𝑏)(𝑎 + 𝑏), both factors are even and exactly
one of them is divisible by 4.
Another option: (2𝑘 + 1)2 − (2𝑚 + 1)2 = 4𝑘(𝑘 + 1) − 4𝑚(𝑚 + 1), and both terms
are multiples of 8 on the right-hand side.
7. 𝑐 = ±3.
421
422 Answers and Hints
(𝑏𝑘−1 − 1) + (𝑏𝑘−2 − 1) + ⋯ + (1 − 1) + 𝑘.
Here, the first 𝑘 terms are divisible by 𝑏 − 1.
11. If 𝑎 ≥ 𝑏, then 2𝑎 +1 = 2𝑎−𝑏 (2𝑏 −1)+2𝑎−𝑏 +1. Continuing, we obtain 2𝑏 −1 ∣ 2𝑑 +1
for some 𝑑 < 𝑎. Then 2𝑏 − 1 ≤ 2𝑑 + 1 ≤ 2𝑏−1 + 1 implying 𝑏 ≤ 2.
Another way: If 𝑏 has an odd prime divisor 𝑐 > 1, then 2𝑐 − 1 ∣ 2𝑎𝑐 − 1, and
2𝑐 − 1 ∣ 2𝑏 − 1 ∣ 2𝑎 + 1 ∣ 2𝑎𝑐 + 1, thus 2𝑐 − 1 ∣ 2, a contradiction. If 𝑏 is a multiple of
4, then 15 = 24 − 1 ∣ 2𝑏 − 1 ∣ 2𝑎 + 1, but this is impossible since 3 ∣ 2𝑎 + 1 ⟺ 𝑎
is odd, 5 ∣ 2𝑎 + 1 ⟺ 𝑎 = 4𝑘 + 2.
12. (a) If 𝑎 = 𝑏𝑞, then |𝑎| = |𝑏| ⋅ |𝑞| ≥ |𝑏| ⋅ 1 for 𝑞 ≠ 0.
(b) Part (a) implies that 𝑎 has 2 ⋅ |𝑎| divisors at most.
13. The largest and second largest proper divisors are less than or equal to the half and
the one third of the number. Answers:
(a) the positive even numbers
(b) the positive multiples of 3 and/or 4 (only 3𝑘 = 𝑘 + 𝑘 + 𝑘, 4𝑘 = 2𝑘 + 𝑘 + 𝑘, and
6𝑘 = 3𝑘 + 2𝑘 + 𝑘 are possible).
14. Denoting the digits backwards by 𝑎0 , . . . , 𝑎𝑠 ,
𝑎𝑠 𝑎𝑠−1 . . . 𝑎1 𝑎0 = 𝑎𝑠 10𝑠 + 𝑎𝑠−1 10𝑠−1 + ⋯ + 𝑎1 10 + 𝑎0 .
Observe:
(a) 10𝑘 − 1 is divisible by 9.
(b) 10𝑘 is divisible by 4 and 25 for 𝑘 ≥ 2.
(c) 10𝑘 is divisible by 8 and 125 for 𝑘 ≥ 3.
(d) 10𝑘 + 1 or 10𝑘 − 1 is divisible by 11 depending on whether 𝑘 is odd or even.
15. No, check the divisibility by 3.
16. Yes, prove by induction that to any 𝑘 there exists a 𝑘-digit number divisible by 2𝑘
and consisting only of digits 1 and 2.
17. (b) (𝑛𝑘) is an integer.
18. The first player has a winning strategy for every 𝑛 > 1.
19. Factor the numbers into the product of a power of two and an odd number and use
the pigeonhole principle. We can also use induction.
20. In 0 = 0 ⋅ 𝑞, the number 𝑞 is not unique.
21. (a) 𝑛 = 4𝑘 + 2. (b) 𝑛 = ±4.
22. (a) Divisible; the quotient is of the required form after eliminating the square root
in the denominator.
(b) 1 + √2 ∣ 1.
(c) The powers of 1 + √2 are units.
1.2. 423
1.2.
1. Answer: 97. Hint: The three-digit number divides the difference of the two num-
bers.
2. There are only 𝑚 possible remainders, so there must be infinitely many powers of
two all giving the same remainder when divided by 𝑚.
3. Consider the remainders of 𝑐 1 , 𝑐 1 + 𝑐 2 , . . . , 𝑐 1 + 𝑐 2 + ⋯ + 𝑐𝑛 when divided by 𝑛.
4. Given 𝑚, consider the integers having as digits only 1s and having at most 𝑚 + 1
digits: 1, 11, 111, . . . There must occur two among them with the same remainder
when divided by 𝑚, hence their difference is of the required form and is a multiple
of 𝑚.
5. Let 𝑟 𝑘 be the remainder of 𝜑𝑘 on division by 𝑚. The pairs (𝑟 𝑘 , 𝑟 𝑘+1 ) can assume
only 𝑚2 distinct values, therefore (𝑟𝑡 , 𝑟𝑡+1 ) = (𝑟𝑠 , 𝑟𝑠+1 ) for some 𝑡 > 𝑠. Show that
(𝑟 𝑘 , 𝑟 𝑘+1 ) = (𝑟 𝑘+𝑡−𝑠 , 𝑟 𝑘+𝑡−𝑠+1 ) for every 𝑘, i.e. the sequence of the remainders 𝑟𝑛 is
periodic (with a period 𝑡 − 𝑠). As 𝑟0 = 0, also 𝑟𝑗(𝑡−𝑠) = 0 for every 𝑗, so 𝑚 ∣ 𝜑𝑗(𝑡−𝑠) .
6. (a) Every integer is of the form 3𝑘 or 3𝑘± 1, so its square is of the form 3𝑠 or 3𝑠 + 1.
This means that a square can have a remainder 0 or 1 on division by 3.
(b) 0, 1. (c) 0, ±1. (d) 0, 1, 4.
7. Examine the remainder of the sum on division by 3 or 4.
8. (a) No. Examine the remainders of divisions by 4 and 5.
(b) Similar to (a), one can show that there is no such square with eight or more
digits and a four- or six-digit number must terminate with 4. Finally, check
the divisibility by 11 and 111/3 = 37. Answer: 7744 is the only solution.
9. Verify that an odd power of a number gives the same remainder as the number
itself when divided by 3.
10. Answer: 16 (so the product is always a multiple of 216 but not of 217 in some cases).
424 Answers and Hints
11. ⌊√𝑛⌋ = 𝑘 holds exactly for 𝑘2 ≤ 𝑛 < (𝑘 + 1)2 . Of these, 𝑘2 , 𝑘2 + 𝑘, and 𝑘2 + 2𝑘 are
divisible by 𝑘. Answer: 3(105 − 1) = 299997.
12. ⌊𝑎 + 𝑏⌋ − (⌊𝑎⌋ + ⌊𝑏⌋) = 0 or 1.
13. No: e.g. |𝑟| ≥ 4 if 12 = 4𝑞 + 𝑟 .
14. Let 𝑡 be the base of the number system. If 𝑑 ∣ 𝑡 − 1, then the remainder on division
by 𝑑 equals the remainder of the sum of the digits. If 𝑑 ∣ 𝑡𝑘 , then the remainder
equals the remainder of the number composed from the last 𝑘 digits. If 𝑑 ∣ 𝑡 + 1,
then the remainder equals the remainder of the alternating sum of the digits (the
last digit has to be taken with a positive sign).
15. This is the special case 𝑡 = 100, 𝑑 = 99 of the previous exercise.
16. Consider the remainder on division by 9. Answer: 8.
17. We convert each digit in base 9 into a two-digit number in base 3 (with first digit 0
if necessary). We can apply a similar procedure if one base is a power of the other
(with positive integer exponent).
18. Answer: 𝑛 = 8. Hint: 𝑡3 ≤ 𝑛 ≤ (𝑡 + 1)2 − 1 implies 𝑡 = 2.
19. From 𝑡 ∣ 735, 𝑡 ≥ 6, and 𝑡 < 10 we get 𝑡 = 7.
20. (a) We can measure every integer gram up to 210 −1 = 1023 with weights of 1, 2, 4,
. . . , 29 grams. This is the maximum. When measuring, there are two options
for each weight: whether or not we put it onto the pan. Thus ten weights can
measure at most 210 − 1 values (we subtract 1 for the case when we put no
weight onto the pan).
(b) We can measure every integer gram up to (310 −1)/2 with weights of 1, 3, 9, . . . ,
39 grams: in base three representation we have to convert the digits 2 to −1.
There is no better stock of weights: when measuring, there are three options
for each weight (left pan, right pan, no pan) but the result has to be divided
by 2 due to the symmetry of the two pans.
21. The limit is log2 10 = 3.3219 . . . .
22. Apply a suitable modification of the proof of Theorem 1.2.2.
23. Though the numbers increase rapidly in the beginning, we will get 0 in finitely
many steps. The reason is that we gradually “lose” all digits.
1.3.
(c) The analog of the division algorithm: We measure the smaller segment on the
larger one as many times as possible, so 𝑎 = 𝑏𝑞+𝑟 where 𝑞 is a positive integer,
𝑟 is a real number, and 0 ≤ 𝑟 < 𝑏. If two segments are commensurable, so
𝑎 = 𝑘𝑐 and 𝑏 = 𝑛𝑐 (with a common measure 𝑐), then the Euclidean algorithm
with 𝑎 and 𝑏 is essentially the same as the similar procedure with the integers
𝑘 and 𝑛, therefore it terminates. Conversely, if the Euclidean algorithm for the
segments terminates, then the last non-zero remainder is a common measure.
(d) The existence of such a special common measure follows from the Euclidean
algorithm.
(e) We start the Euclidean algorithm by measuring the side of length 𝑏 of the
square 𝐴𝐵𝐶𝐷 from 𝐴 on the diagonal 𝐴𝐶 of length 𝑎. We obtain an endpoint
𝐸 with 𝐴𝐸 = 𝑏 and 𝐸𝐶 = 𝑟. The perpendicular to the diagonal in 𝐸 intersects
side 𝐵𝐶 in 𝐹. Then 𝑟 = 𝐸𝐶 = 𝐸𝐹 = 𝐹𝐵. In the next step of the Euclidean
algorithm we divide 𝑏 by 𝑟 in the following way. We first measure 𝐵𝐹 on 𝐵𝐶
and then perform the division algorithm for the hypotenuse 𝐶𝐹 and the leg
𝐶𝐸 of the isosceles right triangle 𝐸𝐹𝐶. But this leads to the original state on
a smaller scale: we have to compare the diagonal and the side of a (smaller)
square. This shows that the Euclidean algorithm goes on for ever.
1.4.
1. Answer: (a) and (b) 3. (c) 5. (d) 7. Hint: Check the remainder on division by 3,
5, and 7.
2. No; if the difference 𝑑 is positive and 𝑐 > 1 is an arbitrary element in the arithmetic
progression, then e.g. 𝑐 + 𝑐𝑑 is composite.
3. Answer: 3 years old. Hint: Consider the remainders on division by 3.
Remark: We have no information about the ages of the two older grandchildren:
e.g. 3, 5, 7, or 3, 7, 11, or 3, 13, 17 are all triples satisfying the requirements. It is an
unsolved problem whether or not there are infinitely many such triples. However,
the smallest element of every such triple must be 3, as claimed in this exercise.
4. (a) 𝑎 − 1 ∣ 𝑎𝑘 − 1 and if 𝑘 = 𝑟𝑠, then 𝑎𝑟 − 1 ∣ 𝑎𝑘 − 1.
(b) If 𝑘 = 𝑟𝑠 with 𝑠 odd, then 𝑎𝑟 + 1 ∣ 𝑎𝑘 + 1.
5. Answer: 𝑡 = 2, 𝑘 = 1. Hint: Check the divisibility by 𝑡 + 1 or 𝑡.
6. Answer: (a), (d), (e) 𝑛 = 1. (b) 𝑛 = 2, 4. (c) There is no such 𝑛. Hint: Check the
divisibility by 3 for (a), and factor the other four expressions.
7. (a) If 𝑛 = 𝑎𝑏 with 0 < 𝑎 ≤ 𝑏, then 𝑎 ≤ √𝑛, thus only 𝑎 = 1 is possible.
(b) If this smallest divisor 𝑑 had a non-trivial positive divisor 𝑠, then 𝑠 ∣ 𝑛 and
1 < 𝑠 < 𝑑 yield a contradiction.
(c) If 𝑛 = 𝑑𝑘 where 𝑑 is the minimal divisor greater than 1, then 𝑑 is a prime by
(b) and 𝑘 is a prime by (a).
1.5. 427
1.5.
1.6.
1. An integer 𝑛 is a 𝑘th power if and only if the exponents of all primes are multiples
of 𝑘 in the standard form of 𝑛.
2. (a) Let 𝑝 be an arbitrary prime divisor of the factor 𝑎 in the product 𝑎𝑏. Since
(𝑎, 𝑏) = 1, 𝑝 ∤ 𝑏, so 𝑝 occurs with the same exponents in the standard forms
of 𝑎 and 𝑎𝑏. Now apply Exercise 1.6.1.
(b) The two factors will be associates of 𝑘th powers except if the product is zero.
(c) We have to assume that the factors are pairwise coprime.
3. Rely on Exercise 1.6.2a.
4. Answer: 3 and 7. Hint: Factor the numerator and argue as in Exercise 1.6.2a.
5. (a) If 𝑎1 ∣ 𝑎 and 𝑏1 ∣ 𝑏, then 𝑎1 𝑏1 ∣ 𝑎𝑏 follows from the elementary properties of
divisibility. For the converse, use Theorem 1.6.2. Consider an arbitrary prime
divisor 𝑝 of 𝑎𝑏 and let the (possibly 0) exponents of 𝑝 be 𝛼, 𝛽, and 𝛾 in the
standard forms of 𝑎, 𝑏, and 𝑐. The condition 𝑐 ∣ 𝑎𝑏 implies 𝛾 ≤ 𝛼 + 𝛽. Thus,
we have to show that 𝛾 = 𝛼′ + 𝛽 ′ for some 0 ≤ 𝛼′ ≤ 𝛼 and 0 ≤ 𝛽 ′ ≤ 𝛽.
(b) Apply the argument of (a) knowing that either 𝛼, or 𝛽 is 0. An alternative way:
Assume 𝑎1 𝑏1 = 𝑎2 𝑏2 where 𝑎𝑖 ∣ 𝑎 and 𝑏𝑖 ∣ 𝑏. Then 𝑎1 ∣ 𝑎2 𝑏2 and (𝑎1 , 𝑏2 ) = 1,
thus 𝑎1 ∣ 𝑎2 . We obtain the converse divisibility similarly, therefore (using
positivity) 𝑎1 = 𝑎2 .
(c) For example, any common divisor 𝑐 > 1 of 𝑎 and 𝑏 can be represented as
𝑐 = 1 ⋅ 𝑐 = 𝑐 ⋅ 1.
(d) Use the arguments of (a) and (b).
(e) (𝑎, 𝑏) ∣ 𝑐 ∣ [𝑎, 𝑏].
6. Use Theorem 1.6.2.
7. (a) 230 . (b) 210 ⋅ 32 . (c) 23 ⋅ 3 ⋅ 5 ⋅ 7 = 840.
8. These are the squares. Hint: Use the formula for 𝑑(𝑛) and Exercise 1.6.1. Another
way: Form pairs of divisors matching every 𝑑 ∣ 𝑛 to its complementary divisor 𝑛/𝑑.
This match is not perfect if a divisor is equal to its complementary divisor.
9. Answer: 20. Hint: Examine which guards touched a lock and apply the previous
exercise.
10. (b) Equality holds if and only if the exponents of all primes are odd in the standard
form of 𝑛.
11. (a)–(b) Check how many divisors of 𝑛 can be larger than 𝑛/2 and 𝑛/3.
(c) Form pairs of divisors whose product is 𝑛. The smaller (more precisely, not
greater) element in each pair is at most √𝑛. Another possibility: Apply the argu-
ment in (a) and (b) for a general 𝑛/𝑘 and choose the optimal value of 𝑘.
12. Answer: 𝑛𝑑(𝑛)/2 . Hint: Form pairs of divisors.
1.6. 429
13. Answer: 𝑛+1. Hint: (i) 𝑛+1 such divisors are 2𝑖 5𝑛−𝑖 , 𝑖 = 0, 1, . . . , 𝑛. (ii) Among 𝑛+2
divisors two must contain 5 with the same exponent by the pigeonhole principle,
and so the larger divisor is a multiple of the smaller one.
14. (a) 𝑎 ∣ 𝑏.
(b) 8.
(c) 2𝑟 where 𝑟 is the number of distinct prime factors in 𝑏/𝑎.
(In (b) and (c), we considered the pairs 𝑥, 𝑦 and 𝑦, 𝑥 as different solutions for 𝑥 ≠ 𝑦.)
15. Use arguments similar to those in the proof of (𝑎, 𝑏)[𝑎, 𝑏] = 𝑎𝑏 (Theorem 1.6.6/III).
16. True: (b), (d).
17. (a) 𝑎 ∣ [𝑎, 𝑏] ∣ 𝑎 + 𝑏 ⟹ 𝑎 ∣ 𝑏, and 𝑏 ∣ 𝑎 follows by symmetry.
(b) and (d) Divide by (𝑎, 𝑏) and apply Exercise 1.6.16b.
(c) For example, 𝑎 = 10𝑘, 𝑏 = 15𝑘; or 𝑎 = 𝑢(𝑢 + 𝑣), 𝑏 = 𝑣(𝑢 + 𝑣).
18. Each equality holds if and only if every common prime divisor of 𝑎 and 𝑏 occurs
with the same exponent in the standard forms of 𝑎 and 𝑏.
19. Let 𝛼, 𝛽, and 𝛾 be (the possibly 0) exponents of a prime 𝑝 in the standard forms
of 𝑎, 𝑏, and 𝑐. To prove (a), we have to verify max(𝛼, min(𝛽, 𝛾)) = min(max(𝛼, 𝛽),
max(𝛼, 𝛾)). We can check this in the three cases separately when 𝛼 is the smallest,
middle, or largest among the three exponents. We can prove also (b) along similar
lines.
20. (a) Using the notation of the previous exercise, both conditions mean that two
exponents of 𝛼, 𝛽, and 𝛾 are equal and the third exponent is not smaller.
(b) Infinitely many.
(c) The analog of (a) remains valid if we replace gcd everywhere by lcm. This
means for the exponents that two of 𝛼, 𝛽, and 𝛾 are equal and the third one is
not larger. The number of solutions is the product of the values 𝛿 belonging
to the distinct prime divisors of 𝑎𝑏𝑐 where 𝛿 = 3𝛼 + 1 if 𝛼 = 𝛽 = 𝛾, and
𝛿 = 2 min(𝛼, 𝛽, 𝛾) + 1 otherwise. (There is a unique solution if and only if
(𝑎, 𝑏, 𝑐) = 1.)
21. Factor 𝑝4 − 1 as long as you can, and verify the divisibilities by 16, 3, and 5 sepa-
rately.
22. Factor 𝑎6 −𝑏6 as long as you can, and verify the divisibilities by 7, 8, and 9 separately.
23. Factor the expression, and show the divisibility for each of the prime power factors
of 360.
24. Verify the divisibility for each prime power factor in the standard form of the divi-
sor separately. Apply various forms of 𝑎 − 𝑏 ∣ 𝑎𝑚 − 𝑏𝑚 and the binomial theorem
for the divisibility by 101.
25. (a) 275. (b) The last digit is not zero.
430 Answers and Hints
26. (a) Every prime occurs in the standard form of 𝑛! with an exponent less than 𝑛: if
𝑝𝑠 ≤ 𝑛 < 𝑝𝑠+1 , then
∞ 𝑠 𝑠
𝑛 𝑛 𝑛 𝑛(𝑝𝑠 − 1) 𝑛
𝛼𝑝 = ∑ ⌊ ⌋ = ∑ ⌊ ⌋ ≤ ∑ = 𝑠 (𝑝 − 1)
< ≤ 𝑛.
𝑘=1
𝑝𝑘 𝑘=1
𝑝 𝑘
𝑘=1
𝑝𝑘 𝑝 𝑝 − 1
(b) 𝑐 = 2, 𝑛 = 2𝑗 .
29. First solution: Choose a prime that occurs in the standard form of 𝑛! +𝑘 with a
higher exponent than in 𝑘.
Second solution: Every integer has a prime divisor greater than 𝑛/2 and it divides
none of the other numbers.
30. 9.
31. The squarefree numbers (i.e. those that are not divisible by any square greater than
one).
32. Prove by contradiction. Reduce the problem to the case when the two 𝑘th powers
are coprime. Show that their difference divides the double of both 𝑘th powers.
Thus, it also divides 2 which is impossible.
33. (a) (𝑎/𝑏)5 = 100 ⇒ 𝑎5 = 100𝑏5 . Examine the exponent of 5 (or of 2) in the
standard forms of the two sides.
A.2. Congruences
2.1.
hence
5. Answer: 50. Hint: We obtain the last digits of the squares by squaring the 101 dig-
its, i.e. all possible remainders modulo 101. To determine the pairwise incongruent
values, examine the coincidences induced by squaring. Use Exercise 2.1.4h.
6. The theorem is false, e.g. (47) ≢ (48). The proof violated the rule that you must not
replace the numerator of a fraction by a congruent value even if both the original
and the new fractions are integers.
11. (a) Cancelling the left-hand side by 𝑝, the new denominator (𝑝 − 1)! is coprime
to 𝑝. Hence, multiplying by (𝑝 − 1)!, we get an equivalent congruence. This
can be proved as in the previous two exercises.
(b)–(c) Apply similar methods as in (a).
432 Answers and Hints
2.2.
1. (a) 3. (b) 5. (c) 2. Hint: The modulus is coprime to the given numbers and
divides their difference.
2. (a) 62 ⋅ 5𝑚−2 ⋅ 𝑚! (b) 6 ⋅ 5𝜑(𝑚)−1 ⋅ 𝜑(𝑚)!
(We considered two residue systems as distinct even if they differed only in the
order of the elements.)
3. Both properties depend only on the difference 𝑑 of the arithmetic progression:
(a) 𝑑 ∣ 𝑚. (b) (𝑑, 𝑚) = 1.
4. (a) 𝑚 is odd.
(b) Every 𝑚 is suitable.
(c) 𝑚 = 2.
(d) (𝑚, 10) = 1.
(e) 𝑚 = 2.
(f) 𝑚 = 3𝑘 .
(g) 𝑚 is squarefree.
(Parts (a) and (d) can be considered as special cases of Exercise 2.2.3b.)
5. (a) (𝑚, 15) = 1.
(b) Every 𝑚 is suitable.
(c) 𝑚 = 2.
(d) (𝑚, 20) ≤ 2.
(e) Every 𝑚 is suitable. This can be verified similar to the proof of 2.2.4g but by a
considerably simpler argument.
6. True: (b).
7. (a) The remainder is 0 for 𝑚 odd and 𝑚/2 for 𝑚 even. Hint: Demonstrate that the
result does not depend on which complete residue system we consider. Then
examine e.g. the least non-negative remainders or the ones of least absolute
value. Another way: Form suitable pairs from the elements of a complete
residue system.
(b) Use the result of (a). If 𝑚 is odd, then we can always exhibit examples both
for 𝑎𝑖 + 𝑏𝑖 forming and not forming a complete residue system.
(c) The remainder of the sum of elements in a reduced residue system is 0 for
𝑚 > 2. For the sums 𝑎𝑖 + 𝑏𝑖 , we have the same results as seen at the complete
residue systems.
8. (a) 𝑚 is either odd or is a multiple of 4. (b) 𝑚 is odd.
9. (a) 𝑚 = 2𝑘 . Hint: We get a complete residue system if and only if the given
numbers are pairwise incongruent, i.e. (𝑖+1)+(𝑖+2)+⋯+𝑗 = (𝑖+𝑗+1)(𝑗−𝑖)/2
is not divisible by 𝑚 for 0 ≤ 𝑖 < 𝑗 ≤ 𝑚 − 1. For 𝑚 = 2𝑘 , use the opposite parity
of the two factors to show the impossibility of such a divisibility. If 𝑚 is not a
2.3. 433
power of two, i.e. 𝑚 = 2𝑘 (2𝑠 + 1) with 𝑠 > 0 (the exponent 𝑘 may be 0), then
(2𝑘 − 𝑠) + (2𝑘 − 𝑠 + 1) + ⋯ + (2𝑘 + 𝑠) is divisible by (in fact, is equal to) 𝑚.
The largest term satisfies the condition 2𝑘 + 𝑠 < 𝑚, but for the smallest term,
2𝑘 − 𝑠 ≤ 0 may occur. In this case, deleting all negative terms, their negatives,
and 0, we obtain a forbidden sum within the given limits still divisible by 𝑚.
(b) 𝑚 is even.
10. True: (a), (c), (e). Hint for (c) and (e): Show that both assertions follow from the
claim:
If (𝑟, 𝑘) = 1, then there exists an 𝑠 satisfying 𝑠 ≡ 𝑟 (mod 𝑘) and (𝑠, 𝑚) = 1.
Proof of the claim: If every prime divisor of 𝑚 divides 𝑘, then (𝑟, 𝑘) = 1 ⇒ (𝑟, 𝑚) =
1, thus we can choose 𝑠 = 𝑟. Otherwise, let 𝑞1 , . . . , 𝑞𝑡 be those prime divisors of 𝑚
that do not divide 𝑘. Assume that 𝑞1 , . . . , 𝑞𝑗 are the ones among these that divide 𝑟
(also 𝑗 = 0 or 𝑗 = 𝑡 may occur). Then 𝑠 = 𝑟 + 𝑞𝑗+1 . . . 𝑞𝑡 𝑘 satisfies the requirements.
11. (b) Answer: 𝑚/(𝑎, 𝑚).
Hint: 𝑎𝑟 𝑖 + 𝑏 ≡ 𝑎𝑟𝑗 + 𝑏 (mod 𝑚) ⟺ 𝑟 𝑖 ≡ 𝑟𝑗 (mod 𝑚/(𝑎, 𝑚)).
12. (a) (𝑎, 𝑚) = 1 or 2 for 𝑚 = 4𝑘 + 2, and (𝑎, 𝑚) = 1 otherwise.
(b) 𝑝1 ⋅ ⋯ ⋅ 𝑝𝑠 ∣ 𝑏 where 𝑝1 , . . . , 𝑝𝑠 are the distinct prime divisors of 𝑚.
13. (𝑘, 𝑚) = 1.
14. (c) Use (b).
2.3.
1. Form pairs of the elements of a (cleverly chosen) reduced residue system or use
the formula for 𝜑(𝑛).
2. (a) 3, 4, 6.
(b) 5, 8, 10, 12.
(c) There is no such 𝑛.
(d) 61, 77, 93, 99, 122, 124, 154, 186, 198.
3. (a) 1285 = 5 ⋅ 257. Hint: 𝜑(211 ) = 210 shows that the minimal number is not
greater than 211 . A smaller suitable integer can only be the product of primes
of the form 2𝑘 + 1.
(b) 311 . Hint: Use the following: (i) 2 ⋅ 310 + 1 is composite (17 divides it); (ii) If
3𝑗 ∣ 𝑝 − 1 for a prime 𝑝(> 2), then 𝑝 ≥ 2 ⋅ 3𝑗 + 1.
4. 100, 80, 50, 40.
5. (a) Use the standard forms of 𝑘 and 𝑛 and the formula for 𝜑. Be careful that only
positive exponents should occur in each standard form.
(b) It follows from (a).
434 Answers and Hints
If 𝑎 and 𝑏 have the same prime divisors, then (A.2.1) clearly holds. To prove the
converse, assume that (A.2.1) is true in some other case, too. Delete the common
factors 1 − 1/𝑝 = 1 − 1/𝑞 and multiply by the common denominator (i.e. by the
product of all remaining primes 𝑝 and 𝑞). Then the largest prime will divide only
one side thus yielding a contradiction.
7. True: (a).
𝑟 𝛽
8. Let the standard form of 𝑘 be 𝑘 = ∏𝑖=1 𝑝𝑖 𝑖 , 𝛽 𝑖 > 0. Then an appropriate 𝑛 is
𝑟 𝑟
𝛼 𝛽 𝑖 , if 𝑝 𝑖 ∣ ∏𝑗=1 (𝑝𝑗 − 1)
𝑛 = ∏ 𝑝𝑖 𝑖 where 𝛼𝑖 = {
𝑖=1 𝛽 𝑖 + 1, otherwise.
9. Use that both 𝑟 ∣ 𝑛 and (𝑟, 𝑛) = 1 are true only for 𝑟 = 1. Equality holds if and only
if 𝑛 is 1, 4, or a prime. Hint: In every other case there exists a number 𝑟, 1 < 𝑟 < 𝑛,
neither coprime to 𝑛 nor dividing 𝑛; e.g. 𝑟 = 𝑛 − 𝑝 where 𝑝 is the smallest prime
divisor of 𝑛.
10. (a) and (c) Use the formula for 𝜑(𝑛).
(b) The columns in table 2.3.1 are not complete residue systems mod 𝑏.
11. (a) The multiples of the least prime divisor of 𝑛 are not coprime to 𝑛. Equality
holds if and only if 𝑛 is the square of a prime.
(b) (b1) 𝑛 is a prime. (b2) 10. (b3) 15, 49. (b4) There is no such 𝑛.
12. 1, 2, and 3. Hint: Verify 𝜑(𝑛) ∣ 𝑛 ⟺ 𝑛 = 2𝛼 3𝛽 where either 𝛼 ≥ 0 and 𝛽 = 0, or
𝛼 > 0 and 𝛽 > 0.
13. Prove by contradiction. Use the formula for 𝜑. The largest prime divisor remaining
after cancellation will divide only one side.
14. Write the fractions 1/𝑛, 2/𝑛, . . . , 𝑛/𝑛 in reduced form, and count how many times
a denominator occurs.
15. Using the formula for 𝜑(𝑛), prove 𝜑(𝑛) ≥ √𝑛/2.
Another option: All primes are coprime to 𝑛 except its prime divisors and there are
many primes up to 𝑛 (see Section 5.4).
16. Denote by 2 = 𝑝1 < 𝑝2 < . . . the sequence of (positive) primes and let 𝑝𝑗 be the
smallest prime not dividing 𝑘. Then 𝑛 = (𝑝𝑗 − 1)𝑘 works.
17. Let 2 = 𝑝1 < 𝑝2 < ⋯ < 𝑝1000 be the first 1000 primes and 𝑃 their product. Then
𝑛𝑖 = 𝑃(𝑝 𝑖 − 1)/𝑝 𝑖 satisfy the requirements.
2.4. 435
18. Answer: 𝑛 ≤ 3. Hint: Compare the exponents of 2 in the standard forms of 𝜑(𝑛! )
and 𝑘!.
19. 𝑚 = 2𝑘 , 𝑝, or 2𝑝 where 𝑝 > 2 is a prime.
2.4.
1. 𝜑(𝑛) ≤ 𝑛 implies 𝜑(𝑛) ∣ 𝑛!. We can solve the exercise without using the Euler–
Fermat Theorem. Among 1, 2, 22 , . . . , 2𝑛 there must be two numbers congruent
modulo 𝑛 by the pigeonhole principle: 2𝑖 ≡ 2𝑗 (mod 𝑛) with some 0 ≤ 𝑖 < 𝑗 ≤ 𝑛.
Since (2, 𝑛) = 1, we can cancel 2𝑖 to obtain 2𝑗−𝑖 ≡ 1 (mod 𝑛) with 1 ≤ 𝑗 − 𝑖 ≤ 𝑛.
Finally, 𝑗 − 𝑖 ∣ 𝑛! implies the assertion of the exercise.
2. Answer: 49. Hint: (1793, 102 ) = 1 implies 1793𝑘𝜑(100) ≡ 1 (mod 100). Compute
𝜑(100) and use 1793 ≡ −7 (mod 100).
3. Apply Fermat’s Little Theorem for 𝑝 = 13 several times.
4. Prove that one of the numbers is divisible by 7.
5. Exhibit the standard form of the divisor and verify the divisibility for each prime
power factor separately by the Euler–Fermat Theorem. Do not forget the cases
where the prime power is not coprime to 𝑎.
6. Demonstrate that the remainder of a 30th power can be only 0 or 1 modulo 11 and
modulo 9.
7. Show that the remainder of an 88th power is 0 or 1 modulo 23.
2𝑝−3 2𝑝−3
8. If neither of 𝑟 𝑖 and 𝑟𝑗 is divisible by 𝑝, then, multiplying 𝑟𝑖 ≡ 𝑟𝑗 (mod 𝑝) by
𝑟 𝑖 𝑟𝑗 , we infer 𝑟 𝑖 ≡ 𝑟𝑗 (mod 𝑝), i.e. 𝑖 = 𝑗 by Fermat’s Little Theorem.
9. (a) Examine the cases 𝑝 ∤ 𝑎 and 𝑝 ∣ 𝑎 separately as in the proof of Theorem 2.4.1B.
(b) Let 𝑘 be the maximum of the exponents in the standard form of 𝑚. Then
𝑖, 𝑗 ≥ 𝑘, 𝑖 ≡ 𝑗 (mod 𝜑(𝑚)) ⟹ 𝑎𝑖 ≡ 𝑎𝑗 (mod 𝑚). Hint: Verify 𝑎𝑖 ≡ 𝑎𝑗
(mod 𝑝𝛼 ) for every prime power factor 𝑝𝛼 in the standard form of 𝑚. Also
use 𝜑(𝑝𝛼 ) ∣ 𝜑(𝑚) (see Exercise 2.3.5a).
10. True: (a), (c).
(a) Use the Euler–Fermat Theorem (𝑎 = 133, 𝑚 = 1000), or modify the method
sketched at Exercise 2.4.1.
(b) Check the divisibility by 4.
(c) Start using 136𝑘 ≡ 136 (mod 1000) ⟺ 136𝑘−1 ≡ 1 (mod 125).
11. Hint: 𝑎𝑘 ≡ 𝑎 (mod 𝑑) ⟺ 𝑎𝑘−1 ≡ 1 (mod 𝑑/(𝑎, 𝑑)).
12. The repunits are the numbers (10𝑘 − 1)/9. Thus we have to determine the integers
𝑚 satisfying 10𝑘 ≡ 1 (mod 9𝑚) for some (positive) 𝑘.
436 Answers and Hints
13. It is sufficient to show that every odd positive prime divisor 𝑝 of 𝑛2 + 1 is of the
form 4𝑘 + 1. To do this, raise 𝑛2 ≡ −1 (mod 𝑝) to the power (𝑝 − 1)/2 and use
Fermat’s Little Theorem.
We can also solve the problem without Fermat’s Little Theorem. Assume that some
positive integer 𝑎 of the form 4𝑘−1 divides 𝑛2 +1 for some 𝑛. Consider the smallest
such 𝑎. We shall get a contradiction by finding a positive integer 𝑏 less than 𝑎 also
of the form 4𝑘 − 1 and dividing some integer 𝑠2 + 1.
As the divisibility 𝑎 ∣ 𝑛2 + 1 depends only on the remainder of 𝑛 on division by 𝑎,
we may assume 0 ≤ 𝑛 ≤ 𝑎 − 1 (or even |𝑛| ≤ 𝑎/2).
Let 𝑛2 + 1 = 𝑎𝑞. Then 𝑎𝑞 = 𝑛2 + 1 ≤ (𝑎 − 1)2 + 1 < 𝑎2 , so (0 <)𝑞 < 𝑎.
If 𝑛 is even, then 𝑛2 + 1 is of the form 4𝑘 + 1, hence 𝑞 is of the form 4𝑘 − 1.
If 𝑛 is odd, then 𝑛2 + 1 is of the form 8𝑘 + 2 = 2(4𝑘 + 1), hence 𝑞/2 is of the form
4𝑘 − 1.
We obtained that the positive number 𝑞 or 𝑞/2 of the form 4𝑘 − 1 and less than 𝑎
divides 𝑛2 + 1, contradicting the minimality of 𝑎.
14. By Fermat’s Little Theorem, 𝑛40 ≡ 𝑛4 (mod 19). Thus, the condition can be written
as 𝑎4 ≡ −𝑏4 (mod 19). Raise this congruence to the 9th power.
15. In the special case 𝑚 = 𝑝, assertions (a) and (b) are just the second form of Fermat’s
Little Theorem. Assertion (c) shows that 𝑎𝑚 ≡ 𝑎 (mod 𝑚) may hold for every 𝑎
even with a composite 𝑚. (These composite integers are called universal pseudo-
primes or Carmichael numbers. We discuss them more in detail in Section 5.7.)
Hints:
(a) In the case of a squarefree 𝑚, verify 𝑎𝜑(𝑚)+1 ≡ 𝑎 (mod 𝑝) for every prime
divisor 𝑝 of 𝑚. If 𝑚 is not squarefree, so the square of a prime 𝑝 divides 𝑚,
then the congruence does not hold e.g. for 𝑎 = 𝑝.
(b) Use the result of Exercise 2.4.9b.
(c) Check 𝑎1729 ≡ 𝑎 (mod 𝑘) for every prime (power) divisor 𝑘 of 1729.
16. 2.4.1B: It is sufficient to prove 𝑎𝑝 ≡ 𝑎 (mod 𝑝) for the elements of a complete
residue system, e.g. for 𝑎 = 1, 2, . . . , 𝑝. Using induction, assume that the congru-
ence is true for some 𝑎 = 𝑘. Expanding (𝑘 + 1)𝑝 by the binomial theorem, we
obtain that the congruence holds for 𝑎 = 𝑘 + 1.
2.4.1A: Let (𝑎, 𝑝) = 1. We may divide the congruence 𝑎𝑝 ≡ 𝑎 (mod 𝑝) (just proved)
by 𝑎, i.e. also 𝑎𝑝−1 ≡ 1 (mod 𝑝) is valid.
2.5.
2.6.
1. (a) 93.
(b) The system 𝑥 ≡ 4 (mod 12), 𝑥 ≡ 8 (mod 15) has no solution.
2. (a) Every digit can occur. (b) 3 or 7.
3. Apply the method shown in Example E1: Transform each congruence into a sys-
tem of congruences where the moduli are the prime powers in the standard form
of the original modulus. Handling a congruence with prime power modulus, we
generally have to distinguish two cases according to whether or not the solution is
coprime to the modulus. Answers:
(a) 𝑥 ≡ 20 (mod 176)
(b) 𝑥 ≡ 60 (mod 333) and 𝑥 ≡ 208 (mod 333)
(c) 𝑥 ≡ 91 (mod 105).
4. (a) 1. (b) 2.
5. Instead of the resulting congruence modulo 1000, investigate the simultaneous sys-
tem modulo 125 and modulo 8. Answer: 016.
6. 1166.
7. (a) 25, 76. (b) 376, 625.
8. (a) Answer: 36. Hint: Instead of 𝑥2 ≡ 𝑥 (mod 1020 ), consider the system of con-
gruences with the corresponding prime power moduli. Show that the congru-
ence 𝑥(𝑥 − 1) ≡ 0 has two solutions modulo a prime power.
(b) Answer: 135. Hint: Find the number of solutions of 𝑥3 ≡ 𝑥 (mod 1020 ) simi-
lar to (a).
438 Answers and Hints
37
9. There are 24 ⋅ 60 = 1440 minutes in a day, so we have 𝑥 ≡ 3938 (mod 1440).
Using 1440 = 25 ⋅ 32 ⋅ 5, consider the congruence for moduli 25 , 32 , and 5. Answer:
13 hours and 21 minutes.
10. Proceed as in the solution of Exercise 2.2.14b-c.
11. Let 𝑝1 , . . . , 𝑝𝐾 be distinct primes and consider the system 𝑥+𝑖 ≡ 0 (mod 𝑝𝑖2 ), 𝑖 = 1,
2, . . . , 𝐾.
12. (a) Solutions are 𝑥 = 𝑎 + 𝑏 + 𝑐 and 𝑥 = 𝑎𝑏 + 𝑏𝑐 + 𝑐𝑎.
(b) Necessity: Apply Theorem 2.6.1 for the subsystems consisting of two congru-
ences. Sufficiency: Let 𝑎 = 𝑑𝑎1 , 𝑏 = 𝑑𝑏1 , and 𝑐 = 𝑑𝑐 1 where 𝑎1 , 𝑏1 , and 𝑐 1
are pairwise coprime and 𝑥 = 𝑑𝑥1 . Divide the congruences by 𝑑 (including
the moduli). The variable in the resulting system is 𝑥1 and the moduli are 𝑎1 ,
𝑏1 , and 𝑐 1 . The moduli are pairwise coprime, therefore this system is solvable,
and thus so is the original system.
13. Necessity: Apply Theorem 2.6.1 for the subsystems consisting of two congruences.
Sufficiency: Prove by induction on 𝑘. The subsystem of the first 𝑘 − 1 congruences
is solvable by the induction hypothesis for 𝑘 − 1. Let 𝑐 be a solution. Thus we need
to verify the solvability of
𝑥 ≡ 𝑐 (mod [𝑚1 , . . . , 𝑚𝑘−1 ]) , 𝑥 ≡ 𝑐 𝑘 (mod 𝑚𝑘 ) .
To check the criterion of Theorem 2.6.1, apply the generalization of Exercise 1.6.19b
for more terms and use the conditions (𝑚𝑘 , 𝑚𝑖 ) ∣ 𝑐 𝑘 − 𝑐 𝑖 and 𝑚𝑖 ∣ 𝑐 𝑖 − 𝑐 for 1 ≤
𝑖 ≤ 𝑘 − 1.
14. No. Rewrite the congruence as a system of congruences with prime (power) mod-
uli. The product of the numbers of solutions of these congruences cannot be 14.
15. (a) Necessity: The number of elements has to be 𝜑(𝑘) = 𝑛. We have 𝑛 ∣ 𝑐 for the
number 𝑐 representing 0 (mod 𝑛), and (𝑐, 𝑘) = 1, so (𝑘, 𝑛) = 1. Sufficiency:
Let 𝑟1 , . . . , 𝑟𝑛 be a complete residue system modulo 𝑛 and 𝑠1 , . . . , 𝑠𝑛 a reduced
residue system modulo 𝑘 (by assumption, 𝜑(𝑘) = 𝑛). Then the systems
𝑥 ≡ 𝑟 𝑖 (mod 𝑛) , 𝑥 ≡ 𝑠𝑖 (mod 𝑘) , 𝑖 = 1, 2, . . . , 𝑛
are solvable due to (𝑘, 𝑛) = 1. Picking one solution for each, these integers
satisfy the requirements.
(b) Necessity is obvious. To verify sufficiency, we can apply the method in (a) di-
rectly if (𝑘, 𝑛) = 1. In the general case, however, we have to pair the elements
of the two reduced residue systems so that the resulting systems of congru-
ences are solvable. This can be guaranteed by proving the claim: If 𝑑 ∣ 𝑛, then
every reduced residue class modulo 𝑑 contains the same number of elements
as a reduced residue system modulo 𝑛.
16. (a) Verify first that (𝑎𝑖 +𝑛, 𝑎𝑗 +𝑛) must be a divisor of 𝑆 = (𝑎1 −𝑎2 )(𝑎1 −𝑎3 )(𝑎2 −𝑎3 )
for any 𝑛 and 𝑖 ≠ 𝑗. Let 𝑝 be a prime divisor of 𝑆 and choose 𝑛 modulo 𝑝 so
that at most one of 𝑎1 + 𝑛, 𝑎2 + 𝑛, and 𝑎3 + 𝑛 is divisible by 𝑝 (for 𝑝 > 3 we
can get that none of them is a multiple of 𝑝). The system composed of these
2.7. 439
congruences for the various prime divisors of 𝑆 is solvable since the moduli
are pairwise coprime.
(b) For example, 1, 2, 3 ,4.
(c) Refine the method of (a) by choosing the odd prime divisors of the product
𝑆 = ∏1≤𝑖<𝑗≤4 (𝑎𝑖 − 𝑎𝑗 ) and 4 as moduli.
(d) Now we have to choose 𝑛 so that for any prime divisor 𝑝 of 𝑆, at most two of
the numbers 𝑎𝑖 + 𝑛 should be multiples of 𝑝 .
(e) Both assertions are true for five numbers and both are false for six numbers.
2.7.
1. (a) Answer: 2 for 𝑚 = 4 and 0 for 𝑚 > 4. Hint: If 𝑚 is the product of two distinct
integers greater than 1, then both occur as factors in (𝑚 − 1)!, so 𝑚 ∣ (𝑚 − 1)!.
The remaining case is 𝑚 = 𝑝2 where 𝑝 is a prime. If 𝑝 > 2, then both 𝑝 and
2𝑝 are factors in (𝑚 − 1)!.
(b) Answer: 2 for 𝑚 = 4, 𝑝−1 for 𝑚 = 2𝑝 where 𝑝 > 2 is a prime, and 0 otherwise.
Hint: Verify first 𝜑(𝑚) ≥ 𝑝𝛼 for 𝑚 = 𝑝𝛼 𝑡 where 𝑝 ∤ 𝑡 and 𝑡 > 2. This implies
that the remainder is 0 unless 𝑚 = 2𝛼 , 𝑝𝛼 , or 2𝑝𝛼 (where 𝑝 > 2 is a prime).
If 𝑚 = 𝑝𝛼 or 2𝑝𝛼 with 𝛼 ≥ 2, then both 𝑝𝛼−1 and 2𝑝𝛼−1 occur in the product
(𝜑(𝑚))!, so 𝑚 ∣ (𝜑(𝑚))!. Similarly, if 𝑚 = 2𝛼 with 𝛼 ≥ 3, then both 2𝛼−1 and
2 appear as factors in (𝜑(𝑚))!. Finally, for 𝑚 = 2𝑝, investigate the remainders
of (𝜑(𝑚))! = (𝑝 − 1)! separately modulo 𝑝 and modulo 2.
(c) Answer: −1 for 𝑚 = 4, 𝑝𝛼 , and 2𝑝𝛼 where 𝑝 > 2 is a prime, and 1 in all other
cases. Hint: Form pairs as in the proof of Wilson’s Theorem. An element 𝑐 in
the reduced residue system causes a problem if it is the pair of itself, i.e. 𝑐2 ≡ 1
(mod 𝑚). Let 𝐻 denote the set of these wrong elements 𝑐. Then the remainder
𝑟 we are looking for equals the remainder of the product of the elements in
𝐻. The main difficulty is that 𝑐2 ≡ 1 (mod 𝑚) holds not only for 𝑐 ≡ ±1
(mod 𝑚) for most composite 𝑚. The exceptions are 𝑚 = 4, 𝑝𝛼 , and 2𝑝𝛼 . Then
𝐻 contains no other elements than 𝑐 ≡ ±1 (mod 𝑚), so 𝑟 ≡ −1 (mod 𝑚). For
all other moduli, show by the Chinese Remainder Theorem that 𝐻 has more
than two elements. Let 𝑑 ≢ 1 (mod 𝑚) be any element in 𝐻 and pair the
elements of 𝐻 by the rule 𝑐 ↦ 𝑐𝑑 (mod 𝑚). Show that this implies 𝑟 ≡ 𝑑 or 1
(mod 𝑚). Forming the pairs within 𝐻 by another element 𝑑 ′ ≢ 1 (mod 𝑚),
we infer that only 𝑟 ≡ 1 (mod 𝑚) is possible.
2. Answer: 7 and 17. Hint: Use Wilson’s Theorem for 𝑚 prime. For composite 𝑚,
observe that (𝑚 − 6)! is not coprime to 𝑚 if 𝑚 − 6 ≥ 𝑚/2.
3. We have to show that the products 𝑎1 𝑏1 , . . . , 𝑎𝑚 𝑏𝑚 do not form a complete residue
system modulo 𝑚.
(a) Let 𝑚 be a prime, 𝑚 = 𝑝. If 𝑝 = 𝑎𝑖 = 𝑏𝑗 holds with 𝑖 ≠ 𝑗, then 𝑎𝑖 𝑏𝑖 ≡ 𝑎𝑗 𝑏𝑗 ≡ 0
(mod 𝑝). If 𝑝 = 𝑎𝑖 = 𝑏𝑖 , then the remaining elements 𝑎𝑗 and 𝑏𝑗 , form two
440 Answers and Hints
2.8.
1. For 𝑚 even.
2. (a) We have to solve the congruence 13𝑥 ≡ 1 (mod 100). Answer: (77).
(b) 100 − 𝜑(100) − 1 = 59.
(c) 19.
(d) Yes.
3. Answers: (a) 2. (b) 4. (c) 8. (d) Let 𝑚 = 2𝛼 𝑡 with 𝑡 odd and let 𝑡 have 𝑘 distinct
prime divisors. Then the answer is 2𝑘 for 𝛼 ≤ 1, 2𝑘+1 for 𝛼 = 2, and 2𝑘+2 for 𝛼 ≥ 3.
Hint: We have to determine the number of solutions of 𝑥2 ≡ 1 (mod 𝑚). First
examine the special cases where 𝑚 is a power of a prime (treat the odd primes and
2 separately). In the general case, convert the problem into a system of congruences
modulo the prime powers in the standard form of 𝑚.
4. (a)–(b) Apply the definition of zero divisor or Theorem 2.8.5.
(c) Prime powers.
(d) The sum is (0) for 𝑚 odd and (𝑚/2) for 𝑚 even. The product is (2) for 𝑚 = 4
and (0) for 𝑚 > 4.
(e) The integers not squarefree, i.e. which are divisible by the square of at least
one prime.
5. (a) We have to verify first of all that the operations are well defined, so the sum
and product of two such residue classes are again residue classes of this type.
The identities hold among all residue classes modulo 20, so they are valid au-
tomatically also in the subset 𝐻. The zero element is (0)20 , and the negative
of (4𝑠)20 is a (−4𝑠)20 = (20 − 4𝑠)20 . The identity element is (16)20 , the inverses
of (16)20 and (4)20 are themselves, whereas (8)20 and (12)20 are the inverses
of each other.
(b) (𝑎)40 (20)40 = (0)40 for every (𝑎) ∈ 𝐾, so every (non-zero) element is a zero
divisor. This implies that there is no identity element and thus 𝐾 is not a field.
(𝐾 is a commutative ring as can be verified similar to part (a).)
(c) Let 1 < 𝑘 < 𝑚 and 𝑘 ∣ 𝑚.
(i) The multiples of 𝑘 among the residue classes modulo 𝑚 form a commu-
tative ring 𝑅 under the addition and multiplication of residue classes.
442 Answers and Hints
(d) Arithmetic mean: the situation is similar to (c). To make a more subtle anal-
ysis, we have to distinguish cases according to the parity of 𝑚. If 𝑚 is odd and
we represent the residue classes with elements providing an integer value for
(𝑎 + 𝑏)/2, then this determines the residue class ((𝑎 + 𝑏)/2)𝑚 uniquely. This
makes it possible to define (slightly artificially) the arithmetic mean of any
two residue classes. If 𝑚 is even, then picking arbitrary representatives from
the two residue classes, (𝑎 + 𝑏)/2 will be uniformly either always an integer,
or never an integer. However, ((𝑎 + 𝑏)/2)𝑚 will not be unique even in the first
case. This means that there is no way to define the arithmetic mean of two
residue classes if 𝑚 is even.
(e) Exponentiation: the residue class on the right-hand side generally depends on
which element was chosen to represent the residue class (𝑏)𝑚 .
7. Modify suitably the argument in the proof of Theorem 2.4.1. Let 𝑔1 , . . . , 𝑔𝑘 be
all elements in 𝐺. Show that 𝑎𝑔1 , . . . , 𝑎𝑔𝑘 enumerates all elements in 𝐺. This
implies (𝑎𝑔1 )(𝑎𝑔2 ) . . . (𝑎𝑔𝑘 ) = 𝑔1 𝑔2 . . . 𝑔𝑘 . Multiplying by the inverse of 𝑔1 𝑔2 . . . 𝑔𝑘 ,
we obtain the statement of the exercise.
8. Following the proof of Wilson’s Theorem, pair every element with its inverse. The
assertion follows if there are at most two elements (including the identity) whose
square is the identity. If there are more than two such elements, devise another
pairing among them, similar to the end of the hint of Exercise 2.7.1c.
3.1.
3.2.
1. (a) 1. (b) 2. (c) 12. (d) 46. (We can exlude 23 as possible order even without
any computations using 43 ≡ −22 (mod 47) and Fermat’s Little Theorem.)
2. There is an appropriate 𝑎 only in (c).
3. 9, 21, and 63.
4. Use (𝑎𝑖 )𝑡 = 𝑎𝑖𝑡 and assertion (i) in Theorem 3.2.2. The most difficult part (c) (con-
taining (a) and (b) as special cases) can be verified as follows:
𝑘 | 𝑖 𝑘 |
1 ≡ (𝑎𝑖 )𝑡 = 𝑎𝑖𝑡 (mod 𝑚) ⟺ 𝑘 ∣ 𝑖𝑡 ⟺ |𝑡 ⟺ | 𝑡.
(𝑖, 𝑘) | (𝑖, 𝑘) (𝑖, 𝑘) |
9. 16.
10. (a) The modulus of the congruences is 𝑚:
𝑎𝑛 ≡ 1 ⟺ 𝑜𝑚 (𝑎) ∣ 𝑛
⟺ 𝑜𝑚 (𝑎) ∣ (𝑛, 𝑘) ⟺ 𝑎(𝑛,𝑘) ≡ 1.
𝑎𝑘 ≡ 1 ⟺ 𝑜𝑚 (𝑎) ∣ 𝑘
(b) By (a), the common divisors of 𝑎𝑛 − 1 and 𝑎𝑘 − 1 are the same as the divisors
of 𝑎(𝑛,𝑘) − 1.
11. For a proof by contradiction, assume that both 𝑎𝑛 ≡ 1 and 𝑎𝑘 ≡ −1 (mod 𝑚) hold
for some 𝑚 > 2. Then 𝑜𝑚 (𝑎) ∣ 𝑛 implies that 𝑜𝑚 (𝑎) is odd. Further, 𝑎2𝑘 ≡ 1
(mod 𝑚) yields 𝑜𝑚 (𝑎) ∣ 2𝑘. Hence, 𝑜𝑚 (𝑎) ∣ 𝑘, so 𝑎𝑘 ≡ 1 (mod 𝑚), a contradiction.
12. To prove 𝑎𝑠 ≡ −1 (mod 𝑝) ⟹ 𝑜𝑝 (𝑎) is even, follow the previous hint. This part
is true for any modulus 𝑚 > 2 instead of 𝑝. For the converse, let 𝑜𝑝 (𝑎) = 2𝑘,
then 𝑎𝑘 ≡ −1 (mod 𝑝). This is false in general for composite moduli, consider
e.g. 𝑚 = 15 and 𝑎 = 4.
13. (b) Use that 𝑎𝑘 ≡ 1 (mod [𝑚, 𝑛]) holds if and only if both congruences 𝑎𝑘 ≡ 1
(mod 𝑚) and 𝑎𝑘 ≡ 1 (mod 𝑛) are valid.
14. Answer: 7. Hint: We ask how many 𝑥 ≢ 1 (mod 1000) satisfy 𝑥2 ≡ 1 (mod 1000).
Instead of mod 1000, consider the system 𝑥2 ≡ 1 (mod 125), 𝑥2 ≡ 1 (mod 8).
15. (a) (𝑎𝑏)[ᵆ,𝑣] = 𝑎[ᵆ,𝑣] 𝑏[ᵆ,𝑣] ≡ 1 ⋅ 1 = 1 (mod 𝑚), so 𝑜(𝑎𝑏) ∣ [𝑢, 𝑣]. Thus 𝑜(𝑎𝑏) =
𝑢𝑣 can occur only for (𝑢, 𝑣) = 1. To prove the converse, assume (𝑎𝑏)𝑡 ≡ 1
(mod 𝑚); we have to show 𝑢𝑣 ∣ 𝑡. To eliminate 𝑎, raise the congruence to the
𝑢th power: 1 ≡ 𝑎𝑡ᵆ 𝑏𝑡ᵆ ≡ 𝑏𝑡ᵆ (mod 𝑚). This implies 𝑜(𝑏) = 𝑣 ∣ 𝑡𝑢. Since
(𝑢, 𝑣) = 1, we infer 𝑣 ∣ 𝑡. Similarly, 𝑢 ∣ 𝑡, thus 𝑢𝑣 = [𝑢, 𝑣] ∣ 𝑡.
(b) We proved 𝑜(𝑎𝑏) ∣ [𝑢, 𝑣] in (a). The other divisibility can be verified using the
ideas in the second part of (a).
16. Let 𝑑 = (𝑜(𝑎), 𝑜(𝑏)) and raise the congruence to powers of exponents 𝑜(𝑎)/𝑑 and
𝑜(𝑏)/𝑑, resp.
17. Observe that the order of 𝑎 modulo 𝑎𝑛 − 1 is just 𝑛.
18. Show that 𝑎𝑏 ≡ 1 (mod 𝑚) implies 𝑜𝑚 (𝑎) = 𝑜𝑚 (𝑏), and so 𝑜𝑚 (𝑎) + 𝑜𝑚 (𝑏) is even.
We have to treat separately the case of 𝑎 ≡ 𝑏 (mod 𝑚), i.e. 𝑎2 ≡ 1 (mod 𝑚). This
means 𝑜𝑚 (𝑎) = 2 (which is even) or 𝑎 ≡ 1 (mod 𝑚) (of order 1).
19. (a) The remainder is 1 for 𝑎 ≡ 1 (mod 𝑝) and 0 otherwise.
(b) The remainder is 1 if 𝑜(𝑎) is odd and −1 if 𝑜(𝑎) is even.
20. (a) Let 𝑎/𝑏 = 0.𝑐 1 𝑐 2 𝑐 3 . . . be the decimal representation of the rational number
𝑎/𝑏. We obtain the digits 𝑐 𝑖 from the following divisions:
10𝑎 = 𝑐 1 𝑏 + 𝑟1 where 0 ≤ 𝑟1 < 𝑏
10𝑟1 = 𝑐 2 𝑏 + 𝑟2 where 0 ≤ 𝑟2 < 𝑏
(A.3.1)
10𝑟2 = 𝑐 3 𝑏 + 𝑟3 where 0 ≤ 𝑟3 < 𝑏
⋮
3.3. 445
3.3.
1. All elements of the reduced residue classes represented by: (a) 3, 5. (b) 3, 7.
(c) 5, 11.
2. Take e.g. the solution of the system 𝑥 ≡ 2 (mod 11), 𝑥 ≡ 3 (mod 14), it is 𝑥 ≡ 101
(mod 154).
3. (a) Follow the arguments of (Y1) and (Y2) in the proof of Theorem 3.3.5. Find
first a primitive root modulo 5, e.g. 2 is suitable. Then test whether or not 2
is a primitive root modulo 25; it suffices to check 25−1 ≢ 1 (mod 25) which
446 Answers and Hints
𝛼
13. Let 𝑔𝑖 be primitive roots mod 𝑝𝑖 𝑖 , 𝑖 = 1, 2, . . . , 𝑟. Then 𝑢𝑖 can be chosen as the
𝛼 𝛼
solution of the system 𝑥 ≡ 𝑔𝑖 (mod 𝑝𝑖 𝑖 ), 𝑥 ≡ 1 (mod 𝑚/𝑝𝑖 𝑖 ). For 𝑚 even, use
Exercise 3.3.12c. Let 𝛼 be the exponent of 2 in the standard form of 𝑚. For 𝛼 = 1,
there is no need for any change in the formula. For 𝛼 = 2, we have to insert a
factor 𝑢𝑗 into the product of powers where 0 ≤ 𝑗 < 2 = 𝜑(4). For 𝛼 ≥ 3, we need
an extra factor 𝑢𝑗 𝑣𝑘 where 0 ≤ 𝑗 < 2 and 0 ≤ 𝑘 < 2𝛼−2 . The values of 𝑢 and 𝑣
are the solutions of the systems 𝑥 ≡ −1 (mod 2𝛼 ), 𝑥 ≡ 1 (mod 𝑚/2𝛼 ), and 𝑥 ≡ 5
(mod 2𝛼 ), 𝑥 ≡ 1 (mod 𝑚/2𝛼 ).
14. (a) For a polynomial 𝐹 with integer coefficients, let deg 𝐹 denote the degree of
𝐹 and 𝑁(𝐹) the number of solutions of 𝐹(𝑥) ≡ 0 (mod 𝑝). Theorem 3.1.2
implies 𝑁(𝐹) ≤ deg 𝐹. If 𝑥𝑝−1 − 1 = 𝑓ℎ, then every element of a reduced
residue system satisfies (at least) one of the congruences 𝑓(𝑥) ≡ 0 (mod 𝑝)
and ℎ(𝑥) ≡ 0 (mod 𝑝) by Fermat’s Little Theorem and the prime property of
𝑝. Hence
𝑝 − 1 ≤ 𝑁(𝑓) + 𝑁(ℎ) ≤ deg 𝑓 + deg ℎ = 𝑝 − 1.
Thus we have equality everywhere, so 𝑁(𝑓) = deg 𝑓.
(b) Apply (a) for the polynomials 𝑓𝑖 .
(c) 𝑜𝑝 (𝑐) = 𝑞𝛽 if and only if 𝑓1 (𝑐) ≡ 0 (mod 𝑝) but 𝑓2 (𝑐) ≢ 0 (mod 𝑝). The
existence of such a 𝑐 now follows from (b).
𝛽 𝛽
(d) Let 𝑑 = 𝑞1 1 . . . 𝑞𝑟 𝑟 be the standard form of 𝑑. By (c), there exist 𝑐 𝑖 with 𝑜𝑝 (𝑐 𝑖 ) =
𝛽
𝑞𝑖 𝑖 (𝑖 = 1, 2, . . . , 𝑟). Then 𝑜𝑝 (𝑐 1 . . . 𝑐𝑟 ) = 𝑑 by Exercise 3.2.15a.
3.4.
3.5.
1. (a) No solution.
(b) 𝑥 ≡ 51 (mod 101). Hint: Use Fermat’s Little Theorem.
(c) 𝑥 ≡ ±2 (mod 23). Hint: We get 𝑥2 ≡ 4 (mod 23) after the usual reduction.
(d) 𝑥 ≡ 0, ±6, ±7 (mod 17).
(e) 𝑥 ≡ 0, 2, 5, 6 (mod 13).
(f) 𝑥 ≡ ±5 (mod 11). Hint: As 𝑥 ≡ 0 (mod 11) is not a solution, we can replace
𝑥20 by 1 during the reduction.
2. (a) Answer: 12. Hint: Add the numbers of solutions of 𝑥30 ≡ 1 (mod 73) and
𝑥45 ≡ 1 (mod 73) and subtract the number of common solutions. The latter
are the solutions of 𝑥(30,45) ≡ 1 (mod 73).
(b) Answer: (𝑘 + 1, 30) if 31 ∣ 𝑘 + 1, and (𝑘 + 1, 30) − 1 otherwise. Hint: The left-
hand side can be written as (𝑥𝑘+1 −1)/(𝑥 −1). Thus the solutions are the same
as the solutions of 𝑥𝑘+1 ≡ 1 (mod 31) except perhaps for 𝑥 ≡ 1. Therefore, we
have to check separately for which 𝑘 does 𝑥 ≡ 1 (mod 31) satisfy the original
congruence.
3.6. 449
3. 𝑎 ≡ 0, ±1 (mod 𝑝).
4. The condition for solvability is (𝑘, 𝑝 − 1) ∣ ind𝑔 𝑔 = 1. The number of solutions is
(𝑘, 𝑝 − 1) = 1.
5. 𝑥 ≡ 𝑐𝑏𝑖 (mod 𝑝), 𝑖 = 1, . . . , 𝑟.
6. (a) 1. (b) ±1.
7. (𝑘, 𝑝 − 1) = 1.
8. For 3 and the primes of the form 3𝑡 − 1.
9. Use any of the two criteria in Theorem 3.5.3 or Definition 3.5.2 (in the latter case
we need Fermat’s Little Theorem for (b)).
10. (𝑘, 𝑝 − 1) = 2.
11. (a) Answer: 1 if 𝑝−1 ∣ 𝑘, and 0 otherwise. Hint: Put 𝑑 = (𝑘, 𝑝−1). The 𝑘th power
residues can be written as 𝑔𝑟𝑑 where 0 ≤ 𝑟 < (𝑝 − 1)/𝑑. Apply the formula for
the sum of a finite geometric series. Another way: In the sum of Exercise 3.3.7,
every 𝑘th power residue occurs (𝑘, 𝑝 − 1) times. A third possibility: Observe
that the 𝑘th power residues are just the roots (with multiplicity one) of the
𝑝−1
polynomial 𝑥 (𝑘,𝑝−1) − 1 over 𝐙𝑝 . Apply the law connecting the roots and the
coefficients (Viète’s formulas) for this polynomial.
𝑝−1
(b) Answer: −1 or 1 according as is even or odd. Hint: Form pairs
(𝑘, 𝑝 − 1)
from the 𝑘th power residues so that the product of the elements in each pair
is congruent to 1. Two other options: Write the 𝑘th power residues as in the
first hint to (a), or apply the third hint to (a).
12. See the hint to Exercise 3.5.9. Generalization: 𝑎 is both a 𝑘th and an 𝑛th power
residue if and only if it is a [𝑘, 𝑛]th power residue.
3.6.
4. The case 𝑝 = 2 is obvious. For 𝑝 > 2, by Chevalley’s Theorem, there exist integers
5
𝑢𝑖 , 1 ≤ 𝑖 ≤ 5, yielding a non-trivial solution of ∑𝑖=1 𝑥𝑖4 ≡ 0 (mod 𝑝). If e.g. 𝑢1 ≢ 0
𝑝−2
(mod 𝑝), then 𝑣 𝑖 = 𝑢1 𝑢𝑖 is another solution with 𝑣 1 ≡ 1 (mod 𝑝). We may
5
assume |𝑣 𝑖 | ≤ (𝑝 − 1)/2 also for the other 𝑣 𝑖 . Thus ∑𝑖=1 𝑣4𝑖 is a multiple of 𝑝 and
5
𝑝 − 1 4 𝑝4
0 < ∑ 𝑣4𝑖 ≤ 1 + 4( ) < .
𝑖=1
2 4
(b) Assume that there are 𝑠 solutions 𝑎1 , . . . , 𝑎𝑠 . Form the polynomials 𝐺𝑣 for ev-
𝑠
ery solution 𝑎𝑣 (𝑣 = 1, . . . , 𝑠) as described in (a). Let 𝐺 = ∑𝑣=1 𝐺𝑣 . Following
the proof of Chevalley’s Theorem, we obtain 𝐹 ∗ = 𝐺. Comparing the degrees
yields that the coefficient of the term (𝑥1 . . . 𝑥𝑡 )𝑝−1 in 𝐺 must be 0 modulo 𝑝,
i.e. 𝑠(−1)𝑡 ≡ 0 (mod 𝑝).
8. (a) The determinant of the matrix 𝐴 is
|−𝑏 𝑎 0 ... 0|
| 0 −𝑏 𝑎 ... 0 ||
|
|0 0 −𝑏 . . . 0 | = (−𝑏)𝑝−1 + (−1)𝑝−2 𝑎𝑝−1 ≡ 0 (mod 𝑝) ,
|⋮ ⋮ ⋮ ⋱ ⋮ ||
|
|𝑎 0 0 ... −𝑏|
so 𝑟(𝐴) ≤ 𝑝 − 2. On the other hand, the minor belonging to the upper left
corner is (−𝑏)𝑝−2 ≢ 0 (mod 𝑝), so 𝑟(𝐴) ≥ 𝑝 − 2. This implies 𝑟(𝐴) = 𝑝 − 2
and the number of solutions is 𝑝 − 1 − (𝑝 − 2) = 1. (Of course, the result is
well known from Theorem 2.5.5.)
3.7. 451
(b) Every element of the matrix is 1, hence its rank is 1, implying that there are
𝑝 − 2 solutions (cf. Exercise 3.5.3).
(c) Similar to (a), we get rank 𝑝−2, so there is one solution (this follows also from
Exercise 3.5.7). The solution is 𝑥 ≡ 𝑎𝑝−2 (mod 𝑝).
10. Let 𝐴𝑓 , 𝐴𝑔 , and 𝐴ℎ be the matrices corresponding to the three polynomials. We get
𝐴𝑔 by putting the last row of 𝐴𝑓 above the other rows without changing the order
of the others. We obtain 𝐴ℎ by reflecting 𝐴𝑓 through the main diagonal and then
make a first row from the last one. These transformations do not affect the rank
of the matrix, so the numbers of solutions are the same for the three congruences.
We can easily solve the problem without the Kőnig–Rados Theorem, too. Since
𝑓(𝑗) ≡ 𝑗𝑔(𝑗) (mod 𝑝) for (𝑗, 𝑝) = 1, the first two congruences have the same
solutions. Similarly,
11. We can eliminate the terms of degree higher than 𝑝−1 by the reduction described in
Theorem 3.1.3. Since it is easy to see whether or not 𝑥 ≡ 0 (mod 𝑝) is a solution, we
can concentrate on finding the solutions coprime to 𝑝. Thus we can replace 𝑥𝑝−1
by 1 by Fermat’s Little Theorem. If every coefficient 𝑑𝑗 in the resulting polynomial
ℎ = 𝑑0 + 𝑑1 𝑥 + ⋯ + 𝑑𝑝−2 𝑥𝑝−2 is a multiple of 𝑝, then ℎ(𝑥) ≡ 0 (mod 𝑝) is true for
every 𝑥. Finally, if 𝑑0 ≡ ⋯ ≡ 𝑑𝑖−1 ≡ 0 (mod 𝑝) but 𝑑𝑖 ≢ 0 (mod 𝑝), then we can
apply the Kőnig–Rados Theorem to the polynomial ℎ1 = ℎ/𝑥𝑖 . The congruences
ℎ(𝑥) ≡ 0 (mod 𝑝) and ℎ1 (𝑥) ≡ 0 (mod 𝑝) will have the same same reduced residue
classes as solutions.
3.7.
3. (a) The condition of solvability is 𝑎 ≡ 1 (mod 11) and there are ten solutions.
Hint: Use Fermat’s Little Theorem and Theorem 3.7.1.
(b) It is solvable if and only if 𝑎 ≡ 1 (mod 8) and there are four solutions.
4.1.
4.2.
1. Solvable: (c), (e), (f). Use Wilson’s Theorem for (c). A congruence with a composite
modulus is solvable if and only if there is a solution for every prime power divisor
of the modulus.
−2 −1 2
2. (a) 𝑝 = 8𝑘 + 1 or 8𝑘 + 3. Hint: ( 𝑝
) =( 𝑝
)( 𝑝 ).
(b) 𝑝 = 12𝑘 ± 1 or 𝑝 = 3. Hint: To apply reciprocity, we need the remainder of
𝑝 > 3 mod 4, and afterwards we need the remainder of 𝑝 mod 3. Therefore, it
is best to distinguish cases according to the remainder of 𝑝 mod 12.
(c) 𝑝 = 6𝑘 + 1 or 𝑝 = 3.
(d) 𝑝 = 5𝑘 ± 1 or 𝑝 = 5.
(e) 𝑝 = 8𝑘 ± 1 or 8𝑘 + 3. Hint: Factor 𝑥4 − 4.
(f) 𝑝 = 4𝑘 + 1. Hint: Apply Theorem 3.5.1. Distinguish cases according to the
−1 2
remainder of 𝑝 mod 8 and use the formulas of ( 𝑝 ) and ( 𝑝 ).
(g) Every 𝑝. Hint: Use (e) and (f) or apply Theorem 3.5.1.
(h) Every prime except the ones of the form 24𝑘 + 17.
−2
3. Follow the hint to Exercise 4.1.5, and apply that 1999 is a prime and ( 1999 ) = −1.
454 Answers and Hints
4.3.
1. (a) 1. (b) −1. (c) −1. (d) 1.
2. (a) Let 𝑚 = 𝑝1 . . . 𝑝𝑟 . If 𝑥2 ≡ 𝑎 (mod 𝑚) is solvable, then 𝑥2 ≡ 𝑎 (mod 𝑝 𝑖 ) is
𝑎 𝑎 𝑎 𝑎
solvable for every 𝑖. Thus ( 𝑝 ) = 1 for every 𝑖 implying ( 𝑚 ) = ( 𝑝 ) . . . ( 𝑝 ) = 1.
𝑖 1 𝑟
−1
3. The case 𝑝 = 2 is obvious. Otherwise 𝑝 ≡ 1 (mod 4), implying ( 𝑝
) = 1. So we
𝑎 𝑝 𝑎2 +𝑏2
can reduce the problem to 𝑎, 𝑏 > 0. Let (say) 𝑎 be odd, then ( 𝑝 ) = (𝑎) = ( 𝑎 ) =
𝑏2
( 𝑎 ) = 1 (for 𝑎 > 1).
4. Both sums equal −1.
𝑘 −2
Hint to (b): Verify ( 2𝑘+1 ) = ( 2𝑘+1 ).
𝑎 𝑚 𝑛 𝑎
5. (a) If 𝑎 ≡ 1 (mod 4), then ( 𝑚 ) = ( 𝑎 ) = ( 𝑎 ) = ( 𝑛 ). If 𝑎 = 2𝑘 𝑡 with 𝑘 ≥ 2 and 𝑡
odd, then 𝑚 ≡ 𝑛 (mod 4) guarantees that the pairs 𝑡, 𝑚 and 𝑡, 𝑛 behave alike
2 2
concerning reciprocity. Also, ( 𝑚 ) = ( 𝑛 ) if 𝑚 ≡ 𝑛 (mod 8), i.e. 𝑘 ≥ 3. If 𝑘 = 2
2 2
(or any even number), then ( 𝑚 ) and ( 𝑛 ) play no role.
(b) Any odd 𝑚 > 1 (coprime to 𝑎) and 𝑛 = 𝑚 + 2𝑎 are suitable in both cases.
𝑟
6. (a) 0 or 𝜑(𝑚). Hint: If every ( 𝑚 ) = 1, then the sum 𝑆 is clearly 𝜑(𝑚). Otherwise
𝑐
take any 𝑐 with ( 𝑚 ) = −1 and replace every 𝑟 by 𝑐𝑟. Verify that the resulting
sum equals both 𝑆 and −𝑆.
(b) −1 if 𝑚 is an odd power of a prime of the form 4𝑘 + 3, and 1 in every other
case.
7. (a) 𝑚 is a square. Hint: The squares clearly meet the requirement. If 𝑚 is not a
square, then there is a prime 𝑝 occuring at an odd exponent in the standard
form of 𝑚, i.e. 𝑚 = 𝑝𝑘 𝑡 with (𝑡, 𝑝) = 1 and 𝑘 odd. Let 𝑐 be a quadratic non-
𝑎
residue mod 𝑝. Then ( 𝑚 ) = −1 for a solution 𝑎 of the system 𝑥 ≡ 𝑐 (mod 𝑝),
𝑥 ≡ 1 (mod 𝑡).
(b) 𝑎 is a square. Hint: Argue as in (a) using reciprocity. Be careful to handle the
negative and/or even numbers 𝑎, as well.
5.1.
5.2.
5 10
2. For a prime 𝐹𝑛 (≠ 5), show that both ( 𝐹 ) and ( 𝐹 ) are −1. The converse can be
𝑛 𝑛
proved exactly the same way as in Theorem 5.2.2.
3. The only if part follows exactly the same way as in Theorem 5.2.2. The converse
can be proved by contradiction: we can assume then that 𝐾𝑛 has a prime divisor
𝑞 ≤ √𝐾𝑛 . Show that 𝑜𝑞 (3) = 2𝑛 or 5 ⋅ 2𝑛 . This implies 2𝑛 ∣ 𝑞 − 1 which combined
with 𝑞 ≤ √𝐾𝑛 yields the desired contradiction.
4. Apply the formula for 𝜑(𝑁).
5. Answer: 5. Hint: Show first that 𝑘 must be a power of two. Then apply Exer-
cise 5.2.1a and the fact that 𝐹5 is divisible by 641.
6. By Theorem 5.2.3, the smallest possible primes are 47, 233, 223, and 431, and these
divide the given Mersenne numbers, as can be checked quickly by repeated squar-
ings.
𝑛
8. If 22 ≡ −1 (mod 𝑞2 ), then we obtain 𝑜𝑞2 (2) = 2𝑛+1 ∣ 𝜑(𝑞2 ) = 𝑞(𝑞 − 1) as in the
proof of Theorem 5.2.1. This implies 𝑜𝑞2 (2) ∣ 𝑞 − 1, so 2𝑞−1 ≡ 1 (mod 𝑞2 ). The
statement for the Mersenne numbers can be proved similarly.
9. Besides (8, 9) only those pairs work where one element is a Fermat or Mersenne
prime and the other element is a suitable power of two.
10. If 𝑘 ∣ 𝑛 holds in 𝐻, then 𝑛/𝑘 = 𝑎 + 𝑏√3 for suitable integers 𝑎 and 𝑏, and 𝑛/𝑘 is
also rational. Using the irrationality of √3, it follows that 𝑏 = 0 and 𝑎 is integer.
The converse is straightforward.
11. It is sufficient to show that if 𝐹𝑛 is a prime, then 𝐹𝑛 ∣ 𝐻𝑘 for a suitable 𝑘. Observe
that 𝑜𝐹𝑛 (6) ∣ 𝐹𝑛 − 1, so 𝑜𝐹𝑛 (6) = 2𝑗 for some 𝑗. Then 𝐹𝑛 ∣ 𝐻𝑗−1 .
5.3.
1. Answer: 6003. (There are infinitely many primes in the reduced residue classes
and each residue class represented by a prime divisor of 9999 contains a positive
prime.)
2. The integer 𝐴 = 4𝑝1 . . . 𝑝𝑟 + 1 does not necessarily have a prime divisor of the form
4𝑘 + 1, since it can be the product of an even number of primes of the form 4𝑘 + 3.
3. (a) Adapt the proof of Theorem 5.3.2.
(b)–(h) Argue as in the proof of Theorem 5.3.3. Examine the possible forms of
prime divisors of the following numbers (rely on Exercise 4.2.5 in parts (c),
(d), (f), and (h)):
(b) 𝑛2 + 2; (c) 𝑛2 + 4; (d) 𝑛2 − 2 or 8𝑛2 − 1; (e) 5𝑛2 − 1; (f) 𝑛2 + 4;
(g) (2𝑛)2 + 3; (h) 12𝑛2 − 1.
4. Infinitely many; the question refers to the arithmetic progression 10000𝑘 + 4321.
458 Answers and Hints
5. Prove by contradiction: assume that the decimal fraction is periodic with a period
of length 𝑘 starting after an initial aperiodic part of 𝑚 digits. We know that there
are infinitely many primes having 1s as their last 2𝑘 digits, and the same holds with
3s as the last 2𝑘 digits. Therefore the period must consist purely of 1s on the one
hand, and purely of 3s on the other hand, which is impossible.
6. The condition is (𝑎, 𝑏, 𝑐) = 1. Necessity is obvious. Hint for sufficiency: Put
(𝑎, 𝑏) = 𝑠, then (𝑠, 𝑐) = 1. By Dirichlet’s theorem, 𝑎 + 𝑏𝑘 = 𝑠𝑝 for some 𝑘, where 𝑝
is a prime greater than 𝑐. Apply again Dirichlet’s Theorem to the arithmetic pro-
gression 𝑠𝑝 + 𝑐𝑛, 𝑛 = 0, 1, . . . .
𝑐
7. (a) ( 𝑝 ) = 1 e.g. for primes of the form 𝑝 = 8 ⋅ |𝑐| ⋅ 𝑘 + 1. We can verify this by
using the standard form of |𝑐| and the properties of the Legendre (or Jacobi)
symbol. (We also have to consider the cases when 𝑐 is negative or even.)
(b) Answer: 𝑐 is not a square. Hint: Use Exercise 4.3.7b (or proceed along the
lines of the solution seen there).
8. For distinct primes 𝑝1 , . . . , 𝑝𝑛−1 , 𝑓 = 𝑥(1 + 𝑘(𝑥 − 𝑝1 ) . . . (𝑥 − 𝑝𝑛−1 )) meets the
requirement for some integer 𝑘: 𝑣 1 = 𝑝1 , . . . , 𝑣 𝑛−1 = 𝑝𝑛−1 , 𝑣 𝑛 = 1.
9. Let 𝑎 and 𝑑 be fixed positive coprime integers. Then 𝑎1 = 𝑎 + 𝑟𝑑 is composite
for some 𝑟 ≥ 0. Since (𝑎1 , 𝑑 𝑠 ) = 1 for every 𝑠, the assumption implies that 𝑝𝑠 =
𝑎1 + 𝑘𝑠 𝑑 𝑠 is a prime for some 𝑘𝑠 . These primes 𝑝𝑠 are also of the form 𝑎 + 𝑘𝑑, and
there are infinitely many distinct numbers among them since 𝑘𝑠 ≠ 0.
5.4.
1. Write 𝑎 and 𝑏 as 𝑎 = ⌊𝑎⌋ + {𝑎} and 𝑏 = ⌊𝑏⌋ + {𝑏}, where 0 ≤ {𝑎}, {𝑏} < 1. Then
𝑎 + 𝑏 = ⌊𝑎⌋ + ⌊𝑏⌋ + {𝑎} + {𝑏}. If the sum of the last two terms is less than 1, then
⌊𝑎 + 𝑏⌋ = ⌊𝑎⌋ + ⌊𝑏⌋, whereas if it falls between 1 and 2, then ⌊𝑎 + 𝑏⌋ = ⌊𝑎⌋ + ⌊𝑏⌋ + 1.
2. Show first that we can restrict ourselves to integer values of 𝑥 and then observe
that there are only finitely many positive integers less than the 𝑥0 guaranteed by
Theorem 5.4.3.
3. Proceed as in the proof of Theorem 5.4.2. Combine 𝜋(𝑝𝑛 ) = 𝑛 with the upper
bound for 𝜋(𝑥) to obtain 𝑝𝑛 > (1/𝑐 2 ) ⋅ 𝑛 ⋅ log 𝑛, if 𝑛 is large enough. The other
estimate is slightly more complicated. You need to verify log 𝑝𝑛 < (1 + 𝜀) log 𝑛.
This leads to 𝑝𝑛 < (1/𝑐 1 + 𝜀) ⋅ 𝑛 ⋅ log 𝑛 for any 𝜀 > 0 if 𝑛 is large enough (depending
on 𝜀).
4. Part (a) is the logarithmic version of (b), so we need to prove only (a). We can use
the inequalities
log 𝑛 ⋅ 𝜋(𝑛) ≥ ∑ log 𝑝 ≥ log 𝑓(𝑛) ⋅ (𝜋(𝑛) − 𝜋(𝑓(𝑛)))
𝑝≤𝑛
and choosing e.g. 𝑓(𝑛) = 𝑛/(log 𝑛)2 leads to the desired result.
5.5. 459
5. (iii) is the logarithmic form of (iv). The implications (i)⇒(ii) and (i)⇒(iii) can be
verified as in Theorem 5.4.2 and Exercise 5.4.4. The converses can be proven by
similar arguments.
6. (a) The upper bound follows immediately from 𝑆(𝑛) ≤ 𝑛⋅𝜋(𝑛) and from the upper
bound for 𝜋(𝑥). For the lower bound, start from 𝑆(𝑛) ≥ (𝜋(𝑛) − 𝜋(𝑐𝑛)) ⋅ (𝑐𝑛)
where 0 < 𝑐 < 1, and show, with the help of the Prime Number Theorem,
that 𝜋(𝑛) − 𝜋(𝑐𝑛) > 𝑐′ ⋅ 𝑛/ log 𝑛 for some 𝑐′ > 0. (We can use Theorem 5.4.3
instead. Then 𝑐 must be chosen sufficiently small to guarantee the existence
of a suitable 𝑐′ .)
(b) Using 𝑝 𝑘 ∼ 𝑘 log 𝑘, show
𝜋(𝑛) 𝜋(𝑛)
𝑆(𝑛) ∼ ∑ 𝑘 log 𝑘 ∼ ∫ 𝑡 log 𝑡 𝑑𝑡.
𝑘=2 2
5.5.
3. (a) The integers 𝑛 with 𝑘 + 1 digits and first digit 1 satisfy 10𝑘 ≤ 𝑛 < 2 ⋅ 10𝑘 , hence
there is a prime among them for every 𝑘 by Chebyshev’s Theorem.
(b) Use part (A) in Theorem 5.5.5 instead of Chebyshev’s Theorem.
4. (a) Let 𝑝 be a prime satisfying 𝑛/2 < 𝑝 ≤ 𝑛. Writing the fractions with a com-
mon denominator, the denominator and all but one numerators are divisible
by 𝑝. Therefore, the sum cannot be an integer (it will be a fraction with a de-
nominator divisible by 𝑝). The statement can be proved without Chebyshev’s
Theorem by examining the exponent of 2 in the least common denominator
lcm(1, 2, . . . , 𝑛) and in the numerator (of the sum).
(b) For 𝑛 ≥ 2𝑘 − 1, any proof of (a) works. For 𝑛 < 2𝑘 − 1, the sum is less than 1.
5. As (2𝑛
𝑘
2𝑛
) = (2𝑛−𝑘 ), we may assume 𝑘 < 𝑛. Then
2𝑛 2𝑛 (2𝑛 − 𝑘) . . . (𝑛 + 1)
( )=( )⋅ .
𝑛 𝑘 (𝑘 + 1) . . . 𝑛
Both the numerator and the denominator of the last fraction are products of 𝑛 − 𝑘
factors, and every factor in the numerator is bigger than any factor in the denomi-
nator. Hence this fraction is larger than 1.
6. The moduli are pairwise coprime, hence this system of congruences is solvable.
The solutions form a reduced residue class modulo 𝑚 = 𝑝1 . . . 𝑝𝐾 𝑞1 . . . 𝑞𝐾 that con-
tains (infinitely many) primes 𝑝 > 𝑚, by Dirichlet’s Theorem. By the construction
of the congruences, 𝑝 − 𝑗 is divisible by 𝑝𝑗 , and 𝑝 + 𝑗 is divisible by 𝑞𝑗 . Further,
𝑝 − 𝑗 > 𝑝𝑗 , 𝑝 + 𝑗 > 𝑞𝑗 , hence each 𝑝 ± 𝑗 is composite.
7. (a) The numerator of (2𝑛 𝑛
) contains 𝑝 as a factor, whereas the denominator and
the other factors of the numerator are not divisible by 𝑝.
(b) Both the numerator and the denominator are divisible by exactly the second
power of 𝑝 (the factors 3𝑝 and 4𝑝 in the numerator and the factors 𝑝 and 2𝑝
in the denominator contain 𝑝). Generalization: If 2𝑛/(2𝑘 + 1) < 𝑝 ≤ 𝑛/𝑘 and
𝑝 > 2𝑘, then (2𝑛
𝑛
) is not divisible by 𝑝.
8. Let 𝐿 be the number of primes between 𝑛 and 2𝑛. By Exercise 5.5.7a, the product
of these primes is the quantity 𝐶 defined in the proof of Theorem 5.5.3 after (5.5.1),
hence 𝐶 < (2𝑛)𝐿 . On the other hand, (5.5.6) in the same proof implies 𝐶 > 4𝑛/4
for 𝑛 large enough, since the second term on the right-hand side of (5.5.7) can
be neglected compared to the first term. The two inequalities thus obtained for
𝐶 imply 4𝑛/4 < (2𝑛)𝐿 , and, taking logarithms, we get the statement for 𝑛 large
enough. This can be extended to every 𝑛 ≥ 2 by the argument seen in the hint to
Exercise 5.4.2.
9. (a) Use the fact that the interval (𝑛, 𝑛 + 𝑛2/3 ) contains a prime if 𝑛 is large enough.
𝑛
(b) The condition 𝑞𝑛 = ⌊𝛼3 ⌋ is equivalent to
𝑛
3𝑛
(A.5.1) √𝑞𝑛 ≤ 𝛼 < 3 √𝑞𝑛 + 1.
Using (A.5.1), choose the primes 𝑞𝑛 so that that 𝛼 should be a common ele-
ment of a nested sequence of intervals. This can be done since nestedness is
equivalent to 𝑞3𝑛 ≤ 𝑞𝑛+1 < (𝑞𝑛 + 1)3 − 1.
5.6. 461
(c) The formula in (b) gives no exact value for 𝛼, so we could prove only the exis-
tence of such an 𝛼.
10. (a) Following the proof of part (B) in Theorem 5.5.5, we get that, choosing a suit-
able 𝑐 > 0, the intervals (𝑛, 𝑛 + 𝑐 log 𝑛) contain no primes for infinitely many
values of 𝑛.
(b) By the proof of Theorem 5.5.1, the interval (𝑛, 𝑛 + 𝐾) is primefree for 𝑛 =
(𝐾 + 1)! +1. We express 𝐾 in terms of 𝑛, using the following estimates for 𝑚!
𝑚 𝑚
( ) < 𝑚! ≤ 𝑚𝑚 .
𝑒
(The upper bound is obvious, and the lower bound can be easily verified by
induction.) Taking logarithms of the inequalities (or of Stirling’s formula),
we get log 𝑚! ∼ 𝑚 log 𝑚. In our case this means log 𝑛 ∼ 𝐾 log 𝐾, yielding
𝐾 ∼ log 𝑛/ log log 𝑛.
Thus we proved that for any 𝜀 > 0 there exist infinitely many positive integers
𝑛 such that the interval (𝑛, 𝑛 + (1 − 𝜀) log 𝑛/ log log 𝑛) contains no primes.
(c) By the Remark, the interval (𝑛, 𝑛 + 𝐾) is primefree if 𝑛 − 1 is the product
of primes not greater than 𝐾 + 1. By Lemma 5.4.5, 𝑛 ≤ 4𝐾+1 , and by Exer-
cise 5.4.4b, even 𝑛 < 𝑒(1+𝜀)(𝐾+1) holds (the latter inequality requires the Prime
Number Theorem). This gives 𝐾 > 𝑐 log 𝑛, which is the result in (a), or using
the sharper inequality, we get part (B) of Theorem 5.5.5.
11. Apply similar arguments as in the proof of part (B) of Theorem 5.5.5 (we need now
inequalities in the opposite direction, of course). The only essential difference is
that the inequality corresponding to (5.5.15) would need log 𝑝𝑗 > log 𝑁 which
is false since 𝑝𝑗 < 𝑁. We can overcome this difficulty as follows: If 𝑁 > 𝑝𝑗 >
𝑁/(log 𝑁)2 , then log 𝑝𝑗 > (1 − 𝜀′ ) log 𝑁 for sufficiently large 𝑁. Therefore it is
worthwhile to write and add the inequalities corresponding to (5.5.13) for these
primes.
5.6.
Use the fact that 0 < 𝑎𝑗 < 1/2 implies 𝑎𝑗 < − log(1 − 𝑎𝑗 ) < 2𝑎𝑗 .
8. It is more convenient to prove the corresponding inequality for the logarithms of
the two sides. Use Theorem 5.6.2 and the fact that − log(1 − 𝑎) can be well approx-
imated by 𝑎 for 0 < 𝑎 ≤ 1/2.
9. (a) Divergent: For even numbers 𝑛 = 2𝑘 we have 𝑛𝑝(𝑛) = 4𝑘, and ∑𝑘 1/(4𝑘) is
divergent.
5.7. 463
(b) Convergent. Let 𝑞 be a fixed prime and 𝑆𝑞 the sum of reciprocals of the integers
𝑛 satisfying 𝑃(𝑛) = 𝑞. Verify
1 1
𝑆𝑞 = ∏ .
𝑞 𝑝≤𝑞 1 − 1
𝑝
10. To prove the observation, let 𝑠 be the period of the rational number and consider
only those 𝑖 > 𝑖0 for which 𝑎𝑖 falls into the periodic part. Show that there can be at
∞ ∞
most 𝑠 such 𝑎𝑖 with exactly 𝑡 digits (for any 𝑡). Hence, ∑𝑖>𝑖 1/𝑎𝑖 < 𝑠 ∑𝑡=1 1/10𝑡−1 <
0
∞.
5.7.
1. (a) Consider the step 𝑟 𝑘 = 𝑟 𝑘+1 𝑞𝑘+2 + 𝑟 𝑘+2 in the algorithm. If we decrease the
product after the equality sign using 𝑟 𝑘+1 > 𝑟 𝑘+2 and 𝑞𝑘+2 ≥ 1, we obtain the
desired inequality 𝑟 𝑘 > 2𝑟 𝑘+2 .
(b) 2 log2 𝑏.
(c) We get the smallest 𝑏, if (𝑎, 𝑏) = 𝑟𝑠−1 = 1 and the quotients 𝑞𝑖 are minimal,
i.e. 𝑞𝑠 = 2 and 𝑞𝑖 = 1 for 𝑖 < 𝑠. Then, starting from the end, the algorithm
gives
𝑟𝑠−1 = 1, 𝑟𝑠−2 = 2, 𝑟𝑠−3 = 𝑟𝑠−2 + 𝑟𝑠−1 , ... , 𝑏 = 𝑟1 + 𝑟2 ,
thus 𝑟𝑠−𝑗 = 𝜑𝑗+1 and 𝑏 = 𝜑𝑠+1 , by the recursion for the Fibonacci numbers.
2. The gcd of the numerator and the denominator does not change during the process
(even when halving the numerator, since the denominator is odd, hence so is the
gcd). As the procedure is a variant of the Euclidean algorithm, we reach finally
(𝑎, 𝑏) = 𝑑. This 𝑑 appears in the numerator, since the new numbers occur there
after each step. Then the denominator 𝑣 satisfies (𝑑, 𝑣) = (𝑎, 𝑏) = 𝑑, thus 𝑑 ∣ 𝑣.
3. 341 = 11 ⋅ 31. Note that
𝜑(11) ∣ 340 ⇒ 2340 ≡ 1 (mod 11) and
5 340
2 ≡ 1 (mod 31) ⇒ 2 ≡ 1 (mod 31) .
This implies 2340 ≡ 1 (mod 11 ⋅ 31), so 341 is a pseudoprime of base 2. But
3340 ≡ 310 ≢ 1 (mod 31) ⇒ 3340 ≢ 1 (mod 341) ,
so 341 is not a pseudoprime of base 3.
5. As 𝑝 is odd, we have
𝑎𝑝 − 1 𝑎𝑝 + 1
𝑛= ⋅ =
𝑎−1 𝑎+1
𝑝−1 𝑝−2
= (𝑎 +𝑎 + ⋯ + 1)(𝑎𝑝−1 − 𝑎𝑝−2 + ⋯ + 1),
464 Answers and Hints
implying that 𝑛 is odd and composite. The validity of 𝑎𝑛−1 ≡ 1 (mod 𝑛) follows
from 𝑎2𝑝 ≡ 1 (mod 𝑛) and 𝑛 ≡ 1 (mod 2𝑝); the latter can be verified by considering
𝑛(𝑎2 − 1) = 𝑎2𝑝 − 1 modulo 𝑝 and using that 𝑛 is odd.
6. 561 = 3 ⋅ 11 ⋅ 17. To prove (𝑎, 561) = 1 ⟹ 𝑎560 ≡ 1 (mod 561), it is sufficient to
verify this for the moduli 3, 11, and 17, which follow from Fermat’s Little Theorem.
7. (a) ⇒ (b): If 𝑛 is not squarefree, then we get a contradiction following the relevant
parts in the proof of Theorem 5.7.4 (but disregarding (5.7.2) there, of course). If
𝑝 ∣ 𝑛, then consider a primitive root 𝑔 mod 𝑝 coprime to 𝑛 (this can be guaranteed
by a suitable system of congruences as seen in the proof of Theorem 5.7.4). Then
(𝑔, 𝑛) = 1 ⟹ 𝑔𝑛−1 ≡ 1 (mod 𝑛)
⟹ 𝑔𝑛−1 ≡ 1 (mod 𝑝)
⟹ 𝑜𝑝 (𝑔) = 𝑝 − 1 ∣ 𝑛 − 1.
(b) ⇒ (c): Since 𝑛 is squarefree, it is sufficient to verify 𝑎𝑛 ≡ 𝑎 (mod 𝑝) for every
prime divisor 𝑝 of 𝑛. This is obvious for 𝑝 ∣ 𝑎. If (𝑝, 𝑎) = 1, then Fermat’s Little
Theorem and 𝑝 − 1 ∣ 𝑛 − 1 imply 𝑎𝑛−1 ≡ 1 (mod 𝑝), and multiplying by 𝑎 we get
the desired congruence.
(c) ⇒ (a): If (𝑎, 𝑛) = 1, then we can divide 𝑎𝑛 ≡ 𝑎 (mod 𝑛) by 𝑎 to get 𝑎𝑛−1 ≡ 1
(mod 𝑛).
8. Use condition (b) of Exercise 5.7.7.
9. (a) If luckily we get 1 < (𝑎, 𝑛) < 𝑛, then we verified not only the compositeness
of 𝑛, but also found a non-trivial divisor. (This has, however, a very small
probability, see part (b).)
(b) Roughly 10−100 .
10. (𝑎 − 1, 𝑛) (or (𝑎 + 1, 𝑛)) is a non-trivial divisor.
11. First we check whether or not 𝑛 is a prime. Then we can clearly restrict ourselves
to the case when 𝑛 is odd and composite.
We see, using a quick algorithm, if 𝑛 is a perfect power: we check whether 𝑘√𝑛 is
an integer for some 2 ≤ 𝑘 ≤ log2 𝑛. If 𝑛 = 𝑚𝑘 , then it suffices to factor 𝑚. The
initial condition also holds for 𝑚, since 𝜑(𝑚) ∣ 𝜑(𝑛), hence the given multiple of
𝜑(𝑛) is a multiple of 𝜑(𝑚). Thus we may assume that 𝑛 is not a perfect power.
We choose (say) 1000 random values 𝑛 ∤ 𝑎 and compute (𝑎, 𝑛). If (𝑎, 𝑛) > 1, then
we can decompose 𝑛 into the product of two non-trivial factors, by Exercise 5.7.9.
If (𝑎, 𝑛) = 1, then adapting the basic idea in Theorem 5.7.5 to our case, consider
the sequence
𝑒 𝑒
𝑎𝑒 , 𝑎 2 , 𝑎 4 , . . . ,
where we know that 𝑒 is a multiple of 𝜑(𝑛). The remainder modulo 𝑛 of the first
element is 1 from the Euler–Fermat Theorem. In the squarefree part of the proof of
Theorem 5.7.5, we only used that 𝑛 is not a prime power, and we can show the same
way that at least half of the elements in a reduced residue system modulo 𝑛 generate
a sequence of remainders where the 1s are followed by a remainder different from
±1, and so we can factor 𝑛, by Exercise 5.7.10.
5.7. 465
If 𝑛 = 𝑛1 𝑛2 with 𝑛𝑖 > 1, then we repeat the entire process for 𝑛1 and 𝑛2 (𝜑(𝑛𝑖 ) ∣ 𝜑(𝑛)
implies that we can use the same exponent 𝑒), and proceed similarly till we get the
prime factorization of 𝑛. Since the number of prime factors is at most log2 𝑛 and
each factorization requires at most 𝑐 log2 𝑛 steps, we get the complete factorization
in not more than 𝑐(log2 𝑛)2 steps with a suitable constant 𝑐.
12. This idea does not work in practice since no quick methods are known for com-
puting factorials or their remainders.
13. (a) Argue as in the part in the proof of Theorem 5.7.4 where we showed that there
are at least as many witnesses as accomplices, provided there are witnesses at
all.
(b) Let 𝑛 > 1 be odd. Choose (say) 1000 random values 𝑎 ≢ 0 (mod 𝑛) and check
the validity of 𝑎𝑛−1 ≡ 1 (mod 𝑛). If it is false in at least one case, then 𝑛 must
be composite. If it is true in all the 1000 cases, then the probability of 𝑛 not
being a prime or a universal pseudoprime is less than 2−1000 .
14. We check 𝑅 integers 𝑎. If 𝑛 is a prime, then we always obtain remainders ±1 and
the probability of pure 1s is 2−𝑅 . (Thus we can make an error also in the opposite
direction at this test by declaring a prime falsely to be a composite integer.) If 𝑛 is
composite, then we can proceed as in the proofs of Theorems 5.7.4 and 5.7.5.
15. Apply a suitable modification of the argument in the hint to Exercise 5.2.3.
16. (a) Verify 𝑜𝑛 (𝑎) = 𝑛 − 1.
(b) Let the standard form of 𝑛 − 1 be
𝛽 𝛽
𝑛 − 1 = 𝑝1 1 . . . 𝑝𝑟 𝑟 .
𝛽
By assumption, 𝑝𝑖 𝑖 ∣ 𝑜𝑛 (𝑎𝑖 ). Then (e.g. by Exercise 3.2.4c) there are integers 𝑏𝑖
𝛽
satisfying 𝑜𝑛 (𝑏𝑖 ) = 𝑝𝑖 𝑖 , which implies 𝑜𝑛 (𝑏1 . . . 𝑏𝑟 ) = 𝑛−1, by Exercise 3.2.15a.
(c) For a proof of contradiction, assume that 𝑛 is composite, hence it has a prime
divisor 𝑞 ≤ √𝑛. Repeat the argument of part (b) for the modulus 𝑞 instead of
𝑛. We obtain 𝑜𝑞 (𝑏) = 𝑐 > √𝑛 ≥ 𝑞 for some 𝑏, which is a contradiction.
17. We have to show that if 𝑎 generates a good sequence, then
𝑎
(A.5.2) 𝑎(𝑛−1)/2 ≡ ( ) (mod 𝑛)
𝑛
holds.
If 𝑎𝑟 ≡ 1 (mod 𝑛), deduce that both sides of (A.5.2) are 1.
𝑗
Turning to the case 𝑎2 𝑟 ≡ −1 (mod 𝑛), compute the remainder of 𝑎(𝑛−1)/2 . Then
show for any prime divisor 𝑞 of 𝑛, that 𝑜𝑞 (𝑎) is an odd multiple of 2𝑗+1 , thus 2𝑗+1 ∣
𝑎
𝑞−1. Based on that, prove that the value of ( 𝑞 ) depends on the parity of (𝑞−1)/2𝑗+1 ,
𝑎
and write ( 𝑛 ) using the standard form of 𝑛. Replace the primes 𝑞 in the standard
form of 𝑛 by the expressions obtained from 2𝑗+1 ∣ 𝑞−1, perform the multiplications
𝑎
and examine the divisibility by a suitable power of two to obtain that ( 𝑛 ) assumes
the value in (A.5.2).
466 Answers and Hints
5.8.
1. This would be an unsigned, anonymous letter that could have been falsified by a
third party in the name of 𝐴.
2. The invertibility of 𝐸 means that the congruence 𝑟𝑒 ≡ 𝑠 (mod 𝑁) has exactly one
solution in 𝑟 for any 𝑠. This congruence is equivalent to the system
(A.5.3) 𝑟𝑒 ≡ 𝑠 (mod 𝑝) , 𝑟𝑒 ≡ 𝑠 (mod 𝑞) .
By Exercise 3.5.7, each of the two congruences in (A.5.3) has exactly one solution
for every 𝑠 if and only if (𝑒, 𝑝 − 1) = (𝑒, 𝑞 − 1) = 1, i.e. (𝑒, 𝜑(𝑁)) = 1.
3. (a) It suffices to show that the congruence is valid both mod 𝑝 and mod 𝑞. Let us
see this mod 𝑝: For 𝑝 ∣ 𝑟, both sides are congruent to 0, and for (𝑝, 𝑟) = 1, we
have
𝑘(𝑞−1)
𝑟1+𝑘𝜑(𝑁) ≡ 𝑟(𝑟𝑝−1 ) ≡ 𝑟 ⋅ 1 = 𝑟 (mod 𝑝) .
(b) 𝑣 ≡ 1 (mod [𝑝 − 1, 𝑞 − 1]).
4. This causes no problem, since we use only the property that 𝑟𝑝 ≡ 𝑟 (mod 𝑝) holds
for every 𝑟 (see Exercise 5.8.3a). (In this case, however, the product (𝑝 − 1)(𝑞 − 1)
is not the same as 𝜑(𝑁), of course.)
5. Let 𝑠 ≡ 𝑟𝑒 (mod 𝑁), where 𝑠 and 𝑒 are known, and we want to find the value of 𝑟.
We raise 𝑠 to the 𝑒th power, and then raise the result to the 𝑒th power, etc., till we
get a number congruent to 𝑠:
𝑘
(A.5.4) 𝑠𝑒 ≡ 𝑠 (mod 𝑁) .
Since (𝑒, 𝜑(𝑁)) = 1, we can take 𝑒th roots in (A.5.4), by Exercise 5.8.2, so
𝑘−1
𝑠𝑒 ≡ 𝑟 (mod 𝑁) .
This means that if (A.5.4) occurs for a small 𝑘, then we can determine 𝑟. If 𝑒𝑘 ≡ 1
(mod 𝜑(𝑁)), then (A.5.4) holds by Exercise 5.8.3a, therefore the order of 𝑒 modulo
𝜑(𝑁) must not be small.
6. 𝐴 and 𝐵 can compute the value using the identities
𝑔𝑘𝐴 𝑘𝐵 = (𝑔𝑘𝐵 )𝑘𝐴 = (𝑔𝑘𝐴 )𝑘𝐵 .
Others cannot do this (hopefully) because they do not know 𝑘𝐴 or 𝑘𝐵 .
7. (a) For a proof by contradiction, assume that two subset sums are equal. Can-
celling the common terms, we get that all terms are distinct in the two sums.
By (5.8.6), the largest term is itself larger, than the complete other sum, yield-
ing a contradiction.
(b) For a proof by contradiction, assume ∑ 𝑑𝑖 = ∑ 𝑑𝑗 for some 𝑑𝑖 and 𝑑𝑗 . Then
∑ 𝑟𝑐 𝑖 ≡ ∑ 𝑟𝑐𝑗 (mod 𝑚), by (5.8.7). We can divide by 𝑟 because (𝑟, 𝑚) = 1,
𝑘−1
i.e. ∑ 𝑐 𝑖 ≡ ∑ 𝑐𝑗 (mod 𝑚). Since 𝑚 > ∑𝑖=0 𝑐 𝑖 , we can replace congruence by
equality which contradicts that 𝐶 is sum injective.
(c) It follows directly from the definition of sum injectivity.
6.1. 467
(d) To get 𝑢, we need the values 𝛿 𝑖 , i.e. which terms of the sum injective sequence
sum to the given 𝑣. For (5.8.6), we can obtain them by the greedy algorithm,
where we always take the largest possible 𝑐 𝑖 . For (5.8.7), we get the values 𝑐 𝑖
and the corresponding 𝑣′ as the smallest positive solutions of the congruences
𝑟𝑥 ≡ 𝑑𝑖 and 𝑟𝑥 ≡ 𝑣 (mod 𝑚). Then we apply the previous procedure.
6.1.
1. To verify multiplicativity, apply the formula for 𝑑(𝑛) (Theorem 1.6.3) or use Ex-
ercise 1.6.5a-b. To disprove complete multiplicativity, find a pair of integers 𝑎, 𝑏
satisfying 𝑑(𝑎𝑏) ≠ 𝑑(𝑎)𝑑(𝑏) (and (𝑎, 𝑏) ≠ 1).
2. (a), (c) 𝑓(𝑛) and ℎ(𝑛) are neither additive nor multiplicative.
(b) 𝑔(𝑛) is completely multiplicative.
(d) 𝑘(𝑛) is additive but not completely.
3. There is no such multiplicative ℎ: By the conditions,
0 = ℎ(6) = ℎ(2)ℎ(3) ⇒ ℎ(10)ℎ(15) = ℎ(2)ℎ(5)ℎ(3)ℎ(5) = 0 ≠ 3.
There are, however, infinitely many additive, in fact completely additive functions
ℎ. Solving the system of equations
0 = ℎ(2) + ℎ(3), 1 = ℎ(2) + ℎ(5), 3 = ℎ(3) + ℎ(5),
we obtain ℎ(2) = −1, ℎ(3) = 1, and ℎ(5) = 2. Let ℎ(7) be a parameter 𝑐, and let
ℎ(𝑝) = 0 for all other primes; there is exactly one completely additive function ℎ
satisfying these conditions: If
𝑛 = 2𝛼1 3𝛼2 5𝛼3 7𝛼4 𝑡, where (𝑡, 210) = 1 where 𝛼𝑖 ≥ 0, 𝑖 = 1, 2, 3, 4,
then
ℎ(𝑛) = −𝛼1 + 𝛼2 + 2𝛼3 + 𝑐𝛼4 .
4. If there exists such a multiplicative function 𝑓 ≠ 0, then 𝑓(1) = 1 by Theorem 6.1.6,
and if 𝑞𝑗 , . . . , 𝑞𝑤 are the prime powers in the standard form of 𝑛, then only 𝑓(𝑛) =
𝑐𝑗 . . . 𝑐𝑤 is possible by Theorem 6.1.7. Verify that the function defined this way is
multiplicative. We can proceed similarly for additive functions and in part (b).
5. True: (a), (d).
6. (a) A necessary and sufficient condition is 𝑓(𝑘) = 0.
(b) A necessary and sufficient condition is 𝑓(𝑘) = 0 in this case, too. To prove
sufficiency, consider the standard forms of 𝑎, 𝑏, and 𝑘, and compute 𝑔(𝑎) =
𝑓(𝑘𝑎), 𝑔(𝑏) = 𝑓(𝑘𝑏), and 𝑔(𝑎𝑏) = 𝑓(𝑘𝑎𝑏) by Theorem 6.1.7. Since (𝑎, 𝑏) = 1,
a prime divisor of 𝑘 cannot divide both 𝑎 and 𝑏.
468 Answers and Hints
0, if 𝐾 ∤ 𝑛
𝑓(𝑛) = { 𝑛
𝑐𝑔( 𝐾 ), if 𝐾 ∣ 𝑛
11. If 𝑓 = 0, then the condition implies 𝑔 = 0, so the assertion is true trivially. Oth-
erwise, looking at the values assumed at 1, we infer that only the constant 1 is
possible as the sum of the two functions. Writing the definition of multiplicativity
for 𝑓 = 1 − 𝑔 and using additivity of 𝑔, we obtain 𝑔(𝑎)𝑔(𝑏) = 0 for every (𝑎, 𝑏) = 1.
Hence 𝑔 assumes 0 and 𝑓 assumes 1 at every prime power except perhaps the pow-
ers of a single prime 𝑝. Therefore (𝑓1000 + 𝑔1000 )(𝑛) = 1 and (𝑓1000 𝑔1000 )(𝑛) = 0
if 𝑝 ∤ 𝑛. This makes it possible to check easily the desired multiplicativity and
additivity.
6.1. 469
12. We can argue as in the solution of Exercise 6.1.9d. We can start from the equalities:
𝑓(𝑎)𝑔(𝑎)(𝑓(𝑏) − 1) + 𝑓(𝑏)𝑔(𝑏)(𝑓(𝑎) − 1) = 0
13. (a) Show that the function has value 0 at infinitely many pairwise coprime inte-
gers.
(b) Let 𝑓(1) = 𝑓(2) = 1 and 𝑓(𝑛) = 0 for 𝑛 > 2.
(c) If 𝑓(𝑝𝜈𝑝 ) ≠ 0 for infinitely many primes 𝑝 with suitable exponents 𝜈𝑝 > 0,
then we infer as in part (a) that the function assumes every value of the range
infinitely often. Hence, there can be only finitely many such primes 𝑝 and we
can take 𝐾 as their maximum.
15. Answer: 𝜑2 (𝑛) = 𝑛 ∏𝑝∣𝑛 (1 − 2/𝑝) (where 𝑝 denotes a prime). Hint: Using si-
multaneous systems of congruences, prove that 𝜑2 (𝑛) is multiplicative. Then it is
sufficient to compute the values of the function at prime powers.
16. Verify that the functions on both sides are multiplicative; for the sum on the left-
hand side, we can argue similarly as in the previous exercise. By multiplicativity,
it is enough to check equality for prime powers.
470 Answers and Hints
6.2.
𝛼 𝛼
16. Let 𝑛 = 2𝛼 𝑝1 1 . . . 𝑝𝑟 𝑟 be the standard form of 𝑛 where 𝑝 𝑖 > 2 (𝛼 = 0 and/or 𝑟 = 0
is allowed). The condition implies 𝛼𝑖 = 1, 𝛼 ≤ 2, and 𝑟 ≤ 1, so 𝑛 = 1, 2, 4, 𝑝,
2𝑝, or 4𝑝 where 𝑝 is an odd prime. Checking these integers, we see that only the
specified four values of 𝑛 satisfy the condition.
17. Both functions assume only the values 0 and ±1.
18. (a) 3. Hint: There is a multiple of 4 among any four consecutive integers.
(b) Arbitrarily many. Hint: See Exercise 2.6.11.
19. Let 𝑆(𝑛) be the sum of the 𝑛th primitive complex roots of unity. It is sufficient to
show that 𝑆(𝑛) is multiplicative and 𝑆(𝑝𝛼 ) = 𝜇(𝑝𝛼 ) for every prime power 𝑝𝛼 . The
multiplicativity is a corollary of the observation: if (𝑘, 𝑚) = 1, then the product
of a 𝑘th and an 𝑚th primitive root of unity is a 𝑘𝑚th primitive root of unity, and
every 𝑘𝑚th primitive root of unity has a unique decomposition into such a prod-
uct. We can solve the exercise also using summation and inversion functions, see
Exercise 6.5.9a.
20. 0.
21. (a) Use the formulas for the functions, or the fact that the divisors of 𝑛 corre-
spond to certain subsets of prime divisors counted with multiplicity. If 𝑛 is
squarefree, then equality holds, otherwise we have strict inequalities.
(b) 𝑘𝜔(𝑛) ≤ 𝑑𝑘 (𝑛) ≤ 𝑘Ω(𝑛) .
22. True: (a).
23. We can proceed as for 𝜎. See the proofs of Theorem 6.2.2 and the part of Theo-
𝛼 𝛼
rem 6.2.8 concerning 𝜎, or Exercise 6.2.1. Answer: If 𝑛 = 𝑝1 1 . . . 𝑝𝑟 𝑟 is the standard
form of 𝑛 and 𝜈 ≠ 0, then
𝑟 𝑟 𝜈(𝛼𝑖 +1)
𝜈𝛼 𝑝𝑖 −1
𝜎𝜈 (𝑛) = ∏(1 + 𝑝𝑖𝜈 + 𝑝𝑖2𝜈 + ⋯ + 𝑝𝑖 𝑖 ) = ∏ .
𝑖=1 𝑖=1
𝑝𝑖𝜈 −1
6.3.
The left-hand side of (A.6.1) is divisible by exactly the first power of 2, so ex-
actly one factor on the right-hand side is even but is not a multiple of 4. There-
fore only one exponent 𝛼𝑖 is odd and the prime 𝑝 𝑖 belonging to it is necessarily
of the form 4𝑘 + 1, whereas the other exponents 𝛼𝑗 are even.
6.3. 473
(b) By part (a), it is enough to check that 𝑑(𝑛) is even for a perfect number 𝑛, so
𝑛 cannot be a square. This holds as 𝜎(𝑛) is odd if 𝑛 is a square, so 𝜎(𝑛) ≠ 2𝑛.
(c) For a proof by contradiction, assume 1 + 𝑝 + ⋯ + 𝑝𝛼 ∣ 𝑝𝛼 (𝛼 + 1). As (1 + 𝑝 +
⋯ + 𝑝𝛼 , 𝑝𝛼 ) = 1, we have 1 + 𝑝 + ⋯ + 𝑝𝛼 ∣ 𝛼 + 1. But this is impossible, since
1 + 𝑝 + ⋯ + 𝑝𝛼 > 𝛼 + 1.
(d) Let 𝑛 = 𝑝1 𝑝2 . . . 𝑝𝑟 where 𝑝1 < 𝑝2 < ⋯ < 𝑝𝑟 are primes. If every 𝑝 𝑖 is odd,
then
𝑝1 + 1 𝑝 +1
... 𝑟 ∣ 𝑝1 . . . 𝑝𝑟
2 2
cannot hold since (𝑝1 + 1)/2 is coprime to every factor of the right-hand side.
If 𝑝1 = 2, then necessarily 𝑝2 = 3. We see that 𝑛 = 6 is harmonic, but if 𝑛 has
further prime factors, we get a contradiction as in the previous argument.
7. (a) If 𝑎 < 𝑏 and 𝜎(𝑎) = 𝜎(𝑏) = 𝑎+𝑏, then 𝜎(𝑏) = 𝑎+𝑏 < 2𝑏 and 𝜎(𝑎) = 𝑎+𝑏 > 2𝑎.
(b) Assume that 𝑎 = 2𝑘 and 𝑏 are amicable. Then
𝜎(2𝑘 ) = 2𝑘+1 − 1 = 𝜎(𝑏) = 2𝑘 + 𝑏,
thus 𝑏 = 2𝑘 − 1, and because both 𝑏 and 𝜎(𝑏) are odd, 𝑏 = 𝑢2 . This yields
2𝑘 − 1 = 𝑢2 , which is already false modulo 4 for 𝑘 ≥ 2.
6.4.
1. We start with the canyon theorems. The proof for Ω(𝑛) is the same as for 𝑑(𝑛)
(Theorem 6.4.1), for 𝑑𝑘 (𝑛) we have to modify the moduli of the system of congru-
ences to 2𝐾+𝑘 and 3𝐾+𝑘 , and for 𝜔(𝑛) we choose two coprime moduli where each
is a product of 𝐾 + 2 distinct primes. For 𝜎(𝑛) we can take 𝑛 as a sufficiently large
prime since then 𝜎(𝑛) = 𝑛 + 1. Because 𝑛 + 1 are 𝑛 − 1 even,
𝑛−1 𝑛+1
𝜎(𝑛 − 1) > (𝑛 − 1) + and 𝜎(𝑛 + 1) > (𝑛 + 1) + .
2 2
This also gives a proof for the peak theorem for 𝜑(𝑛).
Turning to the other peak theorems and to the canyon theorem for 𝜑(𝑛), we choose
𝑛 as the product of the first 𝑟 primes as we did for 𝑑(𝑛) (Theorem 6.4.2).
The peak theorem for 𝑑𝑘 (𝑛) and 𝜎(𝑛), and the canyon theorem for 𝜑(𝑛) can be veri-
fied by a suitable modification of the proof of Theorem 6.4.2. Keeping the notation
there, for Ω(𝑛) and 𝜔(𝑛) we have to show 𝑟 − 𝑠 > 𝐾. This follows combining
𝑛 ≤ 𝑝1 . . . 𝑝𝐾+1 𝑝𝑟𝑟−𝐾−1 < 𝑝𝑟𝑟−𝐾
(for 𝑟 large enough), and
𝑛 + 1 = 𝑞1 . . . 𝑞𝑠 > 𝑝𝑟𝑠 .
(b) Let 𝑛 be the product of the first 𝑟 primes. Then, using the results of Section 5.4,
we get
log 𝑛
log 𝑛 ∼ 𝑝𝑟 ∼ 𝑟 log 𝑟, and so 𝑟 ∼ .
log log 𝑛
By 𝑑(𝑛) = 2𝑟 , we get the estimate stated in the exercise.
4. Let Ω(𝑛) = 𝑠, so 𝑛 = 𝑞1 . . . 𝑞𝑠 where 𝑞𝑖 = 𝑞𝑗 may occur. Because 𝑞𝑖 ≥ 2 we get
𝑛 ≥ 2𝑠 . Equality holds if and only if 𝑛 is a power of two.
5. Show that for a fixed 𝑟, the product of the first 𝑟 primes is the smallest 𝑛 for which
𝜔(𝑛) = 𝑟. This means that 𝜔(𝑛) attains its maximal order of magnitude as a func-
tion of 𝑛 exactly on the products of that type. The desired estimates now follow as
in Exercise 6.4.3b.
6. (a) Apply Theorem 6.4.6 for 𝑛0,99 /𝜑(𝑛), or use 𝑑(𝑛)𝜑(𝑛) ≥ 𝑛 and Theorem 6.4.5.
(b) 𝜑(𝑛) ≥ 𝜋(𝑛) − 𝜔(𝑛).
(c) Let 𝑛 be any integer with 𝜔(𝑛) = 𝑟, and let 𝑛𝑟 be the product of the first 𝑟
primes. Show
𝜑(𝑛) 𝜑(𝑛𝑟 )
≥ and log log 𝑛 ≥ log log 𝑛𝑟 .
𝑛 𝑛𝑟
Hence, it suffices to prove the statement for the numbers 𝑛𝑟 . Using results on
the distribution of primes, we obtain
𝑟 𝑟
𝜑(𝑛𝑟 ) 1 1
log ( ) = log ∏(1 − ) = ∑ log(1 − ) ≥
𝑛𝑟 𝑖=1
𝑝 𝑖 𝑖=1
𝑝 𝑖
𝑟 𝑟
1 1 1
≥ −∑ −∑ 2 >− ∑ − 2 > − log log 𝑝𝑟 − 𝑐 − 2,
𝑝
𝑖=1 𝑖 𝑖=1 𝑝𝑖 𝑝≤𝑝
𝑝
𝑟
so
𝜑(𝑛𝑟 ) 1
> ′ .
𝑛𝑟 𝑐 log 𝑝𝑟
Finally, apply log log 𝑛𝑟 ∼ log 𝑝𝑟 (obtained by taking the logarithm of log 𝑛𝑟 ∼
𝑝𝑟 which is legal as both sides tend to infinity).
(d) Apply Theorem 6.4.6 for 𝜎(𝑛)/𝑛1.01 , or use 𝜎(𝑛) ≤ 𝑛𝑑(𝑛) and Theorem 6.4.5.
(e) 𝜎(𝑛)/𝑛 is the sum of reciprocals of divisors of 𝑛, thus
𝑛
𝜎(𝑛) 1
≤ ∑ ≤ 1 + log 𝑛.
𝑛 𝑗=1
𝑗
1
(b) lim ∏ (1 + ) = ∞.
𝑛→∞
𝑝≤𝑛
𝑝
6.5.
̃ = { 𝑐,
5. (a) 𝑓(𝑛)
if 𝑛 = 1
0, if 𝑛 > 1.
1, if 𝑛 = 2
(b) 𝑔(𝑛)
̃ ={
0, if 𝑛 ≠ 2.
1, if 𝑛 is a prime power
̃
(c) Ω(𝑛) ={
0, otherwise.
1, if 𝑛 is a prime
(d) 𝜔(𝑛)
̃ ={
0, otherwise.
𝑟 𝛼
6. Let 𝑛 = ∏𝑖=1 𝑝𝑖 𝑖 be the standard form of 𝑛. Then
𝑟 𝑟 𝛼𝑖
𝛼 ̃ 𝛽𝑖 ) = ∑ 𝑓(𝑝
̃ 𝛽 ).
𝑓(𝑛) = ∑ 𝑓(𝑝𝑖 𝑖 ) = ∑ ∑ 𝑓(𝑝𝑖
𝑖=1 𝑖=1 𝛽𝑖 =0 𝑝𝛽 ∣𝑛
9. (a) Let 𝑇(𝑛) be the sum of all 𝑛th roots of unity, and 𝑆(𝑛) the sum of the primitive
𝑛th roots of unity. Then 𝑆 + (𝑛) = 𝑇(𝑛) = 𝑒(𝑛) implies 𝑆(𝑛) = 𝜇(𝑛). (We
sketched another proof in Exercise 6.2.18.)
(b) Let 𝑇𝑘 (𝑛) be the sum of 𝑘th powers of all 𝑛th roots of unity, and 𝑆 𝑘 (𝑛) the
similar sum for primitive 𝑛th roots of unity. Then 𝑆 𝑘 (𝑛) = 𝑇𝑘̃ (𝑛) and
𝑛, if 𝑛 ∣ 𝑘
𝑇𝑘 (𝑛) = {
0, if 𝑛 ∤ 𝑘.
Exhibit 𝑆 𝑘 (𝑛) by the Möbius Inversion Formula, and also using Exercise 6.5.8.
Another option: Since 𝑆 𝑘 (𝑛) and the function given in the exercise are multi-
plicative, it is sufficient to verify their equality at prime power places.
(c) We convert the problem into the modulo 𝑝 field. Let 𝑉(𝑘) be the sum of the
solutions of the congruence 𝑥𝑘 ≡ 1 (mod 𝑝), and 𝑈(𝑘) the sum of the elements
of order 𝑘. Prove 𝑈 + (𝑛) = 𝑉(𝑛) and 𝑉(𝑑) = 𝑒(𝑑) for 𝑑 ∣ 𝑝 − 1. Deduce
𝑈(𝑑) = 𝜇(𝑑) for 𝑑 ∣ 𝑝 − 1, thus 𝑈(𝑝 − 1) = 𝜇(𝑝 − 1).
10. (a) 𝜑(1)𝜑(2) . . . 𝜑(𝑛). (b) 𝑛!. (c) 1. (d) 0.
11. The proof of Theorem 6.5.4 applies for this general case.
6.6.
1. 𝑑𝑘 (𝑛).
2. It is well known that addition satisfies all requirements. For convolution playing
the role of multiplication, the associative and commutative laws and the existence
of an identity element follow from Theorem 6.6.2. The distributive law
(𝑓 + 𝑔) ∗ ℎ = (𝑓 ∗ ℎ) + (𝑔 ∗ ℎ)
can be verified easily (it is enough to check one of the two distributive laws since
multiplication is commutative).
No zero divisors: Show that if 𝑘 and 𝑚 are the smallest positive integers satisfying
𝑓(𝑘) ≠ 0 and 𝑔(𝑚) ≠ 0, then (𝑓 ∗ 𝑔)(𝑘𝑚) ≠ 0.
3. Answer: 𝑘. Hint: List the equalities (𝑔 ∗ 𝑔 ∗ ⋯ ∗ 𝑔)(𝑛) = 𝑓(𝑛) for every 𝑛. If 𝑛 = 1,
then we get
𝑔(1) = 𝑘√𝑓(1).
Considering 𝑛 = 2, 3, . . . one after the other, we get unique values for 𝑔(2), 𝑔(3) ,. . .
4. (a) Apply an argument similar to that in the hint for Exercise 6.5.2.
6.6. 479
5. Since the functions on both sides of the equality are multiplicative, it is enough to
prove equality for prime powers. But it is more elegant to rely on the properties of
convolution: Put 𝑔(𝑛) = 𝑛, then 𝜎 ∗ 𝜑 = (𝑔 ∗ 1) ∗ (𝜇 ∗ 𝑔) = 𝑔 ∗ 𝑔, thus
𝑛 𝑛
∑ 𝜎(𝑑)𝜑( ) = (𝜎 ∗ 𝜑)(𝑛) = (𝑔 ∗ 𝑔)(𝑛) = ∑ 𝑘 ⋅ = 𝑛𝑑(𝑛).
𝑑∣𝑛
𝑑 𝑘∣𝑛
𝑘
6.
∞ ∞ ∞
𝑓(𝑛) | 𝑓(𝑛) | 1 1
∑ || = ∑| ⋅ < 𝑐 ∑ 𝑠−𝑠 < ∞.
𝑛=1
𝑛𝑠 | 𝑛=1| 𝑛𝑠0 | 𝑛𝑠−𝑠0 𝑛=1
𝑛 0
is absolutely convergent,
lim 𝐹𝑁 (𝑠) = 𝐹(𝑠).
𝑁→∞
11. Take the product form of the 𝜁 function and note that the Dirichlet series 𝑀(𝑠) of
the function 𝜇 is the reciprocal of 𝜁. Another possibility: Apply Exercise 6.6.10a
for the function 𝑓 = 𝜇.
12. (a) Answer: 𝜋4 /36. Hint: Apply Exercise 6.6.8a.
(b) Answer: 5𝜋4 /72. Hint: Transform the Dirichlet series 𝑇(𝑠) belonging to the
function 𝑑 2 (𝑛) into an infinite product using Exercise 6.6.10a, then compute
the infinite series occuring in the factors of the product to establish
𝜁4 (𝑠)
𝑇(𝑠) = .
𝜁(2𝑠)
13. Answer: 15/𝜋2 . Hint: Apply Exercise 6.6.10a for 𝑓 = |𝜇|, and show that the infinite
product equals 𝜁(𝑠)/𝜁(2𝑠).
∞ ∞ ∞ ∞ ∞
𝑓(𝑛)𝑥𝑛
14. (a) ∑ 𝑛
= ∑ 𝑓(𝑛)( ∑ 𝑥𝑗𝑛 ) = ∑ 𝑥𝑘 (∑ 𝑓(𝑑)) = ∑ 𝑓+ (𝑘)𝑥𝑘 .
𝑛=1
1 − 𝑥 𝑛=1 𝑗=1 𝑘=1 𝑑∣𝑘 𝑘=1
(b) Apply part (a) for functions 𝜇 and 𝜑, taking 𝑥 = 1/2. Answer: (b1) 1/2; (b2) 2.
6.7.
1. Answer: 1. Hint: As in the second proof of Theorem 6.7.5, this sum is an applica-
tion of the Inclusion and Exclusion Principle for the number of integers among 1, 2,
. . . , 𝑛 that have no prime divisors at all. As 1 is the only integer with this property,
the sum equals 1. (The lesson of this story is that even a complicated argument
can be useful sometimes: we computed the obvious number of prime-free integers
with a complicated formula, and this made it possible to find a simple form for the
intricate sum.) Another option: After checking a few small values of 𝑛, we guess
the answer, and then prove it by induction.
2. Answer: 6/𝜋2 . Hint: Let 𝐾(𝑛) be the number of squarefree integers among 1, 2,
. . . , 𝑛. We have to determine
𝐾(𝑛)
lim .
𝑛→∞ 𝑛
As in the second proof of Theorem 6.7.5, use the Inclusion and Exclusion Principle
to establish
𝑛
𝐾(𝑛) = ∑ 𝜇(𝑗)⌊ 2 ⌋.
𝑗
𝑗≤√𝑛
Omitting the floors causes an error term not greater than √𝑛 that can be neglected
compared to the main term
𝜇(𝑗)
𝑛 ∑ .
𝑗2
𝑗≤√𝑛
apart from an error term. We can do this using Theorem 6.4.3 about the mean
value of 𝑑(𝑛). Using the notation there, 𝑑(𝑗) = 𝐷(𝑗)−𝐷(𝑗 −1). We reorder the
sum in (A.6.5) accordingly and apply Theorem 6.4.3 for 𝐷(𝑗). Thus we obtain
𝑛 𝑛 2
log 𝑗 log 𝑡 log 𝑛
∑ ∼∫ 𝑑𝑡 ∼
𝑘=2
𝑗 2
𝑡 2
apart from error terms. We must also show that the error terms are negligible
compared to the main term.
(b) We follow the proof of Theorem 6.7.3. Let 𝑓𝜈 (𝑛) = 𝑛𝜈 and apply Theorem 6.7.2
to the convolution 𝜎𝜈 = 1 ∗ 𝑓𝜈 , then we obtain
𝑛
𝑛 ⌊𝑗⌋
Σ𝜈 (𝑛) = ∑ ∑ 𝑘𝜈 .
𝑗=1 𝑘=1
We can estimate the inner sum for 𝑘 on the right-hand side with the integral
criterion as usual (see the first proof of Theorem 5.6.1 or Exercise 5.6.2).
4. Since the mean value of 𝜎 is relatively small, there are many integers 𝑖 among 1, 2,
. . . , 𝑛 for which (say) 𝜎(𝑖) ≤ 2𝑛. There are few such values 𝜎(𝑖) by Exercise 6.4.9,
so there must be one that is assumed many times by the function.
5. (a) The lower bound is obvious as Ω(𝑖) ≥ 𝜔(𝑖). To establish the upper bound,
represent Ω(𝑖) and 𝜔(𝑖) with the help of their inversion functions (see Ex-
ercise 6.5.5c-d). After the usual rearrangement and omitting the floors, we
obtain
𝑛
′ 1
∑ (Ω(𝑖) − 𝜔(𝑖)) < 𝑛 ∑ ,
𝑖=1 𝑟≤𝑛
𝑟
′
where ∑ indicates that the sum is taken only for the prime power values 𝑟
with exponent greater than one. This sum is less than 1, see the solution of
Exercise 5.6.1b.
(b) This follows from part (a) and the theorems in question.
6. Use Exercise 6.2.20a and apply the Hardy–Ramanujan Theorem for 𝜔 and (relying
on Exercise 6.7.5b) for Ω.
7. The (surprising) answer is 0. Hint: We use that the Hardy–Ramanujan Theorem
is valid also for Ω (see Exercise 6.7.5b). Assume 𝑖 = 𝑎𝑏 where 𝑎 and 𝑏 are less than
√𝑛. Then in most cases both Ω(𝑎) and Ω(𝑏) are about
log log √𝑛 ∼ log log 𝑛,
thus Ω(𝑖) ∼ 2 log log 𝑛. But there are only few such integers 𝑖 (using Exercise 6.7.5b
again).
482 Answers and Hints
in Theorem 6.7.7. The proof is the same as for Theorems 6.7.7 and 6.7.7A.
6.8.
additivity of 𝑓, and the condition of the exercise, we can find a (large) 𝑗 such
that 𝑚 = 𝑑𝑗 and
|𝑓(𝑚)| = |𝑓(𝑐𝑗 𝑑𝑗 ) − 𝑓(𝑐𝑗 )| < 𝜀.
Hence, only 𝑓(𝑚) = 0 is possible.
7.1.
10. This is true if and only if the integers 𝑎𝑖 are coprime and at least one of them is
positive. Hint: Necessity is obvious. To prove sufficiency, assume (e.g.) 𝑎1 > 0.
If we can find a solution in positive integers for some 𝑐 0 , then increasing 𝑥1 and
keeping the other variables unaltered, we get a positive solution for every 𝑐 > 𝑐 0
in the residue class of 𝑐 0 modulo 𝑎1 . Thus it is enough to show that every residue
class modulo 𝑎1 contains an element 𝑐 for which there is a positive solution. We
rely on the equivalence (in the precisely defined meaning discussed in Section 2.5)
of the Diophantine equation
(A.7.1) 𝑎1 𝑥1 + ⋯ + 𝑎𝑘 𝑥𝑘 = 𝑐
and the congruence
(A.7.2) 𝑎2 𝑥2 + ⋯ + 𝑎𝑘 𝑥𝑘 ≡ 𝑐 (mod 𝑎1 ) .
We solve (A.7.2) for 𝑐 = 1, 2, . . . , 𝑎1 . (It is solvable, since (𝑎1 , . . . , 𝑎𝑘 ) = 1 guar-
antees its solvability for any 𝑐.) In congruences we can replace any integer by one
congruent to it, so we can assume that the values 𝑥2 , . . . , 𝑥𝑘 obtained in the 𝑎1
congruences are all positive.
11. (a) Let 𝑎 > 𝑏 and apply the key idea of the previous exercise: If 𝑐 is assem-
blable, then also 𝑐 + 𝑡𝑏 is assemblable for any positive 𝑡. Thus we have to
find the smallest assemblable element in every residue class modulo 𝑏. Since
(𝑎, 𝑏) = 1, the numbers 0𝑎, 1𝑎, 2𝑎, . . . , (𝑏−1)𝑎 form a complete residue system
modulo 𝑏, so the smallest assemblable elements in the residue classes are 𝑏, 𝑎,
2𝑎, . . . , (𝑏 − 1)𝑎. The residue class of (𝑏 − 1)𝑎 enters last, so the largest number
that is not assemblable is (𝑏 − 1)𝑎 − 𝑏 = 𝑎𝑏 − 𝑎 − 𝑏.
(b) Answer: (𝑎 − 1)(𝑏 − 1)/2. (This is an integer, since (𝑎, 𝑏) = 1 implies that at
least one of 𝑎 and 𝑏 is odd.) Hint: Show that if the sum of two positive integers
is 𝑎𝑏 − 𝑎 − 𝑏, then exactly one of them is assemblable.
12. It is more convenient to view the problem from an inverse perspective as cutting
to pieces instead of assembling. Thus we claim that a large cube can be cut into
exactly 𝑛 cubes if (a) 𝑛 is large enough; (b) 𝑛 ≥ 48, and we ask for the complete
answer in (c) for the analog for squares.
(a) We can easily cut a cube into 8 or 27 small (congruent) cubes, so with the
repeated application of these steps, we can cut a cube into 1 + 7𝑥 + 26𝑦 cubes,
where 𝑥 and 𝑦 are arbitrary non-negative integers. Since 7 and 26 are coprime,
every sufficiently large 𝑛 can be represented in this form.
(b) Cutting a cube into 8 cubes, we can always increase the number of small cubes
by 7. Hence it suffices to verify the statement for 48 ≤ 𝑛 ≤ 54.
48: 48 = 27 + 3 ⋅ 7. We cut the cube into 27 cubes, and then we cut each of
three small cubes into eight parts.
49: For brevity, let us write Cu𝑘 for a cube if the length of its edge is 𝑘. We cut
the lower half of Cu6 into four Cu3, the top row into thirty-six Cu1, and the
remaining two rows into nine Cu2.
50: 50 = 7 ⋅ 7 + 1.
51: In Cu6, we form five Cu3 from the lower half plus one quarter in the upper
half, select five Cu2 from the remaining part, and there are forty-one Cu1 left.
7.2. 485
52: We cut a Cu3 from Cu4, and partition two of the remaining thirty-seven
Cu1 into eight parts.
53: Using 53 = 1 + 2 ⋅ 19 + 2 ⋅ 7, it is enough to show a procedure that increases
the number of cubes by nineteen; we cut Cu3 into a Cu2 and nineteen Cu1.
54: We cut Cu8 into six Cu4, two Cu3, four Cu2, and forty-two Cu1.
(c) 𝑛 ≠ 2, 3, 5.
7.2.
2. Answer: 8, 15, 17. Hint: The area is 𝑥𝑦/2, so 𝑥𝑦 = 120. Checking all possible
factorizations of 120, 𝑥2 + 𝑦2 is a square only for 8 ⋅ 15. Another option: By Theo-
rem 7.2.1, we have to solve the equation 60 = 𝑑 2 𝑚𝑛(𝑚 − 𝑛)(𝑚 + 𝑛) with respect to
conditions (7.2.4). Thus we get 𝑑 = 1, 𝑚 = 4, 𝑛 = 1.
𝑥𝑦
= 𝑥 + 𝑦 + 𝑧, 𝑥2 + 𝑦2 = 𝑧 2 .
2
Squaring the form (𝑥𝑦/2)−𝑧 = 𝑥+𝑦 of the first equation, combining the result with
the second equation, and dividing by 𝑥𝑦, we obtain 𝑧 = (𝑥𝑦/4) − 2. Substituting
into the first equation, reordering, and factoring gives (𝑥 − 4)(𝑦 − 4) = 8. Since 𝑥
and 𝑦 are positive, we have only the decompositions 1 ⋅ 8 and 2 ⋅ 4 (apart from the
order of factors).
486 Answers and Hints
4. Answer: Every 𝑘 ≥ 3. Hint: Use Theorem 7.2.1. Verify that 1 and 2 can be repre-
sented in none of the forms given there for 𝑥, 𝑦, and 𝑧. For integers greater than
2, it is sufficient to find a representation for 4 and the odd numbers, due to the
multiplier 𝑑 in the formula: 4 = 2 ⋅ 2 ⋅ 1, and 2𝑟 + 1 = (𝑟 + 1)2 − 𝑟2 .
Remark: The solutions 0 < 𝑢 < 𝑤 < 𝑣 of the Diophantine equation 𝑢2 + 𝑣2 = 2𝑤2
and the solutions 0 < 𝑥 < 𝑦 < 𝑧 of the Pythagorean equation 𝑥2 + 𝑦2 = 𝑧2 can be
deduced from each other by the substitutions 𝑢 = 𝑦 − 𝑥, 𝑣 = 𝑥 + 𝑦, 𝑤 = 𝑧, and
𝑥 = (𝑣 − 𝑢)/2, 𝑦 = (𝑢 + 𝑣)/2, 𝑧 = 𝑤. (𝑥 and 𝑦 are integers as 𝑢 and 𝑣 must be of the
same parity). Therefore, we can characterize all solutions of 𝑢2 + 𝑣2 = 2𝑤2 with
three integer parameters.
7.3.
1. As the signs of 𝑥 and 𝑦 are irrelevant now, we can group the solutions in integers by
four to obtain the essentially distinct solutions, except for the case 𝑦 = 0 that occurs
if and only if 𝑛 is a square and then these two solutions form a group. Thus there
𝑓(𝑛)
are ⌈ ⌉ essentially distinct solutions, where 𝑓(𝑛) is the number of solutions
4
given in Theorem 7.3.1.
2. There are two solutions: we have to make 5 and 7, or 4 and 11 cuts parallel to the
walls of the tin (we get 6 ⋅ 8 = 48 and 5 ⋅ 12 = 60 pieces). Hint : If we make 𝑥 − 1
and 𝑦 −1 cuts parallel to the tin’s walls, then there are 𝑥𝑦/2 crispy and (𝑥 −2)(𝑦 −2)
soft pieces. Equating the two numbers, we obtain (𝑥 − 4)(𝑦 − 4) = 8 after ordering.
Another option: In the first row running around the inside of the tin’s walls, there
are by eight more pieces than in the second such row. This means that apart from
these two rows, there are altogether eight pieces inside that constitute a 2 × 4 or
1 × 8 rectangle.
3. The equation 2/𝑝 = 1/𝑥 + 1/𝑦 is equivalent to (2𝑥 − 𝑝)(2𝑦 − 𝑝) = 𝑝2 . Géza Ottlik’s
approach was different: Multiplying the original equation by 𝑥𝑦, we get that one
of the variables is divisible by 𝑝, say 𝑥 = 𝑘𝑝. Substituting it into the equation and
solving for 𝑦, we find 𝑝 = 2𝑘 − 1. This determines also 𝑥 and 𝑦 uniquely.
5. Using
1 1 1
= +
𝑢 2𝑢 2𝑢
7.3. 487
it is enough to represent 4/𝑛 as a sum of two or three natural numbers for the given
values of 𝑛.
4 1 1
𝑛 = 2𝑠∶ = +
𝑛 𝑠 𝑠
4 1 1
𝑛 = 4𝑠 − 1∶ = +
𝑛 𝑠 𝑠(4𝑠 − 1)
4 1 1 1
𝑛 = 8𝑠 − 3∶ = + +
𝑛 2𝑠 𝑠(8𝑠 − 3) 2𝑠(8𝑠 − 3)
4 1 1
𝑛 = 24𝑠 − 15∶ = +
𝑛 8𝑠 − 5 24𝑠 − 15
4 1 1 1
𝑛 = 24𝑠 − 7∶ = + + .
𝑛 6𝑠 𝑠(24𝑠 − 7) 6𝑠(24𝑠 − 7)
6. Start with the wrong representation 𝑎/𝑏 = 1/𝑏 + 1/𝑏 + ⋯ + 1/𝑏, and apply the
identity
1 1 1
= +
𝑛 𝑛 + 1 𝑛(𝑛 + 1)
sufficiently many times.
7. Answer: No. Hint: Factoring the left-hand side of the Diophantine equation 𝑥4 −
4 = 𝑦5 , the two factors are coprime for 𝑥 odd, hence each is a fifth power. However,
their difference is 4, which is impossible. If 𝑥 is even, then the right-hand side of
the equation is a multiple of 8, which is false for the left-hand side.
8. The only solution is 𝑥 = 𝑦 = 𝑠 = 𝑡 = 0. Hint: Assuming a non-trivial rational solu-
tion, we can convert it into an integer solution, one with (𝑥, 𝑦, 𝑠, 𝑡) = 1. Examining
parity, we get a contradiction. Another approach: A non-trivial integer solution
leads to an equilateral triangle where all three vertices are lattice points. Show by
area considerations that no such triangle exists.
9. The sum is divisible by 3, but not by 9.
10. ±4, ±6.
11. An ugly solution: Let the six numbers be 𝑛, 𝑛 + 1, . . . , 𝑛 + 5, and partition them
into two groups in all possible ways. We have to show that none of the resulting
equations have integer solutions. Since we can easily find the integer (or even ra-
tional) roots of a polynomial with integer coefficients, the proof requires just some
patient (and tedious) computation. We do not have to do this for all groupings, of
course, for example, we immediately see by comparing the size of the factors that
𝑛(𝑛 + 1)(𝑛 + 4) is smaller than (𝑛 + 2)(𝑛 + 3)(𝑛 + 5) for every 𝑛 ≥ 0, and also further
similar considerations can speed up the work.
The following argument is much more elegant; Three of the six numbers are even,
one more is a multiple of 3, and at most one more can be divisible by 5. Hence,
one of the numbers must have a prime divisor greater than 5 for 𝑛 > 1. This prime
cannot divide any of the other five numbers, hence it divides only one of the two
products.
488 Answers and Hints
A third option: If one of the numbers is divisible by 7, then we are done, as seen
previously. Otherwise the six numbers form a reduced residue system mod 7. If
there exist two equal products, then the product of all the six numbers is a square.
However, the product of the six numbers is congruent to −1 mod 7, which is im-
possible for a square.
The third solution works also for 106 instead of 6, using Wilson’s Theorem and the
−1
Legendre symbol ( 𝑝 ) (as 107 is a prime of the form 4𝑘 − 1). Also the first solu-
tion works for 106 (or any other number) in principle (or even in practice with a
well-designed computer program). We can generalize the second solution, too: A
classical theorem by Sylvester and Schur states that among 𝑘 consecutive integers
greater than 𝑘 there always exists one having a prime divisor greater than 𝑘, hence
this prime can divide only one of the two products. In the remaining cases, Cheby-
shev’s Theorem guarantees such a prime that divides only one of the products.
Finally we note that the validity of the statement for any 𝑘 consecutive integers in-
stead of six follows from the hard theorem that the product of consecutive integers
is never a power (see the Remark after Exercise 1.6.3).
12. There is a solution only for even 𝑚: 𝑛 = 𝑚 + 1 and 𝑥 = 𝑦 = 2𝑚/2 . Hint: Rewrite
the equation with the help of (𝑥, 𝑦) and show 𝑥 = 𝑦. Then the equation is of the
form
(A.7.3) 2𝑚 = 𝑥2𝑛−2𝑚 .
Clearly, 𝑥 = 2𝑠 . Substituting it into (A.7.3), prove 𝑚 = 2𝑠 and 𝑛 = 𝑚 + 1.
13. (a) From the form (𝑥 + 5)(𝑦 + 3) = 22, we can obtain 2𝑑(22) = 8 solutions.
(b) No solution; consider the equation modulo 11.
(c)–(e) We have only the trivial solution 𝑥 = 𝑦 = 𝑧 = 0. The good moduli are 3 or
8 for (c); 5, 7, 8, or 23 for (d); 11 for (e).
(f) 𝑥 = ±1, 𝑧 = −2. Hint: The two factors on the left-hand side are coprime for
any integer 𝑥, thus both factors are cubes.
(g) 𝑥 = ±1, 𝑦 = 0. Hint: After simple transformations, we obtain that the product
of two consecutive integers is almost a fourth power. Continuing by congru-
ence considerations, we need one more factorization.
(h) Besides 𝑦 = 𝑥, the only solutions are 𝑥 = 2, 𝑦 = 4, and 𝑥 = 4, 𝑦 = 2. Hint:
Rewrite the equation with the help of (𝑥, 𝑦), or take the logarithm and examine
the behavior of the (real) function 𝑓(𝑧) = 𝑧/ log 𝑧.
(i) 𝑥 = 5, 𝑦 = 1. Hint: Consider the equation modulo 31, and apply the facts
about power residues.
14. (a) There is no such number system. Hint: 1 + 𝑥 + 𝑥2 is always between two
consecutive squares for 𝑥 > 1.
(b) Base 3 is the only solution. Hint: 4(1 + 𝑥 + 𝑥2 + 𝑥3 + 𝑥4 ) is between two
consecutive squares for 𝑥 > 3.
(c) There is no such number system. Hint: The expression can be decomposed
into two coprime factors where one of them cannot be a square.
7.4. 489
7.4.
1. 1 + 𝑖 ∣ 𝑎 + 𝑏𝑖 ⟺ 𝑎 ≡ 𝑏 (mod 2).
2. (a) 𝛼 = 𝛾𝜚 ⟺ 𝛼 = 𝛾 𝜚,
(b) It follows from part (a).
(c) Apply the definition either of a Gaussian irreducible, or of a Gaussian prime,
or use Theorem 7.4.15.
3. By Exercise 7.4.2a, 𝛼 ∣ 𝛼 ⟺ 𝛼 ∣ 𝛼, so 𝛼 = 𝜀𝛼 with a unit 𝜀. Check that the
absolute values of the two sides are always equal, and comparing the angles we get
arg(𝛼) = 𝑘 ⋅ 45∘ . This means that 𝛼 is on one of the coordinate axes or the lines
𝑦 = ±𝑥. (We can get the same result by substituting 𝜀 = ±1, ±𝑖 into 𝛼 = 𝜀𝛼 and
solving the four equations.)
4. (a) Observe that a rational number 𝑎/𝑏 is a Gaussian integer if and only if it is an
(ordinary) integer.
(b) If (𝑎, 𝑏) = 𝑑 in the integers, then we have to show that 𝑎1 = 𝑎/𝑑 and 𝑏1 = 𝑏/𝑑
are also coprime in the Gaussian integers. If a Gaussian integer 𝛾 is a common
divisor of 𝑎1 and 𝑏1 , then 𝑁(𝛾) is a common divisor in the integers of 𝑁(𝑎1 ) =
𝑎21 and 𝑁(𝑏1 ) = 𝑏21 , which implies 𝑁(𝛾) = 1, so 𝛾 is a unit. (Another option is
to establish 1 = 𝑎1 𝑢 + 𝑏1 𝑣 with suitable integers 𝑢 and 𝑣, so 𝛾 ∣ 𝑎1 and 𝛾 ∣ 𝑏1
imply 𝛾 ∣ 1.)
5. True: (a), (c).
6. (Of course, any associate of the results below is correct.)
(a) 2 − 𝑖. Hint: Apply the Euclidean algorithm.
(b) 2. Hint: Observe that 1 − 𝑖 and 2 + 𝑖 are Gaussian primes, 2 = 𝜀(1 − 𝑖)2 , and
2 + 𝑖 ∤ 39.
(c) 1 + 𝑖. Hint: The gcd 𝛿 also divides the sum and difference of the two numbers,
and since (4 + 𝑖, 2 + 𝑖) = 1, we obtain 𝛿 ∣ 2. Hence 𝛿 = 1, or 2, or 1 + 𝑖. Show
that the first two cases are not possible.
7. (a) True: (a1).
(b) (𝛼, 𝛼) = (𝑎, 𝑏) or (𝛼, 𝛼) = (1 + 𝑖)(𝑎, 𝑏).
8. Verify that 𝛽 is a friend of 𝛼 if and only if 𝛽 = 𝜀𝛼 and (𝛼, 𝛼) = 1. Thus 𝛼 has no or
four friends, and we can easily deduce the condition in (a).
9. 32 (2 + 𝑖)3 (2 − 𝑖)(1 + 𝑖)3 (−1 − 4𝑖). Hint: Decompose (270, 2610) = 90 into a product
of Gaussian primes by Theorem 7.4.15. To find the factorization of the remaining
part, 3 + 29𝑖 = 𝜋1 . . . 𝜋𝑟 , consider the norms: 850 = 𝑁(𝜋1 ) . . . 𝑁(𝜋𝑟 ). From the
standard form of 850 (in the integers), we obtain 𝑟 = 4, and the norms of the
Gaussian primes 𝜋𝑖 are 2, 5, 5, and 17. So 𝜋1 = 1 + 𝑖, 𝜋2 = 𝜋3 = 2 + 𝑖 or 2 − 𝑖
depending on whether or not (3 + 29𝑖)/(2 + 𝑖) is a Gaussian integer (𝜋3 = 𝜋2 is
impossible, why?), etc.
490 Answers and Hints
7.5.
𝑟(𝑛)
1. ⌈ ⌉, where 𝑟(𝑛) is the number of solutions given in Theorem 7.5.1 (𝑟(𝑛) = 0 if
8
there are no solutions). Hint: Interchanging 𝑥 and 𝑦, or modifying signs do not
yield essentially different solutions. These give eight possibilities except when 𝑥 or
𝑦 is 0, or |𝑥| = |𝑦| (these occur in the cases 𝑛 = 𝑘2 and 𝑛 = 2𝑘2 ).
2. 16.
3. Answer: 7. Hint: The integers of the form 8𝑘 + 6 cannot be represented as the
sum or difference of two squares, thus 𝑟 ≤ 7. We have to show that all the seven
numbers between two consecutive integers of the form 8𝑘 + 6 can be represented
as desired in infinitely many cases.
4. By Theorem 7.5.1, the exponents of primes 7 and 11 in the standard form of 𝑎2 + 𝑏2
are even, thus they must be at least 2. Another option: 7 and 11 are Gaussian
primes, hence
7 ∣ 𝑎2 + 𝑏2 = (𝑎 + 𝑏𝑖)(𝑎 − 𝑏𝑖) ⟹ 7 ∣ 𝑎 + 𝑏𝑖 or 7 ∣ 𝑎 − 𝑏𝑖
𝑎 + 𝑏𝑖 𝑎 − 𝑏𝑖
⟹ or is a Gaussian integer
7 7
⟹ 7 ∣ 𝑎 and 7 ∣ 𝑏,
and the same holds also for 11.
5. It is solvable if and only if the exponents of the primes of the form 4𝑘 − 1 are even
and the exponent of 2 is not one in the standard form of 𝑛. The number of solutions
is the same as in Theorem 7.5.1 if 𝑛 is a multiple of 4, and is half of that if 𝑛 is odd.
6. An integer has such a representation if and only if it is not a multiple of 4 and has
no prime divisors of the form 4𝑘 − 1. Then the number of representations is 2𝑟+2 ,
where 𝑟 is the number of its odd prime divisors (all are of the form 4𝑘 + 1).
7. (a) Depending on whether 𝑘 is the length of the hypothenuse or of a leg, we need
the number of essentially different solutions in positive integers 𝑥 and 𝑦 of
7.5. 491
where 𝛽𝜇 are the exponents of primes of the form 4𝑘 + 1 in the standard form of 𝑛.
If we perform the previous pairing of divisors by 𝑞1 , then only those (odd positive)
divisors are left where the exponent of 𝑞1 is 2𝑤 1 . Now we repeat the procedure
by 𝑞2 for these divisors, etc. Thus finally only those (positive) odd divisors remain
unmatched where the exponent of every 𝑞𝜈 is 2𝑤 𝜈 . The number of such divisors
is clearly the product on the right-hand side of (A.7.4), on the one hand, and as
all these divisors are of the form 4𝑘 + 1, their number is just 𝑑 ′ (𝑛) − 𝑑 ″ (𝑛), on the
other hand.
We can prove the statement of the exercise also in a single step by writing the dif-
ference 𝐷 = 𝑑 ′ (𝑛) − 𝑑 ″ (𝑛) as
𝑟 𝑠
′ ′
𝐷= ∑ (−1)𝛾1 +⋯+𝛾𝑠 = ∏(𝛽𝜇 + 1) ∏(1 − 1 + ⋯ + (−1)𝛾𝜈 ).
′ ≤𝛽
0≤𝛽𝜇 𝜇=1 𝜈=1
𝜇
0≤𝛾′𝜈 ≤𝛾𝜈
492 Answers and Hints
𝑛
9. Answer: 𝜋. Hint: Observe that 1 + ∑𝑖=1 𝑟(𝑖) is just the number of lattice points
inside or on the border of a circle around the origin of radius √𝑛. Show that the
number of these lattice points is asymptotically equal to the area of the circle as
𝑛 → ∞.
10. All solutions are 𝑥 = ±2, 𝑦 = 2 and 𝑥 = ±11, 𝑦 = 5. Hint: Factor the left-hand side
of the equation in the Gaussian integers and find the possible values of the greatest
common divisor of the two factors. It turns out that each factor must be the cube
of a Gaussian integer. Finally, cube and compare the imaginary parts.
11. 𝛼 = 𝑎 + 𝑏𝑖 is not of this form if and only if 𝑏 is odd or 𝑎 ≡ 𝑏 ≡ 2 (mod 4). Hint:
Apply the argument in the proof of Theorem 7.3.1.
12. Each Gaussian prime in the standard form can be replaced by any of its associates
(which can be compensated by modifying the extra unit factor).
13. True: (a), (c).
14. Answer: 5/6. Hint: Let 𝐹(𝑁) be the number of integers among 1, 2, . . . , 𝑁 that
cannot be written as the sum of three squares. Prove
𝑁+1 𝑁+4 𝑁 + 42
𝐹(𝑁) = ⌊ ⌋+⌊ ⌋+⌊ ⌋ + ... ,
8 8⋅4 8 ⋅ 42
hence
∞
𝐹(𝑁) 1 1
lim = ∑ 𝑘.
𝑁→∞ 𝑁 8 𝑘=0 4
15. Answer: 10. Hint: Verify, using the Three Squares Theorem that at most ten odd
squares suffice, and relying on the Two Squares Theorem, show that infinitely
many integers of the form 8𝑘 + 2 cannot be represented as the sum of less than
ten squares.
16. If 𝑛 = 4𝑘 (8𝑚 + 7), then 𝑛 − (2𝑘 )2 is the sum of three squares.
17. Exactly the positive integers 𝑛 = 4𝑘 (16𝑚 + 14) have no such representation. Hint:
Show that 𝑛 can be written in the required form if and only if 2𝑛 is the sum of three
squares.
18. Yes, it is solvable. Hint: We have to show that the number can be written as the
sum of four squares with at least one of them divisible by 3.
19. It follows from Chevalley’s theorem (or from Exercise 3.6.2) that the congruence
𝑋 2 + 𝑌 2 + 𝑍 2 ≡ 0 (mod 𝑝) has a non-trivial solution 𝑋, 𝑌 , 𝑍. If 𝑍 ≢ 0 (mod 𝑝),
then multiplying the congruence by 𝑍 𝑝−3 (for 𝑝 > 2), we obtain
1 + 𝑐2 + 𝑑 2 ≡ 0 (mod 𝑝) , where 𝑐 = 𝑋𝑍 (𝑝−3)/2 and 𝑑 = 𝑌 𝑍 (𝑝−3)/2 .
20. We can use the solvability of 𝑥2 + 1 ≡ 0 (mod 𝑝) instead of Lemma 7.5.5, and use
the identity
(A.7.5) (𝑎21 + 𝑎22 )(𝑏21 + 𝑏22 ) = (𝑎1 𝑏1 + 𝑎2 𝑏2 )2 + (𝑎1 𝑏2 − 𝑎2 𝑏1 )2
instead of Lemma 7.5.4. We note that there is no need to prove that 𝑚 is odd
(though the argument is valid), and (A.7.5) is just an expanded form of the identity
𝑁(𝛼)𝑁(𝛽) = 𝑁(𝛽𝛼) for the norms of Gaussian integers.
7.6. 493
21. (a) Consider those vectors 𝐝 = 𝐶𝐬 − 𝐭, where the components of 𝐬 and 𝐭 satisfy
0 ≤ 𝑠𝑖 < 𝑢 𝑖 , 0 ≤ 𝑡𝑖 < 𝑣𝑖 , 𝑖 = 1, 2, . . . , 𝑘.
By the pigeonhole principle, there must be two of the 𝐝 that are congruent
modulo 𝑝. Then the difference of the vectors 𝐬 belonging to them can be taken
as 𝐱, and the difference of the relevant vectors 𝐭 plays the role of 𝐳.
(b) Apply part (a) for the case
𝑐 𝑑
𝑘 = 2, 𝑢1 = 𝑢2 = 𝑣 1 = 𝑣 2 = ⌈√𝑝⌉, 𝐶=( )
−𝑑 𝑐
where 1 + 𝑐2 + 𝑑 2 ≡ 0 (mod 𝑝). We obtain
0 < 𝑥12 + 𝑥22 + 𝑧21 + 𝑧22 < 4𝑝 and 𝑝 ∣ 𝑥12 + 𝑥22 + 𝑧21 + 𝑧22 .
(c) If 2𝑝 is nice, then we can proceed exactly as when we showed that 𝑚 is odd in
the proof of Theorem 7.5.3.
If 3𝑝 = 𝑎21 + 𝑎22 + 𝑎23 + 𝑎24 , then let 𝑏𝑖 be the residue of least absolute value
mod 3 of 𝑎𝑖 , and apply (7.5.10) in Lemma 7.5.4. Then 9𝑝 is the sum of four
squares where each is a multiple of 3, thus cancelling by 9 we get that also 𝑝
is nice. (In this step, we basically repeated the proof of Theorem 7.5.3 in the
special case 𝑚 = 3.)
7.6.
1. If 𝑛 is the sum of 𝑠 terms of 600th powers, then 𝑛 is the sum of the same number
of 200th powers as
𝑛 = 𝑥1600 + ⋯ + 𝑥𝑠600 = (𝑥13 )200 + ⋯ + (𝑥𝑠3 )200 .
2. As in the proof of Theorem 7.6.5, the keys are congruences with suitable moduli.
(a) (a1) Prove by induction on 𝑗 that 31 ⋅ 16𝑗 cannot be written as a sum of less
than 16 fourth powers.
(a2) The integers 64𝑡 + 32 are not the sums of 31 eighth powers.
(a3) 𝐺(24) ≥ 𝐺(8) follows as in Exercise 7.6.1.
(a4) The integers 625𝑡 + 125 require at least 125 hundredth powers.
(a5) Check the numbers 625𝑡 + 312.
(b) We can generalize parts (a1)–(a3) to the cases 𝑘 = 2𝑟 and 𝑘 = 3 ⋅ 2𝑟 with 𝑟 ≥ 2.
Prove that the remainder of 𝑎𝑘 modulo 2𝑟+2 can only be 0 or 1 as there is no
primitive root for this modulus.
Part (a4) can be generalized to 𝑘 = 𝜑(𝑝𝛼 ), where 𝑝 > 2 is a prime and 𝛼 ≥ 2.
Apply the Euler–Fermat Theorem (as in the proof of Theorem 7.6.5).
1
The generalization of part (a5) works for 𝑘 = 2 𝜑(𝑝𝛼 ), where 𝑝 > 2 is a prime
and 𝛼 ≥ 2. Verify
𝛼 )/2
𝑎𝜑(𝑝 ≡ 0 or ±1 (mod 𝑝𝛼 )
for any 𝑎.
494 Answers and Hints
We get the following lower bounds for 𝐺(𝑘) in the cases 𝑝 > 2 is a prime,
𝛼 ≥ 2, and 𝑟 ≥ 2:
𝐺(3 ⋅ 2𝑟 ) ≥ 𝐺(2𝑟 ) ≥ 2𝑟+2
𝐺(𝑝𝛼 − 𝑝𝛼−1 ) ≥ 𝑝𝛼
𝑝𝛼 − 𝑝𝛼−1 𝑝𝛼 − 1
𝐺( )≥ .
2 2
We note that these are the only known lower bounds for 𝐺(𝑘) besides those in
Theorem 7.6.4.
3. Let 𝑅 be a large number and form the sums
𝑥1𝑘 + ⋯ + 𝑥𝑘+1
𝑘
, 𝑥𝑖 are integers, 0 ≤ 𝑥𝑖 ≤ 𝑅, 𝑖 = 1, 2, . . . , 𝑘 + 1.
Demonstrate that there are many more sums than values they can have. Thus there
must be an 𝑛 that has many such representations.
4. (a) Performing the operations on the left-hand side, there remain only terms of
the type 𝑎4𝑖 and 𝑎2𝑖 𝑎𝑗2 (𝑖 < 𝑗) with coefficients 6 and 12. We obtain the same
result after squaring on the right-hand side.
(b) Let 𝑛 = 6𝑞 + 𝑟 where 0 ≤ 𝑟 ≤ 5. By Theorem 7.5.3, 𝑞 = 𝑥12 + 𝑥22 + 𝑥32 + 𝑥42 .
Write each 𝑥𝑖 as a sum of four squares. Applying the identity in part (a), we
can represent 6𝑞 as a sum of 48 fourth powers, and 𝑟 is the sum of at most five
terms 14 .
5. The integers 8𝑡 + 6 cannot be written as 𝑥2 ± 𝑦2 , thus two squares are not sufficient.
To verify the second part of the statement, transform the Diophantine equation
𝑥2 + 𝑦2 − 𝑧2 = 𝑛 into 𝑧2 − 𝑦2 = 𝑥2 − 𝑛, and select the value of 𝑥 arbitrarily with
the restriction that 𝑥2 − 𝑛 should not be of the form 4𝑡 + 2 (for any 𝑛, all even or all
odd integers can be taken as 𝑥, and occasionally both the odd and even numbers
are suitable). Apply Theorem 7.3.1 (and the fact that if an integer is the difference
of two squares, then so is its negative). We can proceed similarly for the other
equation.
7.7.
12. (a) Let 𝑘𝜇 denote the number of elements in a complete residue system modulo 𝜇,
and let 𝑅 be the rhombus lattice of the Eulerian integers. Multiplying 𝑅 by 𝜇,
we obtain the rhombus lattice 𝑅𝜇 consisting of the multiples of 𝜇. Thus the
vectors defining the sides of the fundamental rhombus in 𝑅𝜇 are 𝜇 and 𝜔𝜇.
The Eulerian integers in every such fundamental rhombus of 𝑅𝜇 form a com-
plete residue system modulo 𝜇. Therefore 𝑘𝜇 is roughly the ratio of the areas of
the fundamental rhombuses in 𝑅𝜇 and 𝑅, which ratio is |𝜇|2 = 𝑁(𝜇). We can
get rid of the word “roughly” by considering the number of points of the two
lattices in a large circle or square 𝐻. Let 𝐻 have area 𝐴, the number of points
of lattices 𝑅 and 𝑅𝜇 in 𝐻 be 𝑛 and 𝑛𝜇 , and the areas of the fundamental rhom-
buses be 𝑎 and 𝑎𝜇 . Since there are 𝑘𝜇 Eulerian integers in every fundamental
rhombus of 𝑅𝜇 ,
𝑛
(A.7.6) 𝑘𝜇 ∼
𝑛𝜇
if 𝐴 → ∞. On the other hand,
𝐴 𝐴 𝐴
𝑛∼ , 𝑛𝜇 ∼ = ,
𝑎 𝑎𝜇 𝑎𝑁(𝜇)
so
𝐴
𝑛 𝑎
𝑎𝜇
(A.7.7) ∼ 𝐴
= = 𝑁(𝜇).
𝑛𝜇 𝑎
𝑎𝜇
By (A.7.6) and (A.7.7), the constants 𝑘𝜇 and 𝑁(𝜇) are asymptotically equal, so
they must be equal.
(b) By part (a), the number of elements is all right. To show that the elements are
pairwise incongruent modulo 𝜇, use
𝜇 ∣ 𝑗 ⟹ 𝑝 = 𝑁(𝜇) ∣ 𝑗2 ⟹ 𝑝 ∣ 𝑗.
(c) Apply the argument in the proof of the Euler–Fermat Theorem 2.4.1.
13. No solution. Hint: Multiplying the equation by 𝑢𝑣𝑤, we obtain 𝑢2 𝑤 + 𝑣2 𝑢 = 𝑤2 𝑣.
Introducing 𝑢2 𝑤 = 𝑐 and 𝑣2 𝑢 = 𝑑, we get 𝑐𝑑(𝑐 + 𝑑) = (𝑢𝑣𝑤)3 . We can see in the
usual way that the factors on the left-hand side be pairwise coprime, thus 𝑐, 𝑑, and
𝑐 + 𝑑 are (non-zero) cubes, which contradicts Fermat’s Last Theorem for 𝑘 = 3.
14. By the formula for the Pythagorean triples, the area of the triangle is
𝑑 2 𝑚𝑛(𝑚 + 𝑛)(𝑚 − 𝑛),
where 𝑚 > 𝑛 > 0, (𝑚, 𝑛) = 1, and 𝑚 ≢ 𝑛 (mod 2).
(a) The area is (measured by) a square number if and only if 𝑚𝑛(𝑚+𝑛)(𝑚−𝑛) is a
square. The conditions imply that the four factors are (positive and) pairwise
coprime, thus each is a square. This, however, contradicts Lemma 7.7.3.
(b) 𝑑 = 1 by the assumption, thus we obtain as in the previous argument that 𝑚,
𝑛, 𝑚 + 𝑛 are cubes, which contradicts Theorem 7.7.10.
498 Answers and Hints
(c) There are infinitely many such triangles. For every Pythagorean triangle we
can find a similar triangle with this property: if 𝑚 and 𝑛 are given, choose
𝑑 = 𝑚𝑛(𝑚 + 𝑛)(𝑚 − 𝑛). We can express this also without the parametric
characterization: If the area of a triangle is 𝐴, then enlarging its size by 𝐴, the
new triangle has area 𝐴3 .
(d) For 𝑘 even, part (a) implies that the area cannot be a 𝑘th power. For 𝑘 odd,
we get by the arguments in parts (b) and (c) that in the case of coprime side
lengths the area cannot be a 𝑘th power, but for every Pythagorean triangle we
can find a similar one such that its area is a 𝑘th power.
7.8.
2. This is Pell’s equation 10𝑦2 + 1 = 𝑥2 , so there are infinitely many such squares.
4. Infinitely many solutions: (a1), (a2), (b1). No solution: (b2) (this follows from
considering 𝑥2 − 3𝑦2 = −1 modulo 3 or modulo 4).
7. No solution: (a), (b), (d), (e). Infinitely many solutions: (c), (f). Hint: The insolv-
ability can be shown by congruences with suitable moduli. Modulus 8 works in all
the four cases, but 3, 7, 9, and 3, can also be applied in the order of the list. In (c),
we easily see the solution 𝑥 = 4, 𝑦 = 1, thus there are infinitely many solutions
by Exercise 7.8.3. In (f), after multiplying by 3, we get 𝑧2 − 6𝑦2 = 3. As 𝑧 = 3,
𝑦 = 1 is a solution, there are infinitely many solutions. It is clear that 3 ∣ 𝑧 in every
solution, so also 𝑥 = 𝑧/3 is an integer.
7.9.
23 = 21 ⋅ 5 + 21 ⋅ 3 + 22 ⋅ 1 + 20 ⋅ 3
= 21 ⋅ 5 + (21 + 20 ) ⋅ 3 + 22 ⋅ 1 = 1 ⋅ 4 + 3 ⋅ 3 + 2 ⋅ 5
leads to the partition 23 = 5 + 5 + 3 + 3 + 3 + 1 + 1 + 1 + 1.
Verify that the above map is a bijection between the two types of partitions
of 𝑛.
Generating functions: The appropriate generating functions are
∞ ∞
1
𝑈(𝑥) = ∏(1 + 𝑥𝑖 ) and 𝑊(𝑥) = ∏ .
𝑖=1 𝑗=1
(1 − 𝑥2𝑗−1 )
8. First proof : By Exercise 7.9.6, the coefficient of 𝑥𝑛 in the power series expansion of
𝑥𝑟
(1 − 𝑥)(1 − 𝑥2 ) . . . (1 − 𝑥𝑟 )
is the number of partitions of 𝑛 where the biggest term is 𝑟. Thus the sum of these
coefficients for all 𝑟 is just 𝑝(𝑛).
8.1. 501
Second proof : The coefficient of 𝑥𝑛 is influenced only by the first 𝑛 terms on the
right-hand side. Giving them a common denominator and adding, we obtain
1
−1 + .
(1 − 𝑥)(1 − 𝑥2 ) . . . (1 − 𝑥𝑛 )
By Theorem 7.9.2, the coefficient of 𝑥𝑛 equals the number of partitions of 𝑛 from
summands 1, 2, . . . , 𝑛, which is just 𝑝(𝑛).
∞
9. The derivative of the logarithm of 𝑉(𝑥) = ∏𝑖=1 (1 − 𝑥𝑖 ) is
∞
𝑉 ′ (𝑥) −𝑖𝑥𝑖−1
(A.7.9) =∑ .
𝑉(𝑥) 𝑖=1
1 − 𝑥𝑖
(Taking the logarithm and differentiating term by term are legal for |𝑥| < 1/2.)
Multiply (A.7.9) by −𝑥𝑉(𝑥), and apply
∞ ∞ ∞
𝑖𝑥𝑖
∑ = ∑ 𝑖(𝑥𝑖 + 𝑥2𝑖 + . . . ) = ∑ 𝜎(𝑗)𝑥𝑗 .
𝑖=1
1 − 𝑥𝑖 𝑖=1 𝑗=1
Then
∞
(A.7.10) −𝑥𝑉 ′ (𝑥) = 𝑉(𝑥) ∑ 𝜎(𝑗)𝑥𝑗 .
𝑗=1
8.1.
(e) The squares of fractions 𝑟/𝑠 approximating √𝛼 well have this property.
(f) 𝛼 = (1 + √5)2 /4.
5. Use that the fractions 𝑟/𝑠 approximating 𝛼 well satisfy 𝑟2 ∼ 𝛼𝑠2 .
6. We can argue similarly as in the proof of Theorem 8.1.6. To get rid of the square
root, multiply the difference by √2 + 𝑟/𝑠.
7. If 𝑟/𝑠 approximates 𝛼 well, then
(a) 𝑎(𝑟/𝑠) + 𝑏 approximates 𝑎𝛼 + 𝑏 well
(b) 𝑟2 /𝑠2 approximates 𝛼2 well.
8. (a) 0 and 1. (b) and (c) The complete interval (−1, 1).
9. (a) Draw an interval of length 𝜀/2𝑖 around the 𝑖th element.
(b) Cardinality: There is a bijection between these ternary fractions and all real
numbers in [0, 1) written as binary fractions (replace digit 2 by 1). Measure
zero: We obtain the Cantor set by deleting the middle third of the interval
[0, 1), then deleting the middle thirds of both remaining intervals, then delet-
ing the middle thirds of the four remaining intervals, etc. The total length of
the remaining intervals after 𝑚 steps is
𝑚 2
1 2 2𝑚−1 1 1 − (3)
1− − −⋯− 𝑚 =1− ⋅ 2
→ 0, if 𝑚 → ∞.
3 9 3 3 1− 3
8.2.
1. (a) Both proofs of Theorem 8.2.1 can be adapted to the space; for the second proof,
we have to apply a three-dimensional variant of Lemma 8.2.2.
(b) In the 𝑛-dimensional case, we have to assume that the volume of 𝐻 is at least
2𝑛 Δ. (Here Δ is the absolute value of the determinant formed from the coor-
dinate vectors of the 𝑛 sides of the fundamental parallelepiped.)
2. Both proofs of Theorem 8.2.1 can be modified to verify this statement. For the
second proof, we need a generalization of Lemma 8.2.2 (we keep the notation used
there): If the intersection of any 𝑟 + 1 sets 𝐾𝑃 is empty, then 𝑡 ≤ 𝑟Δ. Following
the arguments of the first or second proof, we obtain 𝑟 non-trivial lattice points, no
two of which are symmetric about the center 𝑂. Their mirror images with respect
to 𝑂 yield another 𝑟 lattice points.
8.3. 503
8.3.
1. (a) 4, 1, 4, 2
(b) 1, 1, 2, 1, 2, 1, 2, . . .
(c) 2, 4, 4, 4, . . .
(d) 1, 1, 1, 1, . . .
2. (a) 43/30. (b) (1 + √3)/2.
3. Use the good approximation of the fractions 𝑟𝑛 /𝑠𝑛 in Theorem 8.3.3, and observe
that (𝑠𝑛−1 , 𝑠𝑛 ) = 1 follows from (8.3.11).
4. By Exercise 8.3.1d, every digit in the continued fraction expansion of (1 + √5)/2 is
1. Hence, the fractions 𝑟𝑛 /𝑠𝑛 in Theorem 8.3.3 satisfy 𝑟𝑛 = 𝜑𝑛+2 and 𝑠𝑛 = 𝜑𝑛+1 by
recursion (8.3.8a)–(8.3.8b).
5. Use (8.3.8a), (8.3.8b), and (8.3.10) in Lemma 8.3.4.
6. Denoting the original number by 𝛼 and the one formed from the purely periodic
part by 𝛽, we obtain the finite continued fractions
𝛼 = 𝐶(𝑐 0 , 𝑐 1 , . . . , 𝑐 𝑀−𝑘 , 𝛽) and 𝛽 = 𝐶(𝑐 𝑀−𝑘+1 , . . . , 𝑐 𝑀 , 𝛽).
We obtain the statement by simplifying the multiple-decked fractions and perform-
ing some further rearrangements.
504 Answers and Hints
8.4.
9.1.
9.2.
1. (a)–(e) The degree equals deg 𝛼, except if 𝑟 = 0 in (e). For a proof, choose the
polynomial 𝑓 in the hint to Exercise 9.1.2 as 𝑚𝛼 , and verify that the poly-
nomials 𝑓(−𝑥), etc. given in the hint are irreducible over 𝐐.
(f) deg 𝑘√𝛼 ≤ 𝑘 deg 𝛼.
2. Find first a non-zero polynomial 𝑓 with rational coefficients such that 𝑓(𝛼) = 0,
and check the irreducibility of 𝑓 over 𝐐. If 𝑓 is irreducible, then 𝑓 = 𝑚𝛼 , thus
deg 𝛼 = deg 𝑓. If 𝑓 is reducible, then decompose it into the product of irreducible
factors, and determine which factor has 𝛼 among its roots. We can often verify
irreducibility using the Schönemann–Eisenstein criterion, and for polynomials of
degree two or three it is sufficient to check whether or not the polynomial has a
rational root.
(a) 7.
(b) 3. Express 1/2 = cos 60∘ using cos 20∘ .
(c) 3. See hint to Exercise 9.1.1e.
(d) 2. There is a perfect square under the big square root sign.
(e) 4.
(f) 4. Add 1 and apply the summation formula for this geometric series of four
terms.
3. If 𝛼 = 𝑟 + √𝑠, then 𝛼 is a root of the polynomial (𝑥 − 𝑟)2 − 𝑠 irreducible over 𝐐. For
the converse, use the quadratic formula.
4. (a) Apply that if 𝛼 is algebraic and 𝑟 is rational, then deg(𝛼 + 𝑟) = deg 𝛼 (see
Exercise 9.2.1d).
(b) If 𝛼 is a non-real complex number, then the numbers 𝑠(𝛼 + 𝑟) are everywhere
dense in the complex plane when 𝑟 and 𝑠 assume all rational numbers.
5. (a) deg 𝛼𝑖 ≤ deg 𝑓 for every 𝑖.
(b) Equality holds if and only if 𝑓 is irreducible over 𝐐.
(c) Write 𝑓 as a product of irreducible polynomials (over 𝐐): 𝑓 = 𝑓1 . . . 𝑓𝑘 , where
𝑘 ≥ 2 since 𝑓 is reducible. Let deg 𝑓𝑗 = 𝑛𝑗 . Then 𝑛1 + ⋯ + 𝑛𝑘 = 𝑛 and
𝑛 𝑘
(A.9.1) ∑ deg 𝛼𝑖 = ∑ 𝑛𝑗2 .
𝑖=1 𝑗=1
Show that the sum on the right-hand side of (A.9.1) is maximal if and only if
𝑘 = 2, one of 𝑛1 and 𝑛2 is 1, and the other is 𝑛 − 1.
6. 𝑚𝛼 = 𝑥6 + 5𝑥5 + 10𝑥2 + 5𝑥 − 10. Hint: The conditions imply 𝑓 = 𝑔𝑚𝛼 , where
deg 𝑔 = 1. Hence, 𝑓 has a rational root. Determine it by the rational root test,
and divide 𝑓 by the suitable root factor (the best way to do this is to apply Horner’s
scheme).
9.3. 507
9.3.
9. Algebraic: Show that there exist infinitely many positive integers that are not ra-
tional powers of 𝛼. These must be powers of 𝛼 with transcendental exponents by
Theorem 9.3.5.
Transcendental: The number of powers of 𝛼 with transcendental exponents has
the cardinality of the continuum but only countably many of them can be algebraic
numbers.
9.4.
1. (b) The number 𝛼 defined in Theorem 9.4.2 is a Liouville number, so part (a) im-
plies that there are infinitely many Liouville numbers. Continuum: We obtain as
in the proof of Theorem 9.4.2 that the infinite series formed of any infinite subse-
quence of the sequence 10−𝑘! is a Liouville number.
2. (a) Let 𝑓 = 𝑓1 . . . 𝑓𝑘 be the decomposition of 𝑓 into the product of irreducible
polynomials over 𝐐. Then we can reduce the Diophantine equation (9.4.12)
to a system of equations
𝑧
𝑔𝑗 (𝑦, 𝑧) = 𝑦𝑛𝑗 𝑓𝑗 ( ) = 𝑏𝑗 , 𝑗 = 1, 2, . . . , 𝑘,
𝑦
𝑘
where ∏𝑗=1 𝑏𝑗 = 𝑏. If 𝑏 ≠ 0, then there are only finitely many possibilities
for (say) 𝑏1 , and for each 𝑏1 the first equation can have only finitely many
solutions by (the original) Theorem 9.4.5. If 𝑏 = 0, then at least one 𝑏𝑗 = 0,
and the 𝑗th equation (with 𝑏𝑗 = 0) can have only finitely many solutions for
every possible 𝑗.
(b) We used only these properties in the proof of Theorem 9.4.5.
3. Follow the proof of Theorem 9.4.5. If 𝑧𝑖 /𝑦 𝑖 has no bounded subsequence, then
interchange the roles of 𝑧𝑖 and 𝑦 𝑖 , and consider 𝑓(𝑦 𝑖 /𝑧𝑖 ) instead of 𝑓(𝑧𝑖 /𝑦 𝑖 ). It
suffices to apply Theorem 9.4.4 in the special case (say) 𝜅 = 0.99.
4. Use that if 𝛼 is a multiple root of a polynomial 𝑓, then 𝛼 is a root of the derivative
of 𝑓, too.
9.5.
(c) Express sin(2𝑥) and cos(2𝑥) using tan 𝑥. This implies that if tan 𝑟 is rational,
then both sin(2𝑟) and cos(2𝑟) are rational, which contradicts part (b).
3. In the proof of Theorem 9.5.2, the integral-free expression is 0 after every second
integration by parts since sin 𝜋 = sin 0 = 0. Thus considering two consecutive in-
tegrations by parts as a single step, there will arise always just one new integral-free
expression, and its denominator is 𝜋2 times the previous one. Hence, the assump-
tion 𝜋2 = 𝑎/𝑏 will lead to a contradiction by computing the integral
1
𝜋𝑎𝑛+1 ∫ sin(𝜋𝑥)𝑓(𝑥) 𝑑𝑥
0
following the ideas seen at Theorem 9.5.2.
9.6.
1. The numbers 𝛼 and 𝛼 share the same minimal polynomial. The other three num-
bers can be obtained from 𝛼 and 𝛼 by addition; subtraction and multiplication by
𝑖; multiplication and taking a square root.
2. Only (c) is an algebraic integer. Hint for (d): Assume that cos 1∘ is an algebraic
integer, and show that then so is sin 1∘ . The addition formulas show that cos 𝑘∘
and sin 𝑘∘ are algebraic integers for every integer 𝑘. This is, however, false e.g. for
𝑘 = 30.
3. True: (a), (c), (e), (f), (h).
4. Yes, it is solvable, e.g. 𝑥 = 𝑦 = 1, 𝑧 = 𝑛√2 is a non-trivial solution.
5. True: (a), (c), (d).
6. As 𝛼 is algebraic, it satisfies
𝑎0 + 𝑎1 𝛼 + ⋯ + 𝑎𝑛 𝛼𝑛 = 0
with suitable integers 𝑎𝑖 , where 𝑎𝑛 ≠ 0. Multiplying by 𝑎𝑛−1 𝑛 and arranging the
result by the powers of 𝑎𝑛 𝛼, we obtain that 𝑎𝑛 𝛼 is an algebraic integer, i.e. 𝛼 is a
quotient of an algebraic integer and the integer 𝑎𝑛 . Applying the procedure for 1/𝛼
instead of 𝛼, we get that 𝛼 is a quotient of an integer and an algebraic integer (and
if 𝛼 = 0, then this holds trivially).
7. The constant term is ±1 in the minimal polynomial of 𝛼 (with integer coefficients
and leading coefficient 1).
8. (a) For example, 𝛽𝑛 = (√2 − 1)𝑛 .
(b) If both 1/𝛼 and 𝛼/𝛽 are algebraic integers, then so is their product 1/𝛽. For
the converse, let 𝛽𝑛 = 𝑛√𝛼.
(c) Let 𝑎0 + 𝑎1 𝑥 + ⋯ + 𝑎𝑛−1 𝑥𝑛−1 + 𝑥𝑛 be the minimal polynomial of an algebraic
integer 𝛼 (where every 𝑎𝑖 is an integer). Then the minimal polynomial of 𝛼/𝑏 is
𝑎0 +𝑎1 𝑏𝑥+⋯+𝑎𝑛−1 𝑏𝑛−1 𝑥𝑛−1 +𝑏𝑛 𝑥𝑛 . Rewriting it with a leading coefficient 1,
510 Answers and Hints
the constant term can be an integer only if 𝑏𝑛 ∣ 𝑎0 , thus there exist only finitely
many such integers 𝑏 (since 𝛼 ≠ 0 implies 𝑎0 ≠ 0).
9. The answer is yes for both questions. Take e.g. cos 𝜑+𝑖 sin 𝜑, where (a) cos 𝜑 = 1/3;
(b) cos 𝜑 = √2 − 1.
10. (a) The numbers 𝑎 + 𝑏 𝑛√2, where 𝑎 and 𝑏 are integers, are everywhere dense on
the real line by Theorem 8.4.1.
(b) We obtain from the quadratic formula that the real part of a non-real algebraic
integer can only be a fraction with denominator 2. Hence the algebraic inte-
gers of degree 2 are not dense in the complex plane. The ones of degree 4 are,
however, dense: the numbers (𝑎 + 𝑏√2) + 𝑖(𝑐 + 𝑑√2) where 𝑎, 𝑏, 𝑐, and 𝑑 are
integers have mostly degree 4, and are dense in the plane.
11. (a) If 𝑟 is rational, then 𝛼 = cos 𝑟∘ +𝑖 sin 𝑟∘ is a complex root of unity, and so it is an
algebraic integer. Therefore 2 Re 𝛼 = 2 cos 𝑟∘ is an algebraic integer. If 2 cos 𝑟∘
is rational then it must be an integer. Hence cos 𝑟∘ is 0, ±1/2, or ±1. We can
solve the problem without referring to algebraic integers. If 𝑟 is rational, then
𝑛𝑟 is an integer multiple of 360 for some positive integer 𝑛, i.e. cos(𝑛𝑟∘ ) = 1.
Using
cos(𝑛𝛼) = 2 cos((𝑛 − 1)𝛼) cos 𝛼 − cos((𝑛 − 2)𝛼),
verify by induction that 2 cos(𝑛𝛼) is a polynomial in 2 cos 𝛼 with integer coef-
ficients and leading coefficient 1. Thus if cos(𝑛𝑟∘ ) = 1, then 2 cos 𝑟∘ is a root of
a polynomial with integer coefficients and leading coefficient 1. All rational
roots of such a polynomial can only be integers, so 2 cos 𝑟∘ must be an integer.
(b) At least one of 𝑟 and sin 𝑟∘ is irrational, except if 𝑟 is an odd multiple of 30 or
is divisible by 180.
Assume that tan 𝑟∘ is defined, so 𝑟 is not an odd multiple of 90. Then at least
one of 𝑟 and tan 𝑟∘ is irrational, except if 𝑟 is an odd multiple of 45 or is divisible
by 180.
The result for the sine follows immediately from part (a) because sin 𝑟∘ =
cos(90 − 𝑟)∘ . This implies the statement for the tangent by the hint to Ex-
ercise 9.5.2c.
10.1.
1. In the chain of extensions 𝐿 ⊆ 𝐹 ⊆ 𝑀, one of the two links must have degree 1 by
the Tower Theorem 10.1.3.
2. (a) 2; (b) ∞; (c) ∞.
3. (a) One of the directions is obvious, and the other follows from Theorem 9.3.6.
(b) (b1) 1; (b2) 2; (b3) 2; (b4) 3.
10.2. 511
10.2.
𝜗+𝜗 1 1
Re 𝜗 = = (𝜗 + ).
2 2 𝜗
(Be aware during the proof that 𝜗 can be transcendental.)
7
9. Comparing the extensions and their degrees, we obtain 𝐐(𝛼) = 𝐐(√ 5). (Use The-
orems 10.2.5 and 10.2.3 and Exercise 10.2.2.)
10. Answer: 𝑘 and 𝑘/2 (the latter can occur only for even 𝑘). Hint: Apply the Tower
Theorem for the chain 𝐐 ⊆ 𝐐(𝛽 2 ) ⊆ 𝐐(𝛽). (If 𝑘 is even, exhibit examples to demon-
strate that both values can occur.)
512 Answers and Hints
11. Answer: ±1. Hint: As in Exercise 10.2.8, consider the chain 𝐐 ⊆ 𝐐(Re 𝜗) ⊆ 𝐐(𝜗).
Another option: Show that 𝜗 and 1/𝜗 share the same minimal polynomial and 1
or −1 is a root of this minimal polynomial.
12. Parts (a) and (b) follow from the proofs of Theorem 10.2.6 (or 9.3.1) and Theo-
rem 10.2.7 (or 9.3.6).
13. (a) As 𝜗 is transcendental, (𝑔1 ℎ2 −𝑔2 ℎ1 )(𝜗) = 0 holds if and only if 𝑔1 ℎ2 −𝑔2 ℎ1 = 0.
(b) By part (a),
𝑔(𝑥) 𝑔(𝜗)
↦
ℎ(𝑥) ℎ(𝜗)
is a bijection between the algebraic fractions over 𝐐 and 𝐐(𝜗) that preserves
the operations.
10.3.
1. (a) Verify as in the proof for 𝐼(√2) in Theorem 10.3.5 that there is a division algo-
rithm with respect to the absolute value of the norm in 𝐼(√3).
(b1) The irreducible factors on the two sides are associates:
5 + 3√3 = (2 + √3)(1 + √3) and − 4 + 3√3 = (2 − √3)(1 + 2√3).
(b2) Each decomposition contains a reducible factor.
(c) Apply Theorem 10.3.8. We obtain all (non-associate) primes from the decom-
positions of the positive prime numbers:
(c1) 3 = (√3)2 ; 2 = 𝜀(1 + √3)2 , where 𝜀 = 2 − √3 is a unit.
(c2) If 𝑝 ≡ ±5 (mod 12), then 𝑝 is a prime.
(c3) If 𝑝 ≡ ±1 (mod 12), then 𝑝 is a product of two non-associate primes.
(d) If solvable, there are infinitely many solutions, see Exercise 7.8.3. The equa-
tion is solvable if and only if every prime number of the form 12𝑘 ± 5 occurs
with an even exponent in the standard form of 𝑛 and the sum of the expo-
nents of 2, 3, and the primes of the form 12𝑘 − 1 is even. Hint: Use the result
of part (c) and follow the proof of the Two Squares Theorem. Every unit has
norm +1. The reason why we have to examine the exponents of 2, 3, and the
prime numbers of the form 12𝑘 − 1 is that the primes in 𝐼(√3) occurring in
their decompositions have negative norms, therefore, if the sum of the expo-
nents is odd, then not 𝑛 but −𝑛 can be written in the form 𝑥2 − 3𝑦2 .
2. (a) We can verify as in the Gaussian integers that there is a division algorithm
with respect to the norm.
(b) It follows from Theorem 10.3.8 that all (non-associate) primes are obtained
from the decompositions of the positive prime numbers:
(b1) 2 = −(√−2)2 .
(b2) If 𝑝 ≡ 5 or 7 (mod 8), then 𝑝 is a prime.
(b3) If 𝑝 ≡ 1 or 3 (mod 8), then 𝑝 is a product of two non-associate primes.
10.3. 513
(c) Answer: 𝑥 = ±5, 𝑦 = 3. Hint: The two factors on the left-hand side of
(𝑥 + √−2)(𝑥 − √−2) = 𝑦3 can share only √−2 as a common prime fac-
tor, which implies that 𝑥 is even, but this is impossible by checking the orig-
inal equation modulo 4. Thus the two factors are coprime, and since the
only units are ±1, which are cubes themselves, each factor must be a cube
itself. So we can get the answer by comparing the coefficients of √−2 in
𝑥 + √−2 = (𝑎 + 𝑏√−2)3 .
3. Consider e.g. the decompositions
(a) (1 + √15)(1 − √15) = (−2) ⋅ 7
(b) (1 + √26)(1 − √26) = (−5) ⋅ 5
(c) (2 + √−6)(2 − √−6) = 2 ⋅ 5
(d) (2 + √−10)(2 − √−10) = 2 ⋅ 7.
4. We follow the pattern seen for the Gaussian and Eulerian integers (Theorem 7.4.8).
If 𝑡 ≢ 1 (mod 4), then the elements of 𝐼(√𝑡) form a rectangular lattice in the com-
plex plane, where the lengths of the horizontal and vertical sides of the fundamen-
tal rectangle are 1 and √|𝑡|. The division algorithm requires that every element of
𝐐(√𝑡) falls inside a unit circle around some lattice point. This is satisfied if the cir-
cles cover the entire plane, i.e. √|𝑡| < √3, which means 𝑡 = −1 or −2. Further, it
is definitely not satisfied if a segment on the vertical side bisector of a fundamental
rectangle remains uncovered, i.e. √|𝑡| > √3, which means 𝑡 < −3 (since −3 ≡ 1
(mod 4), so 𝑡 = −3 does not come up now). We can argue similarly also in the
case 𝑡 ≡ 1 (mod 4). Then we have a parallelogram lattice where the length of the
horizontal side of the fundamental parallelogram is 1, the corresponding altitude
1
is 2 √|𝑡|, and its foot is the midpoint of the horizontal base.
5. Use Theorem 10.3.8(vii).
6. Show 𝑛2 + 𝑛 + 𝑘 = 𝑁(𝛼𝑛 ) for every 0 ≤ 𝑛 ≤ 𝑘 − 2, where 𝛼𝑛 is irreducible
in 𝐼(√−4𝑘 + 1). Deduce that if 𝑁(𝛼𝑛 ) were a composite integer for some 𝑛, then
𝑁(𝛼𝑛 ) would have two essentially distinct decompositions into the product of irre-
ducible elements in 𝐼(√−4𝑘 + 1).
7. Irreducibility follows immediately from the properties of the norm. For (b), de-
duce from the condition that to every 𝛽 ∈ 𝐼(√𝑡) there exists an integer 𝑏 satisfying
𝛼 ∣ 𝛽 − 𝑏. Then the prime property of 𝛼 follows from
𝛼 ∣ 𝛽𝛾 ⟹ 𝛼 ∣ 𝑏𝑐
⟹ ±𝑝 = 𝑁(𝛼) ∣ 𝑏2 𝑐2
⟹ 𝑝 ∣ 𝑏 or 𝑝 ∣ 𝑐
⟹ 𝛼 ∣ 𝑏 or 𝛼 ∣ 𝑐
⟹ 𝛼 ∣ 𝛽 or 𝛼 ∣ 𝛾.
8. Since 𝛽 2 /𝛼2 is an algebraic integer, so is its square root 𝛽/𝛼. As 𝛽/𝛼 ∈ 𝐐(√𝑡),
𝛽/𝛼 ∈ 𝐼(√𝑡).
514 Answers and Hints
9. (a) 5 = −(√−5)2 .
(b) We saw in the proof of Theorem 10.3.5 that 2 is irreducible and
10.4.
1. (a) ±√2 ± √3
(b) √2(±1 ± 𝑖)
(c) cos 20∘ , cos 140∘ , cos 260∘
(d) cos 𝑘∘ + 𝑖 sin 𝑘∘ , where 1 ≤ 𝑘 ≤ 360, 𝑘 is an integer and (𝑘, 360) = 1.
2. (a) Applying Viète’s formula for the sum of the roots of the minimal polynomial
of 𝜗, we obtain that 𝜗 (1) + 𝜗 (2) is rational, so 𝜗 (2) ∈ 𝐐(𝜗 (1) ).
(b) There exists a real 𝜗 (𝑗) , thus 𝐐(𝜗 (𝑗) ) ⊆ 𝐑, so 𝐐(𝜗 (𝑗) ) ≠ 𝐐(𝜗).
(c) In the chain 𝐐 ⊆ 𝐐(𝜗 (𝑗) )∩𝐐(𝜗 (𝑘) ) ⊆ 𝐐(𝜗 (𝑗) ), the product of the degrees of the
two links is 3. Therefore it suffices to prove that any two extensions 𝐐(𝜗 (𝑗) )
are distinct. Show that if two of the three extensions 𝐐(𝜗 (𝑗) ) coincide, then
the third must be equal to them. This, however, contradicts part (b).
3. (We abbreviate the relative conjugates by R.C.)
4 4
(a) R.C.: 1 ± √ 2, 1 ± 𝑖 √ 2, 𝑁(𝛼) = −1.
(b) R.C.: 1 ± √2 with double multiplicity, 𝑁(𝛽) = 1.
4 4
(c) R.C.: (1 ± √ 2)(1 + √2), (1 ± 𝑖 √ 2)(1 − √2), 𝑁(𝛾) = −1.
4. Adapt the proof of Theorem 10.3.4. (Be careful: the relative conjugates of 𝜀 are
generally outside 𝐐(𝜗), but their product divided by 𝜀 is inside.)
5. (a) For example, (3 + 4𝑖)/5 is suitable.
10.5. 515
(b) Let the quadratic field be of the form 𝐐(√𝑡), where 𝑡 ≠ 1 is a squarefree in-
𝑡
teger, and let 𝑝 > 2 be a prime satisfying ( 𝑝 ) = 1. Then the congruence
𝑥2 −𝑡 ≡ 0 (mod 𝑝) is solvable, and so the same is true for 𝑥2 − 𝑡 ≡ 0 (mod 𝑝2 ).
Let 𝑐 be a solution. Then (𝑐 + √𝑡)/𝑝 is not an algebraic integer, but its norm
is an integer.
10.5.
A.11. Ideals
11.1.
1. (a) (2)
(b) (1 + 𝑖)
(c) Not an ideal
(d) (1 + 𝑖)
(e) Not an ideal
(f) (7).
2. (a) (2𝑥 − 1)
(b) ([𝑥2 − 2][𝑥2 − 3])
(c) Not an ideal
(d) (𝑥 − 3, 2)
(e) Not an ideal.
3. Let 𝑅 be a field and 𝐼 ≠ 0 an ideal in 𝑅. We have to show 𝐼 = 𝑅. If 𝑎 ≠ 0 is an
element of 𝐼 and 𝑏 is an element of 𝑅, then 𝑐 = 𝑏/𝑎 ∈ 𝑅, so 𝑐𝑎 = 𝑏, 𝑏 ∈ 𝐼, thus
𝐼 = 𝑅. For the converse, pick an element 𝑎 ≠ 0 in 𝑅. Then, by the condition,
(𝑎) = 𝑅, thus 𝑏 ∈ (𝑎) for every 𝑏 ∈ 𝑅. This means 𝑐𝑎 = 𝑏 for some 𝑐 ∈ 𝑅, so
division works and 𝑅 is a field.
4. Let 𝐼 = (𝜉1 21/𝑘1 , . . . , 𝜉𝑛 21/𝑘𝑛 ), where 𝜉1 , . . . , 𝜉𝑛 ∈ 𝑈. Then every element in 𝐼 is of
the form 𝜉21/𝑚 , where 𝜉 ∈ 𝑈 and 𝑚 = lcm[𝑘1 , . . . , 𝑘𝑛 ]. Since 21/(𝑚+1) is not of this
form, 𝐼 ≠ 𝐾, and 𝐾 cannot be generated by finitely many elements.
5. Show that the generators of one of the ideals can be expressed with the help of
generators of the other ideal, and vice versa.
6. (a) (a1): 4 (a2): 9 (a3): 5.
Field: (a2), (a3).
(b) If 𝛼 ≠ 0, then 𝐺/(𝛼) has 𝑁(𝛼) elements, and 𝐺/(𝛼) is a field if and only if 𝛼 is a
Gaussian prime. Hint: To determine the number of residue classes modulo 𝛼,
see the hint for Exercise 7.7.12. To characterize the fields, argue as we proved
that 𝐙/(𝑚) is a field if and only if 𝑚 is a prime number (Theorem 2.8.4; we have
to check, of course, that all necessary preliminary theorems can be adapted
from integers to Gaussian integers).
7. (a) Proceed as in the proof that (2, 𝑥) is not a principal ideal in 𝐙[𝑥] (see the para-
graph about E3 before Definition 11.1.4).
(b) (b1): 2, it is a field. (b2): 6, it is not a field. (b3): 121, it is a field.
8. (a) Field: (a2).
(b) 𝐹[𝑥]/(𝑔) is a field if and only if 𝑔 is irreducible over 𝐹.
11.2. 517
(c) The factor ring has four elements (the residue classes can be represented by
the remainders 𝑎0 + 𝑎1 𝑥, where 𝑎𝑖 = 0 or 1), and we can easily check that
the three non-zero elements have inverses. Another option: The factor ring is
isomorphic to 𝑆 = 𝐙2 [𝑥]/(𝑥2 + 𝑥 + 1), where 𝐙2 is the field of residue classes
modulo 2, and 𝑆 is a field by part (b).
9. (a) Follow the proof of the special case 𝜗 = √2 seen in the Example after Theo-
rem 11.1.6. The key observation is that each residue class of 𝐐[𝑥] modulo the
principal ideal (𝑚𝜗 ) can be uniquely characterized by the common remainder
of the polynomials in the class on division by 𝑚𝜗 , and the only computational
rule for the remainders is that the multiples of 𝑚𝜗 do not count. This corre-
sponds perfectly to the usual representation of the elements in 𝐐(𝜗) and to
the computation method there that uses only 𝑚𝜗 (𝜗) = 0. An alternative ap-
proach: The map 𝑓 ↦ 𝑓(𝜗) from 𝐐[𝑥] onto 𝐐(𝜗) is a ring homomorphism
with image 𝐐(𝜗) and kernel (𝑚𝜗 ). Thus the statement follows from the ho-
momorphism theorem for rings.
(b) By part (a), let 𝑀 = 𝐿[𝑥]/(𝑓). The irreducibility of 𝑓 implies that 𝑀 is a field,
the set of residue classes constant+(𝑓) corresponds to 𝐿∗ , and the residue class
𝑥 + (𝑓) plays the role of 𝜗.
10. (a) It is sufficient to verify the statement for principal ideals since 𝛼 ∈ 𝐼 implies
(𝛼) ⊆ 𝐼, and so the number of residue classes modulo 𝐼 is less than or equal to
the number of residue classes modulo (𝛼). Let 𝛼 ≠ 0, and we show that there
are only finitely many remainders modulo 𝛼. Let 𝜔1 , . . . , 𝜔𝑛 be an integral
basis in 𝐼(𝜗). Then every 𝜉 ∈ 𝐼(𝜗) can be written as 𝜉 = 𝑘1 𝜔1 + ⋯ + 𝑘𝑛 𝜔𝑛 ,
where 𝑘𝑖 ∈ 𝐙, 𝑖 = 1, . . . , 𝑛. Since 𝛼 ∣ 𝑁(𝛼), every residue class modulo 𝛼 has a
representative 𝜉 satisfying 0 ≤ 𝑘𝑖 < |𝑁(𝛼)|, 𝑖 = 1, . . . , 𝑛.
(b) The numbers of elements of the factor rings 𝑅/𝐴𝑗 form a strictly decreasing
sequence. This is impossible, however, as 𝐴2 ≠ 0 and so 𝑅/𝐴2 has only finitely
many elements.
(c) If an ideal 𝐼 ≠ 0 were not finitely generated, then it would contain a strictly
increasing chain of ideals
(𝑎1 ) ⊂ (𝑎1 , 𝑎2 ) ⊂ (𝑎1 , 𝑎2 , 𝑎3 ) ⊂ . . . .
11.2.
1. (a) (5)
(b) (60).
2. (a) 4
(b) 16.
3. Rephrase the statement with divisibility according to Theorem 11.2.1.
518 Answers and Hints
4. (a) Both 2 and 1 + √−5 are common divisors, but there is no common multiple
of them among the common divisors.
(b) (2), (1 + √−5), (1).
(c) For example, 𝛼 = 2, 𝛽 = 1 + √−5.
11.3.
1. (a) They have minimal polynomials with integer coefficients, leading coefficient 1,
and constant term 1 or −1 (see Exercise 9.6.7).
(b) 𝛼 = √𝛼√𝛼.
2. (a) 𝑎 ≠ 0 and 𝑏 is arbitrary or 𝑎 = 𝑏 = 0.
(b) Every 𝑎 ≠ 0 is a unit, thus there are no irreducible or prime elements.
(c) Fundamental Theorem: It is an empty statement, as it refers to elements dif-
ferent from 0 and units. Principal ideal domain: A field contains only the
trivial ideals (0) and (1) (see Exercise 11.1.3), and these are principal ideals.
Euclidean ring: As division can be performed, we can always achieve a zero
remainder (and so any function can be chosen as 𝑓).
3. (a) Only 2 is irreducible.
(b) The procedure yields a unit that has no irreducible divisors.
(c) We can construct a suitable 𝑓 as in the hint to Exercise 1.5.5c.
(d) (0), (1), (2), (22 ), (23 ), . . . .
4. We have to check the requirements of Definition 11.1.1.
5. Hint for necessity: If 𝑅[𝑥] is a principal ideal domain, then (𝑎, 𝑥) is a principal ideal
for every (non-zero) constant polynomial 𝑎.
6. Show that if 𝑓(𝑐) is minimal for an element 𝑐 ≠ 0, then 𝑐 is a unit. So 𝑐 ∣ 𝑐, or 𝑒𝑐 = 𝑐
for some 𝑒. Applying the lack of zero divisors, show that 𝑒 is an identity element.
7. True: (a).
8. The division algorithm with remainders of least absolute value satisfies the condi-
tion. If (𝑏 ≠ 0 and) 𝑎 = 𝑏𝑞 + 𝑟, where |𝑟| ≤ |𝑏|/2, then 𝑓(𝑟) < 𝑓(𝑏).
9. (a) Prove first that every ideal in 𝑅 is finitely generated, and then show (𝑎, 𝑏) =
(𝑑), where 𝑑 = gcd{𝑎, 𝑏}.
(b) It follows from part (a) by Exercise 11.1.10a.
10. For sufficiency, see Exercise 10.3.4 and the hint for it. For necessity, assume that
𝐼(√𝑡) is a Euclidean ring for some 𝑡 < −3 and take an element 𝛽 ≠ 0, ±1 for which
𝑓(𝛽) is minimal. Verify 𝑁(𝛽) ≤ 3. This implies 𝑡 = −7 or 𝑡 = −11 (for 𝑡 < −3).
11.4. 519
11.4.
1. (a) 𝐻 is not an ideal if 𝐴 and 𝐵 are the ideals in Examples E1 or E2 before Defini-
tion 11.4.3: e.g. 2⋅3+[𝑥+3][𝑥−2] = 𝑥2 +𝑥 and 3⋅3−[1+ √−5][1− √−5] = 3,
are not of the form 𝑎𝑏.
(b) If 𝐴 = (𝛼), then
𝑛 𝑛 𝑛
∑ 𝑎𝑖 𝑏𝑖 = ∑ [𝑟 𝑖 𝛼]𝑏𝑖 = 𝛼 ∑ 𝑟 𝑖 𝑏𝑖 = 𝛼𝑏.
𝑖=1 𝑖=1 𝑖=1
11.5.
6. Express the greatest common divisor of ideals (𝛼)2 and (𝛽)2 in two different ways.
7. (a) (21) = (3, 4 + √−5)(3, 4 − √−5)(7, 4 + √−5)(7, 4 − √−5). (Of course, we can
describe these prime ideals with other generators, as well, e.g. (3, 4 + √−5) =
(3, 1 + √−5) = (3, 1 − 2√−5) = (2 − √−5, 1 + √−5), etc.)
(b) 𝑝 = 2 and 3.
(c) 𝑝 = 2, 5, and primes of the form 20𝑘 + 1, 20𝑘 + 3, 20𝑘 + 7, and 20𝑘 + 9.
8. Both properties are equivalent to the fact that every ideal in 𝐼(𝜗) is a principal ideal
(see Exercise 11.3.9b, and Theorems 11.4.2(iii) and 11.5.8).
11.6.
12.1.
circuit. Since the graph is bipartite, the circuit has an even number of edges, and by
the construction, the product of numbers 𝑎𝑖 corresponding to every second edge is
equal to the product of numbers 𝑎𝑖 corresponding to the other edges in the circuit
(as both products are equal to the product of all numbers appearing in the vertices
of the circuit).
9. 𝜋(𝑛). Hint: The primes clearly satisfy the condition, hence the maximum is at
least 𝜋(𝑛). Assume that there are 𝜋(𝑛) + 1 such numbers 𝑎𝑖 . Then for every 𝑎𝑖
we can find a prime that occurs in the standard form of 𝑎𝑖 with a larger exponent
than in the standard form of all other numbers 𝑎𝑗 . By the pigeonhole principle,
there must be a prime that plays this role for two different numbers 𝑎𝑖 which is a
contradiction.
10. 2𝑛/3. Hint: The 2𝑛/3 numbers not relatively prime to 6 (that is, those that are
divisible by at least one of 2 and 3) satisfy the condition. If we pick more than 2𝑛/3
elements, then by the pigeonhole principle there must be an 𝑠 for which at least
five 𝑎𝑖 occur among the numbers 6𝑠 + 1, . . . , 6𝑠 + 6. Show that there must be three
of them that are pairwise relatively prime.
Remark: We can generalize the exercise, replacing three by 𝑟: Determine the max-
imum of 𝑘 if among any 𝑟 numbers 𝑎𝑖 there must be two that are not coprime. For
example, the numbers divisible by at least one of the first 𝑟 − 1 primes form such a
set. (Why?) Erdős conjectured that this set yields the maximum (for every 𝑛 large
enough compared to 𝑟). This long-standing unsolved problem was finally solved
by Ahlswede and Khachatrian in 1994.
11. Dividing by the gcd of the integers 𝑎𝑖 , we can assume that they are relatively prime.
𝑎𝑖
If some of them are divisible by 𝑘, e.g. 𝑘 ∣ 𝑎𝑖 and 𝑘 ∤ 𝑎𝑗 , then 𝑘 ∣ (since 𝑘 is
(𝑎𝑖 , 𝑎𝑗 )
𝑎𝑖
a prime) and ≥ 𝑘. If no 𝑎𝑖 is divisible by 𝑘, then there are two of them, say
(𝑎𝑖 , 𝑎𝑗 )
𝑎𝑖 𝑎𝑗
𝑎𝑖 and 𝑎𝑗 , that are congruent mod 𝑘. Hence ≡ (mod 𝑘), thus the
(𝑎𝑖 , 𝑎𝑗 ) (𝑎𝑖 , 𝑎𝑗 )
larger of the two quotients must be greater than 𝑘.
12. Let 𝑎1 , . . . , 𝑎𝑘 be a suitable set for 𝑛 = 2𝑗 . Then the set 1, 2, . . . , 2𝑡−1 , 2𝑡 𝑎1 , . . . , 2𝑡 𝑎𝑘
will work for 2𝑗+𝑡 ≤ 𝑛 < 2𝑗+𝑡+1 .
13. The optimal choice is 𝑐 = √3 in Chebyshev’s inequality. Then we can replace 8/3
in (12.1.9) and (12.1.10) by 3√3/2. A further improvement is possible if we replace
(12.1.6) by a better estimate: (12.1.10) implies 𝑘 ≤ (1 + 𝜀) log2 𝑛 with an arbitrarily
small 𝜀 > 0 for 𝑛 large enough, hence the term 1 on the right-hand side of (12.1.7)
can be nearly omitted. In total, this means that 2 at the end of (12.1.2) can be
replaced by any constant larger than log2 (3√3/2) = 1.377 . . . for 𝑛 large enough.
524 Answers and Hints
12.2.
1. We apply the greedy algorithm, and always pick the first element which does not
ruin the Sidon property. Assume that we have already chosen 𝑎1 < 𝑎2 < ⋯ < 𝑎𝑠 <
𝑛. We cannot choose 𝑑 as 𝑎𝑠+1 if 𝑑 + 𝑎𝑖 = 𝑎𝑗 + 𝑎𝑘 , or 𝑑 = 𝑎𝑗 + 𝑎𝑘 − 𝑎𝑖 for some 𝑖, 𝑗,
𝑘 ≤ 𝑠. (The case 𝑑 + 𝑑 = 𝑎𝑗 + 𝑎𝑘 cannot occur, since then 𝑑 < 𝑎𝑘 and so we would
have chosen 𝑑 in the sequence earlier, instead of 𝑎𝑘 .) This excludes at most 𝑠3 (in
fact, less than 𝑠3 /2) elements. This means that if 𝑠 < 𝑛1/3 , then we can still find a
new element 𝑎𝑠+1 ≤ 𝑛.
2. To verify the Sidon property, assume 𝑎𝑖 + 𝑎𝑗 = 𝑎𝑘 + 𝑎𝑙 , so
2𝑝(𝑖 + 𝑗 − 𝑘 − 𝑙) + (⟨𝑖2 mod 𝑝⟩ + ⟨𝑗2 mod 𝑝⟩ − ⟨𝑘2 mod 𝑝⟩ − ⟨𝑙2 mod 𝑝⟩) = 0.
The second term is divisible by 2𝑝 and has absolute value less than 2𝑝, so it must
be 0. Then the first term is also 0. This means 𝑖 − 𝑘 = 𝑙 − 𝑗 and 𝑖2 − 𝑘2 ≡ 𝑙2 − 𝑗2
(mod 𝑝). A calculation shows that either 𝑖 = 𝑘 and 𝑗 = 𝑙, or 𝑖 = 𝑙 and 𝑗 = 𝑘.
3. Apply a simplified version of the proof of Theorem 12.2.2 for the field of 𝑝2 ele-
ments and its subfield of 𝑝 elements.
4. Let 𝑔 be a primitive root modulo 𝑝, and let 𝑎𝑖 be the solution of the system of con-
gruences 𝑥 ≡ 𝑖 (mod 𝑝 − 1), 𝑥 ≡ 𝑔𝑖 (mod 𝑝) modulo 𝑝(𝑝 − 1), 𝑖 = 1, 2, . . . , 𝑝 − 1.
5. We can take a Sidon set 𝑆 1 between 1 and 𝑛1 having about √𝑛1 elements by The-
orem 12.2.1. Let 𝑛2 be much larger than 𝑛1 . We leave the interval (𝑛1 , 𝑛1 + 𝑛2 ]
empty, choose a Sidon set in the interval (𝑛1 + 𝑛2 , 𝑛1 + 2𝑛2 ] of about √𝑛2 elements,
delete (at least one member of) those pairs whose difference is less than < 𝑛1 , and
denote the remaining set by 𝑆 2 . By the Sidon property, we deleted fewer than 2𝑛1
elements. Therefore we selected about √𝑛2 + √𝑛1 − 2𝑛1 ≈ √𝑛2 elements up to
𝑛1 +2𝑛2 . Verify that 𝑆 1 ∪𝑆 2 is a Sidon set. Choose an 𝑛3 much bigger than 𝑛1 +2𝑛2 ,
place a Sidon set of size about √𝑛3 between 𝑛1 + 2𝑛2 + 𝑛3 and 𝑛1 + 2𝑛2 + 2𝑛3 , delete
the elements with differences less than 𝑛1 + 2𝑛2 , etc. Continuing the procedure we
obtain an infinite Sidon set meeting the requirements.
6. (a) Generalize the method of Exercise 12.2.3 to the field of 𝑝ℎ elements.
(b) The ℎ-fold sums are all distinct and fall between 1 and 𝑛ℎ.
7. It is sufficient to prove that every positive integer has a unique representation as
𝑎𝑖 −𝑎𝑗 with 𝑖 > 𝑗. We always define two new elements of the sequence. They should
be big enough to avoid that their differences with previously constructed elements
should coincide with differences of two previously constructed elements, and the
difference of these two elements should be the smallest positive integer that has
not yet appeared as a difference of two elements.
8. Let 𝐴 and 𝐵 consist of the numbers which have 0 digits at every odd or even place
in their binary representation counted backwards.
12.3. 525
12.3.
1. (a) Let 𝐴 = {𝑎1 < 𝑎2 < ⋯ < 𝑎𝑘 }. Then 𝑎1 + 𝑎1 < 𝑎1 + 𝑎2 < 𝑎2 + 𝑎2 < 𝑎2 + 𝑎3 <
⋯ < 𝑎𝑘 + 𝑎𝑘 are 2𝑘 − 1 distinct sums. If |𝐴 + 𝐴| = 2𝑘 − 1, then every 𝑎𝑖 + 𝑎𝑗 ,
thus 𝑎𝑖 + 𝑎𝑖+2 is among the above sums, and comparing magnitudes yields
that it can only equal 𝑎𝑖+1 + 𝑎𝑖+1 , so 𝑎𝑖+1 = (𝑎𝑖 + 𝑎𝑖+2 )/2.
(b) If 𝐴 = {𝑎1 < 𝑎2 < ⋯ < 𝑎𝑘 }, 𝐵 = {𝑏1 < 𝑏2 < ⋯ < 𝑏𝑟 }, and 𝑘 ≥ 𝑟, then
𝑎1 +𝑏1 < 𝑎1 +𝑏2 < 𝑎2 +𝑏2 < 𝑎2 +𝑏3 < ⋯ < 𝑎𝑟 +𝑏𝑟 < 𝑎𝑟+1 +𝑏𝑟 < ⋯ < 𝑎𝑘 +𝑏𝑟
are 𝑘 + 𝑟 − 1 distinct sums. In the case of equality, every other 𝑎𝑖 + 𝑏𝑗 coincides
with one of the above sums. By estimating magnitudes, we can easily identify
the sums 𝑎2 +𝑏1 , 𝑎1 +𝑏3 , 𝑎3 +𝑏2 , etc. We obtain that 𝐵 and the first 𝑟 elements
of 𝐴 form arithmetic progressions with the same difference. We can extend
this to any consecutive 𝑟 elements of 𝐴 by modifying the initial sequence of
𝑘 + 𝑟 − 1 sums suitably.
(c) Prove by induction on 𝑡.
2. Delete from 𝐵 all non-zero elements that are not coprime to 𝑚, and follow the first
proof of Theorem 12.3.1. To show that the estimate is sharp, consider e.g. 𝑚 = 𝑝2 ,
𝐴 = {0, 𝑝, 2𝑝, . . . , (𝑝 − 1)𝑝}, and 𝐵 = {0, 𝑝, 2𝑝, . . . , 1, 𝑝 + 1, 2𝑝 + 1, . . . , (𝑝 − 1)𝑝 + 1}.
3. (a) Follow the first proof of Theorem 12.3.1. We have to use the condition when
showing the impossibility of 𝐴 + 𝑏 = 𝐴 for 𝑏 ≠ 0.
(b) We have equality e.g. for 𝐴 = {0, 1, . . . , 𝑘 − 1} and 𝐵 = {0, 1, . . . , 𝑟 − 1} (where
𝑘 + 𝑟 ≤ 𝑚 + 1).
(c) The same proof applies also for the general case.
̂ and
4. We can argue as in the second proof of Theorem 12.3.1: let 𝐴 = 𝐵, 𝐶 = 𝐴+𝐴,
𝑓1 (𝑥, 𝑦) = (𝑥 + 𝑦)𝑚 (𝑥 − 𝑦)2 ∏(𝑥 + 𝑦 − 𝑐),
𝑐∈𝐶
where 𝑚 + |𝐶| = 2𝑘 − 4.
5. (a) As in the second proof of Theorem 12.3.1, reduce the terms 𝑥𝑖 𝑦𝑗 where 𝑖 ≥ 𝑘
or 𝑗 ≥ 𝑟, and apply Lemma 12.3.2.
(b) Let |𝐴𝑖 | = 𝑘𝑖 , 𝑖 = 1, . . . , 𝑛, and let 𝐺(𝑥1 , . . . , 𝑥𝑛 ) be a polynomial over 𝐹 in 𝑛
𝑛
variables and of degree ∑𝑖=1 (𝑘𝑖 − 1). Assume that the coefficient of the term
𝑛 𝑘 −1
∏𝑖=1 𝑥𝑖 𝑖 is not zero. Then 𝐺(𝑎1 , . . . , 𝑎𝑛 ) ≠ 0 for some 𝑎𝑖 ∈ 𝐴𝑖 , 𝑖 = 1, . . . , 𝑛.
6. If 𝐶 = 𝐷 = 𝐙𝑝 , then 𝑐 = 𝑑 works since 2𝑢 = 2𝑣 in 𝐙𝑝 implies 𝑢 = 𝑣 as 𝑝 is odd. If
|𝐶| = |𝐷| = 𝑛 < 𝑝, then apply Exercise 12.3.5b for 𝐴1 = ⋯ = 𝐴𝑛 = 𝐷 and
𝐺(𝑥1 , . . . , 𝑥𝑛 ) = ∏ (𝑥𝑖 − 𝑥𝑗 )(𝑥𝑖 + 𝑐 𝑖 − 𝑥𝑗 − 𝑐𝑗 ).
1≤𝑗<𝑖≤𝑛
8. (a) We have to show that among any 2𝑛 − 1 integers, there exist 𝑛 such that their
sum is a multiple of 𝑛. As seen in Exercise 3.6.6, it is sufficient to prove this
when 𝑛 is a prime 𝑝. We can assume 0 ≤ 𝑎1 ≤ 𝑎2 ≤ . . . ≤ 𝑎2𝑝−1 ≤ 𝑝 − 1.
If there are 𝑝 equal numbers 𝑎𝑖 , then their sum is divisible by 𝑝. Otherwise,
switching to 𝐙𝑝 , let 𝐴𝑖 = {𝑎𝑖 , 𝑎𝑖+𝑝−1 }, 𝑖 = 1, . . . , 𝑝 − 1, then |𝐴𝑖 | = 2. By
Exercise 12.3.7, |𝐴1 + ⋯ + 𝐴𝑝−1 | = 𝑝, so every element in 𝐙𝑝 , thus 𝑎2𝑝−1 , can
be written as 𝑎(1) + ⋯ + 𝑎(𝑝−1) , where 𝑎(𝑖) ∈ 𝐴𝑖 , so 𝑎(1) + ⋯ + 𝑎(𝑝−1) + 𝑎2𝑝−1
is a multiple of 𝑝.
(b) The midpoint of lattice points 𝑃 and 𝑄 is a lattice point if and only if both
the first and second coordinates of 𝑃 and 𝑄 have the same parity. By the pi-
geonhole principle, among any five lattice points there must be two with this
property.
(c) Take 𝑛−1 lattice points of each type where the coordinates modulo 𝑛 are (0, 0),
(0, 1), (1, 0), and (1, 1). We cannot select 𝑛 out of these 4𝑛 − 4 lattice points so
that the averages of both the first and second coordinates are integers.
(d) (i) The lower bound can be verified by generalizing the construction in (c).
The upper bound follows from the pigeonhole principle since among that
many lattice points there are always 𝑛 such that considering any coordinate
they are congruent modulo 𝑛. (ii) Argue similarly as we showed in Exer-
cise 3.6.6 that if the statement there is valid for two integers, then it is true
also for their product.
9. Let |𝐴| = 𝑘, 𝑐 a quadratic non-residue mod 𝑝, and consider the 𝑘2 sums 𝑎𝑖 + 𝑐𝑎𝑗 .
If 𝑘2 > 𝑝, then two sums must be equal, which yields 𝑎𝑖 − 𝑎𝑟 = 𝑐(𝑎𝑠 − 𝑎𝑗 ). Then
(exactly) one of 𝑎𝑖 − 𝑎𝑟 and 𝑎𝑠 − 𝑎𝑗 is a quadratic residue mod 𝑝.
10. Generalize the observations before Theorem 12.3.3.
12.4.
1. The last three equalities are obvious, and we have proved 𝑅(3, 2) ≤ 6. Thus we have
to show that we can color the edges of a complete graph of five vertices with two
colors so that no monochromatic triangle arises. Coloring the sides and diagonals
of a pentagon red and blue, resp., meets this requirement.
2. In part I of the proof of Theorem 12.4.1 we verified
(A.12.1) 𝑅(3, 𝑡) ≤ 𝑡(𝑅(3, 𝑡 − 1) − 1) + 2.
This implies 𝑅(3, 𝑡) ≤ 𝑡𝑅(3, 𝑡 − 1), and we get (a) by induction. We can prove also
the sharper statement (b) by induction if we use (A.12.1) and
1 1 1
⌈𝑒𝑡! ⌉ = 𝑡! (1 + + + ⋯ + ) + 1
1! 2! 𝑡!
obtained from the infinite series expansion of 𝑒.
3. (a) Combine 𝑆(𝑡) < 𝑅(3, 𝑡) (see the proof of Theorem 12.4.2) and part (b) in the
previous exercise.
12.4. 527
(b) Take a bad coloring of the integers 1, 2, . . . , 𝑛 = 𝑆(𝑡) with 𝑡 colors, one where
the equation 𝑥 + 𝑦 = 𝑧 has no monochromatic solution, color each of the
numbers 𝑛 + 1, . . . , 2𝑛 + 1 with the (𝑡 + 1)st color and repeat the coloring of
the first 𝑛 numbers for 2𝑛 + 2, . . . , 3𝑛 + 1 (i.e. 2𝑛 + 1 + 𝑖 has the same color as
𝑖). Show that this is a bad coloring of the integers 1, 2, . . . , 3𝑛 + 1 with 𝑡 + 1
colors.
(c) Prove by induction using part (b).
(d) We generalize the construction in (b). Let 𝜈 be a bad coloring of 1, . . . , 𝑛 = 𝑆(𝑡)
with 𝑡 colors, and 𝜚 a bad coloring of 1, . . . , 𝑟 = 𝑆(𝑣) with 𝑣 other colors. Then
we can obtain a bad coloring of 1 ≤ 𝑚 ≤ 2𝑛𝑟 + 𝑛 + 𝑟 with 𝑡 + 𝑣 colors: Write
𝑚 as 𝑚 = 𝑖(2𝑛 + 1) + 𝑗, where 1 ≤ 𝑗 ≤ 2𝑛 + 1, and let the color of 𝑚 be 𝜈(𝑗) or
𝜚(𝑖) according as 1 ≤ 𝑗 ≤ 𝑛 or 𝑛 + 1 ≤ 𝑗 ≤ 2𝑛 + 1 (i.e. we repeat the coloring
of 1, 2, . . . , 𝑛 defined by 𝜈 in the first halves of the intervals of length 2𝑛 + 1,
and the elements in the second halves of the intervals uniformly get the color
of the serial number of the interval in the coloring of 1, 2, . . . , 𝑟 defined by 𝜚).
4. 5𝑛 − 1.
5. Apply the proof of Theorem 12.4.2 with 𝑅(4, 𝑡) instead of 𝑅(3, 𝑡).
6. If 𝐵 𝑡 + 𝐶 𝑡 ≡ 𝐷𝑡 (mod 𝑝) for some 𝐵𝐶𝐷 ≢ 0 (mod 𝑝) and 𝐶𝐹 ≡ 1 (mod 𝑝), then
(𝐵𝐹)𝑡 + 1 ≡ (𝐷𝐹)𝑡 (mod 𝑝).
7. (a) Use longer and longer red and blue intervals.
(b) We order all arithmetic progressions into one sequence and color an element
blue in each progression one after the other so that the next blue number is at
least the double of the previous one. A more concrete construction: Just the
integers 𝑛! +𝑛 are blue. Then every arithmetic progression 𝑎 + 𝑚𝑑, 𝑚 = 1, 2,
. . . contains a blue number since for 𝑛 = 𝑎 + 𝑑 we have (𝑎 + 𝑑)! +𝑎 + 𝑑 ≡ 𝑎
(mod 𝑑). Therefore there result no infinite red arithmetic progressions, and
as the blue numbers grow very quickly, they cannot even form a three-term
arithmetic progression.
8. If 𝑚 = 𝑤(𝑘, 𝑡) + 1, then we get a 𝑘-term monochromatic arithmetic progression
(𝑘-MCAP) less than 𝑚. Consider the integers 𝑚, 2𝑚, . . . , (𝑚 − 1)𝑚 and apply
Theorem 12.4.4A again (in fact, we color the multipliers of 𝑚). Then we get a new
𝑘-MCAP of multiples of 𝑚 not exceeding (𝑚 − 1)𝑚, etc. Among these infinitely
many 𝑘-MCAP there are infinitely many of the same color since the number of
colors is finite.
9. Apply Van der Waerden’s Theorem for the exponents of powers of two.
10. RRBBRRBB shows that eight numbers do not suffice. To prove the sufficiency of
nine numbers, we must distinguish a few cases. It is worthwhile to rely on symme-
try (of numbers and colors): we may assume that 5 is red, 1 is blue, and 9 is either
red, or blue, then we consider the colors of 3 and 7, etc.
11. (a) There are 2𝑛 colorings of 1, 2, . . . , 𝑛 with two colors. We estimate the number
of colorings containing a 𝑘-term monochromatic arithmetic progression (𝑘-
MCAP). Counting by the first terms and differences, there are at most
528 Answers and Hints
𝑛2 /2(𝑘 − 1) such 𝑘-term arithmetic progressions, each can have two colors,
and we can color the other numbers in 2𝑛−𝑘 ways. Therefore, altogether at
most 𝑛2 2𝑛−𝑘 /(𝑘 − 1) colorings may contain a 𝑘-MCAP (we counted some
bad colorings several times, of course). Thus, if 𝑛2 2𝑛−𝑘 /(𝑘 − 1) < 2𝑛 , so
𝑛 < 2𝑘/2 √𝑘 − 1, then there must be a coloring without a 𝑘-MCAP.
(b) Consider a finite field 𝐹 with 2𝑝 elements, let Δ be a generator of its multi-
plicative group, and 𝑊 a (𝑝 − 1)-dimensional subspace in 𝐹 (considered as a
vector space over 𝐙2 ). We color 𝑘 red if and only if Δ𝑘 ∈ 𝑊. In this coloring
of 1, 2, . . . , 𝑝(2𝑝 − 1), there is no 𝑝 + 1-MCAP.
12. We use the number system with base 𝑑 where we shall specify 𝑑 later. Consider
those positive integers up to 𝑛 where every digit is less than 𝑑/2 and the sum of
the squares of digits is a given 𝑞. Show that such a set contains no three-term
arithmetic progression, and we can choose 𝑞 and 𝑑 so that the set should be as
large as required in the exercise.
12.5.
12.6.
1. The precise formulation: Decompose the set of non-negative integers into the dis-
joint union of two arbitrary infinite subsets 𝐼 and 𝐽, and write an integer 𝑛 > 0
𝑉
in the number system with base 𝑐: 𝑛 = ∑𝑣=0 𝛾𝑣 𝑐𝑣 , 0 ≤ 𝛾𝑣 < 𝑐. Let 𝐴 = { 𝑛 ∣
𝛾 𝑖 = 0 for 𝑖 ∈ 𝐼 } and 𝐵 = { 𝑛 ∣ 𝛾𝑗 = 0 for 𝑗 ∈ 𝐽 }. These are complements as ev-
ery positive integer has a representation in the number system with base 𝑐. Every
such construction satisfies lim inf𝑛→∞ 𝐴(𝑛)𝐵(𝑛)/𝑛 = 1 (but we can easily check
lim sup𝑛→∞ 𝐴(𝑛)𝐵(𝑛)/𝑛 > 1).
2. No, this follows from Theorem 12.5.2.
3. (a) Necessary and sufficient. (b) Sufficient, but not necessary, see e.g. the red set
in Exercise 12.4.7b. (c) Necessary, but not sufficient. (d) Neither necessary, nor
sufficient.
4. We can proceed as in the proof of Theorem 12.6.1. Since 𝑎𝑡 ≡ 𝑡 (mod 2𝑖 3𝑗 ) for
𝑖, 𝑗 ≤ 𝑡, the numbers 𝑎𝑘−𝑠 for log6 𝑘 + 1 ≤ 𝑠 ≤ log6 𝑘 + 𝑑𝑘 form a complete residue
system mod 𝑑𝑘 = 2𝑖 3𝑗 if 𝑑𝑘 < 𝑘 − 5 log6 𝑘. We can guarantee the conditions 𝑑𝑘 ∼ 𝑘
and 𝑑𝑘 ≤ 𝑑𝑘+1 (needed to estimate the number of elements), since if we order the
integer 2𝑖 3𝑗 into an increasing sequence, then the quotient of consecutive elements
tends to 1 because the fractional parts of the values log2 (2𝑖 3𝑗 ) are dense in [0, 1] by
Theorem 8.4.1.
If 𝑎𝑘 ≤ 𝑛 < 𝑎𝑘+1 , then 𝑛 = 𝑎𝑘−𝑠 + 𝑟𝑑𝑘 , where 6𝑘 (1 − 1/𝑘) < 𝑟𝑑𝑘 < 6𝑘+1 . Thus,
choosing these values 𝑟𝑑𝑘 into 𝐵, we get a complement of 𝐴. Here 𝐴(𝑛) = 𝑘. Con-
cerning 𝐵(𝑛), we have to find a good estimate for the number of integers 𝑟𝑑𝑗 satis-
fying 𝑘 ≥ 𝑗 ≥ 𝑣 = ⌊𝑘 − 2 log6 𝑘⌋, and use the common denominator 𝑑𝑣 . There are
at most 6𝑣 terms belonging to 𝑗 < 𝑣.
5. Now 𝐴(𝑛) = 𝜋(𝑛) ∼ 𝑛/ log 𝑛, so
𝑛 2 𝑛 2
log 𝑛 log 𝑥 10(log 𝑛)3
𝑆(𝑛) <∼ 10 ∑ ∼ 10 ∫ 𝑑𝑥 ∼ .
𝑖=2
𝑛 2
𝑥 3
6. Apply Theorem 12.6.4. Since (log 𝐴(𝑖))/𝐴(𝑖) → 0, for any 𝜀 > 0 there is an 𝑖0 such
that (log 𝐴(𝑖))/𝐴(𝑖) < 𝜀/20 for 𝑖 ≥ 𝑖0 . Then
𝑛 𝑛
log 𝐴(𝑖) log 𝐴(𝑖) 10𝑛𝜀
𝐵(𝑛) < 10 ∑ < 𝐶 + 10 ∑ <𝐶+ < 𝜀𝑛.
𝑖=𝑎1
𝐴(𝑖) 𝑖=𝑖
𝐴(𝑖) 20
0
Historical Notes
Continuing the historical comments in the text, we give the birth and death dates, na-
tionalities, and some results in number theory for those mathematicians from the past
whose names occurred in the book. This short summary is very subjective for two
reasons. First, it contains only mathematicians who played an important role in the
branches of number theory discussed in this book. Many great practitioners of num-
ber theory are missing. Second, what we mention or praise are not necessarily the most
important results of the mathematicians listed and we say nothing about their activ-
ities in other branches of mathematics. Thus, the summary below is by no means a
valuation of the mathematicians appearing in it, it is just a small supplement adding
some historical background to the number theory material discussed in the book.
Chebyshev, Pafnuti Lvovich, 1821–1894, Russian. He was the first to prove that
there is always a prime between (2 ≤)𝑛 and 2𝑛, and he determined the order of mag-
nitude of the number of primes up to 𝑥. His famous inequality plays an important
role in probability theory and is connected to Turán’s proof of the Hardy–Ramanujan
Theorem, which became a starting point of probabilistic number theory.
Diophantus of Alexandria, lived around 250 CE, Greek. His name is preserved in
algebraic equations with (generally) integer coefficients when also the solutions are
required to be integers (or occasionally, rational numbers), and also in Diophantine
approximation, which plays an important role in the theory of Diophantine equations.
531
532 Historical Notes
Eratosthenes, 276?–194? BCE, Greek. His name is preserved in a sieve method for
finding primes.
Euclid, lived around 300 BCE, Greek. Mathematicians were educated using his mon-
umental work Elements for more than two thousand years. It contains thirteen books,
three of which deal with number theory and contain the formula for even perfect num-
bers and the proof of the infinitude of primes. We still use the Euclidean algorithm to
find the greatest common divisor of large integers.
Fermat, Pierre, 1601–1665, French. Founder of modern number theory (though his
official profession was in law). His famous Last Theorem remained a conjecture for
more than 350 years, during which the attempts to prove it enriched mathematics with
many effective, new methods. Andrew Wiles proved Fermat’s Last Theorem in 1994.
Fermat’s Little Theorem and its generalization by Euler are fundamental in the theory
of congruences. Fermat primes are related to the Euclidean constructibility of regu-
lar polygons. Fermat discovered which numbers can be represented as sums of two
squares and showed that Pell’s equation has infinitely many solutions.
Gauss, Carl Friedrich, 1777–1855, German. Perhaps the greatest and most versa-
tile mathematician of all times. He was just 15 when he conjectured (but could not
prove) the Prime Number Theorem. He published his book Disquisitiones Arithmeticae
in 1801 containing among other things the detailed theory of quadratic congruences.
Gauss introduced the standard notation for congruences and the Gaussian integers,
which served later as a base to the theory of algebraic number fields. He proved the
Three Squares Theorem and the criterion for constructibility of regular polygons.
Historical Notes 533
Hadamard, Jacques, 1865–1963, French. He and de la Vallée Poussin proved first (at
the same time, but independently) the Prime Number Theorem.
Hermite, Charles, 1822–1901, French. He was the first to prove the transcendence of
𝑒 in 1873.
Hilbert, David, 1862–1943, German. In his famous talk at the mathematical congress
in Paris in 1900, he sketched 23 problems of fundamental importance which exerted
a great influence on twentieth century mathematics. Several Hilbert problems are re-
lated to number theory. Hilbert was the first to prove the existence of 𝑔(𝑘) in Waring’s
problem.
Kalmár, László, 1905–1976, Hungarian. His main area of research was mathematical
logic. In number theory, he and Erdős gave a simple proof for the upper bound on the
number of primes up to 𝑥.
Kőnig, Gyula, 1849–1913, Hungarian. His main area was set theory. In number the-
ory, he was the coauthor of the Kőnig–Rados theorem about the solvability and number
of solutions of congruences of higher degree modulo a prime.
Lagrange, Joseph Louis, 1736–1813, French. His proof of the Four Squares Theorem
was a nice contribution to number theory.
Rados, Gusztáv, 1862–1942, Hungarian. In number theory, he was the coauthor of the
Kőnig–Rados theorem about the solvability and number of solutions of congruences of
higher degree modulo a prime.
Ramsey, Frank Plumpton, 1903–1930, English. During his short life, he was equally
excellent as economist, philosopher, and mathematician. He discovered his famous
theorem in graph theory while investigating mathematical logic.
Vallée Poussin independently in 1896. Improving Euler’s ideas, Riemann pointed out
the central significance of the zeta function (that bears his name) in examining the
distribution of primes. The celebrated Riemann Hypothesis about this function is still
unsolved.
Schneider, Theodor, 1911–1988, German. He and Gelfond solved (at the same time,
but independently) Hilbert’s problem about the powers of algebraic numbers with an
irrational algebraic exponent.
Schur, Issai, 1875–1941, German (forced to emigrate by the Nazis being a Jew). His
famous theorem states that coloring a sufficiently large initial segment of the natural
numbers using finitely many colors, the equation 𝑥 + 𝑦 = 𝑧 has a monochromatic
solution.
Schnirelmann, Lev Demidovich, 1905–1938, Russian. Introducing a special notion
for density, he achieved significant results about Goldbach’s conjecture.
Thue, Axel, 1863–1922, Norwegian. He has important achievements in Diophantine
approximation and in the theory of Diophantine equations.
Turán, Paul, 1910–1976, Hungarian. He gave a simple proof of the Hardy–Ramanujan
theorem which argument became a starting point for applications of probability theory
to number theory. He achieved outstanding results in analytic number theory and for
partitions.
Vinogradov, Ivan Matveyevich, 1891–1975, Russian. He proved a slightly weaker
version of the odd Goldbach conjecture that every sufficiently large odd integer is the
sum of three primes. He improved significantly the previous upper bounds on 𝐺(𝑘) in
Waring’s problem.
Waerden, Bartel Leendert van der, 1903–1996, Dutch. He proved that coloring the
natural numbers using finitely many colors there always arise arbitrarily long (finite)
monochromatic arithmetic progressions.
Waring, Edward, 1736–1798, English. He initiated the investigation of representing
integers as sums of 𝑘th powers. This area is called today Waring’s problem.
Wilson, John, 1741–1793, English. His name appears in the theorem about the
residue modulo 𝑝 of (𝑝 − 1)!.
Tables
537
538 Tables
Primes 2–1733
2 127 283 467 661 877 1087 1297 1523
3 131 293 479 673 881 1091 1301 1531
5 137 307 487 677 883 1093 1303 1543
7 139 311 491 683 887 1097 1307 1549
11 149 313 499 691 907 1103 1319 1553
13 151 317 503 701 911 1109 1321 1559
17 157 331 509 709 919 1117 1327 1567
19 163 337 521 719 929 1123 1361 1571
23 167 347 523 727 937 1129 1367 1579
29 173 349 541 733 941 1151 1373 1583
Primes 1741–3907
1741 1993 2221 2437 2689 2909 3187 3433 3659
1747 1997 2237 2441 2693 2917 3191 3449 3671
1753 1999 2239 2447 2699 2927 3203 3457 3673
1759 2003 2243 2459 2707 2939 3209 3461 3677
1777 2011 2251 2467 2711 2953 3217 3463 3691
1783 2017 2267 2473 2713 2957 3221 3467 3697
1787 2027 2269 2477 2719 2963 3229 3469 3701
1789 2029 2273 2503 2729 2969 3251 3491 3709
1801 2039 2281 2521 2731 2971 3253 3499 3719
1811 2053 2287 2531 2741 2999 3257 3511 3727
Prime Factorization
The table below contains the prime factorization of integers less than 1100 and not
divisible by 2, or 3, or 5.
Mersenne Numbers
Mersenne numbers are the integers 𝑀𝑝 = 2𝑝 − 1 where 𝑝 > 0 is a prime. We discuss
them in detail in Section 5.2 where we list the 51 primes of this form known in 2019.
The table contains the prime factorization of Mersenne numbers with exponents
between 10 and 100.
211 − 1 = 23 ⋅ 89
213 − 1 = 8191
217 − 1 = 131071
219 − 1 = 524287
223 − 1 = 47 ⋅ 178481
229 − 1 = 233 ⋅ 1103 ⋅ 2089
231 − 1 = 2147483647
237 − 1 = 223 ⋅ 616318177
241 − 1 = 13367 ⋅ 164511353
243 − 1 = 431 ⋅ 9719 ⋅ 2099863
247 − 1 = 2351 ⋅ 4513 ⋅ 13264529
253 − 1 = 6361 ⋅ 69431 ⋅ 20394401
259 − 1 = 179951 ⋅ 3203431780337
261 − 1 = 2305843009213693951
267 − 1 = 193707721 ⋅ 761838257287
271 − 1 = 228479 ⋅ 48544121 ⋅ 212885833
273 − 1 = 439 ⋅ 2298041 ⋅ 9361973132609
279 − 1 = 2687 ⋅ 202029703 ⋅ 1113491139767
283 − 1 = 167 ⋅ 57912614113275649087721
289 − 1 = 618970019642690137449562111
297 − 1 = 11447 ⋅ 13842607235828485645766393
542 Tables
Fermat Numbers
𝑛
Fermat numbers are the integers 𝐹𝑛 = 22 + 1, where 𝑛 ≥ 0 is an integer. We discuss
them in detail in Section 5.2.
𝐹𝑛 is a prime for 0 ≤ 𝑛 ≤ 4:
𝐹0 = 3, 𝐹1 = 5, 𝐹2 = 17, 𝐹3 = 257, 𝐹4 = 65537.
No primes are known among the Fermat numbers for 𝑛 ≥ 5.
The prime factorizations of 𝐹5 , 𝐹6 , and 𝐹7 are
𝐹5 = 641 ⋅ 6700417
𝐹6 = 274177 ⋅ 67280421310721
𝐹7 = 59649589127497217 ⋅ 5704689200685129054721.
The complete prime factorization of 𝐹𝑛 is known also for 8 ≤ 𝑛 ≤ 11, but for no
greater 𝑛.
𝐹𝑛 is known to be composite for 12 ≤ 𝑛 ≤ 32 and for some greater values of 𝑛.
No non-trivial divisor of 𝐹20 has been determined so far.
We do not know whether 𝐹33 is prime or composite.
Index
We generally indicate the first occurrence only. The data include the typical
notation (if it exists), the serial number of the definition, theorem, etc. ex-
plaining the notion or denomination, and finally the page number in paren-
theses.
D3.2.1 means Definition 3.2.1, and letters T, L, E instead of D refer to the theo-
rem, lemma, and exercise with the given number. P1.3.3 stands for the proof
of Theorem 1.3.3, 9.6.E3 denotes Example 3 in Section 9.6, and 5.8 means
Section 5.8. This latter can mean the entire section or a part of it. In some
cases, there is only a page number pointing directly to the occurence of the
expression in question, e.g. “Diffie–Hellman principle (160)”.
We add a sign “−” or “+” to the number of definition theorem, etc., if the
notion is introduced not in the given definition, theorem, etc., but just before
or after it, resp., without a new serial number. E.g. D1.4.1− indicates at “triv-
ial divisor” that this phrase is explained before Definition 1.4.1. Similarly,
T6.7.3+ shows that we find the meaning of “average order of magnitude” for
the function 𝜎(𝑛) after stating the theorem (still before the proof ), whereas
P9.3.6+ indicates that we can look up “algebraically closed field” after the
proof of Theorem 9.3.6.
We often include also important theorems besides the definition, e.g. for
“𝜎(𝑛)” we refer both to Definition 6.2.1 explaining this function and Theorem
6.2.2 establishing a formula for it. In some other cases, we list the related the-
orems in separate lines, e.g. at “mean value” we enumerate the mean value
theorems for several arithmetic functions.
If an important notion appears in various topics, we generally list all of them,
see e.g. at “unit” and “norm”. (If the notation is the same, we indicate it only
once.)
For information about notation used in the book, please consult part “Tech-
nical details” in the Introduction. We add that as mentioned in another part
of the Introduction, exercises marked with one or two asterisks are consid-
ered hard or extra hard, resp., by our judgement, and a letter S indicates
that a detailed solution can be found online at www.ams.org/bookpages/
amstext-48.
543
544 Index
relative, 𝑓(𝜗 (𝑗) ), D10.4.2 (332), T10.4.3 for Gaussian integers, T7.4.8 (224)
(333) divisors, number of, 𝑑(𝑛), T1.6.3 (29)
continued fraction, 8.3 (275–281) divisors, sum of, 𝜎(𝑛), D6.2.1 (170), T6.2.2
digit, D8.3.1 (275) (170)
convolution, 𝑓 ∗ 𝑔, D6.6.1 (190)
coprime = relatively prime, D1.3.7 (18) 𝑒 is irrational, T9.5.1 (301)
pairwise, D1.3.8 (18) 𝑒 is transcendental, T9.5.3 (303)
covering congruences, 12.5 (408–412) Egyptian fraction, E7.3.6 (222)
disjoint (DCC), E12.5.6 (412) elementary symmetric polynomial, 𝜎𝑗 ,
cryptography, 5.8 (160–165) T9.3.1+ (291)
cryptosystem, public key, 5.8 (160–165) equivalence relation, P2.1.2+ (38)
cyclotomic polynomial Φ𝑚 , P5.3.4 (126) equivalent ideals, D11.6.1 (373)
Eratosthenes, sieve of, T5.1.2 (114)
𝑑(𝑛) = number of (positive) divisors of 𝑛,
Euclidean algorithm, P1.3.3 (16)
T1.6.3 (29)
Euclidean ring, D11.3.4 (353), T11.3.5
𝑑𝑘 (𝑛), D6.2.6 (171), T6.2.7 (171)
(354)
decimal fraction, E3.2.20 (79)
Euler–Fermat Theorem, T2.4.1 (50)
deficient number, E6.3.3 (177)
Eulerian integer, 𝛼 = 𝑎 + 𝑏𝜔, D7.7.4 (244)
deg = degree
Eulerian prime, T7.7.7 (245)
degree of algebraic element, deg 𝜗, D10.1.5
Eulerian rational, 9.6.E3 (306)
(313)
Euler’s function 𝜑, 𝜑(𝑛), D2.2.7 (43), T2.3.1
of algebraic number, deg 𝛼, D9.2.4 (289)
(47)
of field extension, deg(𝑀 ∶ 𝐿), D10.1.2
Euler’s theorem for partitions, T7.9.5 (258)
(311)
even numbers, number theory of, P1.1.3+
of polynomial modulo 𝑚, deg 𝑓, D3.1.1
(8), P1.4.3+ (22), P1.5.1− (24)
(73)
extension = field extension
derivative of a polynomial, 𝑓′ , T3.7.1 (96),
P5.3.4 (126)
Diffie–Hellman principle, (160) 𝐹: denotes a commutative field in general
Diophantine approximation, 8.1 (263–270) 𝐹[𝑥] = ring of polynomials over the field 𝐹
Diophantine equation, T1.3.6− (18) 𝜑(𝑛) = Euler’s function 𝜑, D2.2.7 (43),
linear, T1.3.6 (18), T7.1.1 (212) T2.3.1 (47)
Dirichlet series, 𝐹(𝑠), D6.6.3 (192) factor ring, 𝑅/𝐼, T11.1.6 (344)
Dirichlet’s theorem (on primes in Fermat number, 𝐹𝑛 , 5.2 (118–125)
arithmetic progressions), T5.3.1 (125) primality test for, T5.2.2 (119)
discrete logarithm = index, ind 𝑎, ind𝑔 𝑎, (prime) divisors of, T5.2.1 (119)
D3.4.1 (86) Fermat prime, 𝐹𝑛 , E1.4.4 (23), 5.2
discriminant of 𝐐(𝜗), P10.5.4+ (338) (118–125)
of 𝑛-tuples in 𝐐(𝜗), Δ(𝛼1 , . . . , 𝛼𝑛 ), Fermat’s Last Theorem, T7.7.1 (241)
D10.5.2 (337) for exponent 3, T7.7.10 (247)
disjoint covering congruences (DCC), for exponent 4, T7.7.2 (242)
E12.5.6 (412) Fermat’s Little Theorem, T2.4.1A (50),
divisibility, divisor, 𝑏 ∣ 𝑎, D1.1.1 (7), D7.4.4 T2.4.1B (51)
(224) Fibonacci number, 𝜑𝑛 , E1.2.5 (13)
among Gaussian integers, 𝛽 ∣ 𝛼, D7.4.4 field, 𝐹, T2.8.3+ (69)
(224) algebraically closed, P9.3.6+ (294)
among ideals, 𝐵 ∣ 𝐴, D11.4.3 (359) field extension, 𝑀 ∶ 𝐿, D10.1.1 (311)
among integers, 𝑏 ∣ 𝑎, D1.1.1 (7) degree of, deg(𝑀 ∶ 𝐿), D10.1.2 (311)
divisibility laws, E1.1.14 (10) finite, D10.1.2 (311)
division algorithm (for integers), T1.2.1 quadratic, 𝐐(√𝑡), 10.3 (320–331)
(11), T1.2.1A (12) simple, 𝐐(𝜗), D10.2.1 (315), T10.2.2
in Euclidean rings, D11.3.4 (353) (315)
546 Index
𝑘th power non-residue, D3.5.2 (89) Möbius function, 𝜇(𝑛), D6.2.3 (170)
residue, D3.5.2 (89), T3.5.3 (89) Möbius inversion formula, T6.5.3 (187)
Kőnig–Rados theorem, T3.6.2 (93) multiple, D1.1.1 (7), D7.4.4 (224)
Kronecker’s theorem (for ideals), T11.5.5 least common, [𝑎, 𝑏], lcm{𝑎, 𝑏}, D1.6.5
(366) (30)
multiple roots of polynomials, P5.3.4 (126)
lattice, T8.2.1 (270), L8.2.2 (271) multiplicative arithmetic function, D6.1.2
least absolute value, remainder of, 𝑟, (166)
T1.2.1A+ (12) (completely), D6.1.3 (166)
least common multiple, [𝑎, 𝑏], lcm{𝑎, 𝑏}, multiplicative inverse, T2.8.3− (69)
D1.6.5 (30)
standard form of, T1.6.6 (30) 𝑛!, standard form of (=
least non-negative remainder, 𝑟, P1.2.1+ Legendre’s-formula), T1.6.8 (32)
(11) norm in algebraic number fields, 𝑁(𝛼),
Legendre’s formula = standard form of 𝑛!, D10.4.4 (334)
T1.6.8 (32) in quadratic fields, D10.3.3 (323)
𝑎
Legendre symbol, (𝑝), D4.1.3 (102) of Eulerian integers, D7.7.5 (244)
linear Diophantine equation, 𝑎𝑥 + 𝑏𝑦 = 𝑐, of Gaussian integers, D7.4.2 (223),
T1.3.6 (18), T7.1.1 (212) T7.4.3 (223)
linear congruence, 𝑎𝑥 ≡ 𝑏 (mod 𝑚), of quaternions, P7.5.4+ (232)
D2.5.1 (52), T2.5.3 (53)–T2.5.5 (55) number of ideal classes, T11.6.3 (373)
Liouville’s approximation theorem, T9.4.1 number of solutions of congruences,
(296) D2.5.2 (53)
Liouville number, E9.4.1 (300) number systems, T1.2.2 (12)
lower integer part = floor
Lucas–Lehmer test (for Mersenne 𝜔(𝑛) = number of distinct (positive) prime
numbers), T5.2.4 (122) divisors of 𝑛, D6.2.5 (171)
Ω(𝑛) = number of “all” (positive) prime
𝜇(𝑛) = Möbius function, D6.2.3 (170) divisors of 𝑛
maximal ideal, D11.4.6+ (360) (counted with multiplicity), D6.2.5 (171)
mean value function( = mean value), order (modulo 𝑚), 𝑜(𝑎), 𝑜𝑚 (𝑎), D3.2.1 (76)
D6.7.1 (195) Ore number, E6.3.6 (177)
of 𝑑(𝑛), T6.4.3 (179), T6.4.4 (181)
of 𝜑(𝑛), T6.7.4 (197) 𝑝𝑛 : denotes the 𝑛th prime in general
of 𝜔(𝑛), T6.7.6 (200) 𝑝(𝑛) = number of partitions of 𝑛, D7.9.1
of Ω(𝑛), E6.7.5 (206) (256)
of 𝜎(𝑛), T6.7.3 (196) 𝜋 is irrational, T9.5.2 (302)
measure zero, D8.1.7 (266) 𝜋(𝑥) = number of primes not greater than
Mersenne number, 𝑀𝑝 , 5.2 (118–125) 𝑥, T5.4.1− (128)
primality test for, T5.2.4 (122) lower and upper bounds, T5.4.3 (130)
(prime) divisors of, T5.2.3 (121) pairwise coprime = pairwise relatively
Mersenne prime, 𝑀𝑝 , E1.4.4 (23), 5.2 prime, D1.3.8 (18)
(118–125) partition, D7.9.1 (256)
Miller–Lenstra–Rabin primality test, peak theorem, T6.4.2 (179)
T5.7.5 (156) Pell’s equation, T7.8.1 (251), T7.8.2 (253)
minimal polynomial of algebraic element, Pepin’s test = primality test for Fermat
𝑚𝜗 , D10.1.5 (313) numbers, T5.2.2 (119)
of algebraic number 𝑚𝛼 , D9.2.1 (288) perfect number, D6.3.1 (176), T6.3.2 (176)
Minkowski’s theorem, T8.2.1 (270) polynomial, cyclotomic, Φ𝑚 , P5.3.4 (126)
modulus of congruence,𝑚, D2.1.1+ (37) degree modulo 𝑚 of, D3.1.1 (73)
monochromatic arithmetic progressions, derivative of, 𝑓′ , T3.7.1 (96), P5.3.4 (126)
T12.4.4 (406), T12.4.4A (406) multiple roots of, P5.3.4 (126)
548 Index
The book is suitable for both graduate and undergraduate courses with enough
material to fill two or more semesters and could be used as a source for inde-
pendent study and capstone projects. Freud and Gyarmati are well-known
mathematicians and mathematical educators in Hungary, and the Hungarian
version of this book is legendary there. The authors’ personal pedagogical
style as a facet of the rich Hungarian tradition shines clearly through. It will
inspire and exhilarate readers.
AMSTEXT/48