2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Size: px
Start display at page:

Download "2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}."

Transcription

1 2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition If a, b are integers, we say that b divides a if there is an integer r such that a = br. We also say that b is a divisor of a, or that b is a factor of a, or that a is divisible by b. To write b divides a, we often use the shorthand notation If b does not divide a, then we write b - a. Example For example: Similarly, 6 72 and 1 19 but b a. 2 12, since 12 = 2 6. Example Note that 3 9 and 3 15, and that also 3 24 = Indeed, 9=3 3, 15 = 3 5 and so 24 = = =3 (3 + 5) = 3 8, so This is true in general: if d a and d b then d (a + b) (see Exercise Sheet 1). Remarks (i) If d a and d b then, for any integers m, n we have d (ma+nb) (see Exercise Sheet 1). This is a crucial property which we will use repeatedly: we might express it by saying that if d divides a and b then it divides every combination of a and b. (Caution! The symbol is not a division operation, do NOT write 2 12 = 6.) (ii) The divisors of a and a are the same. (iii) Using the definition, say what are the divisors of 0 and which numbers are divisible by 0. (iv) Let d and a be integers with d, a 0. If d a then d apple a. (Answer: 0 a, a =0; b 0 for all b 2 Z.) Proposition 2.20 (The division algorithm). Let n > 0 be an integer and let m be a natural number. Then there exist integers q, r such that n = qm + r and 0 6 r < m. Note q is for quotient and r is for remainder: when we divide n by m we get q, with remainder r. Proof. We regard m as being fixed and let P (n) be the statement: P (n) : there exist integers q, r such that n = qm + r and 0 6 r < m. We proceed by induction on n, starting from n =0. 11

2 Base Step P (0) says there are integers q, r such that n = qm+r and 0 6 r<m; the integers q =0 and r =0certainly satisfy this so P (0) is true. Inductive Step that We split into two cases: Suppose k > 0 is an integer for which P (k) is true so there are integers q, r such k = qm + r and 0 6 r < m. 1. If r<m 1 then k +1 = qm +(r + 1) and 0 <r+1<m; putting q 0 = q and r 0 = r +1, we have k +1 = q 0 m + r 0 and 0 6 r 0 <m and P (k + 1) is true. 2. If r = m 1 then k +1 = qm +(m 1) + 1 = (q + 1)m; putting q 0 = q +1and r 0 =0, we have k +1 = q 0 m + r 0 and 0 6 r 0 <m and P (k + 1) is true. In either case P (k + 1) is true so we have completed the inductive step. Hence, by induction, P (n) is true for all integers n > 0. Exercise Use Proposition 2.20 to show that its conclusion is also true for n any integer (positive or negative). Can you also adjust the statement to make it true for any non-zero integer m? Definition Let a, b be integers and let c be a natural number. We say that c is a greatest common divisor (or gcd) of a and b if: (i) c divides both a and b; and (ii) whenever d is an integer which divides both a and b, then d divides c. The integers a, b are called coprime if their greatest common divisor is 1. You may have seen the greatest common divisor called the highest common factor (or hcf) in the past. For example, we can compute the gcd of 12 and 40 as follows: The positive divisors of 12 are 1, 2, 3, 4, 6, 12. The positive divisors of 40 are 1, 2, 4, 5, 8, 10, 20, 40. The common divisors of 12 and 40 are therefore 1, 2, 4 (these are the numbers which satisfy (i)), all of which divide 4 (so 4 satisfies (ii) also). Hence 4 is a gcd of 12 and 40. Remarks (i) Suppose c 1 and c 2 are both greatest common divisors of a, b that is, they both satisfy the two conditions of Definition Then c 1 = c 2. [Exercise: write down a proof!] This means that there is at most one greatest common divisor so we can talk about the gcd, rather than just a gcd. However, it is not obvious that there is a greatest common divisor at all. (ii) The method we used above to find gcd(12, 40) = 4 is fine for small numbers but extremely impractical for large numbers (factorizing large numbers is notoriously difficult). We need a different method. 12

3 Note. If a, b 2 N and b a then gcd(b, a) =b. If b - a then we use the following: Theorem 2.24 (The Euclidean Algorithm). Let a>bbe natural numbers. We use the division algorithm (Proposition 2.20) to find integers r 0,r 1,...r s and q 1,...,q s with the following properties: (i) r 0 = a and r 1 = b; (ii) r 0 = r 1 q 1 + r 2 and 0 < r 2 < r 1 ; r 1 = r 2 q 2 + r 3 and 0 < r 3 < r 2 ;. r s 2 = r s 1 q s 1 + r s and 0 < r s < r s 1 ; r s 1 = r s q s +0. Then r s is the gcd of a and b. Note that r 1 >r 2 >r 3 > and all of these integers are strictly positive, so the above process must terminate after a finite numbers of steps (i.e. we must reach the remainder r s after a finite number of steps). The point is that we perform the division algorithm (Proposition 2.20) with a and b, then with b and the remainder, and so on, until we get a remainder of 0. Then the last non-zero remainder is the gcd. Notice that this Theorem not only proves that the gcd does exist, it also gives us a method to find it. Examples (i) The gcd of 20 and 12 is 4. To show this we use the Euclidean algorithm, starting with r 0 = 20 and r 1 = 12: 20 = so r 2 = 8; 12 = so r 3 = 4; 8 = so r 4 =0. The last non-zero remainder was 4 so, by Theorem 2.24, gcd(20, 12) = 4. (ii) Find the gcd of and Again, we apply the Euclidean algorithm: So gcd(22471, 3266) = = = = = = = Note that we can make a check here to make sure we have not made any numerical errors: 23 should divide both numbers, and indeed it does: = and 3266 = Before saying why Theorem 2.24 is true, we note that it has the following important consequence, which is a corollary of the Euclidean Algorithm: 13

