(a) (m+ 2) div 8 (b) (m+ 2) mod 8
(c) (3mn) div 8 (d) (3mn) mod 8
(e) (5m+ 2n) div 8 (f) (5m+ 2n) mod 8 (g) (3m−2n) div 8 (h) (3m−2n) mod 8
5.3
Divisibility
In this section, we shall study the concept of divisibility. Letaand bbe two integers such that a6= 0. The following statements are equivalent:
• adivides b,
• ais a divisor ofb,
• ais a factor ofb,
• b is amultiple ofa, and
• b isdivisible by a.
They all mean
Memorize this definition! There exists an integerqsuch thatb=aq.
In terms of division, we say thatadividesbif and only if the remainder is zero whenbis divided bya. We adopt the notation
a|b [ pronounced as “adividesb”]
Do not use a forward slash / or a backward slash \ in the notation. To say that a does not Writea|b,nota/b
ora\b. divideb, we add a slash across the vertical bar, as in
a-b [ pronounced as “adoes not divideb”] Do not confuse the notationa|bwith a
b. The notation a
b represents a fraction. It is also written as a/b with a (forward) slash. It uses floating-point (that is, real or decimal) division. For example, 114 = 2.75.
The definition of divisibility is very important. Many students fail to finish very simple
proofs because they cannot recall the definition. So here we go again: Memorize this definition. a|b ⇔ b=aqfor some integerq.
Both integersa andb can be positive or negative, andbcould even be 0. The only restriction isa6= 0. In addition,q must be an integer. For instance, 3 = 2·3
2, but it is certainly absurd to
say that 2 divides 3.
Example 5.3.1 Since 14 = (−2)·(−7), it is clear that−2|14. N Hands-On Exercise 5.3.1 Verify that
5|35, 8-35, 25-35, 7|14, 2| −14, and 14|14,
by finding the quotientqand the remainder rsuch thatb=aq+r, andr= 0 ifa|b.
126 Chapter 5 Basic Number Theory
Example 5.3.2 An integer iseven if and only if it is divisible by 2, and it isodd if and only
if it is not divisible by 2. N
Hands-On Exercise 5.3.2 What is the remainder when an odd integer is divided by 2? Com- plete the following sentences:
• Ifnis even, then n= for some integer . The definition of even
and odd integers. • Ifnis odd, thenn= for .
Memorize them well, as you will use them frequently in this course. 4
Hands-On Exercise 5.3.3 Complete the following sentence:
• Ifnis not divisible by 3, thenn= , or n= , for some integer . Compare this to the div and mod operations. What are the possible values ofnmod 3? 4
Example 5.3.3 Given any integera6= 0, we always havea|0 because 0 =a·0. In particular, 0 is divisible by any
nonzero integer. 0 is divisible by 2, hence, it is considered an even integer. N Example 5.3.4 Similarly,±1 and±b divideb for any nonzero integerb. They are called the
trivial divisors ofa. A divisor ofbthat is not a trivial divisor is called anontrivial divisor
ofb.
For example, the integer 15 has eight divisors: ±1,±3,±5,±15. Its trivial divisors are±1 and±15, and the nontrivial divisors are±3 and±5. N
Definition. A positive integerais aproper divisor ofbifa|b anda <|b|. Ifais a proper
divisor ofb, we say thata divides b properly. ♦
Remark. Some number theorists include negative numbers as proper divisors. In this con- vention,ais a proper divisor ofb ifa|b, and|a|<|b|. To add to the confusion, some number theorists exclude±1 as proper divisors. Use caution when you encounter these terms. ♦
Example 5.3.5 It is clear that 12 divides 132 properly, and 2 divides −14 properly as well.
The integer 11 has no proper divisor. N
Hands-On Exercise 5.3.4 What are the proper divisors of 132?
4
Definition. An integerp >1 is aprime if its positive divisors are 1 andpitself. Any integer greater than 1 that is not a prime is calledcomposite. ♦
Remark. A positive integernis composite if it has a divisordthat satisfies 1< d < n. Also, according to the definition, the integer 1 is neither prime nor composite. ♦
Example 5.3.6 The integers 2,3,5,7,11,13,17,19,23, . . . are primes. N Hands-On Exercise 5.3.5 What are the next five primes after 23?
5.3 Divisibility 127
Theorem 5.3.1 There are infinitely many primes.
Proof: We postpone its proof to a later section, after we prove a fundamental result in number
theory.
Theorem 5.3.2 For all integersa,b, andc wherea6= 0, we have (1) Ifa|b, thena|xb for any integerx.
(2) Ifa|b andb|c, thena|c. (This is called the transitive property of divisibility.)
(3) Ifa|b anda|c, thena|(sb+tc)for any integers xandy. (The expression sb+tcis called a linear combinationof bandc.)
(4) Ifb6= 0anda|bandb|a, thena=±b. (5) Ifa|b anda, b >0, thena≤b.
Proof: We shall only prove (1), (4), and (5), and leave the proofs of (2) and (3) as exercises.
Proof of (1). Assumea|b, then there exists an integer qsuch that b=aq. For any integerx, we have
xb=x·aq=a·xq, wherexq is an integer. Hence,a|xb.
Proof of (4). Assumea|b, andb|a. Then there exist integers qand q0 such that b=aq, and a=bq0. It follows that
a=bq0 =aq·q0.
This implies thatqq0 = 1. Bothq andq0 are integers. Thus, each of them must be either 1 or
−1, which makesb=±a.
Proof of (5). Assumea|banda, b >0. Then b=aqfor some integerq. Sincea, b >0, we also haveq >0. Being an integer, we must haveq≥1. Thenb=aq≥a·1 =a. Example 5.3.7 Use the definition of divisibility to show that given any integersa, b, andc, wherea6= 0, ifa|banda|c, thena|(sb2+tc2) for any integerssand t.
Solution: We try to prove it from first principles, that is, using only the definition of divisibility. Here is the complete proof.
Assumea|b anda|c. There exist integersxandy such thatb=ax andc=ay. Then
sb2+tc2=s(ax)2+t(ay)2=a(sax2+tay2), wheresax2+tay2 is an integer. Hencea|(sb2+tc2).
The key step is substitutingb=axandc=ay into the expressionsb2+tc2. You may ask, how can we know this is the right thing to do?
Here is the reason. We want to show that a| (sb2+tc2). This means we need to find an
integer which, when multiplied bya, yieldssb2+tc2. This calls for writingsb2+tc2as a product of a and another integer that is yet to be determined. Since s and t bear no relationship to a, our only hope lies in b and c. We do know that b =ax and c = ay, therefore, we should
128 Chapter 5 Basic Number Theory
Hands-On Exercise 5.3.6 Leta,b, andc be integers such thata6= 0. Prove that if a|b or a|c, thena|bc.
4
Summary and Review
• An integerbis divisible by a nonzero integeraif and only if there exists an integerqsuch that b=aq.
• An integern >1 is said to be prime if its only divisors are±1 and±n; otherwise, we say that nis composite.
• If a positive integern is composite, it has a proper divisordthat satisfies the inequality 1< d < n.
Exercises 5.3
1. Leta,b, andc be integers such thata6= 0. Use the definition of divisibility to prove that if a| b and c |(−a), then (−c) |b. Use only the definition of divisibility to prove these implications.
2. Leta,b,c, anddbe integers witha, c6= 0. Prove that (a) Ifa|bandc|d, thenac|bd.
(b) Ifac|bc, thena|b.
3. Leta,b, andcbe integers such thata, b6= 0. Prove that ifa|bandb|c, thena|c. 4. Leta,b, andcbe integers such thata6= 0. Prove that ifa|banda|c, thena|(sb+tc)
for any integers sandt.
5. Prove that if nis an odd integer, thenn2−1 is divisible by 4.
6. Use the result from Problem 5 to show that none of the numbers 11, 111, 1111, and 11111 is a perfect square. Generalize, and prove your conjecture.
Hint: Letxbe one of these numbers. Supposexis a perfect square, thenx=n2for some
integer n. How can you apply the result from Problem 5? 7. Prove that the square of any integer is of the form 3kor 3k+ 1.
8. Use Problem 7 to prove that 3m2−1 is not a perfect square for any integerm.
9. Use induction to prove that 3|(22n−1) for all integersn≥1. 10. Use induction to prove that 8|(52n+ 7) for all integersn≥1. 11. Use induction to prove that 5|(n5−n) for all integersn≥1.