Lecture 9: Arithmetics II

Size: px
Start display at page:

Download "Lecture 9: Arithmetics II"

Transcription

1 DD2458, Problem Solving and Programming Under Pressure Lecture 9: Arithmetics II Date: Scribe(s): Marcus Forsell Stahre and David Schlyter Lecturer: Douglas Wikström This lecture is a continuation of the previous one, and covers modular arithmetic and topics from a branch of number theory known as elementary number theory. Also, some abstract algebra will be discussed. 1 Greatest Common Divisor Definition 1.1 If anteger d divides another integer n with no remainder, d is said to be a divisor of n. That is, there exists anteger a such that a d = n. The notation for this is d n. Definition 1.2 A common divisor of two non-zero integers m and s a positive integer d, such that d m and d n. Definition 1.3 The Greatest Common Divisor (GCD) of two positive integers m and s a common divisor d such that every other common divisor d d. The notation for this is GCD(m, n) = d. That is, the GCD of two numbers is the greatest number that is a divisor of both of them. To get antuition of what GCD is, let s have a look at this example. Example Calculate GCD(9, 6). Say we have 9 black and 6 white blocks. We want to put the blocks in boxes, but every box has to be the same size, and can only hold blocks of the same color. Also, all the boxes must be full and as large as possible. Let s for example say we choose a box of size 2: As we can see, the last box of black bricks is not full. It s easy to see that it wouldn t be, since 2 isn t a divisor of 9. We know that 3 is a divisor of both 9 and 6, so we try this size of boxes. 1

2 2 DD2458 Popup HT 2008 There is no larger number that is a divisor of both 9 and 6, so there can t be any larger size of boxes that can be completely filled. We therefore come to the conclusion that GCD(9, 6) must be 3. From the third definition above, it s not very hard to see that the Greatest Common Divisor is equivalent to the greatest common factor (not to be confused with prime factors!), since every other common divisor is smaller than GCD(m, n). The third definition also gives us anefficient but simpler way than the above to find the Greatest Common Divisor of two numbers. First, find the prime factorizations of m and n. Take all the common prime factors and calculate the product of them. Let s call this product d. Since both m and s divisible by this d, and since every common divisor is a divisor of d, we get GCD(m, n) = d. Note that we know that every common divisor is a divisor of d since every common divisor can be written as a product of common prime factors. Example Calculate GCD(60, 42) 60 = = GCD(60, 42) = 2 3 = 6 Since finding the prime factorization of a number in general is hard, this is obviously not a very good way to calculate GCD, especially when m and n grows larger. There are much more efficient ways to calculate it, and we will talk about two of them in a moment, but first let s have a look at a few useful properties of GCD. 1.1 Properties of GCD m and n are positive integers, and k is any integer. GCD(m, n) = GCD(n, m) (1) GCD(m, n) = GCD(m + k n, n) (2) GCD(m, n) = GCD(m mod n, n) (3) GCD(m, n) = 2 GCD(m/2, n/2) if m and n are even. (4) GCD(m, n) = GCD(m/2, n) if m is even and s odd. (5) It is not hard too see that (1) is true, but the others might need some explanation. Property (2) is the basis for (3), so let s start with (2). If x is a common divisor of m and n, then x m and x n. Therefore x k n, and thus x (m + k n).

3 Arithmetics II 3 If x is a common divisor of (m + k n) and n, then x m + k n and x n. Therefore x k n, and thus x (m + k n) k n x m. From this we conclude that the set of common divisors to m and s equal to the set of common divisors to m + k n and n. This means that GCD(m, n) = GCD(m + k n, n) We ll now use this to show (3). We are going to use the fact that m mod s defined as anteger 0 r < n such that for some integer a, m = a n + r. From this we get r = m a n, and from (2) we know that GCD(m a n, n) = GCD(m, n). Since m and n both being eves equivalent to m and n having a common divisor 2, we can move this factor outside of the GCD function, and still get the same result (4). By similar reasoning, if one of m and n are even and not the other one, 2 is a non-common divisor, and the result is not affected if it s removed (5). 1.2 Euclidean Algorithm The Euclidean Algorithm makes use of property (3) from above. The idea is to reduce m and n repeatedly until one of them is zero. The original version of the algorithm actually used property (2) from above, and looks like this: Algorithm 1: Euclidean algorithm for finding the GCD Input: Two integers, m and n Output: The GCD of m and n EuclideanOld(m,n) (1) if m = 0 (2) return n (3) while n 0 (4) if n > m (5) n n m (6) else (7) m m n (8) return m It uses the fact that GCD(m, n) = GCD(m n, n), and simply repeats the operation until n hits zero. A more efficient way of doing this is of course to use (3).