4 Corollary Let a, b be natural numbers and let c = gcd(a, b). Then there exist integers m, n such that c = am + bn. The calculations done in the Euclidean Algorithm can be use to find such numbers m, n here: Example (i) Let a = 20 and b = 12. We saw in Example 2.25(i) that with these values of a and b we have gcd(a, b) =4. We can write out this calculation in a slightly different way that at the same time records an expression for each of the terms that appears as a linear combination of the numbers a and b. Carrying out the Euclidean algorithm we obtain: a = 20 b = = b a b = 8 8 = a b 8 4 = 2b a 0 We conclude that gcd(a, b) = gcd(20, 12) = 4 and that where m = 1 and n =2. 4=2b a = = 20m + 12n, (ii) Let a = and b = We saw in Example 2.25(ii) that with these values of a and b we have gcd(a, b) = 23. We can write out this calculation in a slightly different way that at the same time records an expression for each of the terms that appears as a linear combination of the numbers a and b. Carrying out the Euclidean algorithm we obtain: a = b = = b a 6b = = a 6b 7 (7b a) = 49b 7a = = 7b a 8a 55b = = 16a 110b =2 (8a 55b) 117b 17a = = 117b 17a 25a 172b = We conclude that gcd(22471, 3266) = 23 and that where m = 25 and n = = 25a 172b = = 22471m n, Now we explain why the Euclidean Algorithm works. Proof of Theorem The method or proof we will use is known as direct proof : the idea is that we just start with what we know (the hypotheses of the Theorem) and aim for what we want to know (the conclusion of the Theorem). For this, we must be sure to know exactly what it is that the Theorem is asking use to prove, which will mean looking back at Definitions. To know that r s is the gcd of a and b, we need to check that it satisfies the two properties of the definition of the gcd (Definition 2.22): 14

5 (i) We need to show that r s divides both a and b. By the final equation of Theorem 2.24(ii), we have r s 1 = r s q s, so r s divides r s 1. In the penultimate equation, r s 2 = r s 1 q s 1 + r s, we have r s r s 1 and r s r s and q s 2 Z so, by Remarks 2.19(i) (see question 5(ii) on Exercice Sheet 1), we also have r s r s 2. Then, in the equation before this, r s 3 = r s 2 q s 2 + r s 1, we have r s r s 2 and r s r s 1 and q s 1 2 Z so r s r s 3. Working back through the equations, we get r s r i for all 0 6 i 6 s. In particular, r s divides r 0 = a and r 1 = b. (ii) Suppose d a and d b; then we need to show that d r s. Rearranging the first equation, we have r 2 = r 0 r 1 q 1. Since r 0 = a and r 1 = b, we have d r 0 and d r 1 so the equation shows d r 2 also (as above). Similarly, r 3 = r 1 r 2 q 2 so d r 3. Continuing, we get In particular, d r s. d r i for all 0 6 i 6 s. Since r s satisfies both properties, it is indeed the gcd of a and b. Proof of Corollary Define the set S by S = {ax + by : x, y 2 Z}; so S is the set of all integers which can be written in the form ax + by, for some x, y 2 Z. In order to prove Corollary 2.26, we need only check that gcd(a, b) is an element of S. In fact, we will prove more: that gcd(a, b) is the smallest natural number in S. So let s 2 S be the smallest natural number in S we need to prove that s = gcd(a, b) so we need to check that s satisfies the two conditions of Definition 2.22: (i) We need to show that s divides both a and b; in fact, because we have a symmetry between a and b, we need only check that s a. For contradiction, suppose that s - a. By the division algorithm (Proposition 2.20), we can write (The proof of this Corollary was omitted from the course.) a = qs + r, with 0 <r<s. 15

6 [Note that r 6= 0here as s - a.] Now, since s 2 S, there are x 1,y 1 2 Z with s = ax 1 + by 1. Rearranging for r and substituting for s, we get r = a qs = a q(ax 1 + by 1 ) = a(1 qx 1 )+( qy 1 )b. But then, putting x 2 =1 qx 1 and y 2 = qy 1, we have written r = ax 2 + by 2, with x 2,y 2 2 Z. Hence r 2 S. But we have 0 <r<s, which contradicts s being the smallest element of S. We have our contradiction, so we can conclude that s a, as required. (ii) Suppose d a and d b; then we need to show that d s. But we have s = ax 1 + by 1, for some x 1,y 1 2 Z, so it is clear that d s from Remarks 2.19(i) (see also q.5(ii) on the first Exercise Sheet). We have checked both properties of Definition 2.22 so indeed s = gcd(a, b). 2.2 Prime numbers Definition (i) An integer p 6= 0, ±1 is a prime if its only divisors are ±1 and ±p; otherwise p is composite. Some authors say prime number to mean a positive prime. (ii) Two integers a, b are coprime (or relatively prime) if their greatest common divisor is 1. Remarks (i) The first few positive primes are 2, 3, 5, 7, 11, 13, 17, 19, 23,... (ii) If p 6= 0and p = ab, for some integers a, b 6= ±1, then p is composite. (iii) If p is a prime and b is any integer then the only possibilities for gcd(p, b) are 1 and p (since these are the only positive divisors of p). So: either p, b are coprime, or p b. Theorem 2.30 (Euclid s Lemma). Suppose a, b, c are non-zero integers. (i) If a is coprime to b and a bc, then a c. (ii) If p is prime and p bc then p b or p c. Proof. (i) Since gcd(a, b) =1, by Corollary 2.26 there are integers m, n such that am + bn =1. Multiplying by c, we get c = amc + bnc. Now a amc and a (bc)n (since a bc). Hence a c (using Remarks 2.19(i) again). (ii) Suppose that p is prime and p bc. By Remark 2.29(iii) either p b, or gcd(p, b) =1in which case p c by part (i). Corollary Let p be a prime and let a 1,...,a n be integers. a 1 a 2 a n. Then p divides a i, for some i. Suppose p divides the product 16

