Chapter 4

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 17

Exercise Set 4.

1*

In 1–3, use the definitions of even, odd, prime, and


composite to justify each of your answers.
Prove the statements in 17 and 18 by the method of exhaustion.
1. Assume that k is a particular integer.
17. Every positive even integer less than 26 can be
a. Is−17 an odd integer? b. Is 0 an even integer? expressed as a sum of three or fewer perfect squares.
c. Is 2k−1 odd? (For instance, 10=12+3 2 and 16=4 2.)
2. Assume that m and n are particular integers
18. For each integer n with1 ≤ n ≤ 10, n2 −n+11 is a
a. Is 6m+8n even? b. Is 10mn+7 odd?
prime number.
c. If m > n > 0, is m2 −n2 composite?
3. Assume that r and s are particular integers.
19.Rewrite the following theorem in three different
a. Is 4rseven? b. Is 6r +4s2 +3 odd?
ways :as ∀ , if _____ then _____, as ∀ _____, _____
c. If r and s are both positive, isr2 +2rs+s2 composite?
(without using the words if or then), and as If _____,
Prove the statements in 4–10. then _____ (without using an explicit universal
quantifier).
4. There are integers m and n such that m > 1 and n > 1
b. Fill in the blanks in the proof of the theorem.
1 1
and + n is an integer.
m n Theorem: The sum of any even integer and any odd
1 1 integer is odd.
5. There are distinct integers m and n such that +
m n
is an integer. Proof: Suppose m is any even integer and n is (a). By
6. There are real numbers a and b such that definition of even, m=2 r for some (b), and by
√ a+b ¿ √ a+√ b. definition of odd, n=2 s+ 1 for some integer s. By
7. There is an integer n > 5 such that 2 n −1 is prime. substitution and algebra,
8. There is a real number x such that x > 1 and 2 x > x 10.
m+n=(c )=2(r + s)+1.
Definition: An integer n is called a perfect square if, and
Since r and s are both integers ,so is their sum r + s
only if, n =k2 for some integer k.
.Hence m+n has the form twice some integer plus
9. There is a perfect square that can be written as a sum one, and so (d) by definition of odd.
of two other perfect squares.
Each of the statements in 20–23 is true. For each, (a)
10. There is an integer n such that2 n2 − 5 n+2 is prime.
rewrite the statement with the quantification implicit as
Disprove the statements in 11–13 by giving a counterexample. If _____, then _____, and (b) write the first sentence of
a proof (the “starting point”) and the last sentence of a
11. For all real numbers a and b , if a< b then a 2 < b 2. proof (the “conclusion to be shown”).Note that you do
not need to understand the statements in order to be
n−1
12. For all integers n , if n is odd then is odd. able to do these exercises.
2
1
13. For all integers m and n, if 2 m+ n is odd then m andn are 20. For all integers m, if m>1 then 0< <1 .
m
both odd.
In 14–16, determine whether the property is true for all integers, 21. For all real numbers x, if x >1then x2 > x .
true for no integers, or true for some integers and false for other 22. For all integers m and n, if
integers. Justify your answers. mn=1 then m=n=1∨m=n=−1.
14. (a+ b)2=a2 +b 2 H 15.−a2=(−a)2 23. For all real numbers x, if 0< x <1 then x 2< x.
16. The average of any two odd integers is odd.
But 1 is odd. Therefore, the difference between any odd
integer and any even integer is odd.”
Prove the statements in 24– 34. In each case use only the
definitions of the terms and the Assumptions listed on page 40. Theorem: For all integers k, if k > 0 then k 2 +2k+1
146, not any previously established properties of odd and is composite.
even integers. Follow the directions given in this section for
writing proofs of universal statements.2 “Proof: Suppose k is any integer such that k > 0.If k 2
+2k+1 is composite, then k 2 +2k+1 =r s for some
24. The negative of any even integer is even.
integers r and s such that 1<r <(k 2 +2 k +1)
25. The difference of any even integer minus any odd integer
is odd. and 1< s<(k 2 +2 k +1).
26. The difference between any odd integer and any even since k 2+2k+1=rs
integer is odd. (Note: The “proof” shown in exericse 39
contains an error. Can you spot it?) and both r and s are strictly between 1 and k 2+2 k +1 ,
then k 2 +2 k +1is not prime. Hence k 2+2 k +1 is
27. The sum of any two odd integers is even.
composite as was to be shown.”
28. For all integers n, if n is odd then n2 is odd.
41. Theorem: The product of an even integer and an
29. For all integers n, if n is odd then 3 n+5 is even. odd integer is even.