4 4 DD2458 Popup HT 2008 Algorithm 2: A better version of the Euclidean algorithm Input: Two integers, m and n Output: The GCD of m and n EuclideanIterative(m,n) (1) while n 0 (2) t n (3) n m mod n (4) m t (5) return m This is very much the same idea as the previous one. GCD(m, n) = GCD(n, m mod n), repeat until n hits zero. Since modulo basically is repeated subtraction, this is very much the same algorithm, but several subtractions are done at once. The recursive version of the algorithm looks like this: Algorithm 3: A recursive version of Algorithm 2 Input: Two integers, m and n Output: The GCD of m and n EuclideanRecursive(m,n) (1) if n = 0 (2) return m (3) else (4) return EuclideanRecursive(n, m mod n) 1.3 Binary GCD Algorithm When using a computer to calculate GCD, the Binary GCD Algorithm (also known as Stein s algorithm) might be preferable, since it makes good use of the binary representation of numbers that a computer uses. The idea is to use property (4) and (5) in order to step by step decrease the number of bits in the numbers.

5 Arithmetics II 5 Algorithm 4: Stein s algorithm for binary GCD calculation Input: Two integers, m and n Output: The GCD of m and n BinaryGCD(m,n) (1) if m = 0 or n = 0 (2) return 0 (3) s 0 (4) while m and n are even (5) m m/2 (6) n n/2 (7) s s + 1 (8) while s even (9) n n/2 (10) while m 0 (11) while m is even (12) m m/2 (13) if m < n (14) Swap(m,n) (15) m m n (16) m m/2 (17) return 2 s n First, all the common factors 2 are removed. Since the numbers are stored in binary on a computer, this can be done with shift-operations, which are very fast. If n still has any factors 2, they can be discarded, as they re not common factors. The main-loop of the algorithm is then entered. At this point there are no common factors 2 that are left, since they ve all been removed. Therefore, m can be divided by 2 until it is odd. If it thes smaller than n, they are swapped. This is done so that the next operation never gives a negative result. When row 15 is about to be executed, both m and n are guaranteed to be odd numbers. And since the difference of two odd numbers always is even, row 15 always makes m into an even number. It can therefore be divided by two once again. The loop with shifting right and making even continues until m is zero, and then s returned, but not before multiplying with the common factors 2 that were removed on rows 4 to 7. 2 Bézout s identity Bézout s identity states that for every pair of non-zero integers a and b, there exists integers x and y such that ax + by = GCD(a, b). These can be found using the Extended Euclidean Algorithm. Note though that there is anfinite number of x and y that satisfies this equation. The Extended Euclidean Algorithm finds one solution, and every other solutios on the following form, where k is anteger: x k = x + k y k = y k b GCD(a,b) a GCD(a,b)

6 6 DD2458 Popup HT 2008 Later on, there will be an example of when this identity and the Extended Euclidean Algorithm can be useful. 2.1 Extended Euclidean Algorithm Algorithm 5: Extended Euclidean algorithm for solving ax + by = GCD(a,b) Input: Two integers, m and n Output: Two integers, x and y satisfying the equation ExtendedEuclidean(m,n) (1) if n m (2) return (0, 1) (3) else (4) (x, y ) ExtendedEuclidean(n, m mod n) (5) return (y, x y m n ) If s a divisor of m, then the solution to mx + ny = GCD(m, n) must be x = 0, y = 1, since we know then that GCD(m, n) is n. In the recursive step we use GCD property (3) from above and instead try to solve the equation n x + (m mod n) y = GCD(m, n). By introducing a term n m n y, we can use the fact that n m n + (m mod n) = m (This is simply integer division followed by multiplication, and then adding back the missing remainder). n x + (m mod n) y = GCD(m, n) m m n x + (m mod n) y + n y n y = GCD(m, n) n n m m n (x y ) + ((m mod n) + n ) y = GCD(m, n) n n m n (x y ) + m y = GCD(m, n) n This means that the solution to the equation m x + n y = GCD(m, n), by the recursion, is x = y, and y = (x m n y ). 3 Abstract Algebra Abstract algebra is a branch of mathematics that deals with algebraic structures such as rings, groups, fields, and vector spaces. When dealing with number theory these structures are very often useful, so this is a brief introduction to a few of them. 3.1 Monoids A monoid consists of a set M and a binary operator, such that: For every a, b M: a b M For every a, b, c M: (a b) c = a (b c) There is an e M such that for every a M: a e = e a = a (Closure) (Associativity) (Identity)