7 Proof. Exercise: Prove this result by induction on n, making use of Theorem 2.30(ii). We proceed by induction on n, starting with n =1. Base step If p a 1 then clearly p a 1. Inductive step Suppose k is a natural number and then statement is true for n = k. Now suppose p a 1 a 2 a k a k+1. Put b = a 1 a 2 a k and c = a k+1 and apply Euclid s Lemma (Theorem 2.30) with a = p: either gcd(p, b) =1, in which case Euclid s Lemma says that p c, that is p a k+1 ; or gcd(p, b) 6= 1, in which case p b (as in Remarks 2.29(iii)). But then p a 1 a 2 a k so, by the inductive hypothesis, p a i, for some i. (Note: Proof omitted from lectures.) In either case, we have shown that p a i, for some i apple k +1, so the inductive step is complete. Note that this relies crucially on p being prime it is not true when p is composite. (Find a counterexample!) The main use of this Corollary is in the proof of the following Theorem: Remark: We Theorem 2.32 (Fundamental Theorem of Arithmetic). Every integer n>1can be written as a product of positive prime numbers. Moreover, this representation of n is unique up to the order of the of one number allow a product multiplication. here e.g. 7=7. The following example illustrates what is meant by the words up to the order of multiplication : 60 = = The number 60 can be factorized into prime numbers but, of course, we can write these prime numbers in different orders. Proof. The proof is by induction on n, starting with n =2. The statement P (n) for use in the induction is P (n): every natural number m, with 1 <m6 n, can be written as a product of positive prime numbers, and this representation is unique up to the order of the multiplication. Base step When n =2, we see that 2=2is already a product of primes, and this is clearly unique. Inductive step We suppose k 2 is a natural number for which P (k) is true. To show P (k + 1) is true we have to look at factoring k +1. We split into two cases: If (k + 1) is prime, then (as in the base step), it is already a product of primes, and this is clearly unique. If (k + 1) is composite, then we can write k +1 = m 1 m 2, with m 1,m 2 > 1. But then m 1,m 2 < k +1so, in particular, m 1,m 2 6 k. Then, by the inductive hypothesis, each of m 1 and m 2 can be written as a product of prime numbers. Multiplying these together, we see that (k + 1) can be written as a product of prime numbers also. 17

8 It remains to prove that this representation as a product of primes is unique. So suppose we have two factorizations into prime: p 1 p 2 p r = (k + 1) = q 1 q 2 q s where the p i and q j are primes. We need to show that r = s and that each p i is some q j. Now p 1 divides (k + 1) so, by Corollary 2.31, p 1 divides some q j. As q j is prime, we must therefore have p 1 = q j. Moreover, since we are allowed to reorder the prime factors, we may assume that j =1so that p 1 p 2 p r = p 1 q 2 q s. Dividing both sides by p 1 and putting m =(k + 1)/p 1, we have p 2 p r = m = q 2 q s. Now m 6 k so, by the inductive hypothesis, these expressions for m as a product of primes are the same: so r = s and, for 2 6 i 6 r, each p i is some q j. This was also true for p 1, so we have completed the inductive step. In either case, the inductive step is complete. Hence P (n) is true for all natural numbers n, by induction. Corollary 2.33 (Euclid). There are infinitely many prime numbers. Proof. For contradiction, suppose there are only finitely many primes: we call them p 1 =2,p 2,...,p r. Let n = p 1 p 2 p r so certainly n>1. Then p i cannot divide n +1, or else p i would also divide (n + 1) n =1, which is absurd. This is true for each i, so n +1has no prime divisors. But this contradicts the Fundamental Theorem of Arithmetic 2.32, which says that n +1can be factorized into prime numbers so certainly has a prime divisor. There are many proofs of the above result; the one we give above is roughly Euclid s, which introduces a new method of proof called proof by contradiction (reductio ad absurdam). In this type of proof, (Proof by contradiction; we assume that the hypothesis H is true but the conclusion C is false. Then we use logical reasoning to see [Houston, end up with something which is either obviously false or else which contradicts one of the hypotheses. Chapter 23].) This shows that If H is true then C cannot be false. In other words: if H is true then C is true. We have actually seen something like this in the discussion on the justification of proof by induction. We are now in a position to prove the following result about rational numbers: Recall that any rational number can be written in the form a/b where a, b 2 Z, b 6= 0, and where a and b have no common divisors (i.e. gcd(a, b) =1). Theorem There is no rational number q 2 Q such that q 2 =2. Proof. We assume (for contradiction) that there is a rational number q with q 2 =2. We can write q = a b, 18

9 where a, b are integers with no common divisors (except ±1) and b 6= 0. Since q 2 =2, we have a 2 = 2(b 2 ). In particular, 2 a 2 so, since 2 is prime, Corollary 2.31 implies that 2 a and we can write a =2c, for some c 2 Z. Substituting this in, we get which simplifies to (2c) 2 = 2b 2, 2(c 2 ) = b 2. Now we see that 2 b 2 so again since 2 is prime, by Corollary 2.31, we get 2 b. But then 2 a and 2 b, and so 2 is a common divisor of a and b. This contradicts our assumption that a, b had no common divisors. Hence there is no rational number q 2 Q such that q 2 =2. One can easily generalize Theorem 2.34 to prove that, for any prime number p, there is no rational number which squares to give p the same proof by contradiction works. 2.3 Modular Arithmetic (See [Houston, Chapter 29]) If n is a natural number, then arithmetic modulo n is essentially just ordinary arithmetic, but only working with remainders after dividing by n. It s a simple but surprisingly useful idea which has lots of applications in number theory, cryptography and error correcting codes. It s an idea which will be generalised a lot in the second year algebra module. We start by being a bit more precise about remainders. Suppose a, n are natural numbers. Recall that, from the division algorithm (Proposition 2.20), there are q, r 2 Z with a = qn + r and 0 apple r<n. The same is true for a: a =( q)n r =( q 1)n +(n r) and 0 <n r apple n. In the case where n = r we can of course rewrite this as a =( q 1)n +0. Example. With a = 17 and n = 3we have 17 = 5.3+2and 17 = ( 6).3+1. So we have: Theorem If a 2 Z and n 2 N there are unique q, r 2 Z with a = qn + r and 0 apple r<n. Proof. It remains to prove the uniqueness. So suppose qn + r = a = q 0 n + r 0 and 0 apple r, r 0 <n. 19

