7.2 Applications of Euler s and Fermat s Theorem.

Similar documents
Applications of Fermat s Little Theorem and Congruences

Computing exponents modulo a number: Repeated squaring

Homework until Test #2

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

8 Primes and Modular Arithmetic

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

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

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

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

6.2 Permutations continued

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Lecture 13 - Basic Number Theory.

Math 319 Problem Set #3 Solution 21 February 2002

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

Cryptography and Network Security Number Theory

Today s Topics. Primes & Greatest Common Divisors

mod 10 = mod 10 = 49 mod 10 = 9.

RSA Encryption. Tom Davis October 10, 2003

Cryptography and Network Security Chapter 8

GREATEST COMMON DIVISOR

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

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

MATH10040 Chapter 2: Prime and relatively prime numbers

Overview of Number Theory Basics. Divisibility

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

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

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

Factoring Algorithms

Lecture 13: Factoring Integers

Settling a Question about Pythagorean Triples

SUM OF TWO SQUARES JAHNAVI BHASKAR

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

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

The application of prime numbers to RSA encryption


CONTINUED FRACTIONS AND FACTORING. Niels Lauritzen

DIVISIBILITY AND GREATEST COMMON DIVISORS

8 Divisibility and prime numbers

Some practice problems for midterm 2

RSA and Primality Testing

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

Primality - Factorization

An Introduction to the RSA Encryption Method

Elementary Number Theory

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

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

Computer and Network Security

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

V Quantitative Reasoning: Computers, Number Theory and Cryptography

The cyclotomic polynomials

Public Key Cryptography: RSA and Lots of Number Theory

Elementary factoring algorithms

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

Factoring & Primality

PROPERTIES OF ELLIPTIC CURVES AND THEIR USE IN FACTORING LARGE NUMBERS

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

SYSTEMS OF PYTHAGOREAN TRIPLES. Acknowledgements. I would like to thank Professor Laura Schueller for advising and guiding me

Quotient Rings and Field Extensions

k, then n = p2α 1 1 pα k

Continued Fractions and the Euclidean Algorithm

A Study on the Necessary Conditions for Odd Perfect Numbers

Primes in Sequences. Lee 1. By: Jae Young Lee. Project for MA 341 (Number Theory) Boston University Summer Term I 2009 Instructor: Kalin Kostadinov

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

H/wk 13, Solutions to selected problems

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

Integer Factorization using the Quadratic Sieve

Factoring Polynomials

Five fundamental operations. mathematics: addition, subtraction, multiplication, division, and modular forms

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

Notes on Factoring. MA 206 Kurt Bryan

minimal polyonomial Example

The Euclidean Algorithm

Section 4.2: The Division Algorithm and Greatest Common Divisors

Doug Ravenel. October 15, 2008

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS

Lectures on Number Theory. Lars-Åke Lindahl

Math 453: Elementary Number Theory Definitions and Theorems


Continued Fractions. Darren C. Collins

Groups in Cryptography

UNIVERSITY OF PUNE, PUNE BOARD OF STUDIES IN MATHEMATICS SYLLABUS

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

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

Chapter 3. if 2 a i then location: = i. Page 40

Primality Testing and Factorization Methods

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.

SOLUTIONS FOR PROBLEM SET 2

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

Advanced Cryptography

MATH 289 PROBLEM SET 4: NUMBER THEORY

SECTION 10-2 Mathematical Induction

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

RSA Attacks. By Abdulaziz Alrasheed and Fatima

2 Polynomials over a field

Basic Algorithms In Computer Algebra

Handout NUMBER THEORY

MATH 13150: Freshman Seminar Unit 10

CIS 5371 Cryptography. 8. Encryption --

Just the Factors, Ma am

Transcription:

7.2 Applications of Euler s and Fermat s Theorem. i) Solving non-linear congruences. Example Find a solution to x 12 3 mod 11. Solution Any solution of this must satisfy gcd (x, 11) = 1 so Fermat s Little Theorem gives x 10 1 mod 11. Thus our equation becomes 3 x 12 x 2 x 10 x 2 mod 11. Now check. x x 2 mod 11 1 1 2 4 3 9 4 5 5 3 Note that if x 6 then 11 x 5 and x 2 (11 x) 2 mod 11 so all possible values of x 2 mod 11 will be seen in the table. From the table we see an answer is x 5 mod 11. ii) Example Show that x 5 3 mod 11 has no solutions. Solution by contradiction. Assume x 5 3 mod 11 has solutions. Any solution of this must satisfy gcd (x, 11) = 1 so Fermat s Little Theorem gives x 10 1 mod 11. Since 5 10 we square both sides of the congruence to get 1 x 10 ( x 5) 2 3 2 9 mod 11. This is false and so the assumption is false and thus the congruence has no solution. iii) Example Find a solution to x 7 3 mod 11. Solution Again x 10 1 mod 11 by Fermat s Little Theorem but this time 7 10, in fact gcd (7, 10) = 1. From Euclid s Algorithm we get 3 7 2 10 = 1. (1) Raise both sides of the congruence to the third power to get 3 3 ( x 7) 3 x 3 7 x 1+2 10 by (1), x ( x 10) 2 x mod 11. 1

Hence a solution is x 3 3 5 mod 11. Don t forget to check your answer (by successive squaring of 5). iv) Example Find the last two digits of 13 1010, (asked for in Chapter 3). Hence, using (??), 13 1010 = ( 13 40) 25 13 10 1 25 13 10 13 10 mod 100. 13 1010 13 10 = 13 8 13 2 21 69 49 mod 100. Therefore, the last two digits of 13 1010 are 49. What are the last three digits of 13 1010? See ap- Question for students. pendix. v) Is 2 35 + 1 divisible by 11? Here we look at 2 35 + 1 mod 11. Because 11 is prime we could use Fermat s Little Theorem to say 2 10 1 mod 11. Thus 2 35 + 1 2 5 + 1 32 + 1 = 33 0 mod 11, i.e. 2 35 + 1 is divisible by 11. Question for students. Show that 2 1194 + 1 is divisible by 65. 2

Appendix Contents 1. Further examples of Fermat s Theorem 2. Wilson s Theorem 1) Further examples of the use of Euler s and Fermat s Theorems. Example Show that 2 1194 + 1 is divisible by 65. Solution We need show that 65 (2 1194 + 1). Since 65 = 5 13 we need show that 5 (2 1194 + 1) and 13 (2 1194 + 1). 5 is prime so by Fermat s Little Theorem we have 2 4 1 mod 5. Hence 2 1194 + 1 = ( 2 4) 298 2 2 + 1 1 298 4 + 1 = 5 0 mod 5. 13 is prime so again by Fermat s Little Theorem we have 2 12 1 mod 5. Hence 2 1194 + 1 = ( 2 12) 99 2 6 + 1 1 99 64 + 1 = 65 0 mod 13. Combining these we get the required result. Example Is 221 prime? Solution Fermat s Little Theorem tells us that If 221 is prime then 2 220 1 mod 221. Note that 220 = 128 + 64 + 16 + 8 + 4 = 2 7 + 2 6 + 2 4 + 2 3 + 2 2. Look at powers of 2 modulo 221. ( ) 2 n 2 2n = 2 2n 1 mod 221 0 2 1 2 2 = 4 2 4 2 = 16 3 16 2 = 256 35 4 35 2 = 1225 120 101 5 ( 101) 2 = 10201 35 6 35 2 101 7 ( 101) 2 35. 3