7 Arithmetics II 7 Note that you could have a structure without the identity property, but it wouldn t be a monoid, and you d end up with very strange results! If the monoid also has the property that for every a, b M: a b = b a, the monoid is said to be commutative, or abelian. 3.2 Groups A group is a monoid (G, ) such that: For every a G there is an b G such that: a b = b a = e (Inverse) A group does not need to be abelian, but it might be. It s often natural to denote the binary operation on a group as addition and multiplication, and in those cases the group is usually referred to as an additive or multiplicative group, respectively. In those cases it s also often natural to have 0 or 1 as the identity element. 3.3 Application of groups Exponentiatios in general the same thing as repeated multiplication, just as multiplicatios repeated addition. We can therefore in a multiplicative group do exponentiation: Example We have a group (Z, ). Find 2 3 Calculating 2 3 is the same as multiplying three times, so we get = 4 2 = 8 Therefore 2 3 = 8 When dealing with larger exponents, this way of doing it will be very slow. We can instead use a simple method called Square-and-Multiply (or Double-and-Add when dealing with an additive group). The following algorithm calculates g x. Algorithm 6: Square and Multiply Input: A base g and an exponent x Output: The result of g x SquareAndMultiply(g, x) (1) r 1 (2) while x > 0 (3) if x is odd (4) r r g (5) g g g (6) x Floor(x/2) (7) return r Let g be a number, which in base 2 is represented by the binary digits a n 1 a n 2...a 0, where a 0 is the least significant digit. We can then calculate g x as g 2a k (6) k:a k =1

8 8 DD2458 Popup HT 2008 This algorithm uses the fact that g = a a a n 1 2 n 1. That is, if we go through all the binary digits, and the k th binary digit is a one, multiply the result by g 2k. In the implementation this g 2k is kept between the digits, and only one additional multiplication needs to be do for each bit in x. This means that the running time of this algorithm is roughly O(n 3 ) (since multiplication usually takes n 2 time). It s important to notice that the binary operator doesn t need to be multiplication, it might just as well have been addition or anything else. This quite simple algorithm is not only useful in simple groups, but can also be used to do fast exponentiation with positive integers. 3.4 Ring A commutative ring (R, +, ) is a set R and two binary operators + and such that: (R, +) is an abelian group with identity 0 (R, ) is an abelian monoid with identity 1 For every a, b, c R: a (b + c) = a b + a c, (a + b) c = a c + b c 3.5 Field A field is a ring where multiplicatios commutative, and where every element except zero has a multiplicative inverse. Examples of fields are R and Z p (where p is a prime). Fields are useful because they often behave just like regular numbers. If (K, +, ) is a field, then (K {0}, ) is an abelian group (Multiplicative Inverse) 4 Modular Arithmetics Modular arithmetics, is very often useful when dealing with cyclic structures like groups and rings, and they are also often useful in computer science when dealing with for example cryptography. It basically deals with arithmetics with numbers that wrap around at some value. In general, modular arithmetics can be considered to be arithmetics modulo some integer n. Theorem 4.1 Given two integers n and m, there exists anteger q and anteger r such that n = qm + r. The notation for this is n mod m = r. When n and m are positive integers, we have that n = n m + (n mod m) (We used this above when showing the correctness of the Extended Euclidean Algorithm). Definition 4.2 Two integers n and n are congruent modulo m if and only if n = n + k m for some integer k, that is, n mod m = n mod m. The notation for this is n n (mod m)). Other common notations for this is n n mod m, n = n (mod m), n m n, and n n (m).

9 Arithmetics II 9 It s also worth to note that the congruence relatios an equivalence relation. This means that it has the following properties: a a if a b then b a if a b and b c then a c (Reflexive) (Symmetric) (Transitive) The following theorems might also be useful to know: Theorem 4.3 The set 0, 1,..., n 1 with modular addition and multiplication forms a commutative ring. It can also be defined as the set of elements in the equivalence classes under the congruence relation modulo n. Common notations: Z n, Z/nZ, Z/(n), Z/n, Z/(n)Z Theorem 4.4 If s prime, Z s a field. 5 Useful Theorems Two integers are said to be relatively prime, or co-prime, if they don t have any common prime factors. That is: Theorem 5.1 Two integers m and n are co-prime if their greatest common divisor is The Chinese Remainder Theorem The Chinese Remainder Theorem has its origins in a Chinese book called The Mathematical Classics by Sun Zi, and is a statement about simultaneous congruences. It is said to have it origins from when the emperor was to count how many soldiers he had. They ordered the soldiers to stand in lines of for example 5, and then counted how many was left over. This was repeated a few times with different line-widths, and at the end they could calculate how many soldiers there were. Claim 5.2 Let n 1, n 2,..., n k be pairwise relatively prime integers, and let a 1, a 2,..., a k be integers. Then the following system of equations has a solution: x a 1 (mod n 1 ) x a 2 (mod n 2 ) x a 3 (mod n 3 )... x a k (mod n k ) The constructive proof of this, which is also basis for the implementation of the algorithm, is as follows: (1) Let N = n 1 n 2 n 3... n k (2) Find an r i and s i such that r i + s i N = 1