10 We show that r = r 0 (and then it follows that q = q 0 ). Rearranging the above equation we have So n divides r 0 r. But n(q q 0 )=r 0 r. n<r 0 r<n and the only number in this range which is divisible by n is 0. Thus r 0 r =0, as required. Definition (i) Given a 2 Z and n 2 N, if q, r 2 Z are such that a = qn + r and 0 apple r<n, then we say that r is the remainder on dividing a by n. (ii) Given a, b 2 Z and n 2 N, we say that a and b are congruent modulo n if a, b have the same remainder on dividing by n. In this case we write a b (mod n). Examples. 17 2(mod 3), (mod 3), (mod 3). The following is obvious from the definition, but extremely important! Lemma If a b (mod n) and b c (mod n) then a c (mod n). There is another way of thinking about this (and which, in some ways is better as it doesn t involve thinking about remainders). Theorem If a, b 2 Z and n 2 N, then a b (mod n), n (a b). Proof. We have to show each direction of the implication separately. ()) Suppose that a b (mod n). So this means (by the definition) that we can write a = qn + r and b = q 0 n + r for some q, q 0,r 2 Z and 0 apple r<n. Thus a b =(q q 0 )n and so we see that n (a b). (() Now suppose that n (a b). This means that there is k 2 Z with a b = kn. Let r be the remainder on dividing b by n. So there is some q 2 Z with b = qn + r and 0 apple r<n. ( Exercise: But then Prove a = b + kn =(q + k)n + r and 0 apple r<n. Lemma 2.37 but taking So r is also the remainder on dividing a by n. n (a b) as the definition of Note that if we had taken this as the definition, then there would actually have been some work to do in a b (mod n). ) proving the Lemma. We will use the Theorem in the following, which shows that we can do artihmetic mod n. Theorem 2.39 (Modular Arithmetic). Suppose a, b, c, d 2 Z and n 2 N are such that a b (mod n) and c d (mod n). Then a + c b + d (mod n) and ac bd (mod n). 20 ( Theorem 2.39 says that when doing arithmetic mod n we can any number in our calculations by any number that is congruent to it mod n. )

11 Proof. By Theorem 2.38, we can write (a b) =kn and (c d) =mn for some k, m 2 Z. Then (a + c) (b + d) =kn + mn =(k + m)n so a + c b + d (mod n) (again, using Theorem 2.38). Similarly, ac =(b + kn)(d + mn) =bd + n(kd + bm + kmn) so n (ac bd) and therefore ac bd (mod n). Examples (i) You can verify that 48 3(mod 17). Then (using Theorem 2.39): ( 3)(10) + 3 7(mod 17). (ii) You can use Theorem 2.39 to show that if a b (mod n) and c d (mod n) then b (mod n) and c a d b (mod n). a (iii) What is the last digit of 3 10? So what we want to know is the remainder on dividing 3 10 by 10. We compute: (mod 10) so So the last digit of 3 10 is (mod 10) and 3 8 1(mod 10) therefore (mod 10). ( Alternative solution: 3 10 =(3 2 ) 5 ( 1) 5 1 9(mod 10). ) Exercise. What is the pattern for computing the last digit of 3 k? What is the last digit of 7 10? (iv) We show that a natural number k (in decimal form) is divisible by 9 precisely when the sum of its digits is divisible by 9. (For example 387 has digit sum 18, and is therefore divisible by 9.) To see why this is true, suppose that k written in decimal form is a s a s a j 2{0, 1,...,9}. This means that k = a a s a s. As 10 1(mod 9) we have 10 j 1(mod 9) for any j, so: k a 0 + a a s (mod 9). 1...a 1 a 0 with each Note that the latter is the sum of the digits. A number is divisible by 9 precisely when it is congruent to 0 modulo 9, so we have the result. If we work modulo a prime, some special things happen when computing powers: Theorem Suppose p 2 N is a prime. Then: (i) For all x, y 2 Z we have (x + y) p x p + y p (mod p). 21

12 (ii) (Fermat s Little Theorem) For all a 2 Z we have (iii) If a 2 Z and p does not divide a then a p a (mod p). a p 1 1(mod p). Proof. (i) If we expand (x + y) p using the binomial theorem we obtain: p p p (x + y) p = x p + x p 1 y + x p 2 y xy p 1 + y p. 1 2 p 1 So it will suffice to prove that each binomial coefficient So p = r p(p 1)...(p r + 1) r p p(p 1)...(p r + 1) = (1.2...r). r p r with 1 apple r apple p 1 is divisible by p. But Note that p divides the left-hand side here (as r 1). Moreover, as p>r, it does not divide any of 1, 2,...,r. So as p is prime, by Corollary 2.31 (the Corollary to Euclid s Lemma) it follows that p divides p r. (ii) First we show that this is true for a 0 using a proof by induction. The base case (with a =0) is clear. So suppose we know that k p k (mod p). Then, using (i) we have (k + 1) p k p +1 p k +1(mod p) which does the inductive step. Finally we need to consider what happens with a (for a>0). So we have to show: ( a) p a (mod p). This follows from what we have already proved and the fact that: ( 1) p 1(mod p). (This is clear if p is odd; for p =2you need to note that 1 1(mod 2).) (iii) By (ii) we know that p divides a p a = a(a p 1 1). So if p does not divides a, then (by Euclid s Lemma) p divides a p 1 1, whence a p 1 1(mod p). Examples (i) What is the remainder on dividing by 23? Solution. 23 is a prime and it does not divide 39, so by FLT (or rather (iii) above): (mod 23). Note also that 473 = so: (39 22 ) (mod 23). 22

13 As 39 7(mod 23) we can easily compute: (mod 23) and (mod 23). Thus (mod 23) so (mod 23) and ( 7) 22 1(mod 23). (There are many other ways of doing this last bit.) So the required remainder is 1. (ii) Note that FLT does not generally hold for non-primes: for example we computed that (mod 10). We have discussed addition, subtraction and multiplication mod n. Can we also do division mod n? For example can we find x with 3x 1(mod 6)? (So this is asking whether we can divide by 3 modulo 6). Is is easy to see that this is not possible, by trying all possible values x =0, 1, 2. Another way to see this is to note that if we have such an x then, multiplying by 2, we have 6x 2(mod 6) so 0 2(mod 6), which is clearly not true. The following answers the question of which numbers we can divide by modulo n. Theorem Suppose a 2 Z and n 2 N. Let d be the gcd of a and n. (i) If d>1, then there is no b 2 Z with ab 1(mod n). (ii) If d =1, then there exists b 2 Z with ab 1(mod n). (iii) If n is a prime and n - a, then there exists b 2 Z with ab 1(mod n). Proof. (i) Suppose we can find such a b. Write n = de where 1 <e<nand a = a 0 d. Multiply the equation by e to get abe e (mod n). Now abe = a 0 dbe = a 0 bn. So we obtain 0 e (mod n) which is impossibe as 1 <e<n. (ii) By the Corollary to the Euclidean algorithm, Corollary 2.26, there are b, m 2 Z with ab + mn =1. So ab 1(mod n). (iii) In this case the gcd of a and n is 1, so apply (ii). Notice that the proof of (i) is just a general version of the second argument we gave to show that we cannot divide by 3 modulo 6. The proof of (ii) tells us how to go about finding b (if n is so large that it would be inefficient to try all possibilities). Following the method in Section 2.1, if gcd(a, n) =1we can use to Euclidean algorithm to find b, m 2 Z with 1=ab + mn. Then ab 1(mod n). 23

14 Example (i) Find x 2 Z with 17x 1(mod 91). Let a = 91 and b = 17 and apply the Euclidean Algorithm to find the greatest common divisor of 91 and 17: a = 91 5b = = b a 5b = 6 12 = 2a 10b 11b 2a = 5 5 = 11b 2a 3a 16b = We conclude that gcd(91, 17) = 1 and that Reducing modulo 91 then gives: 1=3a 16b = (mod 91) Therefore, setting x = 75 we have found x 2 Z with 17x 1(mod 91), as required. (ii) Find y 2 Z with 17y 21 (mod 91). To do this, multiply through by 75. The equation becomes y (mod 91), which simplifies to y 28 (mod 91). Note that you can check that this works! We will come back to modular arithmetic in a later section, once we have discussed equivalence relations. For now, notice that modular arithmetic modulo a prime p is somewhere where we can add, subtract, multily and divide, much as in ordinary arithmetic, but only ever working with the remainders 0, 1, 2,...,p 1. When we have made this more precise, we will see that this gives us a field with p elements. D Definitions, Theorems and Proof (See [Houston, Parts III and IV]) This section is a little digression to discuss again the ideas of the language of mathematics and the idea of proof. You have already seen most of the things we discuss here in previous sections so this is really just here as a reminder and as reference point. ADEFINITION is precise statement of the meaning of a concept we are working with. You need to learn these, though this will become easier the more you use a definition, the more you will understand its meaning and the easier it will become to remember. ATHEOREM is a result concerning these concepts. These can be expressed in the form: If... {z} hypothesis then... {z} conclusion So the hypothesis is what we are given and the conclusion is what we are required to show. As an exercise, look at some of the theorems that we have already seen in the notes and identify the hypothesis and the conclusion. 24

Chapter 5. Number Theory. 5.1 Base b representations

Chapter 5. Number Theory. 5.1 Base b representations Chapter 5 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

More information

1 Overview and revision

1 Overview and revision MTH6128 Number Theory Notes 1 Spring 2018 1 Overview and revision In this section we will meet some of the concerns of Number Theory, and have a brief revision of some of the relevant material from Introduction

More information

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time. 8 Modular Arithmetic We introduce an operator mod. Let d be a positive integer. For c a nonnegative integer, the value c mod d is the remainder when c is divided by d. For example, c mod d = 0 if and only

More information

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24 Direct Proof MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Direct Proof Fall 2014 1 / 24 Outline 1 Overview of Proof 2 Theorems 3 Definitions 4 Direct Proof 5 Using

More information

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

Senior Math Circles Cryptography and Number Theory Week 2

Senior Math Circles Cryptography and Number Theory Week 2 Senior Math Circles Cryptography and Number Theory Week 2 Dale Brydon Feb. 9, 2014 1 Divisibility and Inverses At the end of last time, we saw that not all numbers have inverses mod n, but some do. We

More information

NOTES ON SIMPLE NUMBER THEORY

NOTES ON SIMPLE NUMBER THEORY NOTES ON SIMPLE NUMBER THEORY DAMIEN PITMAN 1. Definitions & Theorems Definition: We say d divides m iff d is positive integer and m is an integer and there is an integer q such that m = dq. In this case,

More information

1. multiplication is commutative and associative;

1. multiplication is commutative and associative; Chapter 4 The Arithmetic of Z In this chapter, we start by introducing the concept of congruences; these are used in our proof (going back to Gauss 1 ) that every integer has a unique prime factorization.

More information

4 Powers of an Element; Cyclic Groups

4 Powers of an Element; Cyclic Groups 4 Powers of an Element; Cyclic Groups Notation When considering an abstract group (G, ), we will often simplify notation as follows x y will be expressed as xy (x y) z will be expressed as xyz x (y z)

More information

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CHAPTER 6. Prime Numbers. Definition and Fundamental Results CHAPTER 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results 6.1. Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and the only positive divisors of p are 1 and p. If n

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

3 The language of proof

3 The language of proof 3 The language of proof After working through this section, you should be able to: (a) understand what is asserted by various types of mathematical statements, in particular implications and equivalences;

More information

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information

3 The fundamentals: Algorithms, the integers, and matrices

3 The fundamentals: Algorithms, the integers, and matrices 3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers

More information

5: The Integers (An introduction to Number Theory)

5: The Integers (An introduction to Number Theory) c Oksana Shatalov, Spring 2017 1 5: The Integers (An introduction to Number Theory) The Well Ordering Principle: Every nonempty subset on Z + has a smallest element; that is, if S is a nonempty subset

More information

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II CS 5319 Advanced Discrete Structure Lecture 9: Introduction to Number Theory II Divisibility Outline Greatest Common Divisor Fundamental Theorem of Arithmetic Modular Arithmetic Euler Phi Function RSA

More information

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same

More information

2 Elementary number theory

2 Elementary number theory 2 Elementary number theory 2.1 Introduction Elementary number theory is concerned with properties of the integers. Hence we shall be interested in the following sets: The set if integers {... 2, 1,0,1,2,3,...},

More information

4 Number Theory and Cryptography

4 Number Theory and Cryptography 4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.

More information

Lecture 4: Number theory

Lecture 4: Number theory Lecture 4: Number theory Rajat Mittal IIT Kanpur In the next few classes we will talk about the basics of number theory. Number theory studies the properties of natural numbers and is considered one of

More information

The Fundamental Theorem of Arithmetic

The Fundamental Theorem of Arithmetic Chapter 1 The Fundamental Theorem of Arithmetic 1.1 Primes Definition 1.1. We say that p N is prime if it has just two factors in N, 1 and p itself. Number theory might be described as the study of the

More information

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. INTEGERS PETER MAYR (MATH 2001, CU BOULDER) In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. 1. Divisibility Definition. Let a, b

More information

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic 11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic Bezout s Lemma Let's look at the values of 4x + 6y when x and y are integers. If x is -6 and y is 4 we

More information

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem. CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 10 The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

More information

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element. The first exam will be on Monday, June 8, 202. The syllabus will be sections. and.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive squaring

More information

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases Lecture 2. The Euclidean Algorithm and Numbers in Other Bases At the end of Lecture 1, we gave formulas for the greatest common divisor GCD (a, b), and the least common multiple LCM (a, b) of two integers

More information

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6 CS 70 Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6 1 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes

More information

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. Chapter 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. If n > 1

More information

Modular Arithmetic Instructor: Marizza Bailey Name:

Modular Arithmetic Instructor: Marizza Bailey Name: Modular Arithmetic Instructor: Marizza Bailey Name: 1. Introduction to Modular Arithmetic If someone asks you what day it is 145 days from now, what would you answer? Would you count 145 days, or find

More information

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions Warm-up Problems 1. What is a prime number? Give an example of an even prime number and an odd prime number. A prime number

More information

1. Factorization Divisibility in Z.

1. Factorization Divisibility in Z. 8 J. E. CREMONA 1.1. Divisibility in Z. 1. Factorization Definition 1.1.1. Let a, b Z. Then we say that a divides b and write a b if b = ac for some c Z: a b c Z : b = ac. Alternatively, we may say that

More information

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

Beautiful Mathematics

Beautiful Mathematics Beautiful Mathematics 1. Principle of Mathematical Induction The set of natural numbers is the set of positive integers {1, 2, 3,... } and is denoted by N. The Principle of Mathematical Induction is a

More information

Number Theory Proof Portfolio

Number Theory Proof Portfolio Number Theory Proof Portfolio Jordan Rock May 12, 2015 This portfolio is a collection of Number Theory proofs and problems done by Jordan Rock in the Spring of 2014. The problems are organized first by

More information

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today? 2 Mod math Modular arithmetic is the math you do when you talk about time on a clock. For example, if it s 9 o clock right now, then it ll be 1 o clock in 4 hours. Clearly, 9 + 4 1 in general. But on a

More information

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z: NUMBER SYSTEMS Number theory is the study of the integers. We denote the set of integers by Z: Z = {..., 3, 2, 1, 0, 1, 2, 3,... }. The integers have two operations defined on them, addition and multiplication,

More information

4. Number Theory (Part 2)

4. Number Theory (Part 2) 4. Number Theory (Part 2) Terence Sim Mathematics is the queen of the sciences and number theory is the queen of mathematics. Reading Sections 4.8, 5.2 5.4 of Epp. Carl Friedrich Gauss, 1777 1855 4.3.

More information

Lecture Notes. Advanced Discrete Structures COT S

Lecture Notes. Advanced Discrete Structures COT S Lecture Notes Advanced Discrete Structures COT 4115.001 S15 2015-01-13 Recap Divisibility Prime Number Theorem Euclid s Lemma Fundamental Theorem of Arithmetic Euclidean Algorithm Basic Notions - Section

More information

Chapter 5: The Integers

Chapter 5: The Integers c Dr Oksana Shatalov, Fall 2014 1 Chapter 5: The Integers 5.1: Axioms and Basic Properties Operations on the set of integers, Z: addition and multiplication with the following properties: A1. Addition

More information

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635 COMP239: Mathematics for Computer Science II Prof. Chadi Assi assi@ciise.concordia.ca EV7.635 The Euclidean Algorithm The Euclidean Algorithm Finding the GCD of two numbers using prime factorization is

More information

MATH 361: NUMBER THEORY FOURTH LECTURE

MATH 361: NUMBER THEORY FOURTH LECTURE MATH 361: NUMBER THEORY FOURTH LECTURE 1. Introduction Everybody knows that three hours after 10:00, the time is 1:00. That is, everybody is familiar with modular arithmetic, the usual arithmetic of the

More information

Chapter 2. Divisibility. 2.1 Common Divisors

Chapter 2. Divisibility. 2.1 Common Divisors Chapter 2 Divisibility 2.1 Common Divisors Definition 2.1.1. Let a and b be integers. A common divisor of a and b is any integer that divides both a and b. Suppose that a and b are not both zero. By Proposition

More information

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 CS 70 Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes wish to work over a

More information

A Guide to Arithmetic

A Guide to Arithmetic A Guide to Arithmetic Robin Chapman August 5, 1994 These notes give a very brief resumé of my number theory course. Proofs and examples are omitted. Any suggestions for improvements will be gratefully

More information

a the relation arb is defined if and only if = 2 k, k

a the relation arb is defined if and only if = 2 k, k DISCRETE MATHEMATICS Past Paper Questions in Number Theory 1. Prove that 3k + 2 and 5k + 3, k are relatively prime. (Total 6 marks) 2. (a) Given that the integers m and n are such that 3 (m 2 + n 2 ),

More information

Divisibility. Chapter Divisors and Residues

Divisibility. Chapter Divisors and Residues Chapter 1 Divisibility Number theory is concerned with the properties of the integers. By the word integers we mean the counting numbers 1, 2, 3,..., together with their negatives and zero. Accordingly

More information

Rings and modular arithmetic

Rings and modular arithmetic Chapter 8 Rings and modular arithmetic So far, we have been working with just one operation at a time. But standard number systems, such as Z, have two operations + and which interact. It is useful to

More information

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r.

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r. 118 18. DIVISIBILITY 18 Divisibility Chapter V Theory of the Integers One of the oldest surviving mathematical texts is Euclid s Elements, a collection of 13 books. This book, dating back to several hundred

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

More information

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory). Wednesday, February 21 Today we will begin Course Notes Chapter 5 (Number Theory). 1 Return to Chapter 5 In discussing Methods of Proof (Chapter 3, Section 2) we introduced the divisibility relation from

