Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion. Definition. If, b Z, then we sy tht b divides nd we write b, if nd only if b 0 nd there exists n integer q such tht = q b. In this cse, we lso sy tht b is divisor of, or tht is multiple of b. If b does not divide, then we write b. We hve the following properties for the division opertion. Theorem. If, b, c Z, then () 1 nd 0 (b) if b nd b then = ±b (c) if b nd b c then c (d) if b then b x for ll x Z (e) if x = y + z nd divides ny two of the integers x, y, or z, then divides the remining integer (f) if b nd c then bx + cy for ll x, y Z. Proof. We will prove prt (b), nd leve the rest s n exercise. Suppose tht b nd b, from the definition of the division opertion it follows tht 0 nd b 0, nd tht there exist integers k nd l such tht so tht = k b nd b = l, = k b = k l, nd from the cncelltion lw, since 0, we hve k l = 1. Since k nd l re nonzero integers, then k 1 nd l 1, so we must hve either k = l = 1 or k = l = 1, tht is, either = b or = b.
Theorem. (Division Algorithm) If, b Z with b > 0, then there exist unique integers q, r Z such tht = q b + r with 0 r < b. The integer q is clled the quotient when is divided by b, nd the integer r is clled the (lest nonnegtive) reminder when is divided by b. Proof. If b divides, tht is, = q b for some integer q, then r = 0 nd we re done. Suppose then tht b does not divide, nd let S = { tb t Z, tb > 0}. Note tht if > 0 nd t = 0, then so tht S. Also, note tht if 0 nd t = 1, then since b 1, nd gin tb S, so tht S. = 0 b S, tb = ( 1)b = (1 b) + b > 0 Therefore, for ny Z, S is nonempty set of positive integers, nd by the well-ordering principle, S hs smllest element, cll it r. Since r S, then for some q Z. 0 < r = qb Note tht if r = b, then = (q + 1)b nd b divides, which is contrdiction. Also note tht if r > b, then r = b + c for some c N +, nd then qb = r = b + c implies tht c = (q + 1)b S, nd c = r b < r, which contrdicts the fct tht r is the smllest element of S. This shows tht there exist integers q nd r such tht with 0 r < b. = q b + r Now we show tht these integers re unique. Suppose tht where q 1, q 2, r 1, r 2 Z with 0 r 1, r 2 < b, then = q 1 b + r 1 nd = q 2 b + r 2 q 1 b + r 1 = q 2 b + r 2 ( ) nd therefore so tht (q 1 q 2 )b = r 2 r 1, q 1 q 2 b = r 1 r 2 < b. ( ) If q 1 q 2, then q 1 q 2 1, nd ( ) implies tht b < b, which is contrdiction. Therefore, q 1 = q 2, nd then from ( ) we hve r 1 = r 2.
Note: We cn give explicit formuls for the quotient q nd the lest nonnegtive reminder r in the division lgorithm when the integer is divided by the positive integer b. In fct, since 0 r = q b < b, then nd dividing by the positive integer b, we hve q b < (q + 1) b, tht is, q =, nd r =. b b q b < q + 1, We cn use this fct to give useful property of the floor function. Theorem. If n Z + nd x R, then x = n x. n Proof. Let m = x, using the division lgorithm to divide m by n, we get m = q n + r where 0 r n 1, so tht m n = q + r n where 0 r n 1 1 m n < 1, nd therefore q =. n Now, since m = x, then m x < m + 1, so tht nd so since 0 r n < 1 1 n. Therefore, q = x n m n x n < m n + 1 n, q q + r n x n < q + r n + 1 n < q + 1. Note: We defined n integer n to be even if nd only if n = 2 k for some integer k, nd to be odd if nd only if n = 2 k + 1 for some integer k. Thus, n is even if nd only if it leves reminder of 0 when divided by 2, while n is odd if nd only if it leves reminder of 1 when divided by 2. The division lgorithm provides nother proof tht every integer is either even or odd, but not both.
Gretest Common Divisor Since we re only relly interested in positive divisors, we mke the following definition: Definition. If, b Z, positive integer c is sid to be common divisor of nd b if nd only if c nd c b. Exmple. The common divisors of 42 nd 70 re 1, 2, 7, 14, nd d = 14 is the gretest of the common divisors of 42 nd 70. Definition. If, b Z, where t lest one of the integers nd b is nonzero, then positive integer d is clled gretest common divisor of nd b if nd only if (i) d nd d b, (ii) for ny common divisor c of nd b, we hve c d. Any gretest common divisor of nd b is denoted by gcd(, b), nd we hve the following theorem. Theorem. For ny, b Z +, there exists unique d Z + such tht d is the gretest common divisor of nd b, tht is, d = gcd(, b). Moreover, d = gcd(, b) is the smllest positive integer tht cn be written s liner combintion of nd b, tht is, the smllest positive integer d such tht for some x, y Z. d = x + by Proof. Given, b Z +, let S = {s + bt s, t Z, s + bt > 0}, then S is nonempty set of positive integers ( nd b re in S), nd by the well-ordering principle, S hs smllest element, sy d. We clim tht d is gretest common divisor of nd b. Since d S, then d = x + by for some x, y Z, nd if c is common divisor of nd b, then c d lso. If d, then from the division lgorithm, there exist integers q nd r such tht with 0 < r < d, so tht = q d + r r = q d = q(x + by) = (1 qx) + ( qy)b, nd r S nd 0 < r < d, which contrdicts the choice of d s the lest element of S. Thus, d, nd similr rgument shows tht d b. Therefore, ny, b Z + hve gretest common divisor. To prove uniqueness, suppose tht d 1 nd d 2 re positive integers tht stisfy the definition of the gretest common divisor, then d 1 d2 nd d 2 d1, nd since d 1 nd d 2 re positive, this implies tht d 1 = d 2.
Note: We hve shown tht ny two positive integers nd b hve unique gretest common divisor, which we denote by gcd(, b). We define it for other integers s follows: (i) if Z, with 0, then we define gcd(, 0) =, (ii) if, b Z +, then we define (iii) gcd(0, 0) is not defined. gcd(, b) = gcd(, b) = gcd(, b) = gcd(, b), Definition. If, b Z, then we sy tht the integers nd b re reltively prime or coprime if nd only if gcd(, b) = 1, tht is, if nd only if x + by = 1 for some x, y Z. Theorem. Any two consecutive Fiboncci numbers re reltively prime. Proof. The proof is by induction. Bse Cse : For n = 1, we hve F 1 = 1 nd F 2 = 1, nd gcd(f 1, F 2 ) = gcd(1, 1, ) = 1. Inductive Step : Now ssume tht F n nd F n+1 re reltively prime for some integer n 1, since F n+2 = F n+1 + F n if d is positive common divisor of F n+1 nd F n+2, then d Fn lso, so tht d is positive common divisor of F n nd F n+1. By the inductive hypothesis, F n nd F n+1 re reltively prime, so tht d = 1. Therefore, F n+1 nd F n+2 re lso reltively prime. By the Principle of Mthemticl Induction, nd two consecutive Fiboncci numbers re reltively prime. We cn lso give proof using Cssini s identity: F n+1 F n 1 F 2 n = ( 1)n. If d is the gretest common divisor of F n nd F n+1, then d ( 1) n, so tht d = 1.
Some results concerning reltively prime integers re given below. Theorem. If, b, nd c re integers with nd b reltively prime, nd if bc, then c. Proof. If nd b re reltively prime, then d = gcd(, b) = 1, nd therefore there exist integers x nd y such tht 1 = x + by, multiplying this eqution by c, we hve c = cx + bcy. Clerly cx, nd by ssumption bcy, so tht c lso. Theorem. Let the positive integers nd b be reltively prime. If c nd b c, then b c lso. Proof. Since nd b re reltively prime, there exist integers x nd y such tht 1 = x + by, nd multiplying this eqution by c, we hve c = cx + bcy. Now, if c, then b bcy, nd if b c, then b cx, nd therefore b c. Theorem. If, b Z nd d = gcd(, b), then gcd ( d, b ) = 1, d tht is, d nd b d re reltively prime. Proof. There exist x, y Z such tht d = x + by, nd therefore d x + b d y = 1, nd this is the smllest postive integer which is liner combintion of /d nd b/d. Exmple. Since gcd(3, 5) = 1, then we cn find integers x nd y such tht 3x + 5y = 1. For exmple, tke x = 2 nd y = 1, then 3(2) + 5( 1) = 1. However, for ny k Z, we hve so the solution for x nd y is not unique. 1 = 3(2 5k) + 5( 1 + 3k),
We cn define the gretest common divisor for set of integers contining more thn two elements s follows. Definition. Let 1, 2,..., n be integers, not ll zero, the gretest common divisor of 1, 2,..., n, denoted by ( 1, 2,..., n ) or gcd( 1, 2,..., n ) is the lrgest integer d such tht d k for ll 1 k n. The next lemm shows tht we cn find the gretest common divisor of more thn two integers recursively. Lemm. If 1, 2,..., n re integers, not ll zero, then ( 1, 2,..., n ) = ( 1, 2,..., n 2, ( n 1, n )). Proof. Note tht ny common divisor of the integers 1, 2,..., n is divisor of n 1 nd n, nd so is divisor of ( n 1, n ). Also, ny common divisor of 1, 2,..., n 2 nd ( n 1, n ) is common divisor of 1, 2,..., n. Therefore, the sets of integers hve the sme common divisors. { 1, 2,..., n } nd { 1, 2,..., n 2, ( n 1, n )} Exmple. If = 105, b = 140, nd c = 350, then (, b, c) = (, (b, c)) so tht (105, 140, 350) = (105, (140, 350)) = (105, 70) = 35. Definition. The integers 1, 2,..., n re mutully reltively prime if nd only if ( 1, 2,..., n ) = 1, while they re sid to be pirwise reltively prime if nd only if ( i, j ) = 1 for i j. Note: If 1, 2,..., n re pirwise reltively prime, then they must be mutully reltively prime. The converse is flse s the next exmple shows. Exmple 4. Let = 15, b = 21, nd c = 35, then (, b, c) = (15, 21, 35) = (15, (21, 35)) = (15, 7) = 1, but (15, 21) = 3, (15, 35) = 5, (21, 35) = 7, nd no pir of the three integers, b, c is reltively prime.
To find the gretest common divisor of two positive integers nd b, we cn lwys use brute force to list ll their common divisors, nd then simply select the lrgest from this list. There re more efficient methods, for exmple, the Eucliden lgorithm. However, there is lso n explict formul for the gretest common divisor which ws found by the Brzilin mthemticin Mrcelo Polezzi in 1997. Theorem. Let nd b be positive integers, nd let d = gcd(, b), then 1 d = 2 k b + + b b. Proof. We count the number of lttice points, tht is, points with integer coordintes, on nd inside the tringle AOB shown below, in two different wys. b B y = ( b/)x + b D O A Here the eqution of the line joining A nd B is y = b x + b. First note tht the number of lttice points on the legs of AOB is + b + 1, while the number of lttice points inside or on the hypotenuse is 1 k b 1 + b = ( k) b = 1 k b. Therefore, if s equls the number of lttice points on or inside AOB, then 1 s = k b + ( + b + 1). Next, note tht the number of lttice points on the line segment AB equls the number of points (x, y) where x nd y = b x + b re both integers, tht is, the number of integers x such tht y = b x + b is n integer for 0 x. However, this is just the number of integers in the set { 0, d, 2 d (d 1),,, }. d So the number of lttice points on the line segment AB is equl to d + 1.
Therefore, the number of lttice points inside ADB or on its legs is equl to s (d + 1). Thus, the totl number of lttice points on or inside the rectngle OADB is equl to s + [s (d + 1)] = 2s (d + 1). However, the totl number of lttice points on or inside the rectngle OADB is ( + 1)(b + 1), nd therefore 2s (d + 1) = ( + 1)(b + 1), so tht 1 d = 2s ( + 1)(b + 1) 1 = 2 k b + + b b. Exmple. If = 4 nd b = 18, then (4, 18) = 2 { 18 4 + 2 18 4 + 3 18 = 2 (4 + 9 + 13) + 4 + 18 72 = 52 + 22 72 = 2. 4 } + 4 + 18 4 18 The Eucliden Algorithm Given two positive integers nd b such tht b, we know from the division lgorithm tht there exist unique integers q 0 nd r 0, such tht = b q 0 + r 0 (1) with 0 < r 0 < b. From (1), the integers nd b hve the sme common divisors s the integers b nd r 0, nd therefore gcd(, b) = gcd(b, r 0 ). Continuing, we find unique integers q 1 nd r 1, such tht with 0 < r 1 < r 0 if r 0 b, nd continuing in this mnner, we find unique integers q k nd r k, such tht b = r 0 q 1 + r 1 (2).. r k 2 = r k 1 q k + r k (k) with 0 < r k < r k 1 if r k 1 r k 2. This process must terminte, since the reminders re ll nonnegtive nd re strictly decresing.
If r t is the lst nonzero reminder, then the lst two equtions re r t 2 = r t 1 q t + r t r t 1 = r t q t+1. It is cler tht gcd(, b) = gcd(b, r 0 ) = gcd(r 0, r 1 ) = = gcd(r t 1, r t ) = gcd(r t, 0) = r t, since t ny stge the integers r k 2 nd r k 1 hve the sme common divisors s the integers r k 1 nd r k, nd hence the sme gretest common divisor. This is Euclid s lgorithm for computing the gretest common divisor of two positive integers nd b. The Eucliden lgorithm llows us to write gcd(, b) = u + b v for some integers u nd v. This cn be done by working from the bottom up in the equtions in the Eucliden lgorithm. Exmple. Use the Eucliden Algorithm to compute the gretest common divisor of F 12 nd F 18, nd then express (F 12, F 18 ) s liner combintion of F 12 nd F 18. Solution. Note first tht F 11 = 89, F 12 = 144, F 13 = 233, F 14 = 377, F 15 = 610, F 16 = 987, F 17 = 1597, F 18 = 2584 Using the Eucliden Algorithm, with F 12 = 144 nd F 18 = 2584, we hve 2584 = 17 144 + 136 144 = 1 136 + 8 136 = 17 8 + 0. Therefore, (F 12, F 18 ) = (144, 2584) = 8. Working bckwrds, we hve (F 12, F 18 ) = 8 = 144 136 = 144 (2584 17 144) nd therefore (F 12, F 18 ) = 8 = 18 144 + ( 1) 2584. Note tht we used only 2 divisions in the Eucliden lgorithm, so the lgorithm cn find the gretest common divisor firly rpidly in most cses. However, in the cse of consecutive Fiboncci numbers, in ech division, the quotient is 1, since F n+2 = 1 F n+1 + F n, nd the reminder is F n, so the process is much slower. In fct, it cn be shown tht it tkes exctly n divisions to compute the gretest common divisor of the consecutive Fiboncci numbers F n+1 nd F n+2, nd tht this is the worst cse scenrio for the Eucliden lgorithm.