30. For all integers m, ifm is even then 3m+5 is odd. “Proof: Suppose m is an even integer and n is an
odd integer .If m·n is even, then by definition of even
31. If k is any odd integer and m is any even integer, then, k 2+ mthere
2
exists an integer r such that m·n =2r. Also since m
is odd. is even, there exists an integer p such that m =2p, and
since n is odd there exists an integer q such that
32. If a is any odd integer and b is any even integer, then, n=2 q+1Thus
2 a+3 b is even.
mn=(2 p)(2 q+1)=2 r ,
33. If n is any even integer, then(−1)n =−1.
where r is an integer. By definition of even, then, m·n is
34. If n is any odd integer, then (−1)n =−1. even, as was to be shown.”
Prove that the statements in 35–37 are false. 42. Theorem: The sum of any two even integers equals
4k for some integer k. “Proof: Suppose m and n are any
35. There exists an integer m ≥3 such that m 2 −1 is prime. two even integers. By definition of even, m =2k for
36. There exists an integer n such that 6 n2 +27 is prime. some integer k and n =2k for some integer k. By
substitution,
37. There exists an integer k ≥4 such that 2 k 2 −5k+2 is prime.
m+n =2k+2k =4k.
Find the mistakes in the “proofs” shown in 38–42. This is what was to be shown.”
2
38. Theorem: For all integers k, if k > 0 then k +2k+1 is In 43–60 determine whether the statement is true or
composite. false. Justify your answer with a proof or a
counterexample, as appropriate. In each case use only
“Proof”: For k =2 , k 2 +2 k +1=22 +2 ·2+1=9.But 9=3 ·3 ,
the definitions of the terms and the Assumptions listed
and so 9 iscomposite. Hence the theorem istrue.”
on page 146 not any previously established properties.
39. Theorem: The difference between any odd integer and any
43. The product of any two odd integers is odd.
even integer is odd.
44. The negative of any odd integer is odd.
“Proof: Suppose n is any odd integer, and m is any even
integer. By definition of odd, n=2 k +1 wherek is an integer, 45. The difference of any two odd integers is odd.
and by definition of even, m=2 k where k is an integer. Then
46. The product of any even integer and any integer is
n−m=( 2 k +1)−2 k=1. even.
47. If a sum of two integers is even, then one of the
summands is even. (In the expression a+b, a and b are
called summands.)
57. If m and n are positive integers and mn is a perfect
48. The difference of any two even integers is even.
square, then m and n are perfect squares.
51. For all integers n, if n is prime then (−1)n ¿−1.
58. The difference of the squares of any two
2
52. For all integers m, if m > 2 then m −4 is composite. consecutive integers is odd.
59. For all nonnegative real numbers a and b,
53. For all integers n,n2 −n+11 is a prime number.
√ ab=√ a √ b. (Note that if x is a nonnegative real
54. For all integers n,4 ¿ +n+ 1¿−3 n2 is a perfect square. number, then there is a unique nonnegative real
number y, denoted √ x , such that y 2 = x.
55. Every positive integer can be expressed as a sum of three or
fewer perfect squares. 60. For all nonnegative real numbers a and b,
56. (Two integers are consecutive if, and only if, one is one √ a+b=√ a+√ b .
more than the other.) Any product of four consecutive integers
is one less than a perfect square. 61. Suppose that integers m and n are perfect squares.
Then m + n + 2√ mn is also a perfect square. Why?

✶H 62. If p is a prime number, must 2 p −1 also be prime?


Prove or give a counterexample.

63.✶ If n is a nonnegative integer, must 22 n +1 be


prime? Prove or give a counterexample.
14. Consider the statement: The square of any rational
number is a rational number.
a. Write the statement formally using a quantifier and a
Exercise Set 4.2 variable.
The numbers in 1–7 are all rational. Write each number as a b. Determine whether the statement is true or false and
ratio of two integers. justify your answer.
−35 4 2 Determine which of the statements in 15–20 are true and which
1. 2. 4.6037 3. +
6 5 9 are false. Prove each true statement directly from the
definitions, and give a counterexample for each false statement.
4. 0.37373737...
In case the statement is false, determine whether a small change
5. 0.56565656... would make it true. If so, make the change and prove the new
6. 320.5492492492... statement. Follow the directions for writing proofs on page 154.

7. 52.4672167216721... 15. The product of any two rational numbers is a rational


number.
8. The zero product property, says that if a product of two real
numbers is 0, then one of the numbers must be 0. 16.The quotient of any two rational numbers is a rational
number.
a. Write this property formally using quantifiers and variables.
17.The difference of any two rational numbers is a
b. Write the contrapositive of your answer to part (a). rational number.
c. Write an informal version (without quantifier symbols or r+z
variables) for your answer to part (b). 18.If r and s are any two rational numbers, then is
2
9. Assume that a and b are both integers and that a ≠ 0 and b rational.
≠0. Explain why (b−a)/¿(a b 2) must be a rational number. a+b
19.H For all real numbers a and b, if a < b then a < <
10. Assume that m and n are both integers and that n ≠0. 2
Explain why (5 m+12 n)/(4 n) must be a rational number. b. (You may use the properties of inequalities in T17–
T27 of Appendix A.)
11. Prove that every integer is a rational number.
20. Given any two rational numbers r and s with r < s,
12. Fill in the blanks in the following proof that the square there is another rational number between r and s.
of any rational number is rational: ` (Hint: Use the results of exercises 18 and 19.)

Proof: Suppose that r is (a) . By definition of rational, r Use the properties of even and odd integers that are listed in
=a/b for some (b) with b ≠ 0. By substitution, Example 4.2.3 to do exercises 21–23. Indicate which
properties you use to justify your reasoning.
r 2=(c )=a2 /b 2 .
21. True or false? If m is any even integer and n is any
Since a and b are both integers, so are the products a 2 and odd integer, then m 2 +3n is odd. Explain.
(d) Also b 2 ≠0 by the (e) . Hence r 2is a ratio of two integers
with a nonzero denominator, and so (f) by definition of 22. True or false? If a is any odd integer, then a 2+ ais
rational. even. Explain.

13. Consider the statement: The negative of any rational 23. True or false? If k is any even integer and m is any
number is rational. odd integer, then ¿ is even. Explain.

a. Write the statement formally using a quantifier and a Derive the statements in 24–26 as corollaries of Theorems 4.2.1,
variable. 4.2.2, and the results of exercises 12, 13, 14, 15, and 17.

b. Determine whether the statement is true or false and 24. For any rational numbers r and s,2 r +3s is rational.
justify your answer. 25. If r is any rational number, then 3 r 2 −2r +4 is
rational.
26. For any rational number s,5 s 3 +8 s2 −7 is rational.
33.When expressions of the form ( x−r )( x−s) are multiplied
out, a quadratic polynomial is obtained. For instance,
27. It is a fact that if n is any nonnegative integer, then
( x−2)(x−(−7))=( x−2)(x +7) = x 2 +5 x−14.
1 1 1 1 1−(1/2n+ 1) a. What can be said about the coefficients of the polynomial
1+ + 2 + 3 + …+ n =
2 2 2 2 1 obtained by multiplying out (x −r)(x −s) when both r and s
1−( )
2 are odd integers? when both r and s are even integers? when
one ofr and s is even and the other is odd?
(A more general form of this statement is proved in Section
5.2). Is the right-hand side of this equation rational? If so, b. It follows from part (a) that x 2 −1253 x+ 255cannot be
express it as a ratio of two integers. written as a product of two polynomials with integer
28. Suppose a,b,c,and d are integers and a ≠ c.Suppose also coefficients. Explain why this is so.
that x is a real number that satisfies the equation. 34.Observe that ( x−r )( x−s)(x−t )
ax+ b
=1.Must x be rational? If so, express x as a ratio of two¿ x 3−( r + s+t ) x 2 +( rs+ rt+ st) x−rst .
cx +d
integers. a. Derive a result for cubic polynomials similar to the
result in part (a) of exercise 33 for quadratic
29.Suppose a, b, and c are integers and x, y, and z are
polynomials.
nonzero real numbers that satisfy the following equations:
b. Can x 3+ 7 x2 −8 x−27 be written as a product of three
xy xz yz polynomials with integer coefficients? Explain.
=a and =b and =c .
x+ y x+ z y+ z
In 35–39 find the mistakes in the “proofs” that the sum of
Is x rational? If so, express it as a ratio of two integers. any two rational numbers is a rational number.
30. Prove that if one solution for a quadratic equation of the 35. “Proof: Any two rational numbers produce a rational
form x 2+ bx+ c=0 is rational (where b and c are rational), number when added together. So if r and s are particular
then the other solution is also rational. (Use the fact that if but arbitrarily chosen rational numbers, then r +s is
the solutions of the equation are r and s, rational.”
then x 2 +bx +c=( x−r )( x−s ). ¿ 1 1
36. “Proof: Let rational numbers r = and s= be given.
31. Prove that if a real number c satisfies a polynomial 4 2
equation of the form 1 1 3
Then r + s= + = ,which is a rational number.This is
4 2 4
r 3 x3 + r 2 x 2+ r 3 x 1 +r 0=0 , what was to be shown.”

Where r 0 , r 1 ,r 2, and r 3 are rational numbers, then c 37. “Proof: Suppose r and s are rational numbers. By
satisfies an equation of the form definition of rational, r =a/b for some integers a and b
with b ≠0, and s =a/b for some integers a and b with b
n3 x 3+ n2 x 2 +n3 x 1+ n0=0 , ≠0. Then

where n0 , n1 , n2, andn3 are integers. a a 2a


r + s= + = .
b b b
Definition: A number c is called a root of a polynomial Let p =2a. Then p is an integer since it is a product
p(x) if, and only if, p(c) =0 of integers. Hence r +s = p/b, where p and b are
integers and b ≠0. Thus r +s is a rational number by
32 Prove that for all real numbers c, ifc is a root of a
definition of rational. This is what was to be shown.”
polynomial with rational coefficients, then c is a root of a
polynomial with integer coefficients. 38. “Proof: Suppose r and s are rational numbers.
Use the properties of even and odd integers that are listed in Then r =a/b and s =c/d for some integers a,b,c, andd
with b ≠0 and d≠0 (by definition of rational). Then
Example 4.2.3 to do exercises 33 and 34.
a c
r + s= +
b d
But this is a sum of two fractions, which is a fraction.
where r So is an integer, and so by definition of divisibility,
r +s is a rational number since a rational number
(d)is, as
a was to be shown.
fraction.”
Prove statements 15 and 16d irectly from the definition of
39. “Proof: Suppose r and s are rational numbers. If r +sdivisibility.
is
rational, then by definition of rational r +s =a/b for some
integers a and b with b =0.Also since r and s are rational,
15. For allr integers a, b, and c, if a∨b and a∨c then
=i/j and s =m/n for some integers i, j, m, and n with j ≠0
a∨(b+c ). and
n≠0. It follows that
i m a 16.H For all integers a, b, and c, if a∨b and a∨c then a|
r + s= + = ,
j n b (b−c).

which is a quotient of two integers with a nonzero 17.Consider the following statement: negative of any
denominator. Hence it is a rational number. This is multiple of 3 is a multiple of 3.
what was to be shown.” a. Write the statement formally using a quantifier
and a variable.

b. Determine whether the statement is true or false


and justify your answer.
Exercise Set 4.3
18. Show that the following statement is false: For all
Give a reason for your answer in each of 1–13. Assume that integers a and b, if 3∨(a+ b) then 3∨(a−b).
all variables represent integers.
1. Is 52 divisible by 13? 2. Does 7|56?
For each statement in 19–31, determine whether the
statement is true or false. Prove the statement directly from
3. Does 5|0?
the definitions if it is true, and give a counterexample if it is
false.
4. Does 3 divide (3k+1)(3k+2)(3k+3)?
19. For all integers a, b, and c, if a divides b then a divides
bc.
5. Is 6m(2m+10) divisible by 4?
20. The sum of any three consecutive integers is divisible
6. Is 29 a multiple of 3?
by 3. (Two integers are consecutive if, and only if, one is
one more than the other.)
7. Is−3 a factor of 66?
21. The product of any two even integers is a multiple of 4.
8. Is 6a(a+b) a multiple of 3a?
22.H A necessary condition for an integer to be divisible by
9. Is 4 a factor of 2a·34b?
6 is that it be divisible by 2.
10. Does 7|34? 11. Does 13|73?
23. A sufficient condition for an integer to be divisible by 8
is that it be divisible by 16.
12. If n=4 k +1, does 8 divide n2 −1?
24. For all integers a, b, and c, if a∨b and a∨c then
13. If n=4 k +3 , does 8 dividen2 −1? a∨(2 b−3 c).
14. Fill in the blanks in the following proof that for all 25. For all integers a, b, and c, if a is a factor of c then ab is
integers a and b, if a∨b then a∨(−b). a factor of c.
Proof: Suppose a and b are any integers such that (a) .By
definition of divisibility, there exists an integer r such that 26.H For all integers a, b, and c, if ab∨c then a∨c and
(b) . By substitution. b∨c .
−b=−ar =a(−r). 27.H For all integers a, b, and c, if a∨(b+c )then a∨b or
a∨c .
Let t = (c) .Then t is an integer because t = (−1)·r, and
both−1 and r are integers. Thus, by substitution,−b = at,
28. For all integers a, b , and c , if a∨bc then a∨b
c. Find
or the least positive integer m such that 22·35·7·11x
. square.
e e e
29. For all integers a and b, if a∨b then a 2∨b239.Suppose
. that in standard factored form a= p1 p2 … p k 1 2 k

,where k is a positive integer; p1 , p2 , .. pk are prime numbers;


30. For all integers a and n, if a∨n2 and a ≤ n then a∨n
,e 2,...,e k are positive integers.

31. For all integers a and b, ifa|10b then a|10 or a|b. What is the standard factored form for a 3?
0Find the least positive integer n such that
32. A fast-food chain has a contest in which a card with
numbers on it is given to each customer who makes25 a ·3 · 52· 73 · k is a perfect cube (i.e., equals an integer to
purchase. If some of the numbers on the card add up to third
the 100, power). Write the resulting product as a perfect
cube.
then the customer wins $100. A certain customer receives a
card containing the numbers
40. a. If a and b are integers and 12a =25b, does 12
|b? does 25|a? Explain.
72,21,15,36,69,81,9,27,42,and 63
b. If x and y are integers and 10x =9y, does 10|y? does9
Will the customer win $100? Why or why not?
|x? Explain.
33. Is it possible to have a combination of nickels, dimes,
and quarters that add up to $4.72? Explain.
H 41 How many zeros are at the end of 458·885?
Explain how you can answer this question without
34. Is it possible to have 50 coins, made up of pennies,
actually computing the number. (Hint: 10=2·5.)
dimes, and quarters, that add up to $3? Explain.
42. If n is an integer and n > 1, then n! is the product
35. Two athletes run a circular track at a steady pace so that
of n and every other positive integer that is less than
the first completes one round in 8 minutes and the second in
n. For example, 5!=5·4·3·2·1.
10 minutes. If they both start from the same spot at 4 P.M.,
when will be the first time they return to the start together?
a. Write 6! in standard factored form.
36. It can be shown (see exercises 44–48) that an integer is
b. Write 20! in standard factored form.
divisibleby3if, and only if , the sum of its digits is divisible by
3. An integer is divisible by 9 if, and only if, the sum of its
digits is divisible by 9. An integer is divisible by 5 if, and c.Without computing the value of (20 !)2
only if, its right-most digit is a 5 or a 0. And an integer is determine how many zeros are at the end of this
divisible by 4 if, and only if, the number formed by its right- number when it is written in decimal form.
most two digits is divisible by 4. Check the following integers Justify your answer.
for divisibility by 3, 4, 5 and 9.`
✶43 In a certain town 2/3 of the adult men are
a. 637,425,403,705,125 b. 12,858,306,120,312 married to 3/5 of the adult women. Assume that all
c. 517,924,440,926,512 d. 14,328,083,360,232 marriages are monogamous (no one is married to
more than one other person). Also assume that there
37.Use the unique factorization theorem to write the are at least 100 adult men in the town. What is the
following integers in standard factored form. least possible number of adult men in the town? of
adult women in the town?
a. 1,176 b. 5,733 c. 3,675
Definition: Given any nonnegative integer n, the
38.Suppose that in standard factored form a= p p … p
e1 e2 ek decimal representation of n is an expression of the
1 2 k
form.
,where k is a positive integer; p1 , p2 , .. pk are prime numbers;
d k d k−1 … d 2 d 1 d 0
and e 1,e 2,...,e k are positive integers.
Where k is a non negative integer;d 2 , d 1 , d 0 , … , d k
(called the decimal digits of n) are integers from 0
a. What is the standard factored form for a 2?
to 9 inclusive; d k ≠0 unless n =0 and k =0; and
b. Find the least positive integer n such that 25·3·52·73·n is a
perfect square. Write the resulting product as a perfect square. n=d k .10 k + d k−1 . 10k−1 +…+ d2 .10 2+ d 1 .10+d 0

(For example, 2,503=2·103+5·102 +0·10+3.)


Exercise Set 4.4
44. Prove that if n is any nonnegative integer whose
For each of the values of n and d given in 1–6, find integers q
decimal representation ends in 0, then 5|n.(Hint: If
and r such that n=dq+ r and 0 ≤ r <d .
the decimal representation of a nonnegative integer
n ends in d 0, then n=10 m+ d 0 for some integer
m.). 1. n=70 , d=9 2 . n=62 , d=7
3. n=36 ,d =40 4. n=3 , d=11
45. Prove that if n is any nonnegative integer whose
5. n=−45 , d=11 6. n=−27 , d=8
decimal representation ends in 5, then 5|n.
Evaluate the expressions in 7–10.
46. Prove that if the decimal representation of a
7. a. 43 div 9 b. 43 mod 9
nonnegative integer n ends in d 1 d 2 and if 4|(10 d 1 +
8. a. 50 div 7 b. 50 mod 7
d 0), then 4 |n.( Hint: If the decimal representation
9. a. 28 div 5 b. 28 mod 5
of a nonnegative integer n ends in d 1 d 0, then there
10. a. 30 div 2 b. 30 mod 2
is an integer s such that n =100s+10d 1 +d 0.)
11. Check the correctness of formula (4.4.1) given in Example
4.4.3 for the following values of DayT and N.
a. DayT=6 (Saturday) and N =15
H47. Observe that b. DayT=0 (Sunday) and N =7
7524 = 7·1000+5·100+2·10+4 c. DayT=4 (Thursday) and N =12
=7(999+1)+5(99+1)+2(9+1)+4 ✶12. Justify formula (4.4.1) for general values of
= (7·999+7)+(5·99+5)+(2·9+2)+4 DayT and N.
= (7·999+5·99+2·9)+(7+5+2+4)
= (7·111·9+5·11·9+2·9)+(7+5+2+4) 13. On a Monday a friend says he will meet you
= (7·111+5·11+2)·9+(7+5+2+4) again in 30 days. What day of the week will that be?
= (an integer divisible by 9) + (the sum of H14. If today is Tuesday, what day of the week will it be
the digits of 7524). 1,000 days from today?

Since the sum of the digits of 7524 is divisible by 9, 7524 can 15. January 1, 2000, was a Saturday, and 2000 was a leap
be written as a sum of two integers each of which is year. What day of the week will January 1, 2050, be?
divisibleby9.Itfollowsfromexercise15that7524isdivisible by 9.
16. Suppose d is a positive integer and n is any integer. If
Generalize the argument given in this example to d∨n , what is the remainder obtained when the quotient
any nonnegative integer n. In other words, prove that for any remainder theorem is applied to n with divisor d?
nonnegative integer n, if the sum of the digits of n is divisible
by 9, then n is divisible by 9. 17. Prove that the product of any two consecutive integers
is even.
48.✶ Prove that for any nonnegative integer n, if the sum of
the digits of n is divisible by 3, then n is divisible by 3. 18. The result of exercise 17 suggests that the second
apparent blind alley in the discussion of Example 4.4.7
49.✶ Given a positive integer n written in decimal form, the might not be a blind alley after all. Write a new proof of
alternating sum of the digits of n is obtained by starting with Theorem 4.4.3 based on this observation.
the right-most digit,subtracting the digit immediately to its
left, adding the next digit to the left, subtracting the next digit, 19. Prove that for all integers n,n2 −n+3 is odd.
and so forth. For example, the alternating sum of the digits of
180,928 is 8−2+9−0+8−1=22. Justify the fact that for any 20. Suppose a is an integer. If a mod7=4, what is 5a mod7?
nonnegative integer n, if the alternating sum of the digits of n In other words, if division of a by 7 gives a remainder of 4,
is divisible by 11, then n is divisible by 11. what is the remainder when 5a is divided by 7?

21. Suppose b is an integer. If b mod12=5, what is 8b


mod12? In other words, if division of b by 12 gives a
remainder of 5, what is the remainder when 8b32.
is divided
Given any
by integers a ,b, andc, if a−b is even and b−c is
12? even, what can you say about the parity of 2a−(b+c)? Prove
your answer.
22. Suppose c is an integer. If c mod15=3, what is 10c
mod15? 33. Given any integers a,b, and c, if a−b is odd and b−c is
even, what can you say about the parity of a−c? Prove your
then n2
23. Prove that for all integers n, if n mod5=3answer.
5=4.
H34.Given any integer n, if n > 3, could n,n + 2, and n + 4 all
be prime?
24. Prove that for all integers m and n, if m mod5=2 Prove
and n or give a counterexample.
mod3=6 then mn mod 5=1.
Prove each of the statements in 35–46.
25. Prove that for all integers a and b, if a mod7=5 and b
mod7=6 then ab mod 7=2. 35. The fourth power of any integer has the form 8m or
8m+1 for some integer m.
H26. Prove that a necessary and sufficient condition for a
H36.The
nonnegative integer n to be divisible by a positive product
integer d of any four consecutive integers is divisible
is that n mod d=0.
27. Show that any integer n can be written in one of the three
forms. 37. The square of any integer has the form 4k or 4k+1 for
n=3 q∨n=3 q +1∨n=3 q+ 2 some integer k.
for some integer q. H38. For any integer n, n2 +5 is not divisible by 4.

28. a. Use the quotient-remainder theorem with d =3 to H39.The sum of any four consecutive integers has the form
prove that the product of any three consecutive integers is 4k+2 for some integer k.
divisible by 3.
b. Use the mod notation to rewrite the result of part (a). 40. For any integer n, n(n 22 −1)(n+2) is divisible by 4.
41. For all integers m,m 2 =5k, or m 2 =5k+1, or m 2 =5k+4 for
H29.a.Use the quotient-remainder theorem with d =3 to prove some integer k.
that the square of any integer has the form 3k or 3k+1 for
some integer k. H42.Every prime number except 2 and 3 has the form 6q +1 or
b. Use the mod notation to rewrite the result of part (a). 6q +5 for some integer q.

30. a. Use the quotient-remainder theorem with d =3 to 43. If n is an odd integer, then n 4 mod 16=1.
prove that the product of any two consecutive integers has
the form 3k or 3k+2 for some integer k.
H44. For all real numbers x and y ,∨x∨·∨ y∨¿∨xy∨.
b. Use the mod notation to rewrite the result of part (a).
45. For all real numbers r and c with c ≥0 , if −c ≤r ≤ c ,
In 31–33, you may use the properties listed in Example
then ¿ r∨≤c .
4.2.3.

46. For all real numbers r and c with c ≥0 , if ¿ r∨≤c , then


31. a. Prove that for all integers m and n,m + n and m − n are
either both odd or both even. −c ≤r ≤ c .
b. Find all solutions to the equation m 2 −n2 =56 for
47. A matrix M has 3 rows and 4 columns.
which both m and n are positive integers.
c. Find all solutions to the equation m 2−n2 =88 for which
a11 a 12 a13 a14
both m and n are positive integers..
[ a21 a22 a 23 a24
a31 a32 a 33 a34 ]
that can be produced from n pounds of raw material using
The 12 entries in the matrix are to be storedeither
in row
themajor
floor or the ceiling notation. Which notation is more
form in locations 7,609 to 7,620 in a computer’sappropriate?
memory.
This means that the entries in the first row (reading left to
right) are stored first then the entries in the second
9. Boxes,
row,each
and capable of holding 36 units, are used to ship a
finally the entries in the third row. product from the manufacturer to a wholesaler. Express the
number of boxes that would be required to ship n units of the
a. Which location will a 22 be stored in? product using either the floor or the ceiling notation. Which
notation
b. Write a formula (in i and j) that gives the integer is more
n so that appropriate?
a ij is stored in location 7,609+n.
10. If 0=Sunday, 1=Monday, 2=Tuesday,...,6=Saturday, then
c. Find formulas (in n) for r and s so that a rs is stored in
January 1 of year n occurs on the day of the week given by
location 7,609+n.
the following formula:

48. Let M be a matrix with m rows and n columns, and


n−1 n−1 n−1
suppose that the entries of M are stored in n+
( ⌊
a computer’s⌋−⌊
4 N, 100
memory in row major form (see exercise 47) in locations
⌋+⌊
100 )
⌋ mod 7.

N +1, N +2,...,N +mn−1.Findformulasink for a.r and


Use sthis
so formula
that to find January 1 of
a rs is stored in location N +k. i. 2050 ii. 2100 iii. the year of your birth.
H b. Interpret the different components of this formula.

✶49. If m, n, and d are integers ,d > 0,and m mod d=n mod


11. State a necessary and sufficient condition for the floor of a
d , does it necessarily follow that m =n? That m−n is
real number to equal that number.
divisible by d? Prove your answers.
12. Prove that if n is any even integer, then ⌊ n/2 ⌋ =n/2.
✶50.If m, n, and d are integers, d > 0, and d∨(m−n) , what
is the relation between m mod dand n mod d? Prove your 13. Suppose n and d are integers and d =0. Prove each of
answer. the following.

✶51.If m ,n ,a, b, and d are integers, d > 0, and m mod d=a a. If d∨n, then n = ⌊ n/ d ⌋·d.
and n mod d=b, is (m+n) mod d = a+b? Is (m+n) mod d = b. If n=⌊ n/d ⌋ · d , then d∨n .
(a+b) mod d? Prove your answers. c. Use the floor notation to state a necessary and sufficient
condition for an integer n to be divisible by an integer d.

Some of the statements in 14–22 are true and some are


Exercise Set 4.5 false. Prove each true statement and find a
Compute ⌡x⌡ and ⌠x⌠ for each of the values of x in 1–4. counterexample for each false statement, but do not use
1. 37.999 2. 17/4 Theorem 4.5.1. in your proofs.
3. −14.00001 4. −32/5
14. For all real numbers x and y , ⌊ x− y ⌋ =⌊ x − y ⌋ .
5. Use the floor notation to express 259 div 11 and 259 mod
11. 15. For all real numbers x, ⌊ x −1 ⌋ =⌊ x ⌋ −1.
16. For all real numbers x, ⌊ x2 ⌋ = ⌊ x ⌋ 2.
6. If k is an integer, what is ⌈ k ⌉ ? Why? H17 For all integers n,
n
1 ⌊ ⌋=n /3 if mod 3=0
7. If k is an integer, what is ⌈ k + ⌉ ?Why? 3
2 ¿( n−1)/3if mod 3=1
n−2
8. Seven pounds of raw material are needed to manufacture ¿ if mod 3=2
3
each unit of a certain product. Express the number of units
H18 For all real numbers x and y, ⌈ x + y ⌉=⌈ x ⌉ + ⌈ y ⌉Set
Exercise . 4.6
Fill in the blanks in the following proof by
H19.For all real numbers x, ⌈ x−1⌉ =⌈ x ⌉−1. contradiction that there is no least positive real number.
Proof: Suppose not. That is, suppose that there is a least
20. For all real numbers x and y, ⌈ xy ⌉ =⌈ x ⌉ · ⌈ positive
y ⌉. real number x. [We must deduce (a) ] Consider
the number x/2. Since x is a positive real number, x/2 is
21. For all odd integers n, ⌈ n/2 ⌉=( n+1) /2. also (b) .In addition, we can deduce that x/2 < x by
multiplying both sides of the inequality 1 < 2 by (c) and
22. For all real numbers x and y, ⌈ xy ⌉ =⌈ x ⌉ · ⌊ dividing
y ⌋. (d) . Hence x/2 is a positive real number that is
less than the least positive real number. This is a (e)
Prove each of the statements in 23–29. [Thus the supposition is false, and so there is no least
positive real number.]
23. For any real number x, ifx is not an integer, then 1
Is an irrational number? Explain.
⌊ x ⌋ + ⌊−x ⌋=−1. 0

24.For any integer m and any real number x, ifx is not an


Use proof by contradiction to show that for all
integer, then ⌊ x ⌋ + ⌊ m−x ⌋ =m−1. integers n, 3n+2 is not divisible by 3.

H25 For all real numbers x ⌊ , ⌊ x /2 ⌋ /2 ⌋=⌊ x /4 ⌋ .


4. Use proof by contradiction to show that for all
integers m,7m+4 is not divisible by 7.
26. For all real numbers x, if x−⌊ x ⌋ <1/2 then ⌊ 2 x ⌋
⌊ 2 x ⌋.
Carefully formulate the negations of each of the statements
1 in 5–7. Then prove each statement by contradiction.
27. For all real numbers x, if x – ⌊ x ⌋ ≥ then There is no greatest even integer.
2
⌊ 2 x ⌋=2 ⌊ x ⌋+ 1. There is no greatest negative real number.
7.There is no least positive rational number.
28. For any odd integer n, 8..Fill in the blanks for the following proof that the
difference of any rational number and any irrational
n 2 n−1 n−2
⌈ =
4 2( )( )2
⌉ number is irrational. Proof: Suppose not. That is,
suppose that there exist (a) x and (b) y such that x −y
is rational. By definition of rational, there exist
29. For any odd integer n, integers a, b, c, andd with b ≠ 0 and d ≠ 0 so that
n 2 n2 +3 x = (c) and x −y = (d) .By substitution,
= .
⌈ 4 4 a c
¿⌉ − y=
b d
¿
30. Find the mistake in the following “proof” that ⌊ n/2 ⌋ =
c
(n−1)/2 I fn is an odd integer. “Proof: Suppose n is any odd Adding y and subtracting on both sides gives
d
integer .Then n =2k+1 for some integer k. Consequently,
y= ( e )
2 k +1 ( 2 k +1 )−1 2 ad bc
⌊ = = =k . ⌋ ¿ −
2 2 k bd bd
ad−bc
¿ by algebra .
But n =2k + 1. Solving for k gives k = (n−1)/2. Hence, by bd
substitution, ⌊ n/2 ⌋ =( n−1)/2.”
Now both ad−bc and bd are integers because
products and differences of (f) are (g) . And bd ≠ 0
by the (h) . Hence y is a ratio of integers with a
nonzero denominator, and thus y is (i) by definition
of rational. We therefore have both that 19. y Ifis a product of two positive real numbers is greater than
irrational and that y is rational, which 100, is athen at least one of the numbers is greater than 10.
contradiction. [Thus the supposition is false and the
statement to be proved is true.] 20. If a sum of two real numbers is less than 50, then at least
9. a. When asked to prove that the difference of
oneany
of the numbers is less than 25.
irrational number and any rational number is
irrational, a student began, “Suppose not. That Consider the statement “For all integers n, if n2 is odd
21. is,
suppose the difference of any irrational number andn is odd.”
then
any rational number is rational.” What is wronga.with
Write what you would suppose and what you would need to
beginning the proof in this way? (Hint: Review showtheto prove this statement by contradiction.
answer to exercise 11 in Section 3.2.) b. Write what you would suppose and what you would need
b. Prove that the difference of any irrational
to show to prove this statement by contraposition.
number and any rational number is irrational.
22. Consider the statement “For all real numbers r, if r 2 is
Prove each statement in 10–17 by contradiction.irrational then r is irrational.”
a. Write what you would suppose and what you would need to
10. The square root of any irrational numbershowisto prove this statement by contradiction.
irrational. b. Write what you would suppose and what you would need
to show to prove this statement by contraposition.
11. The product of any nonzero rational number and
any irrational number is irrational. Prove each of the statements in 23–29 in two ways: (a) by
contraposition and (b) by contradiction.
12. If a and b are rational numbers, b≠0,and r is an
irrational number, then a+br is irrational. 23. The negative of any irrational number is irrational.

H 13 For any integer n, n2 −2 is not divisible by 424. The reciprocal of any irrational number is irrational.
H 14.For all prime numbers a,b, andc,a 2 +b 2 ≠c 2.. reciprocal of a nonzero real number x is 1/ x .)
H15. If a,b, and c are integers and a 2 +b 2 = c 2, then at least
one of a and b is even. H25. For all integers n, if n2 is odd then n is odd.