10 10 DD2458 Popup HT 2008 (3) Note that: s i N = 1 r i = (4) The solutios found by x = k i=1 { 1 mod 0 mod n j if j i s i N a i The key to the proof is in step 3. In step two we find the solution (r i, s i ) to the equation using the extended euclidean algorithm. Also take notice that and N are co-prime. In step 3 we have just rewritten the equation from step 2. It s easy to see that s i N 1 (mod ), because r i 0 (mod ), and since N has every factor n j except, it s easy to see that s i N 0 (mod n j ). This fact can be used to prove that (4) is a solution modulo N, but since the proof of this is quite long and tedious, it will not be presented in this text. 5.2 Fermat s little theorem This theorem is also very useful when dealing with number theory, and is for example the basis of the Fermat primality test. Theorem 5.3 Let p be any prime. a p a (mod p) for every integer a. Theorem 5.4 Let p be any prime, and a anteger co-prime to p, then a p 1 1 (mod p) Both of the above statements are equivalent. There are several proofs for the correctness of them, but one in particular is very short and easy to understand. The basic idea is to make bracelets of length p using a different colors. Every bracelet using only one kind of color is removed (this is exactly a bracelets), and the proof continues by showing that the remaining number of bracelets is divisible by p. 5.3 Euler s totient function Euler s totient function, or Euler-phi is defined as follows: Definition 5.5 φ(n) is the number of positive integers less than n that are relatively prime to n. It s not hard to see that φ(p) = p 1 for every prime p. The formula for calculating the value of the function the general case is not hard either. Consider the prime factorization of n: n = p 1 p 2 p 3... p k every p 1 th number smaller than s divisible by p 1. every p 2 th number smaller than s divisible by p every p k th number smaller than s divisible by p k. Therefore, φ(n) = n (1 1/p 1 ) (1 1/p 2 )... (1 1/p k ).

11 Arithmetics II 11 In essence, we re simply removing all the numbers that aren t co-prime to n. The above is often written as an Euler product: n (1 1 p ) 5.4 Modular multiplicative inverse There are several ways to calculate the inverse of an element in group. We will now show two ways to do it - one using Square-and-Multiply, and one using Extended Euclidean. To start with, we will show yet one example of how the Bézout identity can be useful. A modular multiplicative inverse to a number n only exists if n and p are co-prime, that is GCD(n, p) = 1. That means the Extended Euclidean Algorithm solves the equation nx + py = 1, which modulo p is the same as nx 1 (mod p). That is, the x that the Extended Euclidean Algorithm calculates is the inverse to n the integer ring modulo p. We know that for a modular inverse to exists, GCD(n, p) = 1, so p must be coprime to all n. This means that p is a prime, and we can make use of Fermat s theorem. Since we get from Fermat that n p 1 1 (mod p), we easily see that n n p 2 1 (mod p), which means that the inverse of s n p 2, and we can easily calculate n p 2 by Square-and-Multiply. 5.5 Vandermonde Matrix Theorem 5.6 A Vandermonde matrix is always invertible p n A Vandermonde matrix is a matrix with the following structure: 1 α 1 α1 2 α n α 2 α2 2 α n α 3 α3 2 α3 n α m αm 2 αm n 1 (7) If you let A be a Vandermonde matrix, and solve a system of equations Au = y, you will actually find the coefficients of the polynomial P (x) = n 1 i=0 u i x i. In this case, y i should be the y-value of the function at the point α i.

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

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

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

Public Key Cryptography: RSA and Lots of Number Theory

Public Key Cryptography: RSA and Lots of Number Theory Public Key Cryptography: RSA and Lots of Number Theory Public vs. Private-Key Cryptography We have just discussed traditional symmetric cryptography: Uses a single key shared between sender and receiver

More information

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Discrete Mathematics, Chapter 4: Number Theory and Cryptography Discrete Mathematics, Chapter 4: Number Theory and Cryptography Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 4 1 / 35 Outline 1 Divisibility

More information

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS John A. Beachy Northern Illinois University 2014 ii J.A.Beachy This is a supplement to Abstract Algebra, Third Edition by John A. Beachy and William D. Blair

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

RSA and Primality Testing

RSA and Primality Testing and Primality Testing Joan Boyar, IMADA, University of Southern Denmark Studieretningsprojekter 2010 1 / 81 Correctness of cryptography cryptography Introduction to number theory Correctness of with 2

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

Cryptography and Network Security Number Theory

Cryptography and Network Security Number Theory Cryptography and Network Security Number Theory Xiang-Yang Li Introduction to Number Theory Divisors b a if a=mb for an integer m b a and c b then c a b g and b h then b (mg+nh) for any int. m,n Prime

More information

SUM OF TWO SQUARES JAHNAVI BHASKAR

SUM OF TWO SQUARES JAHNAVI BHASKAR SUM OF TWO SQUARES JAHNAVI BHASKAR Abstract. I will investigate which numbers can be written as the sum of two squares and in how many ways, providing enough basic number theory so even the unacquainted

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

8 Divisibility and prime numbers

8 Divisibility and prime numbers 8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

More information

MATH 289 PROBLEM SET 4: NUMBER THEORY

MATH 289 PROBLEM SET 4: NUMBER THEORY MATH 289 PROBLEM SET 4: NUMBER THEORY 1. The greatest common divisor If d and n are integers, then we say that d divides n if and only if there exists an integer q such that n = qd. Notice that if d divides

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

Overview of Number Theory Basics. Divisibility

Overview of Number Theory Basics. Divisibility Overview of Number Theory Basics Murat Kantarcioglu Based on Prof. Ninghui Li s Slides Divisibility Definition Given integers a and b, b 0, b divides a (denoted b a) if integer c, s.t. a = cb. b is called

More information

Stupid Divisibility Tricks

Stupid Divisibility Tricks Stupid Divisibility Tricks 101 Ways to Stupefy Your Friends Appeared in Math Horizons November, 2006 Marc Renault Shippensburg University Mathematics Department 1871 Old Main Road Shippensburg, PA 17013

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

Computer and Network Security

Computer and Network Security MIT 6.857 Computer and Networ Security Class Notes 1 File: http://theory.lcs.mit.edu/ rivest/notes/notes.pdf Revision: December 2, 2002 Computer and Networ Security MIT 6.857 Class Notes by Ronald L. Rivest

More information

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 12 Block Cipher Standards

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

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and Breaking The Code Ryan Lowe Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and a minor in Applied Physics. As a sophomore, he took an independent study

More information

Our Primitive Roots. Chris Lyons

Our Primitive Roots. Chris Lyons Our Primitive Roots Chris Lyons Abstract When n is not divisible by 2 or 5, the decimal expansion of the number /n is an infinite repetition of some finite sequence of r digits. For instance, when n =

More information

The Euclidean Algorithm

The Euclidean Algorithm The Euclidean Algorithm A METHOD FOR FINDING THE GREATEST COMMON DIVISOR FOR TWO LARGE NUMBERS To be successful using this method you have got to know how to divide. If this is something that you have

More information

Introduction to Modern Algebra

Introduction to Modern Algebra Introduction to Modern Algebra David Joyce Clark University Version 0.0.6, 3 Oct 2008 1 1 Copyright (C) 2008. ii I dedicate this book to my friend and colleague Arthur Chou. Arthur encouraged me to write

More information

Today s Topics. Primes & Greatest Common Divisors

Today s Topics. Primes & Greatest Common Divisors Today s Topics Primes & Greatest Common Divisors Prime representations Important theorems about primality Greatest Common Divisors Least Common Multiples Euclid s algorithm Once and for all, what are prime

More information

Computing exponents modulo a number: Repeated squaring

Computing exponents modulo a number: Repeated squaring Computing exponents modulo a number: Repeated squaring How do you compute (1415) 13 mod 2537 = 2182 using just a calculator? Or how do you check that 2 340 mod 341 = 1? You can do this using the method

More information

Number Theory and Cryptography using PARI/GP

Number Theory and Cryptography using PARI/GP Number Theory and Cryptography using Minh Van Nguyen nguyenminh2@gmail.com 25 November 2008 This article uses to study elementary number theory and the RSA public key cryptosystem. Various commands will

More information

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Module No. # 01 Lecture No. # 05 Classic Cryptosystems (Refer Slide Time: 00:42)

More information

Basic Algorithms In Computer Algebra

Basic Algorithms In Computer Algebra Basic Algorithms In Computer Algebra Kaiserslautern SS 2011 Prof. Dr. Wolfram Decker 2. Mai 2011 References Cohen, H.: A Course in Computational Algebraic Number Theory. Springer, 1993. Cox, D.; Little,

More information

3.1. RATIONAL EXPRESSIONS

3.1. RATIONAL EXPRESSIONS 3.1. RATIONAL EXPRESSIONS RATIONAL NUMBERS In previous courses you have learned how to operate (do addition, subtraction, multiplication, and division) on rational numbers (fractions). Rational numbers

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

GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014!

GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014! GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014!!! Challenge Problem 2 (Mastermind) due Fri. 9/26 Find a fourth guess whose scoring will allow you to determine the secret code (repetitions are

More information

Number Theory and the RSA Public Key Cryptosystem

Number Theory and the RSA Public Key Cryptosystem Number Theory and the RSA Public Key Cryptosystem Minh Van Nguyen nguyenminh2@gmail.com 05 November 2008 This tutorial uses to study elementary number theory and the RSA public key cryptosystem. A number

More information

MATH 13150: Freshman Seminar Unit 10

MATH 13150: Freshman Seminar Unit 10 MATH 13150: Freshman Seminar Unit 10 1. Relatively prime numbers and Euler s function In this chapter, we are going to discuss when two numbers are relatively prime, and learn how to count the 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

Math 319 Problem Set #3 Solution 21 February 2002

Math 319 Problem Set #3 Solution 21 February 2002 Math 319 Problem Set #3 Solution 21 February 2002 1. ( 2.1, problem 15) Find integers a 1, a 2, a 3, a 4, a 5 such that every integer x satisfies at least one of the congruences x a 1 (mod 2), x a 2 (mod

More information

Settling a Question about Pythagorean Triples

Settling a Question about Pythagorean Triples Settling a Question about Pythagorean Triples TOM VERHOEFF Department of Mathematics and Computing Science Eindhoven University of Technology P.O. Box 513, 5600 MB Eindhoven, The Netherlands E-Mail address:

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

Groups in Cryptography

Groups in Cryptography Groups in Cryptography Çetin Kaya Koç http://cs.ucsb.edu/~koc/cs178 koc@cs.ucsb.edu Koç (http://cs.ucsb.edu/~koc) ucsb cs 178 intro to crypto winter 2013 1 / 13 Groups in Cryptography A set S and a binary

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

THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0

THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0 THE NUMBER OF REPRESENTATIONS OF n OF THE FORM n = x 2 2 y, x > 0, y 0 RICHARD J. MATHAR Abstract. We count solutions to the Ramanujan-Nagell equation 2 y +n = x 2 for fixed positive n. The computational

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

Public Key Cryptography and RSA. Review: Number Theory Basics

Public Key Cryptography and RSA. Review: Number Theory Basics Public Key Cryptography and RSA Murat Kantarcioglu Based on Prof. Ninghui Li s Slides Review: Number Theory Basics Definition An integer n > 1 is called a prime number if its positive divisors are 1 and

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

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

Cryptography and Network Security Chapter 8

Cryptography and Network Security Chapter 8 Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown (with edits by RHB) Chapter 8 Introduction to Number Theory The Devil said to Daniel Webster:

More information

Number Theory: A Mathemythical Approach. Student Resources. Printed Version

Number Theory: A Mathemythical Approach. Student Resources. Printed Version Number Theory: A Mathemythical Approach Student Resources Printed Version ii Contents 1 Appendix 1 2 Hints to Problems 3 Chapter 1 Hints......................................... 3 Chapter 2 Hints.........................................

More information

The application of prime numbers to RSA encryption

The application of prime numbers to RSA encryption The application of prime numbers to RSA encryption Prime number definition: Let us begin with the definition of a prime number p The number p, which is a member of the set of natural numbers N, is considered

More information

Test1. Due Friday, March 13, 2015.

Test1. Due Friday, March 13, 2015. 1 Abstract Algebra Professor M. Zuker Test1. Due Friday, March 13, 2015. 1. Euclidean algorithm and related. (a) Suppose that a and b are two positive integers and that gcd(a, b) = d. Find all solutions

More information

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY January 10, 2010 CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY The set of polynomials over a field F is a ring, whose structure shares with the ring of integers many characteristics.

More information

Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

More information

Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II

Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II Last week: How to find one solution to a linear Diophantine equation This week: How to find all solutions to a linear Diophantine

More information

Vieta s Formulas and the Identity Theorem

Vieta s Formulas and the Identity Theorem Vieta s Formulas and the Identity Theorem This worksheet will work through the material from our class on 3/21/2013 with some examples that should help you with the homework The topic of our discussion

More information

Introduction to Programming (in C++) Loops. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC

Introduction to Programming (in C++) Loops. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC Introduction to Programming (in C++) Loops Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC Example Assume the following specification: Input: read a number N > 0 Output:

More information

Example. Introduction to Programming (in C++) Loops. The while statement. Write the numbers 1 N. Assume the following specification:

Example. Introduction to Programming (in C++) Loops. The while statement. Write the numbers 1 N. Assume the following specification: Example Introduction to Programming (in C++) Loops Assume the following specification: Input: read a number N > 0 Output: write the sequence 1 2 3 N (one number per line) Jordi Cortadella, Ricard Gavaldà,

More information

ECE 842 Report Implementation of Elliptic Curve Cryptography

ECE 842 Report Implementation of Elliptic Curve Cryptography ECE 842 Report Implementation of Elliptic Curve Cryptography Wei-Yang Lin December 15, 2004 Abstract The aim of this report is to illustrate the issues in implementing a practical elliptic curve cryptographic

More information

Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem)

Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem) Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem) In order to understand the details of the Fingerprinting Theorem on fingerprints of different texts from Chapter 19 of the