So 2 220 = 2 27 2 26 2 24 2 23 2 22 35 ( 101) ( 101) 35 16 220 220 16 16 mod 221. Since 2 220 1 mod 221 we deduce that 221 is not prime. Example You now notice that 221 is composite and in fact 221 = 17 13. Use Fermat s Little Theorem, and not the method of successive squaring modulo 221, to check that 2 220 16 mod 221. Solution. If x 2 220 mod (17 13) then x 2 220 mod 17 and x 2 220 mod 13. By Fermat s Little Theorem we have 2 16 1 mod 17 so Similarly 2 12 1 mod 13 so Thus our two equations become 2 220 = 2 13 16+12 2 12 ( 2 4) 3 ( 1) 3 1 16 mod 17. 2 220 = 2 18 12+4 2 4 = 16 3 mod 13. x 16 mod 17 and x 3 mod 13 Such a system was solved in the Appendix to Chapter 3, using the Chinese Remainder Theorem, where we found x 16 mod 221. Example Solve x 22 + x 11 2 mod 11. Solution Any solution must have gcd (x, 11) = 1 and so, by By Fermat s Little Theorem, x 10 1 mod 11. Thus x 22 + x 11 x 2 + x x 2 + 12x on adding 11 to make the cofficicient even, (x + 6) 2 36 mod 11, 4

by completing the square. Thus we need only solve (x + 6) 2 36 2 mod 11, i.e. (x + 6) 2 5 mod 11. From the table x x 2 mod 11 1 1 2 4 3 9 4 5 5 3 we see that two solutions are x + 6 4 mod 11 and x + 6 4 mod 11, i.e. x 1 or 9 mod 11. Example Show that there are no integer solutions (x, y) to x 12 11x 6 y 5 + y 10 8. Solution We assume for a contradiction that there are integer solutions. When we look at this modulo 11 they will remain solutions. There are three cases. First, it maybe that 11 y in which case the equation becomes x 12 8 mod 11. For any solution of this we must have gcd (x, 11) = 1 so, again by Fermat s Theorem, x 10 1 mod 11 and so we get x 2 8 mod 11. From the table above we see this has no solutions. Secondly, 11 y and 11 x when the equation becomes y 10 8 mod 11. But Fermat s Little Theorem gives y 10 1 mod 11. Thus there are no solutions. Finally, 11 y and 11 x. x 10, y 10 1 mod 11. Thus So Fermat s Theorem again gives both x 12 11x 6 y 5 + y 10 x 2 + 1 mod 11, and so we are looking for solutions to x 2 7 mod 11. Again from the table we see this has no solution. In all cases our equation has no solutions modulo 11. This contradiction means our original equation has no integer solutions. 5

2) Wilson s Theorem. Recall that Z m = {[r] m : 1 r m, gcd (r, m) = 1} = {[r] m : 1 r m, [x] m Z m : [r] m [x] m = [1] m }. Question What 1 r m are self-inverse modulo m, i.e. for which we can we take [x] m = [r] m in [r] m [x] m = [1] m? In other words, for which 1 r m do we have r 2 1 mod m? Answer given here only for m = p, prime. Theorem x 2 1 mod p if, and only if, x 1 or 1 mod p. Proof x 2 1 mod p p ( x 2 1 ) p (x 1) (x + 1) p (x 1) or p (x + 1) since p prime x 1 mod p or x 1 mod p. Thus the only self-inverses in Z p are [1] p and [p 1] p. As a corollary of this we have Theorem Wilson s Theorem. If p is prime then (p 1)! 1 mod p. Proof p.291. Take the product of all the classes in Z p: 1 r p 1 gcd(r,p)=1 [r] p. Rearrange, pairing up a class with its inverse, leaving [1] p and [p 1] p unpaired. So the product becomes ) [1] p ( pairs [r] p [r] 1 p [p 1] p = [p 1] p. Thus 1 r p 1 gcd(r,p)=1 [r] p = [p 1] p, 6

which is equivalent to the stated result. Example Calculate 20! mod 23. Solution 23 is a prime so Wilson s Theorem gives 22! 1 mod 23. But 22! = 22 21 20! ( 1) ( 2) 20! 2 20! mod 23. By observation 12 is the inverse of 2 modulo 23 so 20! (12 2) 20! = 12 (2 20!) 12 22! from above, 12 from 22! 1 mod 23, 11 mod 12. 7