H✶16.For all odd integers a,b, and c, if z is a solution of 26. For all integers a,b, and c, if a X bc then a X b.
ax 2 +bx +c=0 then z is irrational. (In the proof, use the (Recall that the symbol|means “does not divide.”)
properties of even and odd integers that are listed in
Example 4.2.3.) H27. For all integers m and n, if m+n is even then m and
n are both even or m and n are both odd.
17. For all integers a , if a mod 6=3, then a mod 3≠2. 28. For all integers m and n, ifmn is even then m is even
or n is even.
18. Fill in the blanks in the following proof by contraposition
29. For all integers a,b, and c, if a|b and a X c, then a
that for all integers n, if 5 χ n 22 then 5 χ n.
X (b+c).(Hint: To prove p →q ∨r, it suffices to prove
Proof (by contraposition): [The contrapositive is: For all
either p ∧∼ q →r or p ∧∼ r →q. See exercise 14 in
integers n, if 5|n then5|n2.] Suppose n is any integer such that
Section 2.2.)
(a) . [We must show that (b) .] By definition of divisibility, n
= (c) for some integer k. By substitution, n2 = (d) =5(5 k 2). But
30.The following “proof” that every integer is rational is
5k 2 is an integer because it is a product of integers. incorrect. Find the mistake.
Hence n2 =5·(an integer), and so (e) [as was to be shown]. “Proof (by contradiction): Suppose not. Suppose every
integer is irrational. Then the integer 1 is irrational. But
Prove the statements in 19 and 20 by contraposition.
1=1/1, which is rational. This is a contradiction.Use[Hence
the sieve of Eratosthenes to find all prime numbers less
the supposition is false and the theorem is true.]”
than 100. 34. Use the test for primality and the result of
exercise 33 to determine whether the following numbers are
31. a. Prove by contraposition: For all positive prime.
integers
n,r, and s, if rs ≤n , then r ≤ √ n or s ≤ √ n.a. 9,269 b. 9,103 c. 8,623 d. 7,917
b. Prove: For all integers n > 1, if n is not prime,
then there exists a prime number p such that Hp ≤ 35.√ nUse
andproof by contradiction to show that every integer
n is divisible by p.(Hints: Use the resultgreater of part
than 11 is a sum of two composite numbers.
(a),Theorems4.3.1,4.3.3,and4.3.4,andthetransitivepropert
y of order.)
c. State the contrapositive of the result of part (b).
The results of exercise 31 provide a way to test whether
an integer is prime.
Exercise Set 4.7
Test for Primality
Given an integer n > 1, to test whether n is prime check
A calculator display shows that
to see if it is divisible by a prime number less than or
equal to its square root. If it is not divisible by any of 1414213562
√ 2=1.414213562 , and 1.414213562= .
these numbers, then it is prime. 1000000000
This suggests that √2 is a rational number, which
32.Use the test for primality to determine whether contradicts
the Theorem 4.7.1. Explain the discrepancy.
following numbers are prime or not. Example 4.2.1(h) illustrates a technique for
a. 667 b. 557 c. 527 d. 613 showing that any repeating decimal number is rational.
A calculator display shows the result of a certain
calculation as 40.72727272727. Can you be sure that the
result of the calculation is a rational number? Explain.