More information

Handout NUMBER THEORY

Handout NUMBER THEORY Handout of NUMBER THEORY by Kus Prihantoso Krisnawan MATHEMATICS DEPARTMENT FACULTY OF MATHEMATICS AND NATURAL SCIENCES YOGYAKARTA STATE UNIVERSITY 2012 Contents Contents i 1 Some Preliminary Considerations

More information

Public-key cryptography RSA

Public-key cryptography RSA Public-key cryptography RSA NGUYEN Tuong Lan LIU Yi Master Informatique University Lyon 1 Objective: Our goal in the study is to understand the algorithm RSA, some existence attacks and implement in Java.

More information

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by SUBGROUPS OF CYCLIC GROUPS KEITH CONRAD 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by g = {g k : k Z}. If G = g, then G itself is cyclic, with g as a generator. Examples

More information

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11. 9. POLYNOMIALS 9.1. Definition of a Polynomial A polynomial is an expression of the form: a(x) = a n x n + a n-1 x n-1 +... + a 1 x + a 0. The symbol x is called an indeterminate and simply plays the role

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

Factoring Algorithms

Factoring Algorithms Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

More information

Notes on Factoring. MA 206 Kurt Bryan

Notes on Factoring. MA 206 Kurt Bryan The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

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

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures Number Theory Hungarian Style Cameron Byerley s interpretation of Csaba Szabó s lectures August 20, 2005 2 0.1 introduction Number theory is a beautiful subject and even cooler when you learn about it

