Professional Documents
Culture Documents
T Koshy Elementary Number Theory With Applications Solutions PDF
T Koshy Elementary Number Theory With Applications Solutions PDF
ELEMENTARY NUMBER
THEORY WITH
APPLICATIONS
Second Edition
Thomas Koshy
2
ELEMENTARY NUMBER
THEORY WITH
APPLICATIONS
Second Edition
THOMAS KOSHY
FRAMINGHAM STATE COLLEGE
Contents
Preface iii
1 Fundamentals 3
2 Divisibility 25
4 Congruences 63
5 Congruence Applications 77
9 Cryptology 131
This manual contains detailed solutions of all even-numbered exercises in the author's Elementary Number
Theory with Applications, second edition. In addition, it includes some helpful suggestions on How to Study
Math, How to Prepare for an Exam in Math, and How to Take an Exam in Math.
I would like to thank Ward Heilman of Bridgewater State College, Roger W. Leezer of California State
University at Sacramento, and Don Redmond of Southern Illinois University at Carbondale for preparing
the solutions of all even-numbered exercises in the first edition. I am also grateful to Kevin Jackson-Mead
for combing through all solutions in the first edition, both even and odd, for inaccurate and incomplete
solutions, and typographical errors.
Although great care has been taken to ensure the accuracy of solutions and proofs, some errors may
remain. These are solely my own responsibilty. I would appreciate hearing from users concerning any errors,
as well as your thoughts and comments about the book. Finally, enjoy the book and have fun with this rich,
dynamic, and fascinating area of mathematics.
Thomas Koshy
tkoshy@frc.mass.edu
iii
iv PREFACE
How to Study Math
• Prepare a well-planned and well-balanced schedule for each day of the week.
• Always take down notes (on the RHS of your notebook; use the LHS for solutions of corresponding
exercises from the book).
• Study the material taught in class again on the same day as the class.
• Develop a decent working vocabulary of the subject. (Math is a concise and precise language; so try
to speak the language of math fluently.)
• Keep practicing definitions, properties, as well as theorems and their proofs in your own words.
• Study the examples, proofs, and exercises done in class; close your notebook; try to do them on your
own. If you cannot do them without help, study them again and try again.
• Do the exercises at the end of a section, after studying the section; do not reverse the order.
• If you cannot solve a problem because it involves a new theorem, formula, or some property, then
re-study the relevant portion of the section.
• Math can be learned in small quantities only. So, do math every day. Remember, practice is the best
way to succeed.
• Seek help when in doubt or trouble. (e.g. teacher, fellow student, or tutor)
v
vi HOW TO STUDY MATH
• Make the best use of your professor's office hours. Go to him/her always well-prepared. Bring a list of
questions to ask the professor.
• Always review earlier materials before each week. Things must be fresh in your mind for you to build
on them.
• Review notations, definitions, formulas, properties, and theorems. Practice by writing them down.
• On the night before the exam, go to bed early and get a good night's sleep. Otherwise, you won't be
able to concentrate during the exam, your mind will wander, and the material will look foggy.
• Do not stay up late to learn any new material. In fact, do not try to learn anything new the night
before the exam.
• The morning of the exam, glance over all materials to refresh your memory; focus on formulas, prop-
erties, and theorems.
• If a scientific calculator is allowed in the exam, make sure you know how to use the various keys and
functions.
vii
viii HOW TO PREPARE FOR AN EXAM IN MATH
How to Take an Exam in Math
o Taking an exam (in math) is an art. So, master the steps well.
• Take enough writing tools (and a good scientific calculator with extra batteries, if allowed for use in
the exam).
o Do the problems that are easiest for you and those that carry the most weight. The order in which
you answer the problems has no bearing on the score; what matters is the final output.
• Whenever possible, save enough time to check your answers at the end.
Good Luck
ix
X HOW TO TAKE AN EXAM IN MATH
1
Fundamentals
4. 0 or 1
6. no
8. 1, 9, 45, 55, 99
12. A number which is a square, cube, and fifth power must be of the form n 2 ·H = n 30 • So the desired
number is 230 = 1,073, 741,824.
14. Let n be an arbitrary positive integer such that n 2 can be displayed on a 15-digit calculator. Then
n2 ::; 999,999,999,999, 999; that is, n::; 3v'111, 111,111,111,111. Thus n::; 31,622, 776; that is, there
are 31,622,776 positive integers whose squares can be displayed on the calculator. Including 0, the final
answer is 31,622,777.
16. proof:
case 1 Suppose a, b ::> 0. Then ab ::> 0, so lab I = Ia I· lbl.
case 2 Suppose a ::> 0 and b < 0. Since a( -b) ::> 0, Ia( -b)l = a( -b) = Ia I · 1-bl = Ia I · lbl. But
a( -b)= -ab, so Ia( -b)l = 1-abl =lab I. Thus labl = lal· lbl-
case 3 The case a ::; 0 and b > 0 is similar to case 2.
case 4 Suppose a, b < 0. Then ab > 0 and labl = I( -a)( -b)l 1-al · 1-bl, by case 1. Thus
labl = lal · lbl.
18. proof: Let n = 2k + 1 for some integer k. Then ln/2J = lk + 1/2J = k = (n -1)/2.
20. proof: Let n = 2k + 1 for some integer k. Then ln 2 /4J = lk 2 + k + 1/4J = k2 + k = k(k + 1) =
(n- 1)/2 · (n + 1)/2 = (n 2
- 1)/4.
3
4 CHAPTER 1. FUNDAMENTALS
24. proof: Let X= k+x', where 0 <;x' < 1. Then -l-xJ = -l-k-x'J = -(-k-1) =k+1 = rx1.
So
30. proof: Suppose d(x, y) = 0. Then IY- xl = 0, sox= y. Conversely, let x = y. Then y- x = 0 and
hence IY- xl = 0. Thus d(x, y) = 0.
6. 2
L: j ( j - 2)
j=-2
8. 3
L: 3k 2
k=-2
5
5 5 5 5 5
10. I: (3- 2k)k I: 3k - I: 2k 2 = 3 I: k- 2 I: k2
k=l k=l k=l k=l k=l
3. 5·6 -
2
2. 5·6·11 -
6 -
-65
10
12. I: 3'
i=l
5
14. I: i(i + 2)
i=l
16. yes
Proof:
n m
RHS = I: xn+m-i = I; xi, wherej = n + m - i
i=m j=n
n n
= I: xi= I: x'
j=m i=m
= LHS
n n
20. I:[(i+ 1) 3 - i3] I: [3i 2 + 3i + 1]
i=l i=l
n n n
(n+1) 3 -1 3I;i2 +3I;i+I:
i=l i=l i=l
(n + 1) 3 - 1 3S + 3n(n + 1)/2 + n, where S denotes the desired sum
22. 5 6
i~ 2\I;, 1 + 3 j;;/
5 ( 6 6 ) 5
I: I: (2i + 3j)
i=l j=l
= i~ (2i. 6 + 3. 627)
5
I: (12i + 63)
i=l
5 5
12 I: i + 63 I: 1 = 12 . 2 + 63 = 495
56
i=l i=l
24. 5 6
I:I:(i 2 -j+1) 5 ( 26 6 5 )
i=l j=l
i~ i i;;l 1 - j~ j + i~ 1
5
I: (6i'- 627 + 6)
i=l
5 5
6 I: i 2 - 15 I: 1 = 6. 5
~ 11 - 15. 5 = 255
i=l i=l
6 CHAPTER 1. FUNDAMENTALS
3
26. IT (i + 1) = (o + 1)(1 + 1)(2 + 1)(3 + 1) = 24
i=O
k
28. IT (-1Jk = -1
k=O
30. I: p = 2 + 3 + 5 + 7 = 17
p:::;_lO
34. I: (12/d) =
,, (12/1) + (12/2) + (12/3) + (12/4) + (12/6) + (12/12) = 28
d[12
36. I: 1 = 1 + 1 + 1 + 1 = 4
p$ 10
4
40. I: (31- 3}-l) = 34 - 3° = 81- 1 = 80
j=l
2 3 2
42.
I; I; a,J I; (a,,+ a21 + a3J)
j=l i=l j=l
44. a, + a2 + a3
1023 1023
46 · IT (1 + 1/n) -- IT !!±.!
n = 11 . ~2 . 1
3 ...
1024 -
1023 - 1o24
n=l n=l
n n
48. I; k · k! = I; [(k + 1)!- k!J = (n + 1)!- 1! = (n + 1)!- 1
k=l k=l
999
50. By Exercise 48, I; k · k' = 1000! - 1 = ... 999, so the hundreds digit is 9.
k=l
4. yes
6. proof (by contradiction): Assume there is an integer n' E S such that n' < no + l' - 1. Then
no + l* - 1 < l*. Since n' - no + 1 E S* and n' - no + 1 < l*, l* is not a least element of S*, a
contradiction.
8. Let A be a non-empty set of negative integers. Then B = {-ala E A} is a non-empty set of positive
integers and has a least element l in B, by the well-ordering principle. Thus -a 2: l for every a E A;
that is, a .::;_ l for every a in A. Since -l E A, -l is a largest element in A.
7
10. z=12 . -
1.- 12·13
2 -- 78
i=l
s -,-
n(n+l)
16. basis step When n = 1, LHS = a= t.::-/) = RHS. Therefore, P(1) is true.
induction step Assume P(k) is true: z= ari- = a(~-~ ). Then:
k 1 ' 1
i=l
k
Lari-1 +ark
i=l
a(rk-1) k
--"--.,-'- + ar , by the inductive hypothesis
r-1
a(rk- 1) + ark(r -1) a(rk+ 1 - 1)
r-1 r-1
Thus, P(k) implies P(k + 1), so the result follows by induction.
50 50 50
18. z=(k 3 +2) =
k=l
z= k
k=l
3
+2 z=
k=l
1 =(50·51/2) 2 +2·50=1,625,725
n
20.
z= fi/21
i=l
fl/21 + [2/21 + [3/21 + ... + n/21 r
1 + 1 + 2 + 2 + · · · + (n/2) + (n/2) if n is even
1 + 1 + 2 + 2 + ... + (n - 1) /2 + (n - 1) /2 + (n + 1) /2 otherwise
2(1 + 2 + · · · + n/2) if n is even
2[1 + 2 + · · · + (n- 1)/2] + (n + 1)/2 otherwise
2(n/2)(n/2 + 1)/2 if n is even
2[(n -l)/2JI(n- 1)/2 + 1] + (n + 1)/2 otherwise
n(n + 2)/4 if n is even
(n + 1) 2 /4 otherwise
8 CHAPTER 1. FUNDAMENTALS
n n n
22. X l:i(i+1)= l:i 2 +l:i
i=l i=l i=l
n(n+1)(2n+l) + n(n+l)
6 2
n(n+1)(n+2)
3
n i n
'\'
24 · L '\' · _ '\' ·2 _ n(n+l)(2n+1)
.,L.,l-L.,l- 6
i=lj=l i=l
n ;
26.
2.: l:j2 Ln i(i+l)J2i+l)
i=l j=l i=l
n
i 2.:(2i
1
3
+ 3i 2 + i)
l [2 . n 2 (n+1) 2 + 3 . n(n+1)(2n+l) + n(n+l)l
6 4 6 2
2 '\'
n .)
n . L., t n(n+l)
28. IJ 22' = 2( •~• = 22· - , - = 2n(n+1)
i=l
n n n (2.:j) n
30. TI IJ ij = IJ i J~• = IJ ;n(n+1)/2 = (1, 2,,,,, n)n(n+1)/2 = (n!)n(n+1)/2
i=l j=l i=l i=l
n
'""" · _
36 · L n(n+l)
,'- 2
i=l
38.
n ;
2.: 2.: j
i=l j=l
f:: ;(;~1) = ~ f::
i=l i=l
(i2 + i)
~c~i 2 +.~i)
l [n(n+1)(2n+l) + n(n+l)l
2 6 2
4
9
an 0+1+1+···+(n-1)/2+(n-1)/2
2. n-1 . !d.l
2 2
2[1+2+···+(n-1)/2]=
2
n 2 -1
4
0 ifn =1
1 if n = 2
2 if 2 < n s; 22
42. rig nl =
3 if 22 < n s; 23
10 if 29 < n s; 210
Therefore,
1024
44. Let P(n) be a statement such that 1) P(no) is true, and 2) P(k) implies P(k + 1), where k ::0> no.
To prove that P{n) is true for every n ::0> no: Let S denote the set of integers ::0> no such that P(n) is
false. If S = 0, then we are done. So, assumeS# 0. Since P(no) is true, no¢ S. By the well-ordering
principle, S has a least element l and P(l) is false. Since no ¢ S and l E S, l # no; so I > n 0 ; that is,
I;:, no+ 1, or 1-1;:, no. Since 1-1 < l, 1-1 ¢ S. So P(l-1) must be true. Therefore, by condition
(2), P(l) must be true, which is a contradiction. Consequently, S = 0; that is, P(n) is true for every
integer n 2: no.
4. 1, 2, 3, 5
10 CHAPTER 1. FUNDAMENTALS
6. 1, 2, 3, 6
8. a, 3
an an-1 + 5, n;::2
10. a, 1
an a;_ 1 +1, n;:: 2
12. an= an-1 + d = an-2 + 2d = an-3 +3d=···= a,+ (n -1)d =a+ (n- 1)d
14. a,
an
16. Sn a+ ar + ar 2 + · · . + arn-l
rSn ar + ar 2 + · · · + arn-l + arn
rSn- Sn arn- a; that is, (r- 1)Sn = a(r" -1)
a(rn-1)
So Sn r-1
a 1 +1+2+···+(n-1)
1 + [1+ 2 + · · · + (n- 1)]
n(n-1) + 1 n >_ 1
2 ,
22. a1 1
an Gn-1 + n 2, n 2: 2
!(!(109)) = !(99)
91, by Exercise 29
Thus P(k) implies P(k + 1), so the result holds for every integer n:::: 0.
38. A(3, 0) A(2, 1) A(1, A(2, 0)) A(1,A(1, 1)) A(1, A(O, A(1, 0)))
A(1, A(O, A(O, 1))) A(1, A(O, 2)) = A(1, 3)
A(O, A(1, 2)) A(0,4) = 5
A(3, 1) A(2, A(3, 0)) A(2, A(2, 1)) A(2, 5) = 13
12 CHAPTER 1. FUNDAMENTALS
Thus we have:
A(3, 0) 5=20+ 3 -3
A(3, 1) 13 = 21+ 3 - 3
3
A(3, 2) 29 = 22+ - 3
A(3, 3) 61 = 23+ 3 - 3
3
A(3, 4) 125 = 24+ - 3
uo 4
u, /(4) = 5
U2 /(5) = 2
40. We have: U3 /(2) = 1
u4 /(1) = 4
us /(4) = 5
vdots
In general,
4 if n mod 4 0
5 if n mod 4 1
Un =
2 if n mod 4 2
1 1 otherwise
9
4. (2x- 3y) 9 = L:; C(9, r)(2x)'( -3y) 9 - r
r=O
6
6. (x+2y)6 L:; C(6, r)xr(2y) 6 - r
r=O
x6 + 12x5 y + 60x 4 y 2 + 160x 3 y3 + 240x 2 y4 + 192xy5 + 64y6
13
10
8. (x2 + 1/x2)9 I: C(lO, r)x2rx-20+2r
r=O
10
I: C(10,r)x4r-20
r=D
Middle coefficient C(lO, 5) = 252
6
10. (x + y) 6 = I: C(6, r)xryB-r
r=D
2
16. B 3 = I: C(2, i)B, = B0 + 2B1 + B 2 = 1 +2·1+2= 5
i=O
3
Bz = I: C(3, i)B; = Bo + 3B, + 3Bz + B3 = 1 +3·1+3·2+5 = 15
i=O
24. proof: (1 + x )2n = (x + 1)(1 + x)n. The coefficient of xn+l on the LHS is 2
(n ;
1
) and that on the RHS
n
is I: (.:' 1) (7). Hence the result.
i=l
26. Let
(1.1)
(1.2)
14 CHAPTER 1. FUNDAMENTALS
25 ~(2a+nd)(~)=(2a+nd)~(~)
(2a + nd) · 2"
S (2a + nd)2n-l
30. proof (by induction): Let P(n) denote the given statement. When n = 1, LHS = n =RHS. Therefore,
P(1) is true. Assume P(k) is true, where k ~ 1:
2: i(k). +"'
k+l
'l 6
i( .k1)
k+l
t-
i=l i=l
t;i (k)
k
i +(k+ 1) k+1
( k ) + t;(i- 1) i-1
k+l k ) + t; i-1
k)
( k+l (
Therefore, P(k + 1) is true. Thus, by induction, P(n) is true for every n ~ 1. Hence the result.
n n
32. proof: n(1 + x)n-l = L; C)rxr-l. Let x = 1. Then n · 2n-l = L; rC).
r=l r=l
2
34. 2:: Gl 1 =G)
i=2
3
L: Gl Gl+G)=1+3=4=(~)
i=2
4
L: Gl
i=2
Gl + m + (~) = 1 + 3 + 6 = 10 = m
Continuing this pattern, we conjecture that £: (;) = (n!
i=2
1
).
15
n
36. As in Exercise 34, we conjecture that L: G)= (n! 1).
i=3
4. Stn +I= Sn(n + 1)/2 +I= 4n(n +I)+ I= 4n 2 + 4n +I= (2n + 1) 2 = S2n+1·
12. By Theorem 1.13, Stn-1 +I= (2n- 1) 2 , so 8tn_ 1 + 4n = (2n- 1) 2 + 4n -I= (2n) 2
14. proof:
t2n-2tn= (2n)(2n+!) -2· n(n+!) =n'
2 2
16. By Theorem 1.11, tk+tk-1 = k 2. Letting k = tn, this yields the desired result. (This can be confirmed
algebraically also.)
h1 +4(2+3+···+n) +3(n-1)
1 + 4(2 + 3 + · · · + n) + 3(n- 1)
1 +4[n(n+ 1)/2 -1]- 3(n -1)
n(2n-1)
24. 1, 8, 21, 40
30. 1225 = 49. 50/2 = 352 ; 41616 = 288. 289/2 = 2042 ; 1413721 = 1681. 1682/2 = 11892
578±576 2 = 36·
32 ,
3
(17t12v'2t+(17-12,/2) -2 - 2-17 3 ±2·3·17·288 2
32 - 32
34. I 2 -2(1k- I)
k(k±l) -
" ktl
2(1- -n+t 1
)
17
,.,
.Ln-1
+ n(n+1)
2
T,
n-2
+ (n~1)n
2
+ n(n+J)
2
,.,
.Ln-3
+ (n~2)(n~1)
2
+ (n~1)n
2
+ n(n+l)
2
.!.J_
2
+ 2·3
2
+ 3·42 ... + (n-l)n
2
+ n(n+l)
2
4. Sn Sn-1 + n2
Sn~2 + (n- 1) 2 + n 2
Sn~3 + (n- 2) 2 + (n- 1) 2 + n 2
S1 + 22 + 32 + · · · + (n- 1) 2 + n 2
1 + 22 + 32 + · · · + (n -1) 2 + n 2
n(n+1)(2n+l)
6
6. P1 = 1; Pn = Pn-1 + n(J~-o, n 2: 2.
n n
8. L hk = L k(2k -1)
k=l k=l
2 f: k2 _ f: k= 2 [n(n+1~(2n+J)]- n(n +1)
2
k=l k=l
n(n+1~(2n+l) _ n(n/1) = n(n +1) [ ( n
6 2 2 + 1) _ 3]
n(n+1)(4n-1)
6
10.
18 CHAPTER 1. FUNDAMENTALS
Hn-1+2n 2 -n
Hn-2 + [2(n -1) 2 - (n -1)1 + (2n 2 - n)
Hn-2 + [2(n- 1) 2 + 2n 21- [(n- 1) + nl
2 2 2
Hn-3 + 2[(n- 2) + (n -1) + n 1- [(n- 2) + (n- 1) + nl
H, + 2(2 2 + 32 + · · · + n 2 ) - (2 + 3 + · · · + n)
1 + 2(2 2 + 32 + · · · + n 2)- (2 + 3 + · · · + n)
1 + 2 [ n(n+!t(2n+l) _ 1] - [ n(n,+l) _ 1]
l + n(n+1)(2n+l) _
2_ n(n+l) +l
3 2
= n(n/l) [2(2n + 1) - 31
n(n+1)(4n-1)
6
n n
12. En = 2: ek = 2: k(s;-3)
k=l k=l
~I(
n!(n+l)! n + 1l - nI
~ n 0.25cm I
n!(n+l)! = C[
8· Cs
16 + 6. 4. 1 + 2 = 42
19
00
12. Since .)1- 4x = 1-2 L ~( 2,"~12 )x", it follows that
n=l
1- v'f=4x
2x
= f: ~ (2n-
n n- 1
2)xn-1
n=l
1- v'f=4x
2x
= ~~
L-n
(2n-
n-1
2)xn-1
n=l
That is 1
f:
n=O
C,xn = f:
n=O
_1_ (2n) x"
n+1 n
Equating the coefficients of xn, we get the desired result:
Cn= _1
n+ 1
(2n)
n
2n . n(n+l) + 3n 2 (n+l)
2 2
5(n+l)n 2
2
n n n n
4. 2.: 2.: 2; 2.:(2'+ 1 - 2) = L 2'+ 1 - 2n
i=l j=l i=l i=l
n+l
L 2i- (1 + 2)- 2n = (2"+ 2 - 1)- 3- 2n
i=O
2n+ 2 - 2n- 4
6.
n i n L 2j ITn 32i(i+l}/2
IT IT 32j IT 3;~1
i=l j=l i=l i=l
n
n L(i 2
+ i)
IT 3'<'+1} = 3'~1
i=l
"(n+l)(2n+l) + n(n +t)
3 2
3n(n+l)(n+2)/3
20 CHAPTER 1. FUNDAMENTALS
n i n
8. L i' IT j = L i!i'
i=l j=l i=l
10.
n
IT 2'" = 2r~o
L> = 2Tn, where Tn denotes the nth tetrahedral number.
r=O
12. n
L L Lk
i=l j=l k=l
i j
,tl Ct j) = ,~ i(i;l) = ! ,tl (i' + i)
n(n+l)(2n+l) + n(n+l) = n(n+l)(n+2)
12 4 6
14. 8
a1 + 2 · 3 + 3 · 4 + · · · + n(n + 1)
1. 2 + 2 · 3 + · · · + n(n + 1)
n n n
L i(i + 1) = L i 2 + L i
i=l i=l i=l
n(n+1)(2n+l) + n(n+l)
6 2
n(n+l)(n+2)
3 n21
an-1 + 2n-l
an-2 + 2n-2 + 2n-1
Uj +2+22+···+2n-1
1 + 2 + 22 + ... + 2n-1
2n- 1, n 2 1
21
1 + 1 + 2 + 2 + ... + rn/21
k+l k
l:)2i -1) 2
2)2i- 1) 2 + (2k + 1) 2
io;:;=l i=l
1 2
Ok+l Ok + (k + 1)(k + 2) = k(k + l(k + ) + (k + 1)(k + 2)
30. Let P(n): On = 2n- 1. Since a1 = 2 1 - 1 = 1, P(1) is true. Assume P(k) is true: ak = 2k- 1.
Theu Uk+l = uk + 2k = (2k- 1) + 2k = 2k+ 1 -1. So P(k) implies P(k + 1) and the result follows by
induction.
32. proof:
e:l (2n)! _
n!n! -
(2n-1)!
(2n)(2n-1)!
n!n!
2 n!(n-1)!
2 (2nn-1)
34. t,g + t2o + t21 + t22 + t23 + t24 t25 + t26 + t27 + t28
t29 + t3o + t31 + t32 + t33 + t34 + t3s !35 + t37 + t3s + t39 + t•o
22 CHAPTER 1. FUNDAMENTALS
n n n
36. 2:: k3 = 2:: [t~ - t%_ 1] = t~- ty = t~- 1. Thus 2:: k 3 = [n(n + 1)/2}'.
k=Z k=2 k=l
(n(n+l)J[k(k+1)[ + ((n-1)n[[(k-1)k)]
4 4
(
kr + r
r-1
-1)
Since the RHS is an integer, so is the LHS. So the result is also true when n = k + 1. Thus, by
induction, the result is true for every integer n 2: 0.
48. Since an satisfies the same definition as Fn, it follows that an = Fn, n 2: 1.