Lec13 EulerTheorem
Lec13 EulerTheorem
1 Introduction
We begin with the essential definitions.
Definition 1.1. Let n ∈ Z+ . The Euler phi-function (or totient function) of n, denoted
by φ(n), is the number of positive integers not exceeding n that are relatively prime to
n.
So φ(n) is the cardinality of the set {x ∈ Z+ | x < n and (x, n) = 1}, that is,
Examples. The values of φ(n) for n = 1, 2, . . . , 18 are shown in the following table.
n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
φ(n) 1 1 2 2 4 2 6 4 6 4 10 4 12 6 8 8 16 6
Notice, for example, that φ(1) = 1, and φ(p) = p − 1 for any prime p. Thus φ(5) = 4
is the cardinality of {1, 2, 3, 4}, φ(9) = 6 is the cardinality of {1, 2, 4, 5, 7, 8}, etc.
Definition 1.2. A reduced residue system modulo n is any set of φ(n) integers such
that each element of the set is relatively prime to n, and no two different elements of
the set are congruent modulo n.
Example. The set {1, 3, 5, 7} is a reduced residue system mod 8, as well as {−3, −1, 1, 3}.
1
Prof A. Munagi Three Special Congruences MATH4024-Number Theory
Proof. To show that each arj is relatively prime to n, we assume that (arj , n) > 1.
Then there is a prime divisor p of (arj , n). So p|a or p|rj which implies p|a and p|n, or
p|rj and p|n.
However, we cannot have both p|rj and p|n because rj is a member of a reduced residue
system modulo n, and the condition (a, n) = 1 forbids both p|a or p|n. Hence we
conclude that (arj , n) = 1 for 1 ≤ j ≤ φ(n).
To show that no two arj are congruent modulo n, we assume that arj ≡ ark (mod
n), where j 6= k with 1 ≤ j ≤ φ(n), 1 ≤ k ≤ φ(n).
Since (a, n) = 1, we get rj ≡ rk (mod n). But this is a contradiction since rj and rk
belong to the original set of reduced residues modulo n. Hence rj 6≡ rk (mod n).
Proof. (similar to the proof of Fermat’s Little Theorem, see Theorem 3.1 in Lec12).
2
Prof A. Munagi Three Special Congruences MATH4024-Number Theory
Exercise 5. Show that for any nonnegative integer n, 36n − 26n is divisible by 35.
2 Pseudoprimes
Exercise 6. If b and n are positive integers with (b, n) = 1, then the congruence bn ≡ b
(mod n) is equivalent to the congruence bn−1 ≡ 1 (mod n).
Recall that Fermat’s little theorem says that if p is prime and a is not a multiple of
p, then ap−1 ≡ 1 (mod p), or ap ≡ a (mod p).
The contrapositive of this theorem gives a possible way to detect non-primes: if
we can find an integer a which is coprime to n such that an 6≡ a (mod n), then, by
Fermat’s little theorem n is composite.
Example: Let us check if n = 63 is composite:
Hence 63 is composite.
Exercise 7. Show that 589 is not prime by computing the least nonnegative residue
of 2588 modulo 589.
3
Prof A. Munagi Three Special Congruences MATH4024-Number Theory
A lot of composite numbers can indeed be detected by this test, but there are some
that escape it.
The converse of Fermat’s little theorem would have provided a primality test. But
it turns out to be false.
The ancient Chinese were said to have believed that if 2n ≡ 2 (mod n), then n must be
prime. This statement holds true for 1 ≤ n ≤ 340. However, it fails for n = 341 since
we can show that 2341 ≡ 2 (mod 341) (see Exerc. 8) even though 341 is not prime.
Exercise 8. Let n = 341 = 11 · 31.
(a) Show that 2340 ≡ 1 (mod 11).
(b) Show that 2340 ≡ 1 (mod 31).
(c) Deduce that 2341 ≡ 2 (mod 341).
Pseudoprimes are composite numbers that tend to fulfill the properties of primes.
[These are sometimes called Fermat pseudoprimes because they originate from Fermat’s
little theorem.]
For example, we know (from Exerc. 8) that 341 is a pseudoprime to the base 2.
There are composite integers that cannot be detected from the contrapositive of
Fermat’s little theorem, because some integers are pseudoprimes to every base, that is,
some integers are Carmichael numbers!
Definition 2.2. A composite number that satisfies bn−1 ≡ 1 (mod n) for all b ∈ Z+
when (b, n) = 1 is called a Carmichael number or an absolute pseudoprime.