More information

RSA Encryption. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles October 10, 2003

RSA Encryption. Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles October 10, 2003 RSA Encryption Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles October 10, 2003 1 Public Key Cryptography One of the biggest problems in cryptography is the distribution of keys.

More information

The Mathematics of the RSA Public-Key Cryptosystem

The Mathematics of the RSA Public-Key Cryptosystem The Mathematics of the RSA Public-Key Cryptosystem Burt Kaliski RSA Laboratories ABOUT THE AUTHOR: Dr Burt Kaliski is a computer scientist whose involvement with the security industry has been through

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

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples Brian Hilley Boston College MT695 Honors Seminar March 3, 2006 1 Introduction 1.1 Mazur s Theorem Let C be a

More information

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms Principles of Public Key Cryptography Chapter : Security Techniques Background Secret Key Cryptography Public Key Cryptography Hash Functions Authentication Chapter : Security on Network and Transport

More information

0.8 Rational Expressions and Equations

0.8 Rational Expressions and Equations 96 Prerequisites 0.8 Rational Expressions and Equations We now turn our attention to rational expressions - that is, algebraic fractions - and equations which contain them. The reader is encouraged to

More information

Factorizations: Searching for Factor Strings

Factorizations: Searching for Factor Strings " 1 Factorizations: Searching for Factor Strings Some numbers can be written as the product of several different pairs of factors. For example, can be written as 1, 0,, 0, and. It is also possible to write