Determine which statements in 3–13 are true and which are


false. Prove those that are true and disprove those that are

33. The sieve of Eratosthenes, named after its


inventor, the Greek scholar Eratosthenes (276–194 3. 6−7√2 is irrational. 4. 3√2−7 is irrational.
B.C.E.), provides a way to find all prime numbers
less than or equal to some fixed number n. To 5. √4 is irrational. 6. √2/6 is rational.
construct it, write out all the integers from 2 to n.
Cross out all multiples of 2 except 2 itself, then all 7.The sum of any two irrational numbers is
multiples of 3 except 3 itself, then all multiples of 5 irrational.
except 5 itself, and so forth. Continue crossing out the
multiples of each successive prime number up to √n. 8. The difference of any two irrational numbers is
The numbers that are not crossed out are all the prime irrational.
numbers from 2 to n. Here is a sieve of Eratosthenes
that includes the numbers from 2 to 27. The multiples 9.The positive square root of a positive irrational
of 2 are crossed out with a /, the multiples of 3 with number is irrational.
a \, and the multiples of 5 with a —.
10. If r is any rational number and s is any irrational
2 3 4 5 6 7 8 9 10 11 12 13 14 number, then r / s is irrational.
15 16 17 18 19 20 21 22 23 24 25 26 27
11.The sum of any two positive irrational numbers
is irrational.
12. The product of any two irrational numbers is
irrational. 21. An alternative proof of the irrationality of √ 2 counts the
number of 2’s on the two sides of the equation 2 n2=m 2 and
H13.If an integer greater than 1 is a perfect square,
uses the unique factorization of integers theorem to deduce a
then its cube root is irrational. 14. Considercontradiction.
the Write a proof that uses this approach.
following sentence: If x is rational then √ x is
irrational. Is this sentence always true, sometimes
22. Use the proof technique illustrated in exercise 21 to
true and sometimes false, or always false? Justify
prove that if n is any integer that is not a perfect square,
your answer. then√n is irrational.