More information

2.2 Inverses and GCDs

2.2 Inverses and GCDs 34 CHAPTER 2. CRYPTOGRAPHY AND NUMBER THEORY 2.2 Inverses and GCDs 2.2.1 Inverses mod p In the last section we explored the multiplication in Z n. We saw in the special case with n =12 and a = 4 that if

More information

2. THE EUCLIDEAN ALGORITHM More ring essentials

2. THE EUCLIDEAN ALGORITHM More ring essentials 2. THE EUCLIDEAN ALGORITHM More ring essentials In this chapter: rings R commutative with 1. An element b R divides a R, or b is a divisor of a, or a is divisible by b, or a is a multiple of b, if there

More information

CHAPTER 3. Congruences. Congruence: definitions and properties

CHAPTER 3. Congruences. Congruence: definitions and properties CHAPTER 3 Congruences Part V of PJE Congruence: definitions and properties Definition. (PJE definition 19.1.1) Let m > 0 be an integer. Integers a and b are congruent modulo m if m divides a b. We write

More information

Some Review Problems for Exam 1: Solutions

Some Review Problems for Exam 1: Solutions Math 3355 Fall 2018 Some Review Problems for Exam 1: Solutions Here is my quick review of proof techniques. I will focus exclusively on propositions of the form p q, or more properly, x P (x) Q(x) or x