More information

Lecture 16 : Relations and Functions DRAFT

Lecture 16 : Relations and Functions DRAFT CS/Math 240: Introduction to Discrete Mathematics 3/29/2011 Lecture 16 : Relations and Functions Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT In Lecture 3, we described a correspondence

More information

PYTHAGOREAN TRIPLES KEITH CONRAD

PYTHAGOREAN TRIPLES KEITH CONRAD PYTHAGOREAN TRIPLES KEITH CONRAD 1. Introduction A Pythagorean triple is a triple of positive integers (a, b, c) where a + b = c. Examples include (3, 4, 5), (5, 1, 13), and (8, 15, 17). Below is an ancient

More information

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

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

4.5 Finite Mathematical Systems

4.5 Finite Mathematical Systems 4.5 Finite Mathematical Systems We will be looking at operations on finite sets of numbers. We will denote the operation by a generic symbol, like *. What is an operation? An operation is a rule for combining

More information

Math 453: Elementary Number Theory Definitions and Theorems

Math 453: Elementary Number Theory Definitions and Theorems Math 453: Elementary Number Theory Definitions and Theorems (Class Notes, Spring 2011 A.J. Hildebrand) Version 5-4-2011 Contents About these notes 3 1 Divisibility and Factorization 4 1.1 Divisibility.......................................

More information

DIVISIBILITY AND GREATEST COMMON DIVISORS