14. Consider the following sentence: If x is rational


H23 Prove that √ 2+ √ 3 is irrational.
then √ x is irrational. Is this sentence always true,
sometimes true and sometimes false, or always 24.Prove that log 5 (2) is irrational. (Hint: Use the unique
false? Justify your answer. factorisation of integers theorem.)

15. a. Prove that for all integers a, if a 3 is evenH25.


then Let N =2·3·5·7+1. What remainder is obtained when N
a is even. is divided by 2? 3? 5? 7? Is N prime? Justify your answer.
3
b. Prove that √ 2is irrational.
H26.Suppose a is an integer and p is a prime number such
16. a. Use proof by contradiction to show that for p∨a and p∨(a+3).What can you deduce about p?
any integer n, it is impossible for n to equal Why? both
3 q +r and3 q +r , where q 1,q 2,r 1, and r 2, are
1 1 2 2

integers, 0≤ r 11 < 3 ,0 ≤r 2 < 3, and r 1≠ r 2. 27. Let p1 , p2 , p 3,… be a list of all prime numbers in
ascending order. Here is a table of the first six:
b. Use proof by contradiction, the quotient-
remainder theorem, division into cases, and the
result of part (a) to prove that for all integers n, if n2 P2 P3 P4 P5 P6
is divisible by 3 then n is divisible by 3. 3 5 7 11 13
c. Prove that√3 is irrational. H a. For each i =1, 2, 3, 4, 5, 6, let N i = p1 p 2··· p1+1.
Calculate N 1, N 2, N 3, N 4 , N 5, and N 6.
17. Give an example to show that if d is not prime
and n2 is divisible by d, then n need not be divisible
by d.
H18. The quotient-remainder theorem says not only that
there exist quotients and remainders but also that the b.For each i =1,2,3,4,5,6, find the smallest prime number
quotient and remainder of a division are unique. Prove the q isuch that q i divides N i.(Hint: Use the test for primality
uniqueness. That is, prove that if a and d are integers with d from exercise 31 in Section 4.6 to determine your
> 0 and if q 1 , r 1 , q2 , andr2 are integers such that answers.)

a=dq 1+ r 1 where 0 ≤ r 1< d For exercises 28 and 29, use the fact that for all integers n,
and n !=n( n−1)...3 · 2· 1.
a=dq 2+ r 2 where 0 ≤ r 2< d ,
then 28. An alternative proof of the infinitude of the prime
q 1=q 2∧r 1=r 2 . numbers begins as follows: Proof: Suppose there are only
finitely many prime numbers. Then one is the largest. Call
it p . Let M =p ! +1.We will show that there is a prime
H19. Prove that√5 is irrational.
number q such that q > p. Complete this proof.
H20. Prove that for any integer a,9 X (a 2−3).
H✶ 29.Prove that for all integers n, if n > 2 then there is a
prime number p such that n < p < n!. i :=2
if (i > 3 or i ≤0)
H✶30. Prove that if p1 , p2,...,and pn are distinct prime then z : = 1
else z :=0
numbers with p1 ,=2and n > 1,then p1 p 2·· p n+ 1 can
be written in the form 4k+3 for some integer k.
i :=3
H31a. Fermat’s last theorem says that for all integers n >
if (i ≤3 or i > 6)
2, the equation x n + y n=z n has no positive integer solution
then z :=2
(solution for which x, y, and z are positive integers). else Provez :=0
the following: If for all prime numbers p > 2, x + y p=z p
p

has no positive integer solution, then for any integer n > 2Consider the following algorithm segment:
that is not a power of 2, x n + y n=z n has no positive if x·y >0 then do y :=3·x
integer solution. x := x +1 end do
z := x·y
b. Fermat proved that there are no integers x, y, andz such
Find the in
that x 4 + y 4 =z 4. Use this result to remove the restriction value of z if prior to execution x and y have the
part (a) that n not be a power of 2. That is, prove that if n is below.
values given
a power of 2 and n > 4, then x n + y n=z n has no a. xpositive
=2, y =3 b. x =1, y =1
integer solution.
Find the values of a and e after execution of the loops in 4
For exercises 32–35 note that to show there isanda 5:
unique
object with a certain property, show that (1) there is an
object with the property and (2) if objects A and B havea :=2
the property, then A = B. for i :=1 to 2
a := a 2 + 1 a
32. Prove that there exists a unique prime numbernext i
of the
e :=0 f :=2
form n2 −1, where n is an integer that is greater than or
for j :=1 to 4
equal to 2.
f := f ·j
e :=e+ 1 f
33. Prove that there exists a unique prime number of the
next j
form n2 +2n−3, where n is a positive integer.
Make a trace table to trace the action of Algorithm 4.8.1 for
34. Prove that there is at most one real number a
the input variables given in 6 and 7.
with the property that a+r =r for all real numbers r.
6. a =26,d =7 7 . a =59,d =13
(Such a number is called an additive identity.)

