Basic Properties: Umber Heory
Basic Properties: Umber Heory
Basic Properties: Umber Heory
NUMBER THEORY
UNIT 2 CONGRUENCES
1. Basic Properties
Recall that in Unit 0, we came across the problem of finding the odd one out among the
following group of numbers:
We remarked that 39 is the odd one out, for it leaves a remainder of 3 when divided by 4, while the
others leave a remainder of 1 when divided by 4. In view of this, integers can be classified into four
types, according to whether they leave a remainder of 0, 1, 2 or 3 when divided by 4.
b = aq + r .
The number r is called the remainder when b is divided by a. It may take one of the values 0, 1, …,
a − 1 . Hence we may classify the integers into a types according to their remainders upon division
by a. This leads us to the following definition.
Definition 1.1.
Let m ≠ 0 be an integer. We say that x is congruent to y modulo m, denoted as x ≡ y (mod m), if
m| x− y .
Note that x ≡ y (mod m) means that x and y leave the same remainder when divided by m.
As for divisibility, we have the following basic properties about congruences which are easy to
verify.
Page 1 of 11
Mathematical Database
Theorem 1.1.
Let a, b, c, d, m, n be integers, m ≠ 0 , a ≡ b (mod m), c ≡ d (mod m). Then
(1) a ± c ≡ b ± d (mod m)
(2) ac ≡ bd (mod m)
(3) a n ≡ b n (mod m)
a b
(4) if n | a , n | b and (m, n) = 1, we have ≡ (mod m).
n n
Example 1.1.
Find the remainder when
(a) 82002 is divided by 7
Solution.
(a) 82002 ≡ 12002 = 1 (mod 7).
∴ The remainder is 1.
(b) 32003 = (33 )667 (32 ) = 27 66732 ≡ 166732 = 9 (mod 26)
Example 1.2.
Show that a natural number N is divisible by 3 if and only if its sum of digits is divisible by 3.
Solution.
Write N = ak ak −1 a2 a1a0 in its decimal notation.
Page 2 of 11
Mathematical Database
Remark. Compare this proof with the one given in Unit 1. In this proof, we showed that N is
congruent to its sum of digits modulo 3. Hence we can easily find the remainder of a number upon
division by 3 by considering its sum of digits.
Example 1.3.
Show that the sequence 11, 111, 1111, … contains no perfect squares.
Solution.
For all integers n, n ≡ 0, 1, 2 or 3 (mod 4). If n ≡ 0 or 2 (mod 4), then n 2 ≡ 0 (mod 4). If n ≡ 1 or 3
(mod 4), then n 2 ≡ 1 (mod 4).
Note that in the sequence 11, 111, 1111, …, all terms leave a remainder of 3 when divided by 4.
Thus there is no perfect square in the sequence.
Example 1.4.
Find the largest even number which cannot be expressed as the sum of two odd composite numbers.
Solution.
Let n be an even number.
If n ≡ 0 (mod 3), then we have n = 9 + (n − 9) . Since n − 9 is divisible by 3, it is an odd composite
number whenever n > 12 .
If n ≡ 1 (mod 3), then we have n = 25 + (n − 25) . Since n − 25 is divisible by 3, it is an odd
composite number whenever n > 28 .
If n ≡ 2 (mod 3), then we have n = 35 + (n − 35) . Since n − 35 is divisible by 3, it is an odd
composite number whenever n > 38 .
It follows that all even numbers greater than 38 can be expressed as the sum of two odd composite
numbers. However, there is no way of writing 38 as the sum of two odd composite numbers (this
can be seen by listing all odd composite numbers less than 38: 9, 15, 21, 25, 27, 35). Therefore, the
answer is 38.
Page 3 of 11
Mathematical Database
In Example 1.1, part (b), we found that our calculation is very much simplified by expressing
the number as a power of 33 , because 33 ≡ 1 (mod 26). Therefore, in attempting to find the
remainder when a certain power of a is divided by n, where a and n are given, we probably want to
find an exponent k for which a k ≡ 1 (mod n). In the next section we will come across a theorem
which enables us to find such an exponent efficiently. In order to understand the theorem, we first
go over the Euler φ-function in this section.
Definition 2.1.
For positive integer n, we define
φ (n) = number of positive integers not exceeding n that are relatively prime to n.
Illustrations. φ (12) = 4 since 1, 5, 7, 11 are relatively prime to 12. φ (16) = 8 since 1, 3, 5, 7, 9, 11,
13, 15 are relatively prime to 16.
The Euler φ-function turns out to be an important function in number theory on which many
theorems are built. Before we proceed, let’s study some nice properties of the function which
facilitate easy computation of φ (n) for a given n.
Theorem 2.1.
Let a, b be relatively prime natural numbers, p be a prime number and m be a positive integer. Then
(a) φ (ab) = φ (a )φ (b)
(b) φ ( p m ) = p m − p m −1
Remark. Because of the property in (a), the function φ is said to be multiplicative. This is a very
nice property because, if a function f : → is multiplicative, we need only know the value of f
at prime powers. The other values can be computed via the prime factorization of a natural number.
With the formula in (b), therefore, we can compute φ (n) easily for all n.
Page 4 of 11
Mathematical Database
Example 2.1.
Find φ (360) .
Solution.
φ (360) = φ (23 × 32 × 5) = φ (23 ) × φ (32 ) × φ (5) = (23 − 2 2 )(32 − 31 )(51 − 50 ) = 96 .
Example 2.2.
Find all natural numbers n for which φ (n) is odd.
Solution.
Clearly, φ (1) = 1 is odd. Now suppose n > 1 .
Let n = p1 1 p2 2
e e e
pk k , where pi is prime and ei is a positive integer for i = 1, 2, …, k. Then
φ (n) = ∏ ( pi e − pi e −1 ) .
k
i i
i =1
e −1 e −1
For φ (n) to be odd, pi i − pi i is odd for all i. If pi is odd, then pi i − pi i
e e e
is even since both pi i
e −1
and pi i are odd. So pi must be even, i.e. n = 2e for some e > 0 .
Consequently, φ (n) = 2e − 2e −1 . This cannot be odd unless e = 1 , i.e. n = 2 . Indeed, we check that
φ (2) = 1 is odd.
Consequently, we see that φ (n) is odd only if n = 1 or 2.
With the concept of the Euler φ-function in mind, we can now go into Euler’s Theorem, which
helps us find an exponent k for which a k ≡ 1 (mod n) given integers a and n under certain
conditions.
Page 5 of 11
Mathematical Database
Illustration. (3, 100) = 1, φ (100) = φ (22 )φ (52 ) = (22 − 21 )(52 − 51 ) = 40 . Thus 340 ≡ 1 (mod 100).
Remark. Given natural numbers a and n, we say that b is an inverse of a modulo n if ab ≡ 1 (mod
n). For example, 7 is an inverse of 4 (mod 9) since 4 × 7 ≡ 1 (mod 9). Inverses are useful in
simplifying computations and solving congruence equations such as 4 x ≡ 3 (mod 7), but in general
finding an inverse is not easy. Nevertheless, Euler’s Theorem tells us that when (a, n) = 1, aφ ( n )−1 is
an inverse of a (mod n).
Example 3.1.
Find the last two digits of 17 2002 .
Solution.
As we have seen, φ (100) = 40 .
Example 3.2.
Let p be a prime number, p ≡ 3 (mod 4) and p | a 2 + b 2 for some integers a and b. Prove that p | a
and p | b .
Solution.
Suppose p /| a . Then we must have p /| b as well.
Page 6 of 11
Mathematical Database
so that
p −1 p −1
(a b) = ( a p − 2b )
p −2 p −1 2
≡ (−1) ≡ −1 (mod p),
2 2
p −1
where we made use of the fact that p ≡ 3 (mod 4) which implies is odd.
2
On the other hand, a p − 2b is also relatively prime to p, so Fermat Little Theorem asserts that
(a b)
p −2 p −1
≡ 1 (mod p).
Solving the question is not hard: we first note that the unit digit of n must be 3 or 8, and so n is
among 3, 8, 13, 18, 23, 28, … We then find the smallest one among these integers which leaves a
remainder of 4 upon division by 7. It is easy to see that the smallest n is 18.
Note that the conditions imposed on n can be rephrased into t e system of congruences:
n ≡ 3 (mod 5)
n ≡ 4 (mod 7)
and we have shown that the smallest positive n satisfying the system is 18. If we repeat the above
process, it is not hard to see that n = 53, 88, 123, 158, … all satisfy the system and they occur at
intervals of 35. Indeed, any integer n with n ≡ 18 (mod 35) satisfies the system.
Page 7 of 11
Mathematical Database
A natural question to ask is whether all such systems are solvable. A little thought would tell
us that the answer is negative, for the system
n ≡ 1 (mod 2)
n ≡ 2 (mod 4)
is clearly not solvable (as the first constraint requires n to be odd and the second constraint requires
n to be even).
Despite this negative result, an extra constraint would give us something encouraging, as given
in the next theorem.
Proof. We first prove the uniqueness, and then prove the existence.
(Uniqueness)
(Existence)
m1m2 mk
Define M j = for j = 1, 2, …, k. Set
mj
φ ( m1 ) φ ( m2 ) φ ( mk )
x = M1 b1 + M 2 b2 + + Mk bk .
φ (m j )
Then for j = 1, 2, …, k, x ≡ M j b j ≡ (1)b j = b j (mod m j ) where we made use of the fact that
m j | M r for r ≠ j and the Euler’s theorem (noting that m j is relatively prime to M j for all j).
Page 8 of 11
Mathematical Database
Q.E.D.
In the above proof we gave an explicit formula to find x, but in practice this is rarely used as
the number gets too large when we take powers. There is another formula which overcomes this
difficulty but which is not as simple as the preceding one.
Recall that b is said to be an inverse of a modulo n if ab ≡ 1 (mod n). It can be shown that
such b exists if and only if (a, n) = 1 (see exercise 8). Now, (m j , M j ) = 1 for all j, where M j is
defined as above, since the mi ’s are pairwise relatively prime. Hence M j has an inverse modulo
m j , which we denote by M j . Then a solution for the system in Theorem 4.1 can be written as
x = b1M 1 M 1 + b2 M 2 M 2 + + bk M k M k .
We leave it to the reader to verify that such x indeed satisfies the system.
Example 4.1.
Find all integers x for which x ≡ 2 (mod 3), x ≡ 3 (mod 5) and x ≡ 4 (mod 7).
Solution.
Since 3, 5, 7 are pairwise relatively prime, the Chinese remainder theorem asserts that there is a
unique solution modulo 3 × 5 × 7 = 105 .
Now m1 = 3 , m2 = 5 , m3 = 7 , M 1 = 35 , M 2 = 21 , M 3 = 15 , M 1 = 2 , M 2 = 1 , M 3 = 1 , so one
solution for x is given by
x = 2 × 35 × 2 + 3 × 21× 1 + 4 × 15 × 1 = 263 .
Note that 263 ≡ 53 (mod 105), so the general solution is x = 53 + 105t for any integer t.
5. Exercises
1. Prove or disprove each of the following statements. All variables denote natural numbers.
(a) If a ≡ b (mod m), then a 2 ≡ b 2 (mod m).
3. Show that a natural number N is divisible by 9 if and only if its sum of digits is divisible by 9.
4. In Unit 1 and its exercises, we came across various divisibility tests and proved their validity
using divisibility arguments. Try to rephrase the proofs in the language of congruences that we
have been using throughout this unit.
6. Prove that there are infinitely many prime numbers p satisfying p ≡ 3 (mod 4).
1 1 1
φ ( n) = n 1 − 1 − 1 − .
p1 p2 pk
8. (a) Let a, n be integers, n ≠ 0 . Show that a has an inverse modulo n if and only if a and n are
relatively prime.
(Hint: Recall that there exist integers u, v such that cu + dv = gcd(c, d ) .)
(b) In the condition of (a), show that the inverse is unique modulo n.
9. Show that
x = b1M 1 M 1 + b2 M 2 M 2 + + bk M k M k
Page 10 of 11
Mathematical Database
9. (a) Let p1 , p2 , …, p2n be distinct prime numbers. Show that there is an integer x such that
p2i −1 p2i divides x + i for i = 1, 2, …, n.
(b) We say that a positive integer k is ‘good’ if it is not the power of a prime number. Using
(a), show that for every natural number n we can find n consecutive ‘good’ integers.
if and only if n is prime. This gives a test of whether a given natural number n is prime.
But in practice such a test is rarely used. Suggest a reason for this.
11. (IMO 2002 Hong Kong Team Selection Test 1) Considering (mod 4) or otherwise, prove that
if a, b, c, d are integers satisfying
(3a + 5b)(7b + 11c)(13c + 17 d )(19d + 23a ) = 20012001
12. (IMO 2001) Let n be an odd integer greater than 1, and let k1 , k2 , …, kn be given integers.
For each of the n! permutations a = (a1 , a2 , … , an ) of 1, 2, …, n, let
n
S (a ) = ∑ ki ai .
i =1
Prove that there are two permutations b and c, b ≠ c , such that n! is a divisor of S (b) − S (c).
Page 11 of 11
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: