Congruences. Robert Friedman

Size: px
Start display at page:

Download "Congruences. Robert Friedman"

Transcription

1 Congruences Robert Friedman Definition of congruence mod n Congruences are a very handy way to work with the information of divisibility and remainders, and their use permeates number theory. Definition 1. Let n be a positive integer (the modulus). We say that two integers a, b are congruent mod n, which is written as a b (mod n), if n b a. Example If a and b are arbitrary integers, a b (mod 1), since 1 divides every integer and in particular it divides b a. 2. For n = 2, two integers a and b are congruent mod 2 if and only if their difference b a is even. This happens exactly when a and b are both even or they are both odd. 3. Something similar happens for n = 3. Every integer has remainder 0, 1 or 2 when divided by 3, and it is easy to check that a b (mod 3) if and only if a and b have the same remainder when divided by 3. In fact, this generalizes: As we have seen, given integers n > 0 and a, there exist unique integers q, r with 0 r n 1, such that a = nq + r. Here, r is the remainder when you divide a by n. With this said, we have the following alternate way to describe congruences: Proposition 3. Two integers a, b are congruent mod n if and only if they have the same remainder when divided by n. Proof. First suppose that a, b are congruent mod n. Thus, b a = nk for some integer k, so that b = a + nk. Now long division with remainder says that a = nq + r, with 0 r n 1. Hence, b = a + nk = nq + r + nk = nq + nk + r = n(q + k) + r, with 0 r n 1. Thus, we have written b as a multiple of n, namely n(q +k), plus r, with 0 r n 1. By the uniqueness 1

2 of long division with remainder, r is the remainder when we divide n into b. So a and b have the same remainder when divided by n. Conversely, suppose that a and b have the same remainder when divided by n. By definition, a = nq 1 + r and b = nq 2 + r for some integers q 1, q 2. Then b a = nq 2 + r (nq 1 + r) = nq 2 nq 1 = n(q 2 q 1 ). Thus b a is a multiple of n. We are used to seeing the integers grouped into even and odd integers. Likewise, we can group integers according to their remainders when divided by 3, or by n. In general, we call the set of all integers congruent to a given integer a mod n a congruence class mod n. It is easy to see that the number of congruence classes mod n is n, and that they are described by the set of possible remainders 0, 1,..., n 1. We will say a little more about this in the next section. Let us conclude this section by saying a few words about why congruences are a good thing to study. One answer is that they describe cyclical phenomena: days of the week, hours of the day, dates of the year if there are no leap years or leap centuries,... It is important to have a kind of mathematics to describe such phenomena. A second answer is that we might want to study certain complicated equations in integers. For example, we might want to show that there are no interesting integer solutions to the equation x k + y k = z k for any k > 2. Of course, this is a very hard equation to study! We might try to look at the easier equation x k + y k z k (mod n) for various n. For any given n, there are really only finitely many x, y, z to check, so that the existence question for solutions is much easier to decide. The existence or nonexistence of solutions to the congruence equation, and more generally the structure of all of the solutions, might give us some clues as to whether the original equation in integers has a solution. At the end of the seminar, we will try to look at simpler examples of this idea. Properties of congruences There are two kinds of properties of congruences. The first set of properties is as follows: Proposition 4. Let n be a positive integer. 1. For all a Z, a a 2. For all a, b Z, if a b (mod n), then b a 2

3 3. For all a, b, c Z, if a b (mod n) and b c (mod n), then a c These properties look like the usual properties of equality, and they are given the same names (reflexive, symmetric, transitive). Any relationship between two integers (or elements of a more general set) which satisfies all three properties is called an equivalence relation. It is easy to prove Proposition 4. For example, to see (1), for every integer a, a a = 0, and n 0 = 0, so n a a and hence by definition a a As for (2), n b a if and only if n a b, so a b (mod n) if and only if b a We leave (3) as an exercise. A typical example of how to apply these properties is as follows: given an r with 0 r n 1, if a r (mod n) and a b (mod n), then b r (mod n) as well. The second set of properties we use about congruences is that we can add and multiply them in a consistent way. The following generalizes the fact that the sum of two odd numbers or two even numbers is always even, that the sum of an odd and an even number is odd, the product of two odd numbers is always odd and the product of two numbers, one of which is even, is always even: Proposition 5. Let n be a positive integer. Suppose that a 1 a 2 (mod n) and that b 1 b 2 Then a 1 + b 1 a 2 + b 2 (mod n) and a 1 b 1 a 2 b 2 Proof. We shall just prove the second statement and leave the first as an exercise. By assumption, n a 2 a 1 and n b 2 b 1. Write a 2 a 1 = nk 1 and b 2 b 1 = nk 2. Thus a 2 = a 1 + nk 1 and b 2 = b 1 + nk 2. Hence a 2 b 2 = (a 1 + nk 1 )(b 1 + nk 2 ) = a 1 b 1 + nk 1 b 1 + nk 2 a 1 + n 2 k 1 k 2. Subtracting off the a 1 b 1 term gives a 2 b 2 a 1 b 1 = n(k 1 b 1 + k 2 a 1 + nk 1 k 2 ), so that n divides a 2 b 2 a 1 b 1. Thus by definition a 1 b 1 a 2 b 2 We can view the algebraic operations of + and as operations on the finite set of congruence classes mod n; this is an example of a finite algebraic system. We will say more about this in a minute, but first let us record some of the usual properties of congruence addition and multiplication. We will not verify all of these properties; they follow immediately from the usual properties of addition and multiplication of integers. The first set of properties have to do with addition: 3

4 Proposition 6. Let n be a positive integer. (i) (Associativity of addition) For all a, b, c Z, (a + b) + c a + (b + c) (ii) (Commutativity of addition) For all a, b Z, a + b b + a (iii) (Additive identity) For all a Z, a + 0 a (iv) (Additive inverses) For all a Z, a + ( a) 0 Next we consider multiplication: Proposition 7. Let n be a positive integer. (i) (Associativity of multiplication) For all a, b, c Z, (a b) c a (b c) (ii) (Commutativity of multiplication) For all a, b Z, a b b a (iii) (Multiplicative identity) For all a Z, a 1 a Notice that we do not speak about multiplicative inverses or cancellation, and in fact we shall see that cancellation is not always possible. Before that, though, we need the following property linking addition and multiplication: Proposition 8. (Multiplication distributes over addition) Let n be a positive integer. For all a, b, c Z, a (b + c) ab + ac 4

5 In the usual way, we always have a 0 0 (mod n) for every a (because a 0 = a (0 + 0) = a 0 + a 0. But notice that, if for example we take n = 6, (mod 6), although 3 is not congruent to 0 mod 6, so that we cannot just cancel off the nonzero factor 2. For another example with n = 9, (mod 9), but we cannot cancel off the 3 to get 6 2 (mod 9). (Why not?) Note that, if a has a multiplicative inverse mod n, i.e. if there exists an x such that ax 1 (mod n), then we can cancel off multiplication by a, since if ab ac (mod n), then multiply by x to get x(ab) x(ac) (xa)b (xa)c (mod n); (mod n); 1 b 1 c Thus b c Let us collect more information on congruence addition and multiplication. We will work out the example n = 6. We just write down the possible remainders mod 6 in the following table for addition. So the meaning of the entry corresponding to the row labeled by 3 and the column labeled by 4 is that, if a 3 (mod 6) and b 4 (mod 6), then a + b 1 (mod 6) Here is the corresponding table for multiplication: Note the huge number of patterns in these tables. For example, both are symmetric about the top-left-to-lower-right diagonal, which is equivalent to 5

6 the statement that addition and multiplication are commutative. (But it is not easy to see how associativity would show up in the table.) For the addition table, notice that all of the rows are the same except that they are shifted over by one, with the understanding that when you reach 6 = 0 you start over. This reflects the cyclical nature of addition mod 6. Here are some other patterns: multiplication by 5 has the effect of reversing the order of the nonzero entries. Why is this so? The top-left-to-lower-right diagonal in the addition table shows up as a row (and hence column) in the multiplication table. Where is this row, and what is the explanation for why it shows up? With a little effort, you should be able to notice many other patterns in the tables. Equations in congruences We just look at the most basic kinds of equations, linear equations. First, the additive equation a + x b (mod n) always has a (unique) solution, following the steps of middle school algebra: a + x b (mod n); (a + x) + ( a) b + ( a) (mod n); x + (a + ( a)) b a x b a (mod n); Note that the above was long and tedious enough, even though we skipped a few steps! (Which ones?) Of course, most of you would do this in one step in your head. Multiplicative equations are another story: they need not always have a solution, and if they do, the solution need not be unique! For example, the equation 2x 3 (mod 8) has no solution: if it did, 8 would divide 2x 3, which is always an odd number. On the other hand, the equation 2x 4 (mod 8) has two solutions mod 8: x 2 (mod 8) and x 6 (mod 8). On the other hand, the equation 5x 3 (mod 7) has exactly one solution mod 7: x 2 (mod 7). So we need some criterion to decide when an equation of the form ax b (mod n) has a solution, and, if so, how many. We will just discuss the existence question here and leave the problem of deciding how many solutions there are to the exercises. Fortunately, the work has already been done for us in the very first lecture. Proposition 9. The equation ax b (mod n) has a solution if and only if d = gcd(a, n) divides b. 6

7 Proof. The proof follows by writing out the definitions carefully and seeing what they say. The equation ax b (mod n) has a solution if and only if n divides ax b for some x, if and only if there exist integers x and k such that ax b = nk, if and only if b = ax + n( k). Set y = k; clearly b = ax + n( k) for some integers x and k if and only if b = ax + ny for some integers x and y. But Corollary 6 in the first lecture says that the equation b = ax + ny has a solution in integers x and y if and only if d = gcd(a, n) divides b. Running through the chain of logical equivalences, we see that ax b (mod n) has a solution if and only if d = gcd(a, n) divides b. Let us give some easy consequences of the above. The first has to do with the existence of multiplicative inverses. After all, a multiplicative inverse of a mod n is just a solution to the equation ax 1 So we see: Corollary 10. There exists a multiplicative inverse for a mod n if and only if a and n are relatively prime, i.e. gcd(a, n) = 1. Proof. There exists a multiplicative inverse for a mod n if and only if the equation ax 1 (mod n) has a solution, if and only if the gcd of a and n divides 1, if and only if the gcd of a and n is equal to 1. An x such that ax 1 (mod n) is usually written as a 1, with the understanding that this is not the same as the rational number 1/a, and that the answer will depend on n. For example, 2 1 (mod 11) = 6, but 2 1 (mod 17) = 9. The next corollary says that we can cancel off relatively prime factors. (In fact, this is an if and only if statement in a certain sense; see the exercises.) Corollary 11. Suppose that a and n are relatively prime, and that ab ac Then b c Proof. If a and n are relatively prime and ab ac (mod n), find an x such ax 1 (mod n), i.e. find a 1. Then multiplying the equality ab ac (mod n) gives b xab xac c We will use the next corollary later. (It could have been proven easily in the first lecture, with a slightly different proof.) Corollary 12. Let n be a positive integer. Then a 1 and a 2 are both relatively prime to n if and only if a 1 a 2 is relatively prime to n. 7

8 Proof. Suppose that a 1 and a 2 are both relatively prime to n. Using Corollary 10, find x 1 such that a 1 x 1 1 (mod n) and find x 2 such that a 2 x 2 1 Then (a 1 a 2 )(x 1 x 2 ) 1 In other words, a 1 a 2 has the multiplicative inverse x 1 x 2 mod n. So, by the other direction of Corollary 10, a 1 a 2 and n are relatively prime. Conversely, if a 1 a 2 is relatively prime to n, then there exists x such that (a 1 a 2 )x 1 But then a 1 (a 2 x) 1 (mod n), so that a 2 x is a multiplicative inverse for a 1 mod n. Thus a 1 and n are relatively prime. Likewise, a 1 x is a multiplicative inverse for a 2 mod n, so that a 2 and n are relatively prime. Note that congruences to a prime modulus look especially nice from the point of view of multiplicative inverses. The reason is that, if p is a prime number, then p and a are not relatively prime if and only if p divides a. Put another way, this says: Corollary 13. Let p be a prime number. If a is not congruent to zero mod p, then there exists a multiplicative inverse for a mod p. The above says that, when working with congruences mod a prime number p, we can add, subtract, multiply, and divide by all nonzero numbers. So in the sense mod p arithmetic is like arithmetic with the rational numbers. Euler s ϕ-function As we have seen, for a positive integer n, the integers relatively prime to n have special properties. The number of these, properly counted, is important enough to have a special name: Definition 14. Let n be a positive integer. The number of integers r such that 0 r n 1 and such that r and n are relatively prime is called the Euler ϕ-function ϕ(n). Put another way, ϕ(n) counts the number of integers r with 0 r n 1 which have a multiplicative inverse mod n. Here is a table of some of the small values of ϕ(n): n ϕ(n) From the definition of ϕ(n) and basic properties of prime numbers, we have: 8

9 Proposition 15. If p is a prime number, then ϕ(p) = p 1. One can give more general formulas for ϕ(n). We shall discuss these in the exercises. Exercises Exercise 1. Compute the following operations mod n (give your answer in terms of an integer r with 0 r n 1: (mod 8); 3 (mod 5); 4 5 (mod 7); 6 2 (mod 9). Exercise 2. For each of the following a (mod n), find a 1 (mod n), i.e. find an integer x with ax 1 (mod n), or explain why such an integer does not exist: 5 1 (mod 11); 7 1 (mod 28); 2 1 (mod 101) 4 1 (mod 101). Exercise 3. Let n = 2k + 1 be an odd number. What is 2 1 (mod n)? What happens when n = 2k is even? Extra credit: how to find the multiplicative inverse of 3 mod n. First suppose n = 3k + 2 for some k. What is 3 1 (mod n)? (It looks a lot like the answer for 2 1.) If n = 3k + 1, find 3 1 (mod n) as follows. First find a number x such that 3x 1 (mod n), and then note that 3( x) 1 (mod n); finally, write x as a number between 0 and n 1. What if n = 3k? Exercise 4. Given the following equations in congruences, find all possible solutions x (mod n): there may be more than one, or none. 5 + x 1 (mod 7); 4x 2 (mod 11); 3x 0 (mod 27) 10x 5 (mod 25); 10x 2 (mod 25); 5x (mod 12). Exercise 5. Write down addition and multiplication tables for addition and multiplication mod n, where n = 1, 2, 3, 4, 5. Meditate upon your answer, and see if you can make any conjectures. Exercise 6. Prove (3) of Proposition 4: Given a positive integer n, for all a, b, c Z, if a b (mod n) and b c (mod n), then a c Exercise 7. Show that, if a 1 a 2 (mod n) and b 1 b 2 (mod n), then a 1 + b 1 a 2 + b 2 9

10 Exercise 8. Suppose that a is not relatively prime to n. Show that there always exist b, c with b not congruent to c mod n, such that ab ac Exercise 9. In this exercise, we determine the number of solutions to the congruence equation ax b Of course, we will identify two solutions if they are congruent mod n, because otherwise there would be infinitely many solutions as long as there was at least one solution. Let d = gcd(a, n). We have seen that, if d does not divide b, then there are no solutions to this equation. Thus, henceforth, we assume that d n. (i) Show that, if ax 1 b (mod n) and ax 2 b (mod n), then a(x 2 x 1 ) 0 Conversely, if ay 0 (mod n) and ax 1 b (mod n), then ax 2 b (mod n), where x 2 = x 1 + y. Argue that, given one solution x 1 to the congruence ax b (mod n), then all of the solutions are of the form x 1 + y where ay 0 (mod n), and every such expression is in fact a solution. Thus, it suffices to count the number of y such that ay 0 (ii) With d = gcd(a, n) as above, show that a n d 0 (mod n), and in fact, for every k with 0 k d 1, a kn 0 (Why do we d only consider the k d 1?) Thus there are at least d solutions to the congruence ay 0 (mod n), and hence to the congruence equation ax b (iii) To see that the d solutions above are all of the solutions mod n, show that, if n divides al, then n d divides l as follows. First show that n d and a are relatively prime (write d = ax + ny and divide by d), and d then use the fact that n d divides a d l and that n d and a are relatively d prime. Exercise 10. Make a table of ϕ(n) for 11 n 20. Exercise 11. Let n = p a be the power of a prime number. What is ϕ(p a )? Exercise 12. A beautiful formula for ϕ(n) is the following: ϕ(d) = n. d n In other words, the sum of the values of ϕ over all of the divisors of n is exactly n. Verify this formula when n = p is a prime number, and for all other n

Topics in Number Theory

Topics in Number Theory Chapter 8 Topics in Number Theory 8.1 The Greatest Common Divisor Preview Activity 1 (The Greatest Common Divisor) 1. Explain what it means to say that a nonzero integer m divides an integer n. Recall

More information

3. QUADRATIC CONGRUENCES

3. QUADRATIC CONGRUENCES 3. QUADRATIC CONGRUENCES 3.1. Quadratics Over a Finite Field We re all familiar with the quadratic equation in the context of real or complex numbers. The formula for the solutions to ax + bx + c = 0 (where

More information

Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

Elementary Number Theory We begin with a bit of elementary number theory, which is concerned CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

More information

Practice Problems for First Test

Practice Problems for First Test Mathematicians have tried in vain to this day to discover some order in the sequence of prime numbers, and we have reason to believe that it is a mystery into which the human mind will never penetrate.-

More information

Decimal Expansion of Rational Numbers

Decimal Expansion of Rational Numbers Decimal Expansion of Rational Numbers Helmer Aslaksen Dept. of Teacher Education & Dept. of Mathematics University of Oslo helmer.aslaksen@gmail.com www.math.nus.edu.sg/aslaksen/ Why is 0.999... = 1? We

More information

CHAPTER 5: MODULAR ARITHMETIC

CHAPTER 5: MODULAR ARITHMETIC CHAPTER 5: MODULAR ARITHMETIC LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN 1. Introduction In this chapter we will consider congruence modulo m, and explore the associated arithmetic called

More information

3 Congruence arithmetic

3 Congruence arithmetic 3 Congruence arithmetic 3.1 Congruence mod n As we said before, one of the most basic tasks in number theory is to factor a number a. How do we do this? We start with smaller numbers and see if they divide

More information

V55.0106 Quantitative Reasoning: Computers, Number Theory and Cryptography

V55.0106 Quantitative Reasoning: Computers, Number Theory and Cryptography V55.0106 Quantitative Reasoning: Computers, Number Theory and Cryptography 3 Congruence Congruences are an important and useful tool for the study of divisibility. As we shall see, they are also critical

More information

Euler s Totient Theorem

Euler s Totient Theorem Euler s Totient Theorem Misha Lavrov ARML Practice 11/11/2012 Example We want to be able to solve the following type of problem: Problem (VTRMC 2012/4.).. 3 What are the last two digits of 3 33. }{{} 2012

More information

Oh Yeah? Well, Prove It.

Oh Yeah? Well, Prove It. Oh Yeah? Well, Prove It. MT 43A - Abstract Algebra Fall 009 A large part of mathematics consists of building up a theoretical framework that allows us to solve problems. This theoretical framework is built

More information

Math 31 - Homework 1 Solutions

Math 31 - Homework 1 Solutions Math 31 - Homework 1 Solutions 1. Find gcd(a, b) and express gcd(a, b) as ma + nb for: (a) (116, 84) Solution. Use the Euclidean algorithm: 116 = ( 1)( 84) + 32 84 = ( 3)(32) + 12 32 = (2)(12) + 8 12 =

More information

MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction.

MODULAR ARITHMETIC. a smallest member. It is equivalent to the Principle of Mathematical Induction. MODULAR ARITHMETIC 1 Working With Integers The usual arithmetic operations of addition, subtraction and multiplication can be performed on integers, and the result is always another integer Division, on

More information

ORDERS OF ELEMENTS IN A GROUP

ORDERS OF ELEMENTS IN A GROUP ORDERS OF ELEMENTS IN A GROUP KEITH CONRAD 1. Introduction Let G be a group and g G. We say g has finite order if g n = e for some positive integer n. For example, 1 and i have finite order in C, since

More information

Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices. A Biswas, IT, BESU SHIBPUR

Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices. A Biswas, IT, BESU SHIBPUR Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices A Biswas, IT, BESU SHIBPUR McGraw-Hill The McGraw-Hill Companies, Inc., 2000 Set of Integers The set of integers, denoted by Z,

More information

Mathematics of Cryptography

Mathematics of Cryptography CHAPTER 2 Mathematics of Cryptography Part I: Modular Arithmetic, Congruence, and Matrices Objectives This chapter is intended to prepare the reader for the next few chapters in cryptography. The chapter

More information

Equivalence relations

Equivalence relations Equivalence relations A motivating example for equivalence relations is the problem of constructing the rational numbers. A rational number is the same thing as a fraction a/b, a, b Z and b 0, and hence

More information

MTH 382 Number Theory Spring 2003 Practice Problems for the Final

MTH 382 Number Theory Spring 2003 Practice Problems for the Final MTH 382 Number Theory Spring 2003 Practice Problems for the Final (1) Find the quotient and remainder in the Division Algorithm, (a) with divisor 16 and dividend 95, (b) with divisor 16 and dividend -95,

More information

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

More information

Math E-301: Homework 4 Notes Due 10/5/09

Math E-301: Homework 4 Notes Due 10/5/09 Math E-301: Homework 4 Notes Due 10/5/09 The notes for homeworks will vary. For some problems, I may give one solution, but there may be other ways to approach the problem. I will try to mention these

More information

Even Number: An integer n is said to be even if it has the form n = 2k for some integer k. That is, n is even if and only if n divisible by 2.

Even Number: An integer n is said to be even if it has the form n = 2k for some integer k. That is, n is even if and only if n divisible by 2. MATH 337 Proofs Dr. Neal, WKU This entire course requires you to write proper mathematical proofs. All proofs should be written elegantly in a formal mathematical style. Complete sentences of explanation

More information

Algebra. Sample Solutions for Test 1

Algebra. Sample Solutions for Test 1 EPFL - Section de Mathématiques Algebra Fall semester 2008-2009 Sample Solutions for Test 1 Question 1 (english, 30 points) 1) Let n 11 13 17. Find the number of units of the ring Z/nZ. 2) Consider the

More information

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may Number Theory Divisibility and Primes Definition. If a and b are integers and there is some integer c such that a = b c, then we say that b divides a or is a factor or divisor of a and write b a. Definition

More information

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory

More information

1 Die hard, once and for all

1 Die hard, once and for all ENGG 2440A: Discrete Mathematics for Engineers Lecture 4 The Chinese University of Hong Kong, Fall 2014 6 and 7 October 2014 Number theory is the branch of mathematics that studies properties of the integers.

More information

Homework 5 Solutions

Homework 5 Solutions Homework 5 Solutions 4.2: 2: a. 321 = 256 + 64 + 1 = (01000001) 2 b. 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (1111111111) 2. Note that this is 1 less than the next power of 2, 1024, which

More information

Fractions and Decimals

Fractions and Decimals Fractions and Decimals Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles December 1, 2005 1 Introduction If you divide 1 by 81, you will find that 1/81 =.012345679012345679... The first

More information

Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4

More information

Further linear algebra. Chapter I. Integers.

Further linear algebra. Chapter I. Integers. Further linear algebra. Chapter I. Integers. Andrei Yafaev Number theory is the theory of Z = {0, ±1, ±2,...}. 1 Euclid s algorithm, Bézout s identity and the greatest common divisor. We say that a Z divides

More information

APPLICATIONS OF THE ORDER FUNCTION

APPLICATIONS OF THE ORDER FUNCTION APPLICATIONS OF THE ORDER FUNCTION LECTURE NOTES: MATH 432, CSUSM, SPRING 2009. PROF. WAYNE AITKEN In this lecture we will explore several applications of order functions including formulas for GCDs and

More information

We now explore a third method of proof: proof by contradiction.

We now explore a third method of proof: proof by contradiction. CHAPTER 6 Proof by Contradiction We now explore a third method of proof: proof by contradiction. This method is not limited to proving just conditional statements it can be used to prove any kind of statement

More information

p 2 1 (mod 6) Adding 2 to both sides gives p (mod 6)

p 2 1 (mod 6) Adding 2 to both sides gives p (mod 6) .9. Problems P10 Try small prime numbers first. p p + 6 3 11 5 7 7 51 11 13 Among the primes in this table, only the prime 3 has the property that (p + ) is also a prime. We try to prove that no other

More information

It is time to prove some theorems. There are various strategies for doing

It is time to prove some theorems. There are various strategies for doing CHAPTER 4 Direct Proof It is time to prove some theorems. There are various strategies for doing this; we now examine the most straightforward approach, a technique called direct proof. As we begin, it

More information

PROBLEM SET # 2 SOLUTIONS

PROBLEM SET # 2 SOLUTIONS PROBLEM SET # 2 SOLUTIONS CHAPTER 2: GROUPS AND ARITHMETIC 2. Groups.. Let G be a group and e and e two identity elements. Show that e = e. (Hint: Consider e e and calculate it two ways.) Solution. Since

More information

Homework until Test #2

Homework until Test #2 MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

More information

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m) Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

