Professional Documents
Culture Documents
Lemma 4.1.1. [Division algorithm] Set a and b be two integers wi,th b > 0. Then there exist unique
integers q, r such that a —— qb + r, where 0 < r < b. The integer q i,s called the quotient and r, the
remainder.
Definition 4.1.2. Let o, h C Z with h 0. If n = bc, for some c C H then b is said to divide o and
we write b|n (read as b divides n. ) When b|n, we also say that h is a divisor of o, and that n is a
multiple of h.
Remark 4.1.3. Let o be a nonzero integer. If h is a positive divisor of a, then 1 < fi < n|. Hence the
set of all positive divisors of a nonzero integer is a nonempty finite set.
Further, if n is a positive integer and h is a positive diviuor of n, then n = kb for some k H so
that b < n. It then follows that if n, b C H such that n|b and b|n, then n = b.
Definition 4.1.4. 1. Let a and h be two nonzero integers. Then the set S of their common positive
divisors is nonempty and finite. Thus, S contains its greatest element. This element is called
the greatest common divisor of a and h and is denoted by gcd(a, h). The gcd is also called
the highest common factor.
2. An integer a is said to be relatively prime to an integer fi if gcd(o, fi) = 1. In this case, we also
say that the integers n and ñ are coprimes.
61
62 CHAPTER 4. ELEMENTARY NUMBER 'THEORY
The next result is often stated as ‘the gcd(o. h) is a linear combination of n and h’.
Theorem 4.1.5. [Bézout’s identity] Set a and b be two nonzero integers and let d —— gcd(a, h).
7’fien th,ere eat.st, integers +o, to •iicfi that d —— axq + bid.
In this case, r is a positive integer in S which is strictly less than d. This contradicts the choice of d
as the least element of S. Thus, r —— 0. Consequently, d a. Similarly, d b. Hence d < gcd(o, h).
Now, gcd(a, h) | n and gcd(n, b) | b. Since d —— est + hyt for some sb, pb C Z, we have gcd(a, b) d.
That is, d = k x gcd(n, b) for some integer k. However, both gcd(a, h) and d are positive. Thus k is a
positive integer. Hence d > gcd(n, b).
Therefore, d gcd(a, b). •
We prove three useful corollaries to Bézout’s identity.
Corollary 4.1.6. Let u, b C P ord let d C H. Then, d —— gcd(n, b) if and only // d|n, d b, and each
common diivisor of a and b divides d.
Proof. Suppose d —— gcd(n, h). Then d|a and d|b. Bâzout’s identity, d —— ak + fix, for some k. m. R.
Thus, any common divisor of o and h divid aged(n, D).
Conversely. suppose d a, d b and eac c mon divisor of o and h divides d. Since d is a common
divisor of n and ñ, fly what we have just proved, d| gcd(o, b). Further, gcd(a, b) is a common divisor of
a and b; so, by assumption gcd(o, b)|d. By Remark 4.1.3, d —— gcd(o, b). •
Corollary 4.1.'Z. Se/ ‹i, h ñe n,onzero in,te.gr.re. Th,r.n gcd(o, b) 1 i,f and on,fp if there. eat.s/ in,irgers
J0 ORd p0 .9UCb UOt £tJ0 -|- bp0 == 1.
Proof. If gcd(n, h) = 1, then by Bezout’s identity, there exist integers +o nd vo such that «+o + 3vo =
Conversely, suppose there exist integers zp and to such that •*o + vo = 1. If gcd(n, h) = k, then k is
a positive integer such that k l. It follows that k < 1; consequently, k —— 1.
Proof. The positive integers nt, ... , n k at e pair wise coprimes means that if f j, then gcd(ni. ny) = 1.
Let a e Z be such that i «, k• We show by induction that i k• . For k —— 2, it is given
that 1 . 21 and gcd( 1, z) = 1. By Bézout’s identity, there exist z, p e Z such that mz + zv =
Multiplying by a, we have a = « 1 + 2v = 1 2 (*( @2 ) + $( )) •
Since 2 and 1 « , we see that 2
, 1
C Z so that (z(@ 2) + p(@)) C Z. Hence 1 2«
Assume the induction hypothesis that the statement is true for k —— m. Let each of nt, . . , «-‹-1
divide n and that they are pairwise coprimes. Let n,t r,p = /. Then gcd(é, u,p+j) = 1. By the
induction hypothesis, é|o. By the basis case, (k —— 2 as proved), we conclude that é «+i « . That
is,
4.1. DIVISION AU C ORI'THM AND US APPLICATIONS 63
The division algorithm helps to algorithmically compute the greatest common divisor of two
nonzero integers, commonly known as the Euclid’s algorithm.
Let o, and b be nonzero integers. By the division algorithm, there exists integers q and r with
0 < r < |fi| such that n = |6 q + r. We apply our observation that a common divisor of two integers
divides their gcd.
Now, gcd(|h , r) divides both |fi| and r; hence it divides n. Again, gcd(|h| , r) divides both u and |h|.
Hence gcd(|b|, r) gcd(a, |h|).
Similarly, with r —— a — b q, we see that gcd(n, |h|) divides both a and |h|; hence gcd(a, |h|) |r.
Consequently, gcd(o, |b|)| gcd(| b| , r).
Further, the gcd of any two integers is positive. Thus, gcd(a, h) = gcd(o, |b|). So, we obtain
Euclid’s algorithm applies this idea repeatedly to find the greatest common divisor of two given
nonzero integers, which we now present.
Euclid’s algorithm
Input: Two nonzero integers a and b; Output: gcd(o, h).
rp l’œil
gcd(a, h) r¿+
The process will take at most h — 1 steps as 0 < r o < b. Also, note that rt+i can be expressed in
the form rt +i = « +o + pb for integers zb, pb using backtracking. That is,
Example 4.1.9. We apply Euclid’s algorithm for computing gcd(l55, —275) as follows.
To write o = gcd(l55, —275) in the form l 55* o + (—27 5)vo. notice that
Also, note that 275 = - 55 and 155 = - 31 and thus, 5 = (9 + (—275) + (16 + 55a-) 155, for all
5 5 31a-)
z C Z. Therefore, we see that there are infinite number of choices for the pair (z, p) C Z2, for which
d = az + hp.
EXERCISE 4.1.10. 7. Let a, b C H with gcd(a, h) = d. Then gcd( , ¿) = 1.
2. Pro oe that the system I 6:s + 12d = 6 do.s a .so/ution for :r., y C B if and only i/ 3 divides b.
64 CHAPTER 4. ELEMENTARY NUMBER 'THEORY
We are now ready to prove an important result that helps us in proving the fundamental theorem
of arithmetic.
Proof. Suppose p ah. If p a, then there is nothing to prove. So, assume that p n. As p is a prime,
gcd(p, a) = 1. Thus there exist integers z. p 1 = nz + py. Then b = ribs + php. Since p at
un6 p pb, we see that p b. •
One also has the following result.
Proof. Suppose gcd(n, n) = 1. There exist +o, vo Z such that zoo + «vo = 1. Thell b = vo + =o-
Since n|ah and n|nh. we have n|b.
Now, we are ready to prove the fundamental theorem of arithmetic that states that ‘every positive
integer greater than 1 is either a prime or is a product of primes. This product is unique, except for
the order in which the prime factors appear’.
theorem 4.1.14. [Fundamental theorem of arithmetic] Let n, C H w/tfi n > 2. them thet-e exist
prime numbers p > p2 > > rk and positive integers n , n2 •!k •!uch that n —— p11 p -2- - p h , for
2 k
t2
some k > 1. Moreo her, i/ n, also eguo/.s ti V2 q¿
Theorem 4.1.15. [Euclid: Infinitude of primes] The number of primes i,s ‹narrate.
Proof. On the contrary assume that the number of primes is finite, say p —— 2, H2 = 3, . . Pk Consider
the positive integer N —— rirz Ok + 1. We see that none of the primes pi , rz, rk divides N. This
contradicts Theorem 4.1.14.
Proposition 4.1.16. [Primality testing] Let n C H iritfi n > 2. If no pri,me p < divides n, then
n is pi-ime.
4.2. MODULAR ARITHME III 65
Proof. Suppose n = zp, for 2 < z, p < n. Then, either z < or p < . Without loss of generality,
assume z < . Ifs is a prime, we are done. Else, take a prime divisor p of s. Now, p < and p
divides n. •
EXERCISE 4. l.l'Z. 7. Pro oe that the.re nre i,nfinit.ely sung prices of t,lie form 4n — 1.
2. Fix N H, N > 2. Then, there ezi.sfis n con.secutire set o/ N nnturol wtishers thu/. are. composite.
Definition 4.1.18. The least common multiple of integers n and h, denoted as lcm(a, h), is the
smallest positive integer that is a multiple of both n and h.
Lemma 4.1.19. be/ n, b C Z out Tel é C H. Then, £ —— lcm(a, b) i/ end on,/y i/ n|/, b|é end / diciJes
each common m,ultiple of u and b.
Proof. Let é = lcm(o, h). Clearly, n|é and b|é. Let z be a common multiple of both n and h. If é z,
then by the division algorithm, z = / q + r for some integer q and some r with 0 < r < £. Notice that a|
z and a|é. So, a|r. Similarly, b r. That is, r is a positive common multiple of both o and h which is less
than lcm(n, fi). This is a contradiction. Hence, é = lcm(a, h) divides each common multiple of u and b.
Conversely, suppose n|é, b|é and é divides each common multiple of o and b. By what we have
just proved, lcm(n, b)|é. Further, lcm(a, b) is a common multiple of n and b. Thus é| lcm(n, h). By
Remark 4.1.3, we conclude that é = lcm(o. h).
Theorem 4.1.20. Let a, b C H. 7’fien gcd(n, lcm(n, b) = at. In particular, lcm(n, b) = ah i/ and
b-)
only t/ gcd(o, h) = 1.
ome
Proof. Let d —— gcd(a, h). Then n = nod and h = hid ct, fit C H. Further.
Hence 131d|c. That is, 131d divides each common multiple of o and b. By Lemma 4.1.19,
a bid —— lcm(o. ñ).
Example 4.2.2. 1. Notice that 2|(2£ — 2rn) and also 2 (2k — 1) — (2m — 1)a . Therefore, any two
even integers are congruent modulo 2; and any two odd integers are congruent modulo 2.
2. The numbers CIO and 22 are congruent modulo 4 as 4|(22 — 10) and 4|(22 — (—10)).
3. Let n be a fixed positive integer. Recall the notation n — 1] := (0, 1, 2, ... , n — 1}.
(a) Then, by the division algorithm, for any n C Z there exists a unique h C n — 1] such that
n — b (mod n,). The number b is called the residue of n modulo n.
66 CHAPTER 4. ELEMENTARY NUMBER 'THEORY
n—1
(b) Further Z U I• + kn : k C Z}, i. e., every integer is congruent to an element of n — 1].
&=0
The set n — I] is taken as the standard representative for the set of residue classes
modulo n.
Theorem 4.2.3. Fi,+. n C H, an,d lr.t u, b, c, ñ C H. Th,r.n t,hr. /offomin,p arr. t,rur.:
1. If a — b (mod n) and b — c (mod n), then a — c (mod n).
2. If a — b (mod n), then a + c — b + c (mod n), n — c — b — c (mod n) and nc bc (mod n).
3. If a —— b (mod n,) on4 c —— d (mod n,), then, a c b + d (mo4 n), a — r ñ — d (mcd n,) and
ac —— bd (mod n). in pal ti.cular, a —— b (mod n) ’implie.s a” —— b” (mod n) for all m E R.
. If ac — be (mod n) for nonzero a, b, c, and d —— gcd(c, n), then a — b (mod n/d). In parti,cular,
i/ nc bc (mod n) for nonzero a, h, c, and gcd(c, n) = 1, them n b (mod n).
Proof. We will only prove two parts. The readers should supply the proof of other parts.
3. Note that ac — bd —— ac — bc + bc — bd —— c(a — b) + b(c — d). Thus, n ac — bd, whenever n a — b
and n|c — d. In particular, taking c = o and d —— h and repeatedly applying the above result, one has
a‘ — b‘ (mod n), for all m C H.
4. Let gcd(c, n) = d. Then. there exist nonzero ct. my C Z with c = 1d, n —— std. Then n|nc — hc
implies n, d| c. 1d(a #), which implie 1 i( b). By Proposition 4.1.13, n,1|a b, ‹. e. yg d ) ’
Example 4.2.4. 1. Note that -3 9 + 13- (—2) 1 (mod 13). If z satisfies 9z 4 (mod 13) then
To verify, if a 12 (mod 13), then 9z 108 (13 x 8 + 4) 4 (mod 13). Therefore, the
congruence equation 9s 4 (mod 13) has solution z 12 (mod 13).
2. Verify that 9- (—5) + 23- (2) = 1. Hence, the equation 9s 1 (mod 23) has the
3. Verify that the equation 3z 15 (mod 30) has solutionss = 5, 15, 25; where as the equation
7z, —— 15 (mod 30) has only one solution z = 15; and that the equation 3z 5 (mod 30) has no
solution.
theorem 4.2.5. [Linear Congruence] Let n be a posi,tine integer and let a, b be nonzero i,ntegers.
then the congruence equation as — b (mod n) has at least one solution if and only if gcd(n, n)|b.
Moreover, i/ d —— gcd(n. n)|b, then nz b (mod n) lie.s exactly d number of .so/utioncs T J, . . d
(0, 1, 2, ... , n — I}, where ri r j (mod n/d) for all i, j —— 1, 2, ... , d.
Proof. Write d —— gcd(o. n). Let o be a solution of nz b (mod n). Then, by definition, • o — = s.
for some q C H. Thus, b = nzb — sq. Since d a and d|n, we have d axq — nq b.
Conversely, suppose d b. Then, h = did , for some 3i o H. By Brzout’s identity, there exist
+o, vo o Z such that «+o + vo = d. Hence,
That is, o t is a solution of nz h (mod n). This proves the first statement.
To proceed further, assume that d b. By what we have just proved. there exists a solution zt of
as — b (mod n). By the division algorithm, there exist p, r C D with 0 < r < n such that +i = p +
Now, nr «( 1 — Q ) 1 b (mod n). Thus, r is also a solution of us b (mod n), i.e., there
exists r C (0, 1 ... , n — 1} satisfying ar — b (mod n).
If 2 (0, 1, .... n, 1} is any other solution of us b (mod n,), then *2 ar (mod n,).
Thus, by Theorem 4.2.3.4, 2 (mod n/d). Conversely, if +2 (mod n/d), then *2' + m(n/d)
‹i
for some m c Z. Then +z = « + ( / d) = ar + mn(a Jd). us cl| a, the number n/d is an integer.
Hence, «+z ar (mod n) so that *2 is a solution of nz b (mod n).
Therefore, all solutions of na h (mod n) in {0, 1, ... , n — 1} are of the form r + k(n/d) for k C R.
However, there are exactly d number of integers in (0, 1, ... , n — 1} which are congruent to r modulo
(n/d). Hence there are d number of solutions of nz b (mod n) in (0, 1, ... , n — 1}. •
Remark 4.2.6. Observe that a solution of the congruence us h (mod n) is a number in (0, 1, ... , m—
l}. This set is not to be confused with the congruence class n — 1]. When d —— gcd(n. n), we may write
the distinct solutions in n — 1] in increasing order as r = r. r z = r + n/d, p3 = r + 2n/d, . . d
r + (d — l)n/d. It means that the solutions are zi rt (mod n) for / = 1, 2, ... , d.
1. Set p be a prime. Wri,te Up : —— {0, 1, 2, ... , p — 1} and Bp* :—— (1, 2, ... , p — 1} = Zp \ (0}. Show
that Up has lhe foIIom’ing properties:
(a) For all a, b C Up, a + h (mod p) C Up.
(b) For all a, b C Up, a + b —— b + a (mod p) .
(c) For all n, b, c C Up, a + (h + c) (o + h) + c (mod p) .
(d) For all a C Bp, a + 0 n (mod p).
(e) For all a C Up, a + (p — n) 0 (mod p).
(f) For all a, b C Up, u- b (mod p) C Up.
(g) For all a, b C Up, a- h - a (mod p).
b
c) (n- c (mod p).
(h) For all a, b, c C Up, a- h-)
(-b
(i) For all a C Up, a- 1 a (mod p) .
) For each, a C Up, there exists b Up s uch that a - b — I (mod p) .
68 CHAPTER 4. ELEMENTARY NUMBER 'THEORY
Any nonempty set containing at least two elements such as 0 and 1, in which ‘addition’ and
‘multiplication’ can be defined in such a way that the above properties are satisfied, is called a
field. So, Zp = (0, 1, 2, ... , p — I} is an example of a field. The well known examples of fields
are:
(a) Q, the set of rational numbers.
(b) R, the set of real numbers.
(c) C, the set of complex numbers.
(d) Let p > 3. Write q —— (p — 3)/2. There exist two- element sets fa , bi i, 2i 2 i • • •i qi q$
fi
that are pairwise di.sjoi’nt sau’.sfyi’ng a-, b, — 1 (mod p) for 1 < i < q, and U I•‹. *81
(2, 3, ... , p — 2}.
(e) If p > 3, then 2 3- --- - (p — 2) 1 (mod p).
<z (mod z)
Proof. For 1 < k < rn, define M k . Then, gc6 (Mk › k) 1 and hence there exist integers *i. ’Jb
k
such that M k k + k!4k — 1 for 1 < k < m. Let 1 < 7, j < rn. Then
Example 4.3.2. Consider the system of congruences z 20 (mod 28) and z 14 (mod 27) in
Exercise 4.2.7.5. In this case. 1 = 20, = 14, nt = 28 and = 27 so that M —— 28 27 = 756, 1
1
27 and 2' 28. Them +i = — and +2 = 1 show that 1 1 + 2 2' 2- —1 2- 1 = 1. Hence
7 8
EXERCISE 4.5.3. 1. Find the smallest positive integer which when divided by 4 le.ave.s a remainder
1 an,d wh,en, dioi,dr.d buy 9 lr.arr.s a rem,ai,n,dr.r 2.
Find the smalle.st, positive i,nteger which when divided by 8 leaves a remained 4 and wh,en, divided
hp 15 leaves a reminder 10.
3. Does there exist a positi,oe. integer n such that n — 4 (mod 14) and n — 6 (mod 18)? Glide
reasons /or your answer. What if we replace 6 or 4 m/tfi as odd number?
Let n be a positive. integer. Show that th,e set Bp : —— (0, 1, 2, ... , n— 1} has the followi,ng properties:
Any set, say R, with 0, 1 C R. 0 1, in which ‘addition’ and ‘multiplication’ can be defined in
such a way that the above properties are satisfied, is called a commutative ring with unity.
So, Hq (0, 1, 2, ... , u, 1} is an example of a commutative ring with unity. The well known
examples of commutative ring with unity are:
(a) H, the set of integers.
(b) Q, the set of rational numbers.
(c) IR, the set of real numbers.
(d) C, the set of complex numbers.
5. Let m and n be two copiñme positive integers. By Exercise }.8.8.}, the sets Pp, dp, end Hpq are
commutat,ioe. rings with nudity. Now, define addition and multiplication i.n dp dp component-
wi,se. Also, define the functi,on
(a) dq x dp is a commutatioe ring with unity. What are the ñ and 1 here?
70 CHAPTER 4. ELEMENTARY NUMBER 'THEORY
Such a function / is called a ring isomorphism, and thus, the two rings Hp x Hq and Zpq are
isomorphic.