More information

MATH 2200 Final Review

MATH 2200 Final Review MATH 00 Final Review Thomas Goller December 7, 01 1 Exam Format The final exam will consist of 8-10 proofs It will take place on Tuesday, December 11, from 10:30 AM - 1:30 PM, in the usual room Topics

More information

The Euclidean Algorithm and Multiplicative Inverses

The Euclidean Algorithm and Multiplicative Inverses 1 The Euclidean Algorithm and Multiplicative Inverses Lecture notes for Access 2009 The Euclidean Algorithm is a set of instructions for finding the greatest common divisor of any two positive integers.

More information

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

More information

PRIME NUMBERS YANKI LEKILI

PRIME NUMBERS YANKI LEKILI PRIME NUMBERS YANKI LEKILI We denote by N the set of natural numbers: 1,2,..., These are constructed using Peano axioms. We will not get into the philosophical questions related to this and simply assume

More information

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2 8. p-adic numbers 8.1. Motivation: Solving x 2 a (mod p n ). Take an odd prime p, and ( an) integer a coprime to p. Then, as we know, x 2 a (mod p) has a solution x Z iff = 1. In this case we can suppose

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

Contribution of Problems

Contribution of Problems Exam topics 1. Basic structures: sets, lists, functions (a) Sets { }: write all elements, or define by condition (b) Set operations: A B, A B, A\B, A c (c) Lists ( ): Cartesian product A B (d) Functions

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 9 September 30, 2015 CPSC 467, Lecture 9 1/47 Fast Exponentiation Algorithms Number Theory Needed for RSA Elementary Number Theory