More information

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system CHAPTER Number Theory FIGURE FIGURE FIGURE Plus hours Plus hours Plus hours + = + = + = FIGURE. Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter described a mathematical

More information

Solutions to Homework Set 3 (Solutions to Homework Problems from Chapter 2)

Solutions to Homework Set 3 (Solutions to Homework Problems from Chapter 2) Solutions to Homework Set 3 (Solutions to Homework Problems from Chapter 2) Problems from 21 211 Prove that a b (mod n) if and only if a and b leave the same remainder when divided by n Proof Suppose a

More information

Solutions to Practice Problems

Solutions to Practice Problems Solutions to Practice Problems March 205. Given n = pq and φ(n = (p (q, we find p and q as the roots of the quadratic equation (x p(x q = x 2 (n φ(n + x + n = 0. The roots are p, q = 2[ n φ(n+ ± (n φ(n+2

More information

Basic Properties of Rings

Basic Properties of Rings Basic Properties of Rings A ring is an algebraic structure with an addition operation and a multiplication operation. These operations are required to satisfy many (but not all!) familiar properties. Some

More information

Mathematics of Cryptography Part I

Mathematics of Cryptography Part I CHAPTER 2 Mathematics of Cryptography Part I (Solution to Odd-Numbered Problems) Review Questions 1. The set of integers is Z. It contains all integral numbers from negative infinity to positive infinity.

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

Properties of Real Numbers

Properties of Real Numbers 16 Chapter P Prerequisites P.2 Properties of Real Numbers What you should learn: Identify and use the basic properties of real numbers Develop and use additional properties of real numbers Why you should

More information

Is this number prime? Berkeley Math Circle Kiran Kedlaya

Is this number prime? Berkeley Math Circle Kiran Kedlaya Is this number prime? Berkeley Math Circle 2002 2003 Kiran Kedlaya Given a positive integer, how do you check whether it is prime (has itself and 1 as its only two positive divisors) or composite (not

More information

Proofs are short works of prose and need to be written in complete sentences, with mathematical symbols used where appropriate.

Proofs are short works of prose and need to be written in complete sentences, with mathematical symbols used where appropriate. Advice for homework: Proofs are short works of prose and need to be written in complete sentences, with mathematical symbols used where appropriate. Even if a problem is a simple exercise that doesn t

More information

MODULAR ARITHMETIC KEITH CONRAD

MODULAR ARITHMETIC KEITH CONRAD MODULAR ARITHMETIC KEITH CONRAD. Introduction We will define the notion of congruent integers (with respect to a modulus) and develop some basic ideas of modular arithmetic. Applications of modular arithmetic

More information

4.4 Clock Arithmetic and Modular Systems

4.4 Clock Arithmetic and Modular Systems 4.4 Clock Arithmetic and Modular Systems A mathematical system has 3 major properies. 1. It is a set of elements 2. It has one or more operations to combine these elements (ie. Multiplication, addition)

More information

Reading 7 : Program Correctness

Reading 7 : Program Correctness CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Instructors: Beck Hasti, Gautam Prakriya Reading 7 : Program Correctness 7.1 Program Correctness Showing that a program is correct means that

More information

EULER S THEOREM. 1. Introduction Fermat s little theorem is an important property of integers to a prime modulus. a p 1 1 mod p.

EULER S THEOREM. 1. Introduction Fermat s little theorem is an important property of integers to a prime modulus. a p 1 1 mod p. EULER S THEOREM KEITH CONRAD. Introduction Fermat s little theorem is an important property of integers to a prime modulus. Theorem. (Fermat). For prime p and any a Z such that a 0 mod p, a p mod p. If

More information

= 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

= 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that Instructions. Answer each of the questions on your own paper, and be sure to show your work so that partial credit can be adequately assessed. Credit will not be given for answers (even correct ones) without

More information

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors. The Prime Numbers Before starting our study of primes, we record the following important lemma. Recall that integers a, b are said to be relatively prime if gcd(a, b) = 1. Lemma (Euclid s Lemma). If gcd(a,

More information

Introduction to Modular Arithmetic, the rings Z 6 and Z 7

Introduction to Modular Arithmetic, the rings Z 6 and Z 7 Introduction to Modular Arithmetic, the rings Z 6 and Z 7 The main objective of this discussion is to learn modular arithmetic. We do this by building two systems using modular arithmetic and then by solving

More information

a = bq + r where 0 r < b.

a = bq + r where 0 r < b. Lecture 5: Euclid s algorithm Introduction The fundamental arithmetic operations are addition, subtraction, multiplication and division. But there is a fifth operation which I would argue is just as fundamental

More information

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given

More information

NUMBER THEORY AMIN WITNO

NUMBER THEORY AMIN WITNO NUMBER THEORY AMIN WITNO ii Number Theory Amin Witno Department of Basic Sciences Philadelphia University JORDAN 19392 Originally written for Math 313 students at Philadelphia University in Jordan, this

More information

Lecture 13 - Basic Number Theory.

Lecture 13 - Basic Number Theory. Lecture 13 - Basic Number Theory. Boaz Barak March 22, 2010 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that A divides B, denoted

More information

Course notes on Number Theory

Course notes on Number Theory Course notes on Number Theory In Number Theory, we make the decision to work entirely with whole numbers. There are many reasons for this besides just mathematical interest, not the least of which is that

More information

Students in their first advanced mathematics classes are often surprised

Students in their first advanced mathematics classes are often surprised CHAPTER 8 Proofs Involving Sets Students in their first advanced mathematics classes are often surprised by the extensive role that sets play and by the fact that most of the proofs they encounter are

More information

2 The Euclidean algorithm

2 The Euclidean algorithm 2 The Euclidean algorithm Do you understand the number 5? 6? 7? At some point our level of comfort with individual numbers goes down as the numbers get large For some it may be at 43, for others, 4 In

More information

Algebraic Systems, Fall 2013, September 1, 2013 Edition. Todd Cochrane

Algebraic Systems, Fall 2013, September 1, 2013 Edition. Todd Cochrane Algebraic Systems, Fall 2013, September 1, 2013 Edition Todd Cochrane Contents Notation 5 Chapter 0. Axioms for the set of Integers Z. 7 Chapter 1. Algebraic Properties of the Integers 9 1.1. Background

More information

Problem Set 5. AABB = 11k = (10 + 1)k = (10 + 1)XY Z = XY Z0 + XY Z XYZ0 + XYZ AABB

Problem Set 5. AABB = 11k = (10 + 1)k = (10 + 1)XY Z = XY Z0 + XY Z XYZ0 + XYZ AABB Problem Set 5 1. (a) Four-digit number S = aabb is a square. Find it; (hint: 11 is a factor of S) (b) If n is a sum of two square, so is 2n. (Frank) Solution: (a) Since (A + B) (A + B) = 0, and 11 0, 11

More information

Proof that an Infinite Number of Mersenne Prime Numbers Exit

Proof that an Infinite Number of Mersenne Prime Numbers Exit Proof that an Infinite Number of Mersenne Prime Numbers Exit Stephen Marshall 29 Aug 2014 Abstract This paper presents a complete and exhaustive proof of the infinitude of Mersenne prime numbers. The approach

More information

ARITHMETICAL FUNCTIONS II: CONVOLUTION AND INVERSION

ARITHMETICAL FUNCTIONS II: CONVOLUTION AND INVERSION ARITHMETICAL FUNCTIONS II: CONVOLUTION AND INVERSION PETE L. CLARK 1. Sums over divisors, convolution and Möbius Inversion The proof of the multiplicativity of the functions σ k, easy though it was, actually

More information

MATH 321 EQUIVALENCE RELATIONS, WELL-DEFINEDNESS, MODULAR ARITHMETIC, AND THE RATIONAL NUMBERS

MATH 321 EQUIVALENCE RELATIONS, WELL-DEFINEDNESS, MODULAR ARITHMETIC, AND THE RATIONAL NUMBERS MATH 321 EQUIVALENCE RELATIONS, WELL-DEFINEDNESS, MODULAR ARITHMETIC, AND THE RATIONAL NUMBERS ALLAN YASHINSKI Abstract. We explore the notion of well-definedness when defining functions whose domain is

More information

INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS

INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS STEVEN HEILMAN Contents 1. Homework 1 1 2. Homework 2 6 3. Homework 3 10 4. Homework 4 16 5. Homework 5 19 6. Homework 6 21 7. Homework 7 25 8. Homework 8 28

More information

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES 2016 47 4. Diophantine Equations A Diophantine Equation is simply an equation in one or more variables for which integer (or sometimes rational) solutions

More information

b) Find smallest a > 0 such that 2 a 1 (mod 341). Solution: a) Use succesive squarings. We have 85 =

b) Find smallest a > 0 such that 2 a 1 (mod 341). Solution: a) Use succesive squarings. We have 85 = Problem 1. Prove that a b (mod c) if and only if a and b give the same remainders upon division by c. Solution: Let r a, r b be the remainders of a, b upon division by c respectively. Thus a r a (mod c)

More information

CHAPTER 3 Numbers and Numeral Systems

CHAPTER 3 Numbers and Numeral Systems CHAPTER 3 Numbers and Numeral Systems Numbers play an important role in almost all areas of mathematics, not least in calculus. Virtually all calculus books contain a thorough description of the natural,

More information

The last three chapters introduced three major proof techniques: direct,

The last three chapters introduced three major proof techniques: direct, CHAPTER 7 Proving Non-Conditional Statements The last three chapters introduced three major proof techniques: direct, contrapositive and contradiction. These three techniques are used to prove statements

More information

Quotient Rings and Field Extensions

Quotient Rings and Field Extensions Chapter 5 Quotient Rings and Field Extensions In this chapter we describe a method for producing field extension of a given field. If F is a field, then a field extension is a field K that contains F.

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

Appendix F: Mathematical Induction

Appendix F: Mathematical Induction Appendix F: Mathematical Induction Introduction In this appendix, you will study a form of mathematical proof called mathematical induction. To see the logical need for mathematical induction, take another

More information

5.1 Commutative rings; Integral Domains

5.1 Commutative rings; Integral Domains 5.1 J.A.Beachy 1 5.1 Commutative rings; Integral Domains from A Study Guide for Beginner s by J.A.Beachy, a supplement to Abstract Algebra by Beachy / Blair 23. Let R be a commutative ring. Prove the following

More information

10 k + pm pm. 10 n p q = 2n 5 n p 2 a 5 b q = p

10 k + pm pm. 10 n p q = 2n 5 n p 2 a 5 b q = p Week 7 Summary Lecture 13 Suppose that p and q are integers with gcd(p, q) = 1 (so that the fraction p/q is in its lowest terms) and 0 < p < q (so that 0 < p/q < 1), and suppose that q is not divisible

More information

CHAPTER 6: RATIONAL NUMBERS AND ORDERED FIELDS

CHAPTER 6: RATIONAL NUMBERS AND ORDERED FIELDS CHAPTER 6: RATIONAL NUMBERS AND ORDERED FIELDS LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN 1. Introduction In this chapter we construct the set of rational numbers Q using equivalence

More information

Introduction. Appendix D Mathematical Induction D1

Introduction. Appendix D Mathematical Induction D1 Appendix D Mathematical Induction D D Mathematical Induction Use mathematical induction to prove a formula. Find a sum of powers of integers. Find a formula for a finite sum. Use finite differences to

More information

Part V, Abstract Algebra CS131 Mathematics for Computer Scientists II Note 29 RINGS AND FIELDS

Part V, Abstract Algebra CS131 Mathematics for Computer Scientists II Note 29 RINGS AND FIELDS CS131 Part V, Abstract Algebra CS131 Mathematics for Computer Scientists II Note 29 RINGS AND FIELDS We now look at some algebraic structures which have more than one binary operation. Rings and fields

More information

3. Applications of Number Theory

3. Applications of Number Theory 3. APPLICATIONS OF NUMBER THEORY 163 3. Applications of Number Theory 3.1. Representation of Integers. Theorem 3.1.1. Given an integer b > 1, every positive integer n can be expresses uniquely as n = a

More information

Elementary Number Theory

Elementary Number Theory Elementary Number Theory Ahto Buldas December 3, 2016 Ahto Buldas Elementary Number Theory December 3, 2016 1 / 1 Division For any m > 0, we define Z m = {0, 1,... m 1} For any n, m Z (m > 0), there are

More information

Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University

Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof Harper Langston New York University Proof and Counterexample Discovery and proof Even and odd numbers number n from Z is called

More information

2. Integers and Algorithms Euclidean Algorithm. Euclidean Algorithm. Suppose a and b are integers

2. Integers and Algorithms Euclidean Algorithm. Euclidean Algorithm. Suppose a and b are integers 2. INTEGERS AND ALGORITHMS 155 2. Integers and Algorithms 2.1. Euclidean Algorithm. Euclidean Algorithm. Suppose a and b are integers with a b > 0. (1) Apply the division algorithm: a = bq + r, 0 r < b.

More information

Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00

Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00 18.781 Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00 Throughout this assignment, f(x) always denotes a polynomial with integer coefficients. 1. (a) Show that e 32 (3) = 8, and write down a list

More information

A farmer raises rabbits. Each rabbit gives birth when 2 months old and then each month there after.

A farmer raises rabbits. Each rabbit gives birth when 2 months old and then each month there after. Fibonacci Problem: A farmer raises rabbits. Each rabbit gives birth when 2 months old and then each month there after. Question: How many rabbits will the farmer have after n months? Try it on small numbers.

More information

PYTHAGOREAN TRIPLES PETE L. CLARK

PYTHAGOREAN TRIPLES PETE L. CLARK PYTHAGOREAN TRIPLES PETE L. CLARK 1. Parameterization of Pythagorean Triples 1.1. Introduction to Pythagorean triples. By a Pythagorean triple we mean an ordered triple (x, y, z) Z 3 such that x + y =

More information

Chapter 6. Number Theory. 6.1 The Division Algorithm

Chapter 6. Number Theory. 6.1 The Division Algorithm Chapter 6 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

Chapter 4: Binary Operations and Relations

Chapter 4: Binary Operations and Relations c Dr Oksana Shatalov, Fall 2014 1 Chapter 4: Binary Operations and Relations 4.1: Binary Operations DEFINITION 1. A binary operation on a nonempty set A is a function from A A to A. Addition, subtraction,

More information

Climbing an Infinite Ladder

Climbing an Infinite Ladder Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder and the following capabilities: 1. We can reach the first rung of the ladder. 2. If we can reach a particular rung of the ladder,

More information

Integers and Rational Numbers

Integers and Rational Numbers Chapter 6 Integers and Rational Numbers In this chapter, we will see constructions of the integers and the rational numbers; and we will see that our number system still has gaps (equations we can t solve)

More information

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS Class Meetings: MW 2:00-3:15 pm in Physics 144, September 7 to December 14 [Thanksgiving break November 23 27; final exam December 21] Instructor:

More information

1.3. Properties of Real Numbers Properties by the Pound. My Notes ACTIVITY

1.3. Properties of Real Numbers Properties by the Pound. My Notes ACTIVITY Properties of Real Numbers SUGGESTED LEARNING STRATEGIES: Create Representations, Activating Prior Knowledge, Think/Pair/Share, Interactive Word Wall The local girls track team is strength training by

More information

3 Structure of Modular Multiplication

3 Structure of Modular Multiplication 3 Structure of Modular Multiplication Unlike addition, multiplication in Z M is fairly strange. There may not always be an inverse, you can multiply two non-zero numbers together and get zero, and in general

More information

LESSON 1 PRIME NUMBERS AND FACTORISATION

LESSON 1 PRIME NUMBERS AND FACTORISATION LESSON 1 PRIME NUMBERS AND FACTORISATION 1.1 FACTORS: The natural numbers are the numbers 1,, 3, 4,. The integers are the naturals numbers together with 0 and the negative integers. That is the integers

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 Proofs Intuitively, the concept of proof should already be familiar We all like to assert things, and few of us

More information

Chapter Two. Number Theory

Chapter Two. Number Theory Chapter Two Number Theory 2.1 INTRODUCTION Number theory is that area of mathematics dealing with the properties of the integers under the ordinary operations of addition, subtraction, multiplication and

More information

Rational Numbers CHAPTER Introduction

Rational Numbers CHAPTER Introduction RATIONAL NUMBERS Rational Numbers CHAPTER. Introduction In Mathematics, we frequently come across simple equations to be solved. For example, the equation x + = () is solved when x =, because this value

More information

2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try.

2. Methods of Proof Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. 2. METHODS OF PROOF 69 2. Methods of Proof 2.1. Types of Proofs. Suppose we wish to prove an implication p q. Here are some strategies we have available to try. Trivial Proof: If we know q is true then

More information

1. R In this and the next section we are going to study the properties of sequences of real numbers.

1. R In this and the next section we are going to study the properties of sequences of real numbers. +a 1. R In this and the next section we are going to study the properties of sequences of real numbers. Definition 1.1. (Sequence) A sequence is a function with domain N. Example 1.2. A sequence of real

More information

Lecture 3: Finding integer solutions to systems of linear equations

Lecture 3: Finding integer solutions to systems of linear equations Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture

More information

11 Ideals. 11.1 Revisiting Z

11 Ideals. 11.1 Revisiting Z 11 Ideals The presentation here is somewhat different than the text. In particular, the sections do not match up. We have seen issues with the failure of unique factorization already, e.g., Z[ 5] = O Q(

More information

MAT2400 Analysis I. A brief introduction to proofs, sets, and functions

MAT2400 Analysis I. A brief introduction to proofs, sets, and functions MAT2400 Analysis I A brief introduction to proofs, sets, and functions In Analysis I there is a lot of manipulations with sets and functions. It is probably also the first course where you have to take

More information

12 Greatest Common Divisors. The Euclidean Algorithm

12 Greatest Common Divisors. The Euclidean Algorithm Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan 12 Greatest Common Divisors. The Euclidean Algorithm As mentioned at the end of the previous section, we would like to

More information