DIVISIBILITY AND GREATEST COMMON DIVISORS DIVISIBILITY AND GREATEST COMMON DIVISORS KEITH CONRAD 1 Introduction We will begin with a review of divisibility among integers, mostly to set some notation and to indicate its properties Then we will

More information

Grade 7/8 Math Circles Fall 2012 Factors and Primes

Grade 7/8 Math Circles Fall 2012 Factors and Primes 1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Fall 2012 Factors and Primes Factors Definition: A factor of a number is a whole

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following

More information

Notes on Algebraic Structures. Peter J. Cameron

Notes on Algebraic Structures. Peter J. Cameron Notes on Algebraic Structures Peter J. Cameron ii Preface These are the notes of the second-year course Algebraic Structures I at Queen Mary, University of London, as I taught it in the second semester

More information

26 Integers: Multiplication, Division, and Order

26 Integers: Multiplication, Division, and Order 26 Integers: Multiplication, Division, and Order Integer multiplication and division are extensions of whole number multiplication and division. In multiplying and dividing integers, the one new issue

More information

Table of Contents. Bibliografische Informationen http://d-nb.info/996514864. digitalisiert durch

Table of Contents. Bibliografische Informationen http://d-nb.info/996514864. digitalisiert durch 1 Introduction to Cryptography and Data Security 1 1.1 Overview of Cryptology (and This Book) 2 1.2 Symmetric Cryptography 4 1.2.1 Basics 4 1.2.2 Simple Symmetric Encryption: The Substitution Cipher...

More information

Module MA3411: Abstract Algebra Galois Theory Appendix Michaelmas Term 2013

Module MA3411: Abstract Algebra Galois Theory Appendix Michaelmas Term 2013 Module MA3411: Abstract Algebra Galois Theory Appendix Michaelmas Term 2013 D. R. Wilkins Copyright c David R. Wilkins 1997 2013 Contents A Cyclotomic Polynomials 79 A.1 Minimum Polynomials of Roots of

More information

Chapter 11 Number Theory

Chapter 11 Number Theory Chapter 11 Number Theory Number theory is one of the oldest branches of mathematics. For many years people who studied number theory delighted in its pure nature because there were few practical applications

More information

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan 3 Binary Operations We are used to addition and multiplication of real numbers. These operations combine two real numbers

More information

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any. Algebra 2 - Chapter Prerequisites Vocabulary Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any. P1 p. 1 1. counting(natural) numbers - {1,2,3,4,...}

More information

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions. Algebra I Overview View unit yearlong overview here Many of the concepts presented in Algebra I are progressions of concepts that were introduced in grades 6 through 8. The content presented in this course

More information

z 0 and y even had the form

z 0 and y even had the form Gaussian Integers The concepts of divisibility, primality and factoring are actually more general than the discussion so far. For the moment, we have been working in the integers, which we denote by Z

More information

Lectures on Number Theory. Lars-Åke Lindahl

Lectures on Number Theory. Lars-Åke Lindahl Lectures on Number Theory Lars-Åke Lindahl 2002 Contents 1 Divisibility 1 2 Prime Numbers 7 3 The Linear Diophantine Equation ax+by=c 12 4 Congruences 15 5 Linear Congruences 19 6 The Chinese Remainder

More information

Factoring Polynomials

Factoring Polynomials Factoring Polynomials Sue Geller June 19, 2006 Factoring polynomials over the rational numbers, real numbers, and complex numbers has long been a standard topic of high school algebra. With the advent

More information

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works.

1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works. MATH 13150: Freshman Seminar Unit 18 1. The RSA algorithm In this chapter, we ll learn how the RSA algorithm works. 1.1. Bob and Alice. Suppose that Alice wants to send a message to Bob over the internet

More information

Factoring & Primality

Factoring & Primality Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

More information

A Course on Number Theory. Peter J. Cameron

A Course on Number Theory. Peter J. Cameron A Course on Number Theory Peter J. Cameron ii Preface These are the notes of the course MTH6128, Number Theory, which I taught at Queen Mary, University of London, in the spring semester of 2009. There

More information

Theorem3.1.1 Thedivisionalgorithm;theorem2.2.1insection2.2 If m, n Z and n is a positive

Theorem3.1.1 Thedivisionalgorithm;theorem2.2.1insection2.2 If m, n Z and n is a positive Chapter 3 Number Theory 159 3.1 Prime Numbers Prime numbers serve as the basic building blocs in the multiplicative structure of the integers. As you may recall, an integer n greater than one is prime

More information

3 Some Integer Functions

3 Some Integer Functions 3 Some Integer Functions A Pair of Fundamental Integer Functions The integer function that is the heart of this section is the modulo function. However, before getting to it, let us look at some very simple

More information