More information

Part IA Numbers and Sets

Part IA Numbers and Sets Part IA Numbers and Sets Definitions Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

More information

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition Todd Cochrane Department of Mathematics Kansas State University Contents Notation v Chapter 0. Axioms for the set of Integers Z. 1 Chapter 1.

More information

MATH10040 Chapter 1: Integers and divisibility

MATH10040 Chapter 1: Integers and divisibility MATH10040 Chapter 1: Integers and divisibility Recall the basic definition: 1. Divisibilty Definition 1.1. If a, b Z, we say that b divides a, or that a is a multiple of b and we write b a if there is

More information

Applied Cryptography and Computer Security CSE 664 Spring 2017

Applied Cryptography and Computer Security CSE 664 Spring 2017 Applied Cryptography and Computer Security Lecture 11: Introduction to Number Theory Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline What we ve covered so far: symmetric

More information

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers: WORKSHEET MATH 215, FALL 15, WHYTE We begin our course with the natural numbers: N = {1, 2, 3,...} which are a subset of the integers: Z = {..., 2, 1, 0, 1, 2, 3,... } We will assume familiarity with their

More information

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer. CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3 CS 70 Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes wish to work over a smaller

More information

Number theory (Chapter 4)

Number theory (Chapter 4) EECS 203 Spring 2016 Lecture 10 Page 1 of 8 Number theory (Chapter 4) Review Questions: 1. Does 5 1? Does 1 5? 2. Does (129+63) mod 10 = (129 mod 10)+(63 mod 10)? 3. Does (129+63) mod 10 = ((129 mod 10)+(63

More information

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Warm-up Problems 1. What is a prime number? Give an example of an even prime number and an odd prime number. (a) Circle the prime

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively

More information

Winter Camp 2009 Number Theory Tips and Tricks

Winter Camp 2009 Number Theory Tips and Tricks Winter Camp 2009 Number Theory Tips and Tricks David Arthur darthur@gmail.com 1 Introduction This handout is about some of the key techniques for solving number theory problems, especially Diophantine

More information

#26: Number Theory, Part I: Divisibility

#26: Number Theory, Part I: Divisibility #26: Number Theory, Part I: Divisibility and Primality April 25, 2009 This week, we will spend some time studying the basics of number theory, which is essentially the study of the natural numbers (0,

More information

Integers modulo N. Geoff Smith c 1998

Integers modulo N. Geoff Smith c 1998 Integers modulo N Geoff Smith c 1998 Divisibility Suppose that a, b Z. We say that b divides a exactly when there is c Zsuch that a = bc. We express the fact that b divides a in symbols by writing b a.

More information

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972) Intro to Math Reasoning Grinshpan EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972) We all know that every composite natural number is a product

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

More information

The group (Z/nZ) February 17, In these notes we figure out the structure of the unit group (Z/nZ) where n > 1 is an integer.

The group (Z/nZ) February 17, In these notes we figure out the structure of the unit group (Z/nZ) where n > 1 is an integer. The group (Z/nZ) February 17, 2016 1 Introduction In these notes we figure out the structure of the unit group (Z/nZ) where n > 1 is an integer. If we factor n = p e 1 1 pe, where the p i s are distinct

More information

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya Resources: Kenneth Rosen,

More information

Commutative Rings and Fields

Commutative Rings and Fields Commutative Rings and Fields 1-22-2017 Different algebraic systems are used in linear algebra. The most important are commutative rings with identity and fields. Definition. A ring is a set R with two

More information

MATH10040: Chapter 0 Mathematics, Logic and Reasoning

MATH10040: Chapter 0 Mathematics, Logic and Reasoning MATH10040: Chapter 0 Mathematics, Logic and Reasoning 1. What is Mathematics? There is no definitive answer to this question. 1 Indeed, the answer given by a 21st-century mathematician would differ greatly

More information

Chapter 1 A Survey of Divisibility 14

Chapter 1 A Survey of Divisibility 14 Chapter 1 A Survey of Divisibility 14 SECTION C Euclidean Algorithm By the end of this section you will be able to use properties of the greatest common divisor (gcd) obtain the gcd using the Euclidean

More information

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is LARGE PRIME NUMBERS 1. Fermat Pseudoprimes Fermat s Little Theorem states that for any positive integer n, if n is prime then b n % n = b for b = 1,..., n 1. In the other direction, all we can say is that

More information

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions MATH 11/CSCI 11, Discrete Structures I Winter 007 Toby Kenney Homework Sheet 5 Hints & Model Solutions Sheet 4 5 Define the repeat of a positive integer as the number obtained by writing it twice in a

More information

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

Chapter 1 : The language of mathematics.

Chapter 1 : The language of mathematics. MAT 200, Logic, Language and Proof, Fall 2015 Summary Chapter 1 : The language of mathematics. Definition. A proposition is a sentence which is either true or false. Truth table for the connective or :

More information

REAL NUMBERS. Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b.

REAL NUMBERS. Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b. REAL NUMBERS Introduction Euclid s Division Algorithm Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b. Fundamental

More information

SOLUTIONS TO PROBLEM SET 1. Section = 2 3, 1. n n + 1. k(k + 1) k=1 k(k + 1) + 1 (n + 1)(n + 2) n + 2,

SOLUTIONS TO PROBLEM SET 1. Section = 2 3, 1. n n + 1. k(k + 1) k=1 k(k + 1) + 1 (n + 1)(n + 2) n + 2, SOLUTIONS TO PROBLEM SET 1 Section 1.3 Exercise 4. We see that 1 1 2 = 1 2, 1 1 2 + 1 2 3 = 2 3, 1 1 2 + 1 2 3 + 1 3 4 = 3 4, and is reasonable to conjecture n k=1 We will prove this formula by induction.

More information

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points. Math 152, Problem Set 2 solutions (2018-01-24) All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points. 1. Let us look at the following equation: x 5 1

More information

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6 Math 131 notes Jason Riedy 6 October, 2008 Contents 1 Modular arithmetic 2 2 Divisibility rules 3 3 Greatest common divisor 4 4 Least common multiple 4 5 Euclidean GCD algorithm 5 6 Linear Diophantine

More information

Primes and Modular Arithmetic! CSCI 2824, Fall 2014!!

Primes and Modular Arithmetic! CSCI 2824, Fall 2014!! Primes and Modular Arithmetic! CSCI 2824, Fall 2014!!! Scheme version of the algorithm! for finding the GCD (define (gcd a b)! (if!(= b 0)!!!!a!!!!(gcd b (remainder a b))))!! gcd (812, 17) = gcd(17, 13)

More information

MATH FINAL EXAM REVIEW HINTS

MATH FINAL EXAM REVIEW HINTS MATH 109 - FINAL EXAM REVIEW HINTS Answer: Answer: 1. Cardinality (1) Let a < b be two real numbers and define f : (0, 1) (a, b) by f(t) = (1 t)a + tb. (a) Prove that f is a bijection. (b) Prove that any

More information

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers: Divisibility Euclid s algorithm The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers: Divide the smaller number into the larger, and

More information

Definition For a set F, a polynomial over F with variable x is of the form

Definition For a set F, a polynomial over F with variable x is of the form *6. Polynomials Definition For a set F, a polynomial over F with variable x is of the form a n x n + a n 1 x n 1 + a n 2 x n 2 +... + a 1 x + a 0, where a n, a n 1,..., a 1, a 0 F. The a i, 0 i n are the

More information

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory. CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L06, Steve/Courses/2011/S2/CSS322/Lectures/number.tex,

More information

Introduction to Abstract Mathematics

Introduction to Abstract Mathematics Introduction to Abstract Mathematics Notation: Z + or Z >0 denotes the set {1, 2, 3,...} of positive integers, Z 0 is the set {0, 1, 2,...} of nonnegative integers, Z is the set {..., 1, 0, 1, 2,...} of

More information

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results Euclid s Division Lemma : Given two positive integers a and b, there exist unique integers q and r satisfying a = bq + r, 0 r < b. Euclid s Division

More information

A SURVEY OF PRIMALITY TESTS

A SURVEY OF PRIMALITY TESTS A SURVEY OF PRIMALITY TESTS STEFAN LANCE Abstract. In this paper, we show how modular arithmetic and Euler s totient function are applied to elementary number theory. In particular, we use only arithmetic

More information