Ctanujit Classes of Mathematics Statistics & Economics: Study Notes On Number Theory
Ctanujit Classes of Mathematics Statistics & Economics: Study Notes On Number Theory
Ctanujit Classes of Mathematics Statistics & Economics: Study Notes On Number Theory
1 Divisibility
Definition 1.1 An integer b is divisible by an integer a, written a | b, if there is
an integer x such that b = ax. We also say that b is a multiple of a, and that a
is a divisor of b.
Any integer a has ±1 and ±a as divisors. These divisors are called trivial.
The proof of the following simple properties are left to the reader.
Definition 1.3 Every nonzero integer a has finitely many divisors. Conse-
quently, any two integers a and b, not both = 0, have finitely many common
divisors. The greatest of these is called the greatest common divisor and it is
denoted by (a, b).
In order not to have to avoid the special case a = b = 0, we also define (0, 0)
as the number 0. (One good reason for this choice will appear in Theorem 1.9.)
By definition, if at least one of the numbers a and b is nonzero, then
d = (a, b) ⇔ d | a ∧ d | b ∧ (x | a ∧ x | b ⇒ x ≤ d).
Obviously, (b, a) = (a, b) = (−a, b) = (a, −b) = (−a, −b), so when calculat-
ing the greatest common divisor of two numbers we may replace them by their
absolute values.
Example 1 The number 102 has the positive divisors 1, 2, 3, 6, 17, 34, 51, 102,
and the number −170 has the positive divisors 1, 2, 5, 10, 17, 34, 85, and 170.
The common positive divisors are 1, 2, 17, and 34. Hence (102, −170) = 34.
To determine the greatest common divisor by finding all common divisors is
obviously not a feasible method if the given numbers are large.
Example 2 The numbers 4, 6, and 9 are relatively prime but not pairwise
relatively prime.
Theorem 1.5 (The Division Algorithm) Given integers a and b with a > 0 there
exist two unique integers q and r such that b = aq + r and 0 ≤ r < a.
The number q is called the quotient and r is called the (principal) remainder.
Obviously, q = [b/a] (= the greatest integer ≤ b/a).
Proof. Consider the arithmetic progression
Theorem 1.5’ (Modified Division Algorithm) Given integers a and b with a > 0
there exist two unique integers q and r such that b = aq +r and −a/2 < r ≤ a/2.
Example 4 The sets {0}, Z, and {0, ±3, ±6, ±9, . . . } are ideals. More gener-
ally, given any integer g, the set A = {ng | n ∈ Z} consisting of all multiples of
g is an ideal. This ideal is said to be generated by the number g, and it will be
denoted by gZ. Thus, using this notation, 3Z = {0, ±3, ±6, ±9, . . . }.
Note that the trivial ideal {0} is generated by 0 and that the whole set Z is
generated by 1.
1 DIVISIBILITY 3
Proof. Suppose A is a non-empty subset with property (i) of Definition 1.6, and
let x0 be an element of A. Since 0 = x0 − x0 we first note that 0 ∈ A. Then we
see that x ∈ A ⇒ −x = 0 − x ∈ A and that
x, y ∈ A ⇒ x, −y ∈ A ⇒ x + y ∈ A,
Proof. The zero ideal is generated by 0, so assume that A contains some nonzero
integer x0 . Since by (ii), A also contains the number −x0 (= (−1)x0 ), A cer-
tainly contains a positive integer. Let g be the least positive integer belonging
to A.
We will prove that A is generated by the number g. That ng belongs to A
for every integer n follows immediately from (ii), so we only have to prove that
there are no other numbers in A. Therefore, let b ∈ A and divide b by g. By
the division algorithm, there exist integers q and r with 0 ≤ r < g such that
b − qg = r. Since qg ∈ A it follows from (i) that r ∈ A, and since g is the least
positive integer in A, we conclude that r = 0. Hence b = qg as claimed.
We will now use Theorem 1.8 to characterize the greatest common divisor.
Let a and b be two integers and consider the set
A = {ax + by | x, y ∈ Z}.
The set A is clearly closed under subtraction, i.e. A is an ideal, and by the
previous theorem, A is generated by a unique nonnegative number g. This
number has the following two properties:
1 DIVISIBILITY 4
The proof of Theorem 1.9 is easily extended to cover the case of n integers
a1 , a2 , . . . , an instead of two integers a and b. The general result reads as follows.
Corollary 1.10 If c | a and c | b, then c | (a, b), i.e. every common divisor of a
and b is a divisor of the greatest common divisor (a, b).
Proof. By Theorem 1.9 (i) we have ax0 + by0 = (a, b), and the conclusion of the
corollary now follows from Proposition 1.2 (iv).
Proof. (i) Write d = (a, b). By Theorem 1.9, the ideal {ax + by | x, y ∈ Z}
is generated by d. Now cax + cby = c(ax + by), so it follows that the ideal
{cax + cby | x, y ∈ Z} is generated by cd. But the latter ideal is according
to Theorem 1.9 also generated by the number (ca, cb). Since the nonnegative
generator is unique,
we
conclude that (ca, cb) = cd.
a b
(ii) By (i), d , = (a, b) = d. The result now follows upon division
d d
by d.
Proof. Assume (a, b) = 1 and a | bc. Since clearly a | ac, it follows that a is a
common divisor of ac and bc. By Corollary 1.11, (ac, bc) = c(a, b) = c, and the
conclusion a | c now follows from Corollary 1.10.
Example 5 Let us calculate (247, 91). The ordinary division algorithm gives
247 = 2 · 91 + 65
91 = 1 · 65 + 26
65 = 2 · 26 + 13
26 = 2 · 13.
Hence (247, 91) = (91, 65) = (65, 26) = (26, 13) = (13, 0) = 13.
By instead using least absolute remainders, we obtain the following sequence
as a result of the division algorithm:
247 = 3 · 91 − 26
91 = 3 · 26 + 13
26 = 2 · 13.
ax + by = (a, b)
has at least one integer solution x0 and y0 . (We will see later that there are
in fact infinitely many integer solutions.) As a by-product of the Euclidean
Algorithm we have an algorithm for finding such a solution. Denoting the
successive pairs (a0 , b0 ) obtained during the process by (a0 , b0 ), (a1 , b1 ), (a2 , b2 ),
. . . , (an , bn ), with bn = 0, we have
a0 = a, b0 = b
ai = bi−1 , bi = ai−1 − qi bi−1 for suitable integers qi , i = 1, 2, . . . , n
an = (a, b).
Hence, the equation 247x + 91y = (247, 91) has x = 3, y = −8 as one of its
integer solutions.
Example 7 [30, 42]=210, because in the sequence 30, 60, 90, 120, 150, 180,
210, . . . of multiples of 30, the number 210 is the first one that is also a multiple
of 42.
Proposition 1.17 Let a and b be nonnegative integers. Then [a, b] · (a, b) = ab.
2 Prime Numbers
Definition 2.1 An integer > 1 is called a prime number or a prime if it has
only trivial divisors. An integer > 1 which is not a prime is called composite.
Proof. Assume that p | bc but p6 | b. Since p has only trivial divisors, it follows
that (p, b) = 1. Hence p | c by Theorem 1.12.
Theorem 2.2 is easily extended to
Proof. Obvious.
Proof. We will show that given any finite collection of primes p1 , p2 , . . . , pn there
is a prime q which does not belong to the collection. Let N = p1 p2 · · · pn + 1.
By Theorem 2.3, N has a prime factor q (which could be N itself). Since
(N, pj ) = (1, pj ) = 1 for each j whereas (N, q) = q, it follows that q 6= pj for
each j.
2 PRIME NUMBERS 9
On the other hand, there are arbitrarily large gaps in the sequence of primes:
Proposition 2.6 For any natural number k there exist k consecutive composite
numbers.
i.e. N consists of 1 and all positive integers whose prime factorization only uses
the primes p1 , p2 , . . . , pn .
Since the factorization of any number ≤ x only uses primes that are ≤ x,
the set N contains all of the numbers 1, 2, 3, . . . , [x] (= the greatest integer
≤ x). Consequently,
[x] Z [x]+1
X 1 X 1 dt
≥ ≥ = ln([x] + 1) > ln x.
n n=1 n 1 t
n∈N
x2 x3 x2 x2
1
− ln(1 − x) = x + + + · · · ≤ x + (1 + x + x2 + . . . ) = x +
2 3 2 2 1−x
1 1 1
ln(1 − )−1 ≤ + 2 .
p p p
By summing these inequalities for all primes p ≤ x and comparing with (1), we
obtain
X1 X 1
(2) + > ln ln x.
p p2
p≤x p≤x
and by combining this inequality with (2) we obtain the desired result
X1
> ln ln x − 1.
p
p≤x
Lemma 2.8 Z x
X1 π(x) π(u)
= + du.
p x 2 u2
p≤x
n−1
X 1 1 1 1
= k − +n −
pk pk+1 pn x
k=1
n−1 X k−1n
X k n n
= − + −
pk pk pn x
k=1 k=2
n
X 1 π(x)
= − .
pk x
k=1
Theorem 2.9 For any ǫ > 0 and any real number ω, there exists a number
x > ω such that
x
π(x) > (1 − ǫ) .
ln x
Remark. For those who know the definition of lim sup we can state Theorem 2.9 as
π(x)
follows: lim supx→∞ x/ ln x
≥ 1.
Proof. Assume the theorem to be false. Then there is an ǫ > 0 and a real
number ω such that π(x) ≤ (1 − ǫ) lnxx for all x > ω. But then
Z x Z ω Z x Z x
π(u) π(u) π(u) 1
2
du = 2
du + 2
du ≤ C + (1 − ǫ) du
2 u 2 u ω u ω u ln u
= C + (1 − ǫ)(ln ln x − ln ln ω) = D + (1 − ǫ)(ln ln x),
where C and D are constants (depending on ω). Since obviously π(x) < x, it
now follows from Lemma 2.8, that
X1
≤ (1 − ǫ) ln ln x + Constant.
p
p≤x
π(x)
lim = 1.
x→∞ x/ ln x
The proof is too complicated to be given here.
We will now derive heuristically some conclusions from the Prime Number
Theorem. Firstly, it follows that π(x)/x < C/ ln x for some constant C, and
hence the ratio π(x)/x approaches 0 and the ratio (x − π(x))/x approaches 1
as x tends to infinity. Since n − π(n) is the number of composite numbers less
than or equal to n, the ratio (n−π(n))/n represents the proportion of composite
numbers among the first n integers. That this ratio tends to 1 means in a certain
sense that “almost all” positive integers are composite.
On the other hand, primes are not particularly scarce, because the logarithm
function grows very slowly. By the Prime Number Theorem we can use x/ ln x
3 THE LINEAR DIOPHANTINE EQUATION AX+BY=C 12
(1) ax + by = c.
Corollary 3.2 Suppose that (a, b) = 1. Then the linear equation ax + by = c has
integer solutions for all integers c. If x0 , y0 is a solution, then all solutions are
given by
x = x0 + bn, y = y0 − an, n ∈ Z.
Solution 1: The equation is solvable, because (247, 91) = 13 and 13 | 39. Since
91
13 = 7 the equation has an integer solution with 0 ≤ x ≤ 6. Trying x = 0, 1,
2, we find that x = 2 gives the integer value y = −5. Therefore, the general
solution of the equation is x = 2 + 7n, y = −5 − 19n.
Solution 2: In Example 6, section 1, we found that x = 3, y = −8 solves
the equation 247x + 91y = 13. By multiplying this solution by 3, we get the
particular solution x0 = 9, y0 = −24 to our given equation, and the general
solution is x = 9 + 7n, y = −24 − 19n. This parametrization of the solutions
is different from that above, but the set of solutions is of course the same as in
solution no. 1.
Solution 3: The solution above uses the Euclidean algorithm. We will now give
another method, which is more or less equivalent to the Euclidean algorithm,
but the presentation is different. To solve
This equation has smaller coefficients. Note that if x1 and y1 are integers, then
x = x1 and y = y1 − 2x are integers, too. Hence, solving (4) for integer values
is equivalent to solving (3) for integer values.
3 THE LINEAR DIOPHANTINE EQUATION AX+BY=C 14
For linear equations with more than two variables we have the following
result, which follows immediately from Theorem 1.9′ .
The third solution method in Example 1 can easily be adopted to take care
of equations with more than two variables.
4 Congruences
Definition 4.1 Let m be a positive integer. If m | (a − b) then we say that a is
congruent to b modulo m and write a ≡ b (mod m). If m6 | (a − b) then we say
that a is not congruent to b modulo m and write a 6≡ b (mod m).
The numbers in the top row are computed from left to right. If a number
is even, the next number is obtained by dividing it by 2, and if a number is
odd the next one is obtained by subtracting 1. The numbers in the bottom
row are computed from right to left. For instance, 34 = (32 )2 ≡ 92 ≡ 81,
35 = 3 · 34 ≡ 3 · 81 ≡ 243 ≡ 1, 3326 = (3163 )2 ≡ 272 ≡ 3.
For the rest of this section, we fix a positive integer m which we will use as
modulus.
Proposition 4.8 There are exactly m distinct residue classes modulo m, viz. 0,
1, 2, . . . , m − 1.
Proof. According to the division algorithm, there is for each integer a a unique
integer r belonging to the interval [0, m − 1] such that a ≡ r (mod m). Thus,
each residue class a is identical with one of the residue classes 0, 1, 2, . . . , m − 1,
and these are different since i 6≡ j (mod m) if 0 ≤ i < j ≤ m − 1.
Definition 4.9 Chose a number xi from each residue class modulo m. The re-
sulting set of numbers x1 , x2 , . . . , xm is called a complete residue system modulo
m.
Lemma 4.10 If x and y belong to the same residue class modulo m, then
(x, m) = (y, m).
Two numbers a and b give rise to the same residue class modulo m, i.e. a = b,
if and only if a ≡ b (mod m). The following definition is therefore consistent
by virtue of Lemma 4.10.
Definition 4.12 Let φ(m) denote the number of residue classes modulo m that
are relatively prime to m. The function φ is called Euler’s φ-function. Any set
{r1 , r2 , . . . , rφ(m) } of integers obtained by choosing one integer from each of the
residue classes that are relatively prime to m, is called a reduced residue system
modulo m.
4 CONGRUENCES 18
Example 3 The positive integers less than 8 that are relatively prime to 8 are
1, 3, 5, and 7. It follows that φ(8) = 4 and that {1, 3, 5, 7} is a reduced residue
system modulo 8.
Proof. In order to show that the set {ar1 , ar2 , . . . , arm } is a complete residue
system, we just have to check that the elements are chosen from distinct residue
classes, i.e. that i 6= j ⇒ ari 6≡ arj (mod m). But by Proposition 4.5 (ii),
ari ≡ arj (mod m) implies ri ≡ rj (mod m) and hence i = j.
Since (si , m) = 1 and (a, m) = 1, we have (asi , m) = 1 for i = 1, 2, . . . , φ(m)
by Theorem 1.14. Hence as1 , as2 , . . . , asφ(m) are φ(m) numbers belonging to
residue classes that are relatively prime to m, and by the same argument as
above they are chosen from distinct residue classes. It follows that they form a
reduced residue system.
and hence
5 LINEAR CONGRUENCES 19
φ(m) φ(m)
Y Y
aφ(m) sj ≡ si (mod m).
j=1 i=1
Since (si , m) = 1, we can use Proposition 4.5 (ii) repeatedly to cancel the si ,
and we obtain aφ(m) ≡ 1 (mod m).
Proof. If p6 | a, then (a, p)=1. Since φ(p) = p − 1 by Example 4, the first part
now follows immediately from Euler’s theorem. By multiplying the congruence
by a, we note that ap ≡ a (mod p), and this obvioulsy holds also in the case
a ≡ 0 (mod p).
5 Linear Congruences
The congruence
(1) ax ≡ b (mod m)
(2) ax − my = b
ax ≡ b (mod m)
Note that the existence of a solution in Corollories 5.2 and 5.3 can also be
deduced from Euler’s theorem. By taking x0 = aφ(m)−1 and x1 = bx0 we obtain
ax0 = aφ(m) ≡ 1 (mod m) and ax1 = bax0 ≡ b (mod m).
However, in order to solve the congruence (1) it is usually more efficient to
solve the equivalent equation (2) using the methods from section 3. Another
possibility is to replace the congruence (1) by a congruence with a smaller
modulus and then reduce the coefficients in the following way:
In (1) we can replace the numbers a and b with congruent numbers in the
interval [0, m − 1], or still better in the interval [−m/2, m/2]. Assuming this
done, we can now write equation (2) as
(3) my ≡ −b (mod a)
with a module a that is less than the module m in (1). If y = y0 solves (3), then
my0 + b
x=
a
is a solution to (1). Of course, the whole procedure can be iterated again and
again until finally a congruence of the form z ≡ c (mod n) is obtained.
Solution: Since 2 divides the numbers 296, 176, and 114, we start by replacing
(4) with the following equivalent congruence:
Now, reduce 148 and 88 modulo 57. Since 148 ≡ −23 and 88 ≡ −26, we can
replace (5) with
Concluding remarks. These remarks are intended for readers who are familiar with
elementary group theory.
Let Z∗m denote the set of all residue classes modulo m that are relatively prime
to the module m. We can equip Z∗m with a multiplication operation by defining the
product of two residue classes as follows:
a · b = ab.
For this definition to be well behaved it is of course necessary that the residue class ab
be dependent on the residue classes a and b only, and not on the particular numbers
a and b chosen to represent them, and that ab belong to Z∗m . However, this follows
from Proposition 4.3 (ii) and Theorem 1.14.
The multiplication on Z∗m is obviously associative and commutative, and there is
an identity element, namely the class 1. Moreover, it follows from Corollary 5.2 that
the equation a · x = 1 has a unique solution x ∈ Z∗m for each a ∈ Z∗m . Thus, each
element in Z∗m has a unique multiplicative inverse.
This shows that Z∗m is a finite abelian (commutative) group. The order of the
group (i.e. the number of elements in the group) equals φ(m), by definition of the
Euler φ-function.
One of the first theorems encountered when studying groups reads: If n is the
order of a finite group with identity element e, then an = e for every element a in the
group. Applying this result to the group Z∗m , we recover Euler’s theorem, since the
statement
a φ(m) = 1
is just another way of saying that
aφ(m) ≡ 1 (mod m)
where the moduli m1 , m2 and m3 are pairwise relatively prime. As shown above,
we can replace the first two congruences with an equivalent congruence of the
form x ≡ x0 (mod m1 m2 ), and hence the whole system (1) is equivalent to a
system of the form
(
x ≡ x0 (mod m1 m2 )
(2)
x ≡ a3 (mod m3 ).
x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
(3) ..
.
x ≡ ar (mod mr )
Proof. We will give a second proof of the theorem and also derive a formula for
the solution.
Let for each j = 1, 2, . . . , r, δj be an integer satisfying
(
1 (mod mj )
δj ≡
0 (mod mi ), if i 6= j.
Then obviously
r
X
(4) x= δj a j
j=1
m
The numbers δj = bj will now clearly have the desired properties.
mj
This proves the existence of a solution x to (3). To prove that the solution
is unique modulo m, suppose x′ is another solution. Then x ≡ x′ (mod mj )
holds for j = 1, 2, . . . , r, and it follows from Proposition 4.6 that x ≡ x′
(mod m1 m2 · · · mr ).
Formula (4) is particularly useful when we are to solve several systems (3)
with the same moduli but with different right hand members a1 , a2 , . . . , ar .
Solution 1: Using the method in our first proof of the Chinese Remainder
Theorem, we replace the first congruence by x = 1 + 3y. Substituting this
into the second congruence we obtain 3y + 1 ≡ 2 (mod 4) or 3y ≡ 1 (mod 4).
This congruence has the solutions y ≡ −1 (mod 4), i.e. y = −1 + 4z. Hence,
x = −2 + 12z, and substituting this into the last congruence we end up in the
congruence 12z − 2 ≡ 3 (mod 5) or 12z ≡ 5 ≡ 0 (mod 5). This congruence has
the unique solution z ≡ 0 (mod 5), that is z = 5t and x = −2 + 60t. Hence, the
system has the unique solution x ≡ −2 (mod 60).
Solution 2: Let us instead use the method of the second proof. Then we have
first to find numbers b1 , b2 , and b3 such that
A map between two sets with the same number of elements is a bijection if
and only if it is surjective. But surjectivity of the map τ follows immediately
from the Chinese Remainder Theorem, because given (x1 , x2 ) ∈ C(m1 ) × C(m2 ),
there is a (unique) x ∈ C(m) such that x ≡ x1 (mod m1 ) and x ≡ x2 (mod m2 ),
which amounts to saying that τ (x) = (x1 , x2 ).
We will next identify the image τ (R(m)) of the reduced residue system R(m)
under the map τ . Since
and
x ≡ xj (mod mj ) ⇒ ((x, mj ) = 1 ⇔ (xj , mj ) = 1)
it follows that x ∈ R(m) ⇔ τ (x) ∈ R(m1 ) × R(m2 ). Thus, τ maps the set
R(m) bijectively onto the Cartesian product R(m1 ) × R(m2 ). The former set
has φ(m) elements and the latter has φ(m1 )φ(m2 ) elements. Since the two sets
must have the same number of elements, we have proved the following important
theorem about Euler’s φ-function.
f1 (x) ≡ 0 (mod m1 )
f2 (x) ≡ 0 (mod m2 )
..
.
fr (x) ≡ 0 (mod mr )
x ≡ a1 (mod m1 )
x ≡ a2 (mod m2 )
..
.
x ≡ ar (mod mr )
by defining
τ (x) = (x1 , x2 , . . . , xr ),
where each xj ∈ C(mj ) is a number satisfying the congruence xj ≡ x (mod mj ).
6 THE CHINESE REMAINDER THEOREM 26
We use the solution formula (4) obtained in the proof of the Chinese Remainder
Theorem. Thus, we determine b1 and b2 such that
42 42
b1 ≡ 1 (mod 7) and b2 ≡ 1 (mod 6).
7 6
We easily find that b1 = −1 and b2 = 1 solve these congruences, and hence we
can take δ1 = −6 and δ2 = 7. We conclude that four different solutions modulo
42 of our original system are
x1 = −6 · 2 + 7 · (−1) = −19 ≡ 23
x2 = −6 · 2 + 7 · 2 = 2
x3 = −6 · (−3) + 7 · (−1) = 11
x4 = −6 · (−3) + 7 · 2 = 32.
Theorem 6.5 Let f (x) be an integral polynomial. For each positive integer m,
let X(m) denote a complete set of roots modulo m of the polynomial congruence