35. Prove that there is at most one real number b with the 8. The following algorithm segment makes change; given
property that br =r for all real numbers r. (Such a number is an amount of money A between 1c / and 99c /, it
called a multiplicative identity.) determines a breakdown of A into quarters (q), dimes(d),
nickels (n), and pennies (p).

q := A÷25
Exercise Set 4.8 A :=A mod 25
d := A÷10
Find the value of z when each of the algorithm segments in 1 A :=A mod 10
and 2 is executed. n :=A÷5
p := A mod5 q=⌊ a/d ⌋∧r =a−⌊ a/d ⌋ · d .
a. Trace this algorithm segment for A =69.
b.Trace this algorithm segment for A =87. b. In a computer language with a built-in-floor function, div
and mod can be calculated as follows:
Find the greatest common divisor of each of the pairs of
integers in 9–12. (Use any method you wish.) a÷d=⌊ a /d ⌋∧a mod d=a−⌊ a/d ⌋ · d .
9. 27 and 72 10. 5 and 9
11. 7 and 21 12. 48 and 54 Rewrite the steps of Algorithm 4.8.2 for a computer
language with a built-in floor function but without div
Use the Euclidean algorithm to hand-calculate the and greatest
mod.
common divisors of each of the pairs of integers in 13–16.
13. 1,188 and 385 14. 509 and 1,177
24. An alternative to the Euclidean algorithm uses
15. 832 and 10,933 16. 4,131 andsubtraction
2,431 rather than division to compute greatest common
divisors. (After all, division is repeated subtraction.) It is
Make a trace table to trace the action of Algorithm
based on 4.8.2
the following lemma: Lemma 4.8.3
for the input variables given in 17 and 18.
17. 1,001 and 871 18. 5,859 andIf1,232
a ≥ b>0 , t hen gcd (a , b)=gcd (b , a−b) .

H19.Prove that for all positive integers a and Algorithm


b,a|b if, and 4.8.3 Computing gcd’s by Subtraction
only if, gcd(a,b) =a. (Note that to prove “A if, [Given
and only if, positive integers A and B, variables a and b are
two
B,” you need to prove “if A then B” and “if B then A.”) to A and B. Then a repetitive process begins. If a =
set equal
0, and b =0, then the larger of a and b is set equal to a−b (if a
20. a. Prove that if a and b are integers, not both
≥b)zero,
or toand
b−a (if a < b), and the smaller of a and b is left
d =gcd(a,b), then a/d and b/d are integers with unchanged.
no common This process is repeated over and over until
divisor that is greater than one. eventually a or b becomes 0. By Lemma 4.8.3, after each
b. Write an algorithm that accepts the numerator
repetitionand
of the process,
denominator of a fraction as input and produces as output
the numerator and denominator of that fractiongcd written in
( A , B)=gcd (a ,b).
lowest terms. (The algorithm may call upon the Euclidean
After the last repetition,
algorithm as needed.)
gcd ( A , B)=gcd (a ,0)∨gcd ( A , B)=gcd (0 , b)
21. Complete the proof of Lemma 4.8.2 by proving the
depending on whether a or b is nonzero. But by Lemma
following: If a and b are any integers with b ≠ and q and r
4.8.1,
are any integers such that
gcd (a , 0)=a∧gcd (0 , b)=b .
a=bq+ r .
Hence, after the last repetition,
then gcd (b , r )≤ gcd( a , b).
gcd ( A , B )=aif a ≠0∨gcd ( A , B)=bif b ≠ 0.¿
H22 a. Prove: If a and d are positive integers and q and Input:
r are A, B [positive integers]
integers such that a =dq + r and 0 < r < d, then
−a=d (−(q+1))+(d −r)
Algorithm Body:
and0< d−r <d .
a := A , b :=B
b. Indicate how to modify Algorithm 4.8.1 to allow for the while(a ≠ 0∧b ≠ 0)
input a to be negative. if a ≥ b thena :=a−b
else b :=b−a
23. a. Prove that if a,d,q, andr are integers such that
a=dq+ r and 0 ≤ r <d , then end while
if a=0 then gcd :=b
else gcd :=a

[After execution of the if-then-else statement,


gcd=gcd ( A , B) .¿

Output: gcd [a positive integer]

a. Prove Lemma 4.8.3.


b. Trace the execution of Algorithm 4.8.3 for A
=630 and B =336.
c. Trace the execution of Algorithm 4.8.3 for A
=768 and B =348.

Exercises 25–29 refer to the following definition.

Definition: The least common multiple of two


non zero integers a and b, denoted lcm( a ,b) , is the
positive integer c such that
a. a∨c andb∨c
b. for all positive integers m, if a∨m and b∨m ,
then c ≤m .

25. Find
a. lcm(12, 18) b. lcm(22·3·5, 23·32)
c. lcm(2800, 6125)

26. Prove that for all positive integers a and b,


gcd (a , b)=lcm( a , b) if, and only if, a=b .

27. Prove that for all positive integers a and b, a∨b


if, and only if, lcm(a ,b)=b.

28. Prove that for all integers a and


b , gcd (a , b)∨lcm(a , b) .

H29. Prove that for all positive integers a and b,


gcd (a , b)· lcm( a ,b)=ab.

You might also like