Number Theory
Number Theory
Chapter 1
Ex 1.1 Let a and b be nonzero integers. We can find nonzero integers q and r such
that a = qb + r where 0 ≤ r < b. Prove that (a, b) = (b, r).
∀d ∈ Z, (d | b, d | r) ⇐⇒ (d | a, d | b).
If a = bq + r, the set of common divisors of a, b is equal to the set of common divisors
of b, r.
As a ∧ b is the smallest positive element of this set, so is b ∧ r, we conclude that
a ∧ b = b ∧ r.
a = bq + r, 0≤r<b
b = q1 r + r1 , 0 ≤ r1 < r
r = q2 r1 + r2 , 0 ≤ r2 < r1
..
.
rk−1 = qk+1 rk + rk+1 , 0 ≤ rk+1 < rk
rk = qk+2 rk+1
Then rk+1 = (a, b). This process of finding (a, b) is known as the Euclidian algorithm.
b ∧ r = r ∧ r1 .
1
Let N ∈ N. While the remainders ri , i ≤ N , are not equal to 0, we can define the
sequences (qi ), (ri ) by
a = bq + r, 0≤r<b
b = q1 r + r1 , 0 ≤ r1 < r
r = q2 r1 + r2 , 0 ≤ r2 < r1
..
.
rk−1 = qk+1 rk + rk+1 , 0 ≤ rk+1 < rk
rk = qk+2 rk+1 , rk+2 = 0
2
So 187 ∧ 221 = 17.
With the same instructions, we obtain
314 ∧ 159 = 1.
The Python script which gives the gcd is very concise :
def gcd(a,b):
a, b = abs(a), abs(b)
while b != 0:
a, b = b, a % b
return a
Ex 1.4 Let d = (a, b). Show how one can use the Euclidean algorithm to find numbers
m and n such that am + bn = d.(Hint: In Exercise 2 we have that d = rk+1 . Express
rk+1 in terms of rk and rk+1 , then in terms of rk−1 and rk−2 , etc.).
Proof. With a slight modification of the notations of exercise 2, we note the Euclid’s
algorithm under the form
r0 = a, r1 = b, ri = ri+1 qi+1 +ri+2 , 0 < ri+2 < ri+1 , 0 ≤ i < k, rk = qk+1 rk+1 , rk+2 = 0
3
• Suppose for 0 ≤ i < k the induction hypothesis P (i) et P (i + 1) :
ri = ami + bni , mi , ni ∈ Z,
ri+1 = ami+1 + bni+1 , mi+1 , ni+1 ∈ Z.
Then ri+2 = ri − ri+1 qi+1 = a(mi − qi+1 mi+1 ) + b(ni − qi+1 ni+1 ).
If we define mi+1 = mi − qi+1 mi+1 , ni+1 = ni − qi+1 ni+1 , we obtain ri+2 = ami+2 +
bni+2 , mi+2 , ni+2 ∈ Z, so P (i + 2).
• The conclusion is that P (i) is true for all i, 0 ≤ i ≤ k + 1, in particular rk+1 =
amk+1 + bnk+1 , that is
a ∧ b = d = am + bn,
where m = mk+1 , n = nk+1 ∈ Z.
Proof. From exercises 1.3, 1.4, we know that the sequences (ri ), (mi ), (ni ) are given by
r0 = a, r1 = b
m0 = 1, m1 = 0
n0 = 0, n1 = 1
4
So
17 = 187 ∧ 221 = 6 × 187 − 5 × 221.
Similarly
17 = 6188 ∧ 4709 = 121 × 6188 − 159 × 4709.
1 = 314 ∧ 159 = −40 × 314 + 79 × 159.
We obtain the same results with the following Python script :
def bezout(a,b):
"""input : entiers a,b
output : tuple (x,y,d),
(x,y) solution de ax+by = d, d = pgcd(a,b)
"""
(r0,r1)=(a,b)
(u0,v0) = (1,0)
(u1,v1) = (0,1)
while r1 != 0:
q = r0 // r1
(r2,u2,v2) = (r0 - q*r1,u0 - q*u1,v0 - q*v1)
(r0,r1) = (r1,r2)
(u0,u1) = (u1,u2)
(v0,v1) = (v1,v2)
return (u0,v0,r0)
Proof. Let d = a ∧ b.
• If ax + by = c, x, y ∈ Z, as d | a, d | b, d | ax + by = c.
• Conversely, if d | c, then c = dc′ , c′ ∈ Z.
From Prop. 1.3.2., dZ = aZ + bZ, so d = au + bv, u, v ∈ Z, and c = dc′ =
a(c u) + b(c′ v) = ax + by, where x = c′ u, y = c′ v are integers.
′
Conclusion :
∃(x, y) ∈ Z × Z, ax + by = c ⇐⇒ a ∧ b | c.
Ex 1.7 Let d = (a, b) and a = da′ and b = db′ . Show that (a′ , b′ ) = 1.
Proof. Suppose d ̸= 0 (if d = 0, then a = b = 0, and a′ , b′ are any numbers in Z and the
result may be false, so we must suppose d ̸= 0).
As d = am+bn, m, n ∈ Z, d = d(a′ m+b′ n), so 1 = a′ m+b′ n, which proves a′ ∧b′ = 1.
Conclusion : if d = a ∧ b ̸= 0, and a = da′ , b = db′ , then a′ ∧ b′ = 1.
5
Ex. 1.8 Let x0 and y0 be a solution to ax + by = c. Show that all solutions have the
form x = x0 + t(b/d), y = y0 − t(a/d), where d = (a, b) and t ∈ Z.
Proof. Suppose a ̸= 0, b ̸= 0.
Let x0 and y0 be a solution to ax + by = c.
If (x, y) is any solution of the same equation,
ax + by = c
ax0 + by0 = c,
then
a(x − x0 ) = −b(y − y0 ),
so
a b
(x − x0 ) = − (y − y0 ).
d d
Let a′ = a/d, b′ = b/d : from ex. 1.7, we know that a′ ∧ b′ = 1.
As a′ (x − x0 ) = −b′ (y − y0 ), b′ | a′ (x − x0 ), and b′ ∧ a′ = 1, so (Gauss’ Lemma : prop.
1.1.1) b′ | x − x0 .
There exists t ∈ Z such that x − x0 = tb′ . Then a′ tb′ = −b′ (y − y0 ). As b ̸= 0, b′ ̸= 0,
so a′ t = −(y − y0 ) :
x = x0 + t(b/d)
y = y0 − t(a/d)
ax + by = c ⇐⇒ ∃t ∈ Z, x = x0 + t(b/d), y = y0 − t(a/d).
Ex. 1.9 Suppose that u, v ∈ Z and that (u, v) = 1. If u | n and v | n, show that uv | n.
Show that this is false if (u, v) ̸= 1.
6
Ex. 1.12 Suppose that we take several copies of a regular polygon and try to fit them
evenly about a common vertex. Prove that the only possibilities are six equilateral trian-
gles, four squares, and three hexagons.
Proof. Let n be the number of sides of the regular polygon, m the number of sides
starting from a summit in the lattice, α the measure of the exterior angle, β the measure
of the interior angle (in radians) (α + β = π).
Then α = 2π/n, β = π − 2π/n.
mβ = 2π, m(π − 2π/n) = 2π, m(1 − 2/n) = 2, so
1 1 1
+ = , m > 0, n > 0. (1)
m n 2
As this equation is symmetric in m, n, we may suppose first m ≤ n.
In this case 1/m ≥ 1/n, so 2/n ≤ 1/2 : n ≥ 4.
If n > 6, 1/n < 1/6, 1/m = 1/2 − 1/n > 1/2 − 1/6 = 1/3, so m < 3, m ≤ 2 : m = 1
or m = 2.
If m = 1, n < 0 : it is impossible. If m = 2, 1/n = 0 : also impossible. Therefore
n ≤ 6 : 4 ≤ n ≤ 5. If n = 4, m = 4. if n = 5, n = 10/3 : impossible. if n = 6, m = 3.
Using the symmetry, the set of solutions of (1) is
corresponding with the usual lattices composed of equilateral triangles, squares or hexagons.
n1 Z + · · · + ns Z = d Z (d ≥ 0).
We define
d = gcd(n1 , . . . , ns ) ⇐⇒
(i) d ≥ 0 (3)
(ii) d | n1 , . . . , d | ns (4)
(iii) ∀δ ∈ Z, (δ | n1 , . . . , δ | ns ) ⇒ δ | d (5)
7
As Z is a principal ring, there exists δ ≥ 0 such that n1 Z + · · · + ns Z = δ Z. ni ∈
n1 Z+· · ·+ns Z so ni ∈ δZ, i = 1, . . . , s : δ | n1 , . . . , δ | ns . From (iii), we deduce δ | d. As
δZ ⊂ dZ, d | δ, with d ≥ 0, δ ≥ 0. Consequently, d = δ and n1 Z + · · · + ns Z = d Z, d ≥ 0,
so d = gcd(n1 , . . . , ns ).
At last, as n1 Z + · · · + ns Z = d Z, there exist integers m1 , m2 , . . . , ms such that
n1 m1 + n2 m2 + · · · + ns ms = d.
Proof. Let a1 , a2 , . . . , ar ∈ Z.
Note gcd(a1 , a2 , . . . , ar ) = a1 ∧ a2 ∧ · · · ∧ ar . The following result generalizes Ex. 6 :
∃(x1 , x2 , . . . , xr ) ∈ Zr , a1 x1 + a2 x2 + · · · + ar xr = c ⇐⇒ a1 ∧ a2 ∧ · · · ∧ ar | c.
Let d = a1 ∧ a2 ∧ · · · ∧ ar .
• If a1 x1 + a2 x2 + · · · + ar xr = c, as d | a1 , . . . , d | ar , d | a1 x1 + a2 x2 + · · · + ar xr = c.
• Conversely, if d | c, then c = dc′ , c′ ∈ Z.
As dZ = a1 Z+a2 Z+· · ·+ar Z, so d = a1 m1 +a2 m2 +· · ·+ar mr , m1 , m2 , . . . , mr ∈ Z.
c = dc′ = a1 (m1 c′ ) + · · · ar (mr c′ ) = a1 x1 + · · · + ar xr , where xi = mi c′ , i = 1, 2, . . . , r.
Ex. 1.15 Prove that a ∈ Z is the square of another integer iff ordp (a) is even for all
primes p. Give a generalization.
Proof. Suppose a = b2 , b ∈ Z. Then ordp (a) = 2 ordp (b) is even for all primes p.
Conversely, Qsuppose that ordp (a) is even for all primes p. We must also suppose
a > 0. Let a = pa(p ) the decomposition of a in primes. As a(p) is even, a(p) = 2b(p)
p
for an integer b(p) function of the prime p. Let b = pb(p) . Then a = b2 .
Q
p
With a similar proof, we obtain the following generalization for each integer a ∈
Z, a > 0 :
a = bn for an integer b ∈ Z iff n | ordp (a) for all primes p.
Ex. 1.16 If (u, v) = 1 and uv = a2 , show that both u and v are squares.
Ex. 1.17 Prove that the square root of 2 is irrational, i.e., that there is no rational
number r = a/b such that r2 = 2.
Proof. Suppose that there exists some r ∈ Q, r > 0, such that r2 = 2. Then r = a/b, a ∈
N∗ , b ∈ N∗ . With d = a ∧ b, a = da′ , b = db′ , a′ ∧ b′ = 1, so r = a′ /b′ , a′ ∧ b′ = 1, so we
may suppose r = a/b, a > 0, b > 0, a ∧ b = 1 and a2 = 2b2 .
a2 is even, then a is even (indeed, if a is odd, a = 2k + 1, k ∈ Z, a2 = 4k 2 + 4k + 1 =
2(2k 2 + 2k) + 1 is odd).
So a = 2A, A ∈ N, then 4A2 = 2b2 , 2A2 = b2 .
8
With the same reasoning, b2 is even, then b is even, so b = 2B, B ∈ N. Thus 2 | a, 2 | b,
2 | a ∧ b, in contradiction
√ with a ∧ b = 1.
Conclusion : 2 is irrational.
√
n
Ex. 1.18 Prove that m is irrational if m is not the n-th power of an integer.
Proof. Here m ∈ N.
√
Suppose that r = n m ∈ Q. As r ≥ 0, r = a/b, a ≥ 0, b > 0, a ∧ b = 1. Moreover
rn = m, thus an = mbn .
For every prime p, n ordp (a) = ordp (m) + n ordp (b), so n | ordp (m).
From Ex. 1.15, we conclude that m is a n-th power.
√
Conclusion : if m ≥ 0 is not the n-th power of an integer, n m is irrational.
Ex. 1.19 Define the least common multiple of two integers a and b to be an integer m
such that a | m, b | m, and m divides every common multiple of a and b. Show that such
an m exists. It is determined up to sign. We shall denote it by [a, b].
m = [a, b] ⇐⇒ aZ ∩ bZ = mZ and m ≥ 0.
m = a ∨ b ⇐⇒
(i) m ≥ 0
(ii) a | m, b | m
(iii) ∀µ ∈ Z, (a | µ, b | µ) ⇒ m | µ
Proof.
pa(p) , b = ε′ pb(p) , ε, ε′ = ±1, and
Q Q
(a) Let a = ε
p p
Y
m= pmax(a(p),b(p)) .
p
Then
9
(i) m ≥ 0.
(ii) As a(p) ≤ Q max(a(p), b(p)), pa(p) | pmax(a(p),b(p)) , so a | m. Similarly, b | m.
(iii) If µ = ε ′′ pc(p) is a common multiple of a and b, then for all primes p, a(p) ≤
p
c(p), b(p) ≤ c(p), so max(a(p), b(p)) ≤ c(p), so m | µ. Since m verifies the characterization
of lcm, we obtain
Therefore ordp [a, b] = max(ordp (a), ordp (b)).
(b) Similarly, we prove that Y
a∧b= pmin(a(p),b(p)) .
p
(a ∨ b)(a ∧ b) = |ab|.
a = da′ , b = db′ , a′ ∧ b′ = 1.
δ | d(a′ + b′ ),
δ | da′ b′ .
δ | db′2
δ | da′2
(a + b) ∧ (a ∨ b) = a ∧ b.
10
Ex. 1.21 Prove that ordp (a + b) ≥ min(ordp a, ordp b) with equality holding if ordp a ̸=
ordp b.
Proof. As a ∧ b | a + b, ordp (a ∧ b) ≤ ordp (a + b), so min(ordp (a), ordp (b)) ≤ ordp (a + b).
Suppose ordp (a) ̸= ordp (b),The problem being symmetric in a, b, we may suppose
α = ordp (a) < β = ordp (b). So there exist q, r ∈ Z such that
a = pα q, p ∤ q
b = pβ r, p ∤ r α < β.
Ex. 1.22 Almost all the previous exercises remain valid if instead of the ring Z we
consider the ring k[x]. Indeed, in most we can consider any Euclidean domain. Convince
yourself of this fact. For simplicity we shall continue to work in Z.
Proof. We can adapt all the preceding proofs to the Euclidean domain k[x]. The only
difference is that the units in Z are ±1, and the units in k[x] are the elements of k ∗ .
Using Ex. 1.16, we see that (c + b)/2 and (c − b)/2 are squares : there exist u, v such
that
c − b = 2u2 , c + b = 2v 2 , u ∧ v = 1.
11
(a/2)2 = u2 v 2 , and we can choose the signs of u, v such that a = 2uv. Then b =
v 2 − u2 , c = v 2 + u2 . There exists λ ∈ Z (λ = d) such that x = 2λuv, y = λ(v 2 − u2 ), z =
λ(v 2 + u2 ).
Conversely, if λ, u, v are any integers, (2λuv)2 + (λ(v 2 − u2 )2 = λ2 (4u2 v 2 + v 4 + u4 −
2u v 2 ) = λ2 (v 4 + u4 + 2u2 v 2 ) = (λ(u2 + v 2 ))2 .
2
Conclusion : if x, y, z ∈ Z,
x2 + y 2 = z 2 ⇐⇒ ∃λ ∈ Z, ∃(u, v) ∈ Z2 , u ∧ v = 1,
x = λ(v 2 − u2 )
x = 2λuv
y = λ(v − u )2 2 or y = 2λuv
z = λ(v + u )2 2
z = λ(v 2 + u2 )
Then
n−1
X n−1
X
xS = xn−i y i = xn + xn−i y i
i=0 i=1
n−1
X n
X
yS = xn−1−i y i+1 = xn−j y j (j = i + 1)
i=0 j=1
n−1
X
n
=y + xn−i y i .
i=1
So xS − yS = xn − y n ,
n−1
X
n n
x − y = (x − y) xn−1−i y i = (x − y)(xn−1 + xn−2 y + · · · + xn−1−i y i + · · · + y n−1 ).
i=0
b) If we substitute −y by y, we obtain
n−1
X
xn − (−1)n y n = (x + y) (−1)i xn−1−i y i .
i=0
If n is odd,
n−1
X
n n
x +y = (x+y) (−1)i xn−1−i y i = (x+y)(xn−1 −xn−2 y+· · ·+(−1)i xn−1−i y i +· · ·+y n−1 ).
i=0
12
Ex. 1.25 If an − 1 is a prime, show that a = 2 and that n is a prime. Primes of the
form 2p − 1 are called Mersenne primes. For example, 23 − 1 = 7 and 25 − 1 = 31. It is
not known if there are infinitely many Mersenne primes.
Ex. 1.26 If an + 1 is a prime, show that a is even and that n is a power of 2. Primes
t 1 2
of the form 22 + 1 are called Fermat primes. For example, 22 + 1 = 5 and 22 + 1 = 17.
It is not known if there are infinitely many Fermat primes.
t t
So 1 < a2 + 1 < an + 1, and a2 + 1 is a non trivial factor of an + 1, in contradiction
with the hypothesis.
Conclusion : if an + 1 is a prime (a > 1, n > 1), a is even and n is a power of 2.
As k or k + 1 is even, 8 | n2 − 1.
(n − 1)n(n + 1) = n(n2 − 1), product of three consecutive numbers, is a multiple of 3.
As 3 ∤ n, and 3 is a prime, 3 ∧ n = 1, so 3 | n2 − 1.
3 ∤ n ⇒ 3 | n2 − 1.
13
Ex. 1.28 For all n show that 30 | n5 − n and that 42 | n7 − n.
Proof. If we want to avoid Fermat’s Little Theorem (Prop. 3.3.2. Corollary 2 P. 33),
note that
5 | n5 − n.
Moreover,
7 | n7 − n.
Moreover
1 1 1
Ex. 1.30 Prove that Hn = 2 + 3 + ... +
is not an integer.
n
14
Indeed, each i such that 2 ≤ i ≤ n can be written with the form i = 2t q, 2 ∤ q. Then
i = 2t q ≤ n < 2s+1 , so 2t < 2s+1 , t < s + 1, t ≤ s, which proves
So
2k−s Q Q
Hn = k
= s ,
2 R 2 R
where Q, R are odd integers. Hn is a quotient of an odd integer by an even integer: Hn
is never an integer.
λ(αβ) = λ(α)λ(β).
Ex. 1.33 Show that α ∈ Z[i] is a unit iff λ(α) = 1. Deduce that 1, -1, i, and - i are
the only units in Z[i].
15
Ex. 1.34 Show that 3 is divisible by (1 − ω)2 in Z[ω].
Proof. As ω 3 = 1, ω = ω 2 , and 1 + ω + ω 2 = 0, so
|1 − ω|2 = (1 − ω)(1 − ω 2 ) = 1 + ω 3 − ω − ω 2 = 3, therefore
3 = (1 − ω)(1 − ω 2 ).
Consequently,
αα = (a + bω)(a + bω 2 )
= a2 + b2 + ab(ω + ω 2 )
= a2 + b2 − ab
= λ(α)
λ(α) = 1 ⇐⇒ a2 − ab + b2 = 1
⇐⇒ (2a − b)2 + 3b2 = 4
3b2 ≤ 4, so b = 0 or b = ±1.
If b = 0, then a = ±1, α = 1 or α = −1
If b = 1, then (2a − 1)2 = 1, 2a − 1 = ±1 : a = 0 or a = 1, α = ω or α = 1 + ω = −ω 2 .
If b = −1, then (2a + 1)2 = 1, 2a + 1 = ±1 : a = 0 or a = −1, α = −ω or
α = −1 − ω = ω 2 .
So
λ(α) = 1 ⇐⇒ α ∈ {1, ω, ω 2 , −1, −ω, −ω 2 }.
The set of units of Z[ω] is the group of the roots of x6 − 1.
√ √
Ex. 1.36 Define Z[ −2] √ as the set of all complex numbers of the form a + b√−2,
where a, b ∈ Z. Show that 2 2
√ Z[ −2] is a ring. Define λ(α) = a + 2b for α = a + b −2.
Use λ to show that Z[ −2] is a Euclidean domain.
16
√ √ √
Proof. Note −2√= i 2, and A √ = Z[ −2].
Let α = a +√b −2, β = c + d −2 ∈ A :
• 1 = 1 + 0 −2 √ ∈ A. √ √
• α − β = (a +√b −2) − (c √ + d −2) = (a − c) + (b − d)√ −2 ∈ A.
• αβ = (a + b −2)(c + d −2) = (ac √ − 2bd) + (ad + bc) −2 ∈ A.
√ of (C, +, ×) : Z[ −2] is a ring.
So A is a subring
Let z = a + b −2 be any complex number, and define integers a0 , b0 ∈ Z such that
|a − a0 | ≤ 1/2,
|b − b0 | ≤ 1/2 (it
√ suffice to take for a0 the nearest integer of a, that is
1
a0 = a + 2 ). Let z0 = a0 + b0 −2.
As λ(z) = zz = a2 + 2b2 , then
1 1 3
λ(z − z0 ) = (a − a0 )2 + 2(b − b0 )2 ≤ + 2 × = < 1.
4 4 4
Conclusion : for any z ∈ C, there exists z0 ∈ A such that λ(z − z0 ) < 1.
Let (z1 , z2 ) ∈ A × A, z2 ̸= 0. We apply the preceding result to the complex z1 /z2 :
there exists q ∈ A such that zz12 − q ≤ 1. Let r = z1 − qz2 . Then z1 = qz2 + r, λ(r) <
λ(z2 ). √
So Z[ −2] is a Euclidean domain.
√
Ex. 1.37 Show that the only units in Z[ −2] are 1 and −1.
√
Proof. As in Ex. 35, we prove that α = a + b −2 is an unit if and only if λ(α) = 1, i.e.
a2 + 2b2 = 1. As 2b2 ≤ 1, b = 0, and a2 = 1. So the only units are 1 and −1.
Ex. 1.38 Suppose that π ∈ Z[i] and that λ(π) = p is a prime in Z. √Show that π is a
prime in Z[i]. Show that the corresponding result holds in Z[ω] and Z[ −2].
Ex. 1.39 Show that in any integral domain a prime element is irreducible.
17
Chapter 2
Ex 2.1 Show that k[x], with k a finite field, has infinitely many irreducible polynomi-
als.
Proof. Suppose that the set S of irreducible polynomials is finite : S = {P1 , P2 , . . . , Pn }.
Let Q = P1 P2 · · · Pn + 1. As S contains the polynomials x − a, a ∈ k, deg(Q) ≥
q = |k| > 1. Thus Q is divisible by an irreducible polynomial. As S contains all the
irreducible polynomials, there exists i, 1 ≤ i ≤ n, such that Pi | Q = P1 P2 · · · Pn + 1, so
Pi | 1, and Pi is an unit, in contradiction with the irreducibility of Pi .
Conclusion: k[x] has infinitely many irreducible polynomials. As each polynomial
has only a finite number of associates, there exist infinitely many monic irreducible
polynomials.
Ex. 2.2. Let p1 , p2 , . . . , pt ∈ Z be primes and consider the set of all rational numbers
r = a/b, a, b ∈ Z, such that ordpi a ≥ ordpi b for i = 1, 2, . . . , t. Show that this set is a
ring and that up to taking associates p1 , p2 , . . . , pt are the only primes.
Proof. Let R the set of such rationals. Simplifying these fractions, we obtain
p
r ∈ R ⇐⇒ ∃p ∈ Z, ∃q ∈ Z \ {0}, r = , q ∧ p1 p2 · · · pt = 1.
q
• 1 = 1/1 ∈ R.
• if r, r′ ∈ R, r = p/q, r′ = p′ /q ′ , with q ∧ p1 p2 · · · pt = 1, q ′ ∧ p1 p2 · · · pt = 1. then
′ −qp′ ′
qq ′ ∧ p1 p2 · · · pt = 1, and r − r′ = pq qq ′ , rr′ = pp ′ ′
qq ′ , so r − r , rr ∈ R.
Thus R is a subring of Q.
If r = a/b ∈ R is an unit of R, then b/a ∈ R, so ordpi a = ordpi (b), i = 1, . . . , t. After
simplification, r = p/q, with p ∧ p1 · · · pt = 1, q ∧ p1 · · · pt = 1, and such rationals are all
units.
Note that pi , 1 ≤ i ≤ t, is a prime: if pi | rs in R, where r = a/b, s = c/d ∈ R, then
there exists u = e/f ∈ R such that rs = pi u, with b, d, f relatively prime with p1 , . . . , pt .
Then acf = pi bde. As pi ∧ f = 1, pi divides a or c in Z, so pi divides r or s in R.
If r = a/b ∈ R, with b ∧ p1 · · · pr = 1, a = pk11 · · · pkt t v, v ∈ Z, ki ≥ 0, i = 1, . . . , t. So
r = upk11 · · · pkt t , where u = v/b is an unit.
Let π be any prime in R. As any element in R, π = upk11 · · · pkt t , ki ≥ 0, u = a/b an
unit. u−1 π = pk11 · · · pkt t , so π | pk11 · · · pkt t (in R). As π is a prime in R, π | pi for an index
i = 1, . . . , t. Thus pi = qπ, where q ∈ R. Since pi is irreducible, q is a unit, so pi and π
are associate.
Conclusion: the primes in R are the associates of p1 , . . . , pt .
Ex. 2.3 Use the formula for ϕ(n) to give a proof that there are infinitely many primes.
[Hint: If p1 , p2 , . . . , pt were all the primes, then ϕ(n) = 1, where n = p1 p1 · · · pt .]
Proof. Let {p1 , · · · , pt } the finite set of primes,with p1 < p2 < · · · < pt , and n = p1 · · · pt .
By definition, ϕ(n) is the number of integers k, 1 ≤ k ≤ n, such that k ∧ n = 1. From the
existence of decomposition in primes, if k ≥ 1, k = pk11 · · · pkt t , where ki ≥ 0, i = 1, . . . , t.
So k ∧ n = 1 if and only if k = 1. Thus ϕ(n) = 1 The formula for ϕ(n) gives ϕ(n) =
(p1 − 1) · · · (pt − 1) = 1. As pi ≥ 2, this equation implies that p1 = p2 = · · · = pt = 2,
so t = 1, and the only prime number is 2. But 3 is also a prime number : this is a
contradiction.
Conclusion : there are infinitely many prime numbers.
18
n m
Ex. 2.4 If a is a nonzero integer, then for n > m show that (a2 + 1, a2 + 1) = 1 or
2 depending on whether a is odd or even.
n m n m
Proof. Let d = a2 + 1 ∧ a2 + 1. Then d | a2 + 1, d | a2 + 1. So
n
a2 ≡ −1 (mod d),
2m
a ≡ −1 (mod d).
Ex. 2.5 Use the result of Ex. 2.4 to show that there are infinitely many primes. (This
proof is due to G.Polya.)
n
Proof. Let Fn = 22 + 1, n ∈ N. We know from Ex. 2.4 that n ̸= m ⇒ Fn ∧ Fm = 1.
Define pn as the least prime factor of Fn . If n ̸= m, Fn ∧ Fm = 1, so pn ̸= pm . The
application φ : N → N, n 7→ pn is injective (one to one), so φ(N) is an infinite set of
prime numbers.
Ex. 2.6 For a rational number r let ⌊r⌋ be the largest integer
j k jlessk than
j ork equal to r,
1 1
n n n
e.g., 2 = 0, ⌊2⌋ = 2, and 3 + 3 = 3. Prove ordp n! = p + p2 + p3 + · · · .
Proof. The number Nk of multiples m of pk which are not multiple of pk+1 , where
1 ≤ m ≤ n, is
n n
Nk = k − k+1 .
p p
n
P
Each of these numbers brings the contribution k to the sum ordp n! = ordp i. Thus
i=1
X n n
ordp n! = k − k+1
pk p
k≥1
X n X n
= k k − k k+1
p p
k≥1 k≥1
X n X n
= k k − (k − 1) k
p p
k≥1 k≥2
X
n n
= +
p pk
k≥2
X n
=
pk
k≥1
j k
n
Note that pk
= 0 if pk > n, so this sum is finite.
19
√
n
n! ≤ p≤n p1/(p−1) .
Q
Ex. 2.7 Deduce from Ex. 2.6 that ordp n! ≤ n/(p − 1) and that
(The original statement p|n p1/(p−1) was modified.)
Q
Proof.
X n X n n 1 n
ordp n! = ≤ = 1 =
pk p k p1− p
p−1
k≥1 k≥1
Ex. 2.8 Use Exercise 7 to show that there are infinitely many primes.
Proof. If the set P of prime numbers was finite, we obtain from Ex.2.7, for all n ≥ 2,
√
n
Y 1
n! ≤ C = p p−1 ,
p∈P
√
n 1
ln( n!) = (ln 1 + ln 2 + · · · + ln n)
n
As ln is an increasing fonction,
Z i
ln t dt ≤ ln i, i = 2, 3, . . . , n
i−1
So
Z n n Z
X i n
X n
X
ln t dt = ln t dt ≤ ln i = ln i
1 i=2 i−1 i=2 i=1
Thus
√
n 1
Z
1 n
1
ln( n!) ≥ (n ln n − n + 1) = ln n − 1 +
ln t dt =
n1 n n
√ √
As lim ln n − 1 + n1 = +∞, lim ln( n n!) = +∞, so lim n n! = +∞.
n→∞ n→∞ √ n→∞
Thus there exists n such that n n! ≥ C: this is a contradiction. P is an infinite
set.
20
Ex. 2.9 A function on the integers is said to be multiplicative if f (ab) = f (a)f (b).
whenever (a, b) = 1. Show that a multiplicative function is completely determined by its
value on prime powers.
Proof. Let the decomposition of n in prime factors be n = pk11 · · · pkt t , p1 < · · · < pt . As
k
pki i ∧ pj j = 1 for i ̸= j, i, j = 1, . . . , t,
Proof. If n ∧ m = 1,
X
g(nm) = f (δ)
δ|nm
X
= f (dd′ )
d|n,d′ |m
= g(n)g(m)
g is a multiplicative function.
P
Ex. 2.11 Show that ϕ(n) = n d|n µ(d)/d by first proving that µ(d)/d is multiplicative
and then using Ex. 2.9 and 2.10.
21
P µ(d)
From Ex.2.10, n 7→ d|n d is also a multiplicative function, and so is ψ, where ψ
is defined by
X µ(d)
ψ(n) = n .
d
d|n
To verify the equality ϕ = ψ, it is sufficient from Ex. 2.9 to verify ϕ(pk ) = ψ(pk ) for all
prime powers pk , k ≥ 1 (ϕ(1) = ψ(1) = 1).
X µ(pk )
ψ(pk ) = pk
pk
d|pk
k µ(1) µ(p)
=p +
1 p
(The other terms are null.)
So
1
ψ(pk ) = pk 1 − = pk − pk−1 = ϕ(pk ).
p
Thus ϕ = ψ : for all n ≥ 1,
X µ(d)
ϕ(n) = n .
d
d|n
2 ϕ(d)2 ,
P P P
Ex. 2.12 Find formulas for d|n µ(d)ϕ(d), d|n µ(d) and d|n µ(d)/ϕ(d).
Proof. As µ, ϕ are multiplicative, so are µϕ, µ2 ϕ2 , µ/ϕ. We deduce from Ex. 2.10 that
the three following fonctions F, G, H are multiplicative, defined by
X X X
F (n) = µ(d)ϕ(d), G(n) = µ(d)2 ϕ(d)2 , H(n) = µ(d)/ϕ(d),
d|n d|n d|n
k
X
F (pk ) = µ(pi )ϕ(pi )
i=0
= ϕ(1) − ϕ(p) = 1 − (p − 1) = 2 − p
Q
So F (n) = p|n (2 − p).
Similarly,
k
X
G(pk ) = µ(pi )2 ϕ(pi )2
i=0
= ϕ(1)2 + ϕ(p)2 = 1 + (p − 1)2 = p2 − 2p + 2
k
X
H(pk ) = µ(pi )/ϕ(pi )
i=0
= 1/ϕ(1) − 1/ϕ(p) = 1 − 1/(p − 1) = (p − 2)/(p − 1)
22
k
P
Ex. 2.13 Let σk (n) = d|n d . Show that σk (n) is multiplicative and find a formula
for it.
P
Ex. 2.14 If f (n) is multiplicative, show that h(n) = d|n µ(n/d)f (d) is also multi-
plicative.
Proof. We show first that the Dirichlet product f ◦ g of two multiplicative functions f, g
is multiplicative. Suppose that n∧m = 1. If d | n, d′ | m, so δ = dd′ | nm, and conversely,
if δ | nm, as n ∧ m = 1, there exist d, d′ such that d | n, d′ | m, and δ = dd′ . Thus
X nm
(f ◦ g)(nm) = f (δ)g
δ
δ|nm
X nm
′
= f (dd )g
dd′
d|n,d′ |m
XX n m
= f (d)f (d′ )g g ′
d d
d|n d′ |m
X n X
m
= f (d)g f (d′ )g ′
d ′ d
d|n d |m
= (f ◦ g)(n)(f ◦ g)(m)
P
Applying this result with g = µ, we obtain that n 7→ h(n) = d|n µ(n/d)f (d) is multi-
plicative, if f is multiplicative.
23
Ex. 2.15 Show that
P
(a) d|n µ(n/d)ν(d) = 1 for all n.
P
(b) d|n µ(n/d)σ(d) = n for all n.
Proof. Here ν = σ0 , σ = σ1 .
P P
(a) From the Möbius Inversion Theorem, as ν(n) = d|n 1 = d|n I(d), where I(n) =
1 for all n ≥ 1, X
1 = I(n) = µ(n/d)ν(d).
d|n
P P
(b) From the same theorem, as σ(n) = d|n d = d|n Id(d), where Id(n) = n for all
n ≥ 1, X
n = Id(n) = µ(n/d)σ(d).
d|n
Ex. 2.17 Show that σ(n) is odd iff n is a square or twice a square.
24
where αi , βi , λj , µk ∈ N∗ , 1 ≤ i ≤ r, 1 ≤ j ≤ s, 1 ≤ k ≤ t (the formula ϕ(pα ) = pα − pα−1
is not valid if α = 0). Then
n ∧ m = pγ11 · · · pγr r
n ∨ m = pδ11 · · · pδrr q1λ1 · · · qsλs sµ1 1 · · · sµt t ,
25
= nν(n)/2 .
Q
Ex. 2.20 Prove that d|n d
Proof. Let
n = pα1 1 · · · pαk k
be the decomposition of n in prime factors.
2
Y Y Y
d = d d
d|n d|n d|n
Y Yn
= d (δ = n/d)
δ
d|n δ|n
Y Y1
= nν(n) d
d
d|n d|n
= nν(n)
Conclusion: Y ν(n)
d=n 2 .
d|n
Proof.
∧(n) = log p if n = pα , α ∈ N∗
= 0 otherwise.
Let n = pα1 1 · · · pαt t be the decomposition of n in prime factors. As ∧(d) = 0 for all factors
of n, except for d = pij , i > 0, j = 1, . . . t,
X α1
X αt
X
∧(d) = ∧(pi1 ) + ··· + ∧(pit )
d|n i=1 i=1
= α1 log p1 + · · · + αt log pt
= log n
Ex. 2.22 Show that the sum of all the integers t such that 1 ≤ t ≤ n and (t, n) = 1 is
1
2 nϕ(n).
26
Proof. Suppose nP> 1 (the formulaPis false if n = 1).
Let S = t= t.
1≤t≤n, t∧n=1 1≤t≤n−1, t∧n=1
Using the symmetry t 7→ n − t, as t ∧ n = 1 ⇐⇒ (n − t) ∧ n = 1, we obtain
X X
2S = t+ t
1≤t≤n−1, t∧n=1 1≤t≤n−1, t∧n=1
X X
= t+ n−s (s = n − t)
1≤t≤n−1, t∧n=1 1≤s≤n−1, (n−s)∧n=1
X X
= t+ n−t
1≤t≤n−1, t∧n=1 1≤t≤n−1, (n−t)∧n=1
X X
= t+ n−t
1≤t≤n−1, t∧n=1 1≤t≤n−1, t∧n=1
X
= n
1≤t≤n−1, t∧n=1
= n Card{t ∈ N | 1 ≤ t ≤ n − 1, t ∧ n = 1}
= nϕ(n)
Conclusion : X 1
∀n ∈ N∗ , t = nϕ(n).
2
1≤t≤n, t∧n=1
Ex. 2.23 Let f (x) ∈ Z[x] and let ψ(n) be the number of f (j), j = 1, 2, . . . , n, such that
(f (j), n) = t t−1
Q1. Show that ψ(n) is multiplicative and that ψ(p ) = p ψ(p). Conclude that
ψ(n) = n p|n ψ(p)/p.
27
• φ is injective : if φ([j]nm ) = φ([k]nm ), then [j]n = [k]n , [j]m = [k]m , so n | j − k, m |
j − k. As n ∧ m = 1, nm | j − k so [j]nm = [k]nm .
• φ is surjective : if (a, b) ∈ Bn × Bm , there exist j, k ∈ Z, 1 ≤ j ≤ n, 1 ≤ j ≤ m,
such that a = [j]n , b = [k]m . From the Chinese Remainder Theorem, there exists i ∈
Z, 1 ≤ i ≤ n, such that i ≡ j (mod n), i ≡ k (mod m). Then φ([i]nm ) = ([i]n , [i]m ) =
([j]n , [k]m ) = (a, b).
Finally, ψ(nm) = |Bnm | = |Bn | |Bm | = ψ(n)ψ(m), if n ∧ m = 1 : ψ is a multiplicative
function.
The interval I = [1, pt ] is the disjoint reunion of the pt−1 intervals Ik = [kp+1, (k+1)p]
pt−1
P−1
for k = 0, 1, · · · , pt−1 − 1, so ψ(pt ) = Card Ck , where Ck = {j ∈ Ik | f (j) ∧ pt =
k=0
1} = {j ∈ Ik | f (j) ∧ p = 1}.
As f (j)∧p = 1 ⇐⇒ f (j −kp)∧p = 1, the application v : Ck → C0 , j 7→ j −kp is well
defined and is bijective, so |Ck | = |C0 | = ψ(p). Thus ψ(pt ) = pt−1 Card I0 = pt−1 ψ(p) :
ψ(pt ) = pt−1 ψ(p).
t(p) ,
Q
If n = p|n p then
Y
ψ(n) = ψ(pt(p) )
p|n
Y
= pt(p)−1 ψ(p)
p|n
Y ψ(p)
=n
p
p|n
Proof. Notations :
P : set of all monic polynomials p in k[x].
Pn : set of all monic polynomials p in k[x] with deg(p) ≤ n.
M : set of all monic irreducible polynomials p in k[x].
Mn : set of all monicP irreducible polynomials p in k[x] with deg(p) ≤ n.
We must prove that q − deg p(x) diverges.
p∈M
P − deg p(x)
• q diverges :
p∈P
n
X 1 X X 1
=
q deg f qd
f ∈Pn d=0 deg(f )=d
n
X 1
= Card {f ∈ P | deg(f ) = d}
qd
d=0
n
X 1 d
= q = n + 1.
qd
d=0
28
q − deg f diverges.
P
So
f ∈P
P −2 deg f
• q converges :
f ∈P
n
X X X 1
q −2 deg(f ) =
q 2d
f ∈Pn d=0 deg(f )=d
n
X 1
= Card{f ∈ P | deg(f ) = d}
q 2d
d=0
n
X 1
=
qd
d=0
1
≤ 1
1− q
q −2 deg f converges.
P
As any finite subset of P is included in some Pn ,
f ∈P
P − deg p(x)
• q diverges :
p∈M
Let Mn = {p1 , p2 , . . . , pl(n) } the set of all monic irreducible polynomials such that
deg pi ≤ n. Let
l(n)
Y 1
λ(n) = 1 .
i=1
1 − qdeg(p i)
Since the monic prime factors of any polynomial p ∈ Pn are in Pn , the decomposition of
p is p = pa11 · · · pal l , so
X 1
λ(n) ≥ = n + 1.
q deg p
p∈Pn
So lim λ(n) = ∞ : this is another proof that there exist infinitely many monic irreducible
n→∞
29
polynomials in k[x] (cf Ex. 2.1).
l(n)
X 1
log λ(n) = − log 1 −
q deg pi
i=1
l(n) ∞
X X 1
=
mq m deg pi
i=1 m=1
l(n) ∞
1 1 X X 1
= + ··· + +
q deg p1 q deg pl(n) mq m deg pi
i=1 m=2
Yet
∞ ∞
X 1 X 1
≤
mq m deg pi q m deg pi
m=2 m=2
1 1
= 1
q 2 deg pi 1 − degp
q i
1 2
= ≤ 2 deg p
q 2 deg pi −q deg p i q i
P∞ s
Ex. 2.25 Consider the function ζ(s) = n=1 1/n . ζ is called the Riemann zeta
function. It converges for s > 1. Prove the formal identity (Euler’s identity)
Y
ζ(s) = (1 − 1/ps )−1 .
p
Proof. We prove this equality, not only formally, but for all complex value s such that
Re(s) > 1.
Let s ∈ C and f (n) = n1s , n ∈ N∗ .
∗
P∞ multiplicative : f (mn) = f (m)f (n) for m, n ∈ N .
f is completely
Moreover n=1 f (n) is absolutely convergent for Re(s) > 1. Indeed, if s = u +
iv, u, v ∈ R, |f (n)| = |n−s | = |e−s log(n) | = |e−u log(n) e−iv log(n) | = e−u log(n) = n1u , so
∞ ∞
1/nu converges if u = Re(s) > 1.
P P
|f (n)| =
n=1 n=1
30
With these properties of f (f multiplicative and ∞
P
n=1 f (n) absolutely convergent),
we will show that
X∞ Y
f (n) = (1 + f (p) + f (p2 ) + · · · ).
n=1 p
∞ ∞ ∞
Let S ∗ = |f (pk )|
P P P
|f (n)| < ∞, and S = f (n) ∈ C. For each prime number p,
n=1 n=1 k=1
∞
converges (this sum is less than S ∗ ), so f (pk ) converges absolutely. Thus, for x ∈ R,
P
k=0
the two finite products
∞
YX ∞
YX
k ∗
P (x) = f (p ), P (x) = |f (pk )|
p≤x k=0 p≤x k=0
31
Ex. 2.26 Verify the formal identities:
(a)
∞ ∞ ∞
X µ(m) X 1 X µ(m)
ζ(s) =
ms ns ms
m=1 n=1 m=1
X µ(m)
=
ns ms
n,m≥1
∞ X
X 1
= µ(m) (u = nm)
us
u=1 m|u
∞
X 1 X
= µ(m)
us
u=1 m|u
=1
P
Indeed, m|u µ(m) = 1 if u = 1, 0 otherwise. So
X
ζ(s)−1 = µ(n)/ns .
n∈N∗
(b)
∞ ∞
2
X 1 X 1
ζ(s) =
ns ms
n=1 m=1
X 1
=
(nm)s
n,m≥1
XX 1
=
us
u≥1 n|u
X 1 X
= 1
us
u≥1 n|u
X 1
= ν(u)
us
u≥1
So
∞
2
X ν(n)
ζ(s) = .
ns
n=1
32
(c) For Re(s) > 2,
X 1 X 1
ζ(s)ζ(s − 1) =
ns ms−1
n≥1 m≥1
X m
=
(nm)s
m,n≥1
X X 1
= m s
u
u≥1 m|u
X σ(u)
=
us
u≥1
So
X σ(n)
ζ(s)ζ(s − 1) = .
ns
n≥1
P
Ex. Q2.27 Show that 1/n, the sum being over square free integers, diverges. Conclude
x
P
that p<N (1 + 1/p) → ∞ as N → ∞. Since e > 1 + x, conclude that p<N 1/p → ∞.
(This proof is due to I.Niven.)
Therefore X 1 6 X 1
≥ 2 .
a π n
a∈∆,a≤N n≤N
P∞ 1 P 1 1
As n=1 n diverges, lim a = +∞, so the family a a∈∆ of the inverse of square
N →∞ a∈∆,a≤N
free integers is not summable:
X1
= ∞.
a
a∈∆
Q
Let SN = p<N (1 + 1/p) , and p1 , p2 , . . . , pl (l = l(N )) all prime integers less than
N . Then
1 1
SN = 1+ ··· 1 +
p1 pl
X 1
=
pε11 · · · pεl l
(ε1 ,··· ,εl )∈{0,1}l
ε
P
We prove this last formula by induction. This is true for l = 1 : ε∈{0,1} 1/p1 = 1+1/p1 .
33
If it is true for the integer l, then
1 1 1 X 1 1
1+ ··· 1 + 1+ = 1+
p1 pl pl+1 p1 · · · pεl l
ε1
pl+1
(ε1 ,...,εl )∈{0,1}l
X 1 X 1
= +
pε1 · · · pεl l pε1 · · · pεl l pl+1
(ε1 ,...,εl )∈{0,1}l 1 (ε1 ,...,εl )∈{0,1}l 1
X 1
= εl+1
pε11 · · · pεl l pl+1
(ε1 ,...,εl ,εl+1 )∈{0,1}l+1
Y 1
lim 1+ = +∞.
N →∞ p
p<N
X1
lim = +∞.
N →∞ p
p<N
34
Chapter 3
Ex. 3.1 Show that there are infinitely many primes congruent to −1 modulo 6.
Ex. 3.2 Construct addition and multiplication tables for Z/5Z, Z/8Z, and Z/10Z.
Z/8Z:
+ 0 1 2 3 4 5 6 7 × 0 1 2 3 4 5 6 7
0 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 0
1 1 2 3 4 5 6 7 0 1 0 1 2 3 4 5 6 7
2 2 3 4 5 6 7 0 1 2 0 2 4 6 0 2 4 6
3 3 4 5 6 7 0 1 2 3 0 3 6 1 4 7 2 5
4 4 5 6 7 0 1 2 3 4 0 4 0 4 0 4 0 4
5 5 6 7 0 1 2 3 4 5 0 5 2 7 4 1 6 3
6 6 7 0 1 2 3 4 5 6 0 6 4 2 0 6 4 2
7 7 0 1 2 3 4 5 6 7 0 7 6 5 4 3 2 1
Z/10Z :
+ 0 1 2 3 4 5 6 7 8 9 × 0 1 2 3 4 5 6 7 8 9
0 0 1 2 3 4 5 6 7 8 9 0 0 0 0 0 0 0 0 0 0 0
1 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9
2 2 3 4 5 6 7 8 9 0 1 2 0 2 4 6 8 0 2 4 6 8
3 3 4 5 6 7 8 9 0 1 2 3 0 3 6 9 2 5 8 1 4 7
4 4 5 6 7 8 9 0 1 2 3 4 0 4 8 2 6 0 4 8 2 6
5 5 6 7 8 9 0 1 2 3 4 5 0 5 0 5 0 5 0 5 0 5
6 6 7 8 9 0 1 2 3 4 5 6 0 6 2 8 4 0 6 2 8 4
7 7 8 9 0 1 2 3 4 5 6 7 0 7 4 1 8 5 2 9 6 3
8 8 9 0 1 2 3 4 5 6 7 8 0 8 6 4 2 0 8 6 4 2
9 9 0 1 2 3 4 5 6 7 8 9 0 9 8 7 6 5 4 3 2 1
35
Python code to generate the latex code to create such an array :
n= 10
print(’$’)
ligne = ’\\begin{array}{c|’+ n*’c’+’}’
print(ligne)
ligne=’\\times’
for j in range(n):
ligne += ’ & ’ + str(j)
ligne += ’\\’
ligne += ’\\’
ligne += ’ \\hline’
print(ligne)
for i in range(n):
ligne = str(i)
for j in range(n):
ligne +=’ & ’+ str((i * j) % n)
ligne += ’\\’
ligne += ’\\’
print(ligne)
print(’\\end{array}’)
print(’$’)
Ex. 3.3 Let abc be the decimal representation for an integer between 1 and 1000. Show
that abc is divisible by 3 iff a + b + c is divisible by 3. Show that the same result is true
if we replace 3 by 9. Show that abc is divisible by 11 iff a − b + c is divisible by 11.
Generalize to any number written in decimal notation.
9 | n ⇐⇒ 9 | a + b + c.
36
Then 10n ≡ 1 (mod 9), so
l
X
9 | n ⇐⇒ ak 10k ≡ 0 (mod 9)
k=0
Xl
⇐⇒ ak ≡ 0 (mod 9)
k=0
⇐⇒ 9 | a0 + a1 + · · · + an ,
Ex. 3.4 Show that the equation 3x2 + 2 = y 2 has no solution in integers.
Ex. 3.5 Show that the equation 7x2 + 2 = y 3 has no solution in integers.
Ex. 3.6 Let an integer n > 0 be given. A set of integers a1 , . . . , aϕ(n) is called a reduced
residue system modulo n if they are pairwise incongruent modulo n and (ai , n) = 1 for all
i. If (a, n) = 1, prove that aa1 , aa2 , . . . , aaϕ(n) is again a reduced residue system modulo
n.
So i ̸= j ⇒ ai ̸≡ aj ⇒ aai ̸≡ aaj :
aa1 , . . . , aaϕ(n) a reduced residue system modulo n.
Note that {a1 , a2 , . . . , aϕ(n) } is a reduced residue system modulo n if and only if
{a1 , a2 , . . . , aϕ(n) } = U (Z/nZ).
37
Ex. 3.7 Use Ex. 2.6 to give another proof of Euler’s theorem, aϕ(n) ≡ 1 (mod n) for
(a, n) = 1.
Proof. The proofQis more clear if we stay in Z/nZ.
Let P = x
x∈U (Z/nZ)
ϕ(n)
Q
(if {a1 , . . . , aϕ(n) } is a reduced residue system modulo n, then P = ai .)
i=1
Let a ∈ Z such that a ∧ n = 1, then b = a ∈ U (Z/nZ). We define
U (Z/nZ) → U (Z/nZ)
ψ
x 7→ bx.
• Then ψ(x) = ψ(x′ ) ⇒ bx = bx′ ⇒ b−1 bx = b−1 bx′ ⇒ x = x′ , so ψ is injective.
• Let y ∈ U (Z/nZ). If x = b−1 y, then ψ(x) = bb−1 y = y, so ψ is surjective.
ψ is a bijection, so
Y Y
bx = x,
x∈U (Z/nZ) x∈U (Z/nZ)
that is Y Y
bϕ(n) x= x.
x∈U (Z/nZ) x∈U (Z/nZ)
Q
As y = x is in the group U (Z/nZ), y is invertible, thus
x∈U (Z/nZ)
bϕ(n) = 1.
That is aϕ(n) = 1 : for all a ∈ Z, if a ∧ n = 1, then aϕ(n) ≡ 1 (mod n).
Ex. 3.8 Let p be an odd prime. If k ∈ {1, 2, . . . , p − 1}, show that there is a unique bk
in this set such that kbk ≡ 1 (mod p). Show that k ̸= bk unless k = 1 or k = p − 1.
Proof. • existence.
As p is prime and 1 ≤ k ≤ p − 1, k ∧ p = 1, so there exist λk , µk ∈ Z such that
λk p + µk k = 1. Let bk ∈ {0, 1, . . . , p − 1} such that bk ≡ µk (mod p). Then kbk ≡ 1, and
bk ̸≡ 0 (mod p), so 1 ≤ bk ≤ p − 1.
• unicity. If kbk ≡ kb′k (mod p), where bk , b′k ∈ {1, 2, . . . , p − 1}, then p | k(b′k − bk ),
and p ∧ k = 1, thus p | b′k − bk . b′k ≡ bk , and bk , b′k ∈ {1, 2, . . . , p − 1}, so bk = b′k .
If p is a prime number, and k ∈ {1, 2, . . . , p−1}, there is a unique bk in {1, 2, . . . , p−1}
such that kbk ≡ 1 (mod p).
If k = bk , then k 2 ≡ 1 (mod p), so p | (k − 1)(k + 1), and p is a prime, thus p | k − 1
or p | k + 1, that is k ≡ ±1 (mod p). As 1 ≤ k ≤ p − 1, k = 1 or k = p − 1 (and
12 ≡ (p − 1)2 ≡ 1 (mod p)).
Ex. 3.9 Use Ex. 3.8 to prove that (p − 1)! ≡ −1 (mod p). (misprint corrected)
Proof. If p = 2, then the proposition is true : (2 − 1)! = 1 ≡ −1 (mod d). If p is odd, by
Exercise 3.8, each element k in the product p! can be associated with its inverse bk ̸= k
modulo k, with the exceptions 1 and p − 1, which are their own inverses, so
p! ≡ 1 × (p − 1) ≡ −1 (mod p).
38
Ex. 3.10 If n is not a prime, show that (n − 1)! ≡ 0 (mod n), except when n = 4.
If u = p is a prime, then n = p2 .
In the case p = 2, n = 4 and n = 4 ∤ (n − 1)! = 6. In the other case, p > 2, and
(n − 1)! = (p2 − 1)! contains the factors p, 2p, where 1 < p < 2p < p2 , so p2 | (p2 − 1)!,
that is n | (n − 1)!.
Conclusion : if n is not a prime, (n − 1)! ≡ 0 (mod n), except when n = 4.
Ex. 3.11 Let a1 , . . . , aϕ(n) be a reduced residue system modulo n and let N be the
number of solutions to x2 ≡ 1 (mod n). Prove that a1 · · · aϕ(n) ≡ (−1)N/2 (mod n).
H = {x ∈ Z/nZ | x2 = 1}
(here 1 = 1).
Then H ⊂ U (Z/nZ), 1 ∈ H ̸= ∅, and
x ∈ H, y ∈ H ⇒ x2 = y 2 = 1 ⇒ (xy −1 )2 = 1 ⇒ xy −1 ∈ H,
If x ∈ H, −x ∈ H.
• If n is odd, each x = a ∈ H(a ∈ Z, 1 ≤ a ≤ n − 1) satisfies −x ̸= x: otherwise
2a ≡ 0 (mod n), 2a = kn, k ∈ Z . As 0 < 2a = kn < 2n, then k = 1, and n = 2a is even,
in contradiction with the hypothesis.
So each x ∈ H can be paired with −x in the product P , and x(−x) = −1, so
Y
P = x = (−1)N/2 .
x∈H
39
If a1 , . . . , aϕ(n) is a reduced residue system modulo n, then a1 · · · aϕ(n) = P =
N/2 , so
Q
x∈U (Z/nZ) x = (−1)
p!
Ex. 3.12 Let kp = k!(p−k)!
be a binomial coefficient, and suppose that p is prime. If
1 ≤ k ≤ p − 1, show that p divides kp . Deduce (a + b)p ≡ ap + bp (mod p).
Ex. 3.13 Use Ex. 3.12 to give another proof of Fermat’s theorem, ap−1 ≡ 1 (mod p)
if p does not divide a.
(which is true for k = 1, k = 2) then, from induction hypothesis and the case k = 2
already proved in Ex 3.12,
∀k ∈ N∗ , k p ≡ k (mod p).
∀k ∈ Z, k p ≡ k (mod p).
40
Ex. 3.14 Let p and q be distinct odd primes such that p−1 divides q −1. If (n, pq) = 1,
show that nq−1 ≡ 1 (mod pq).
Ex. 3.15 For any prime p show that the numerator of 1 + 21 + 13 + . . . + p−1
1
is divisible
by p.
(p − 1)! (p − 1)!
N = (p − 1)! + + ··· + , D = (p − 1)!.
2 p−1
From Wilson’s theorem, (p − 1)! ≡ −1 (mod p), so in the field Z/pZ,
−1 −1 −1
N = (−1)(1 +2 + ··· + p − 1 ).
Ex. 3.16 Use the proof of the Chinese Remainder Theorem to solve the system x ≡ 1
(mod 7), x ≡ 4 (mod 9), x ≡ 3 (mod 5).
If r2 = 4, s2 = −1, then r2 m2 + s2 n2 = 4 × 9 − 1 × 35 = 1,
so e2 = s2 n2 = −35 verifies
41
so e3 = s3 n3 = 2 × 63 = 126 verifies
x = 148 + k 315, k ∈ Z,
Ex. 3.17 Let f (x) ∈ Z[x] and n = pa11 · · · pat t . Show that f (x) ≡ 0 (mod n) has a
solution iff f (x) ≡ 0 (mod pai i ) has a solution for i = 1, . . . , t.
Proof. If x is such that f (x) ≡ 0 (mod n), as pαi i | n, f (x) ≡ 0 (mod pai i ).
Conversely, let x1 , x2 , . . . , xt be integers such that
Ex. 3.18 For f ∈ Z[x], let N be the number of solutions to f (x) ≡ 0 (mod n) and Ni
be the number of solutions to f (x) ≡ 0 (mod pai i ). Prove that N = N1 N2 · · · Nt .
Proof. Note [x]n the class of x modulo n. Let S the set of solutions in Z/nZ of f (x) = 0,
and Si the set of solutions in Z/pai Z of f (x) = 0.
(We designate with the same letter the polynomial f in Z[x] or its reduction in
Z/nZ[x].)
Let
S → S1 × S2 × · · · × St
φ:
[x]n 7→ ([x]pa1 , [x]pa2 , . . . , [x]pat )
1 2 t
42
Ex. 3.19 If p is an odd prime, show that 1 and −1 are the only solutions of x2 ≡ 1
(mod pa ).
Proof.
x2 − 1 (mod pa ) ⇐⇒ pa | (x − 1)(x + 1).
Let d = (x − 1) ∧ (x + 1). Then d = 1 or d = 2.
• If d = 1, then x is even (if not, x − 1 and x + 1 are even, and 2 | d). As pa |
(x − 1)(x + 1) and (x − 1) ∧ (x + 1) = 1, then pa | x − 1, or pa | x + 1, that is
x ≡ ±1 (mod pa ).
• If d = 2, then x is odd, and
x−1x+1
pa | 4 .
2 2
As p is an odd prime, p∧4 = 1, so p | x−1
2
x+1 x−1 x+1 a
2 , where 2 ∧ 2 = 1, hence p |
x−1
2 | x−1
or pa | x+1
2 | x + 1, thus
x ≡ ±1 (mod pa ).
Conclusion: {−1, 1} is the set of roots of x2 − 1 in Z/pa Z.
Ex. 3.20 Show that x2 ≡ 1 (mod 2b ) has one solution if b = 1, two solutions if b = 2,
and four solutions if b ≥ 3.
Proof. Consider the equation x2 ≡ 1 (mod 2b ).
• If b = 1, x2 ≡ 1 (mod 2) ⇐⇒ 2 | (x − 1)(x + 1) ⇐⇒ x ≡ 1 (mod 2): we obtain
one solution.
• If b = 2, as 02 ≡ 22 ≡ 0 (mod 4), x2 ≡ 1 (mod 4) ⇐⇒ x ≡ ±1 (mod 4): we
obtain two solutions.
• Suppose that b ≥ 3. The equation has 4 solutions 1, −1, 1 + 2b−1 , −1 + 2b−1 .
Indeed, (±1)2 ≡ 1 (mod 2b ), and
(1 + 2b−1 )2 = 1 + 2.2b−1 + 22b−2 = 1 + 2b (1 + 2b−2 ) ≡ 1 (mod 2b ),
and similarly (−1 + 2b−1 )2 ≡ 1 (mod 2b ).
These solutions are incongruent modulo 2b :
1 ̸≡ −1 (mod 2b ) and 1 + 2b−1 ̸≡ −1 + 2b−1 (if not, 2b | 2, so b ≤ 1).
If 1 + 2b−1 ≡ −1 (mod 2b ), then 2b | 2 + 2b−1 = 2(1 + 2b−2 ), thus 2 | 2b−1 | (1 + 2b−2 ),
this is impossible because 1 + 2b−2 is odd (b ≥ 3). Therefore −1 + 2b−1 ̸≡ 1 (mod 2b ).
Moreover 1 + 2b−1 ≡ 1 (mod 2b ) implies 2b | 2b−1 , so 2 | 1 : this is a contradiction, so
1 + 2b−1 ̸≡ 1 (mod 2b ), and similarly −1 + 2b−1 ̸≡ −1 (mod 2b ). There exist at least 4
solutions.
We show that these are the only solutions :
∀x ∈ Z, x2 ≡ 1 (mod 2b ) ⇒ x ≡ ±1 (mod 2b−1 ).
Indeed, if x2 ≡ 1 (mod 2b ), 2b | (x − 1)(x + 1), where d = (x − 1) ∧ (x + 1) = 2.
As in Ex.3.19, if d = 1, then 2b | x − 1 or 2b | x + 1, a fortiori x ≡ ±1 (mod 2b−1 ).
If d = 2, then x is odd, and 2b | 4 x−1 2
x+1
2 , so 2
b−2 | x−1 x+1 , with x−1 ∧ x+1 = 1, so
2 2 2 2
2b−2 | x−1
2 or 2 b−2 | x+1 , that is 2b−1 | x − 1 or 2b−1 | x + 1, thus x ≡ ±1 (mod 2b−1 ).
2
(Alternatively, we can prove this implication by induction.)
Hence every solution of x2 ≡ 1 (mod 2b ), b ≥ 3 is such that x = ±1 + k2b−1 , k ∈ Z :
there exist only four such values in the interval [0, 2b [, namely 1, −1+2b−1 , 1+2b−1 , −1+2b .
b−1 b−1
Conclusion: if b ≥ 3, the roots of x2 − 1 in Z/2b Z are 1, −1, 1 + 2 , −1 + 2 .
43
Ex. 3.21 Use Ex. 18-20 to find the number of solutions to x2 ≡ 1 (mod n).
Proof. Let n = 2a0 pa11 · · · pakk be the decomposition in prime factors of n > 1 (p0 = 2 <
p1 < · · · < pk , a0 ≥ 0, ai > 0, 1 ≤ i ≤ k). Let N be the number of solutions of x2 ≡ 1
(mod n), and Ni the number of solutions of x2 ≡ 1 (mod pai i ), i = 0, 1, . . . k. From
Ex.3.18, we know that N = N0 N1 · · · Nk , where (Ex. 3.19), Ni = 2, i = 1, 2, . . . , k, and
(Ex.3.20), N0 = 1 if a0 = 1 (or a0 = 0), N0 = 2 if a0 = 2, N0 = 4 if a0 ≥ 3.
Conclusion : the number of solutions of x2 ≡ 1 (mod n), where n = 2a0 pa11 · · · pakk , is
N = 2k if a0 = 0 or a0 = 1
N = 2k+1 if a0 = 2
k+2
N =2 if a0 ≥ 3
Ex. 3.22 Formulate and prove the Chinese Remainder Theorem in a principal ideal
domain.
Proposition. Let R a principal ideal domain, and m1 , . . . , mt ∈ R. Suppose that
(mi , mj ) = 1 for i ̸= j (that is (mi ) + (mj ) = (1), mi R + ni R = R). Let b1 , . . . , bt ∈ R
and consider the system of congruences:
This system has solutions and any two solutions differ by a multiple of m1 m2 · · · mt .
This result can be generalized to any commutative ring, not necessarily a PID (see
S.LANG, Algebra):
Proposition. Let A a commutative ring. Let a1 , . . . , an be ideals of A such that
ai + aj = A for all i ̸= j. Given elements x1 , . . . , xn ∈ A, there exists x ∈ A such that
x ≡ xi (mod ai ) for all i.
Ex. 3.23 Extend the notion of congruence to the ring Z[i] and prove that a + bi is
always congruent to 0 or 1 modulo 1 + i.
Proof. If a, b, c are in Z[i] we say that a ≡ b (mod c) if there exists q ∈ Z[i] such that
a − b = qc.
As i ≡ −1 (mod 1 + i), a + bi ≡ a − b (mod 1 + i).
(1 − i)(1 + i) = 2, so 2 ≡ 0 (mod 1 + i).
44
If a − b is even, a − b = 2k, k ∈ Z ⊂ Z[i], so a − b ≡ 0 (mod 1 + i).
If a − b is odd, a − b = 2k + 1, k ∈ Z, so a − b ≡ 1 (mod 1 + i).
Conclusion : for all z ∈ Z[i], z ≡ 0, 1 (mod 1 + i).
Ex. 3.24 Extend the notion of congruence to the ring Z[ω] and prove that a + bω is
always congruent to −1, 0 or 1 modulo 1 − ω.
Ex. 3.25 Let λ = 1 − ω ∈ Z[ω]. If α ∈ Z[ω] and α ≡ 1 (mod λ), prove that α3 ≡ 1
(mod 9).
α3 − 1 = (α − 1)(α − ω)(α − ω 2 )
= (α − 1)(α − 1 + λ)(α − 1 + λ)
= (α − 1)(α − 1 + λ)(α − 1 − ω 2 λ)
= βλ(βλ + λ)(βλ − ω 2 λ)
= λ3 β(β + 1)(β − ω 2 )
Moreover,
Ex. 3.26 Use Ex. 25 to show that if ξ, η, ζ ∈ Z[ω] are not zero and ξ 3 + η 3 + ζ 3 = 0,
then λ divides at least one of the elements ξ, η, ζ.
45
and by Ex.3.25,
46