Applications of Fermat s Little Theorem and Congruences



Similar documents
Math 319 Problem Set #3 Solution 21 February 2002

1. MATHEMATICAL INDUCTION

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

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

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

Computing exponents modulo a number: Repeated squaring

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

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

SOLUTIONS FOR PROBLEM SET 2

Homework until Test #2

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.

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

Factoring Algorithms

V Quantitative Reasoning: Computers, Number Theory and Cryptography

GREATEST COMMON DIVISOR

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

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

Lectures on Number Theory. Lars-Åke Lindahl

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

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


SUM OF TWO SQUARES JAHNAVI BHASKAR

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)

Overview of Number Theory Basics. Divisibility

Primality - Factorization

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

The Mean Value Theorem

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

calculating the result modulo 3, as follows: p(0) = = 1 0,

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

Continued Fractions and the Euclidean Algorithm

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

Continued Fractions. Darren C. Collins

Zero: If P is a polynomial and if c is a number such that P (c) = 0 then c is a zero of P.

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

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

MATH10040 Chapter 2: Prime and relatively prime numbers

4. FIRST STEPS IN THE THEORY 4.1. A

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

3 1. Note that all cubes solve it; therefore, there are no more

Quotient Rings and Field Extensions

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

Geometry 1. Unit 3: Perpendicular and Parallel Lines

Integer roots of quadratic and cubic polynomials with integer coefficients

Some practice problems for midterm 2

CONTENTS 1. Peter Kahn. Spring 2007

Lectures notes on orthogonal matrices (with exercises) Linear Algebra II - Spring 2004 by D. Klain

Online EFFECTIVE AS OF JANUARY 2013

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

1.4. Arithmetic of Algebraic Fractions. Introduction. Prerequisites. Learning Outcomes

Integer Factorization using the Quadratic Sieve

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

3.3. Solving Polynomial Equations. Introduction. Prerequisites. Learning Outcomes

PYTHAGOREAN TRIPLES KEITH CONRAD

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS

Unique Factorization

TEXAS A&M UNIVERSITY. Prime Factorization. A History and Discussion. Jason R. Prince. April 4, 2011

2 When is a 2-Digit Number the Sum of the Squares of its Digits?

Lecture 13 - Basic Number Theory.

Properties of Real Numbers

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


Just the Factors, Ma am

Math Abstract Algebra I Questions for Section 23: Factoring Polynomials over a Field

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

26 Integers: Multiplication, Division, and Order

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

RSA and Primality Testing

Algebra Practice Problems for Precalculus and Calculus

8 Primes and Modular Arithmetic

DIVISIBILITY AND GREATEST COMMON DIVISORS

Handout NUMBER THEORY

Solutions to TOPICS IN ALGEBRA I.N. HERSTEIN. Part II: Group Theory

Factoring Polynomials

Maths delivers! A guide for teachers Years 11 and 12. RSA Encryption

Stupid Divisibility Tricks

2 : two cube. 5 : five cube. 10 : ten cube.

Chapter 17. Orthogonal Matrices and Symmetries of Space

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

3. Mathematical Induction

FACTORING AFTER DEDEKIND

Pythagorean vectors and their companions. Lattice Cubes

FACTORING IN QUADRATIC FIELDS. 1. Introduction. This is called a quadratic field and it has degree 2 over Q. Similarly, set

3 Factorisation into irreducibles

COMMUTATIVE RINGS. Definition: A domain is a commutative ring R that satisfies the cancellation law for multiplication:

Mathematics. ( : Focus on free Education) (Chapter 5) (Complex Numbers and Quadratic Equations) (Class XI)

3.1. Solving linear equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

H/wk 13, Solutions to selected problems

26 Ideals and Quotient Rings

Settling a Question about Pythagorean Triples

Lecture Notes on Polynomials

FACTORING OUT COMMON FACTORS

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

SOLVING POLYNOMIAL EQUATIONS

CM2202: Scientific Computing and Multimedia Applications General Maths: 2. Algebra - Factorisation

University of Lille I PC first year list of exercises n 7. Review

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

FACTORING CERTAIN INFINITE ABELIAN GROUPS BY DISTORTED CYCLIC SUBSETS

5. Factoring by the QF method

Transcription:

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 mod 2, 14 0 mod 7, 25 16 mod 9, 43 27 mod 35. Properties: Let m be a positive integer and let a, b, c, d be integers. Then 1. a a mod m 2. If a b mod m, then b a mod m. 3. If a b mod m and b c mod m, then a c mod m. 4. (a) If a qm + r mod m, then a r mod m. (b) Every integer a is congruent mod m to exactly one of 0, 1,..., m 1. 5. If a b mod m and c d mod m, then a ± c b ± d mod m and ac bd mod m. 5. If a b mod m, then a ± c b ± c mod m and ac bc mod m. 5. If a b mod m, then a n b n mod m for any n Z +. 6. If (c, m) = 1 and ac bc mod m, then a b mod m. Theorem (Fermat s Little Theorem): Let p be a prime. Then n p n mod p for any integer n 1. Corollary: Let p be a prime. Then n p 1 1 mod p for any integer n 1 with (n, p) = 1. 1

PROBLEMS 1. Find all solutions to each of the following congruences: (i) 2x 1 mod 3. (ii) 3x 4 mod 8. (iii) 6x 3 mod 15. (iv) 8x 7 mod 18. (v) 9x + 23 28 mod 25. 2. What is the last digit of 4321 4321? 3. Prove that there is no perfect square a 2 which is congruent to 2 mod 4. 4. Prove that there is no perfect square a 2 whose last digit is 2. 5. Prove that 888... 882 is not a perfect square. 6. Prove that there is no perfect square a 2 whose last digits are 85. 7. Prove that the following equations have no solutions in integer numbers: (i) x 2 3y = 5 (ii) 3x 2 4y = 5 (iii) x 2 y 2 = 2002 8. Prove that 10 11 10 1. 9. Prove that 1100 11 10 1. 10. Prove that 17 a 80 1 for any a Z + with (a, 17) = 1. 11. What is the remainder after dividing 3 50 by 7? 2

THEOREM AND EXAMPLES Theorem: If (a, m) = 1, then, for every integer b, the congruence has exactly one solution where s is such number that ax b mod m (1) x bs mod m, (2) as 1 mod m. (3) Proof (Sketch): We show that (2) is the solution of (1). In fact, if we multiply (2) by a and (3) by b (we can do that by property 5 ), we get which imply (1) by property 3. ax abs mod m and bsa b mod m, Example 1: Find all solutions of the following congruence 2x 5 mod 7. Solution: We first note that (2, 7) = 1. Therefore we can apply the theorem above. Since 2 4 1 mod 7, we get x 5 4 6 mod 7. Example 2: Find all solutions of the following congruence 2x 5 mod 8. Solution: Since (2, 8) = 2, we can t apply the theorem above directly. We now note that 2x 5 mod 8 is equivalent to 2x 8y = 5, which is impossible, since the left-hand side is divisible by 2, whereas the right-hand side is not. So, this equation has no solutions. Example 3: Find all solutions of the following congruence 4x 2 mod 6. Solution: Since (4, 6) = 2, we can t apply the theorem above directly again. However, canceling out 2 (think about that!), we obtain 2x 1 mod 3. Note that (2, 3) = 1. Therefore we can apply the theorem above to the new equation. Since 2 2 1 mod 3, we get x 1 2 2 mod 3. Example 4: What is the last digit of 345271 79399? Solution: It is obvious that 345271 1 mod 10, therefore by property 5 we have This means that the last digit of 345271 79399 is 1. 345271 79399 1 79399 1 mod 10. 3

Example 5: Prove that there is no integer number a such that a 4 is congruent to 3 mod 4. Solution: By the property 4(a) each integer number is congruent to 0, 1, 2, or 3 mod 4. Consider all these cases and use property 5 : If a 0 mod 4, then a 4 0 4 0 mod 4. If a 1 mod 4, then a 4 1 4 1 mod 4. If a 2 mod 4, then a 4 2 4 0 mod 4. If a 3 mod 4, then a 4 3 4 1 mod 4. So, a 4 0 or 1 mod 4. Therefore a 4 3 mod 4. Example 6: Prove that there is no perfect square a 2 whose last digit is 3. Solution: By the property 4(a) each integer number is congruent to 0, 1, 2,..., 8 or 9 mod 10. Consider all these cases and use property 5 : If a 0 mod 10, then a 2 0 2 0 mod 10. If a 1 mod 10, then a 2 1 2 1 mod 10. If a 2 mod 10, then a 2 2 2 4 mod 10. If a 3 mod 10, then a 2 3 2 9 mod 10. If a 4 mod 10, then a 2 4 2 6 mod 10. If a 5 mod 10, then a 2 5 2 5 mod 10. If a 6 mod 10, then a 2 6 2 6 mod 10. If a 7 mod 10, then a 2 7 2 9 mod 10. If a 8 mod 10, then a 2 8 2 4 mod 10. If a 9 mod 10, then a 2 9 2 1 mod 10. So, a 2 0, 1, 4, 5, 6 or 9 mod 10. Therefore a 2 3 mod 10, and the result follows. Example 7: Prove that 444444444444444444443 is not a perfect square. Solution: The last digit is 3, which is impossible by Example 6. Example 8: Prove that the equation x 4 4y = 3 has no solutions in integer numbers. Solution: Rewrite this equation as x 4 = 4y + 3, which means that x 4 3 mod 4, which is impossible by Example 5. Example 9: Prove that 10 101 2003 1. Solution: We have therefore by property 5 we get which means that 10 101 2003 1. 101 1 mod 10, 101 2003 1 2003 1 mod 10, Example 10: Prove that 23 a 154 1 for any a Z + with (a, 23) = 1. Solution: By Fermat s Little theorem we have a 22 1 mod 23, therefore by property 5 we get and the result follows. a 22 7 1 7 1 mod 23, 4

SOLUTIONS Problem 1(i): Find all solutions of the congruence 2x 1 mod 3. Solution: We first note that (2, 3) = 1. Therefore we can apply the theorem above. Since 2 2 1 mod 3, we get x 1 2 2 mod 3. Problem 1(ii): Find all solutions of the congruence 3x 4 mod 8. Solution: We first note that (3, 8) = 1. Therefore we can apply the theorem above. Since 3 3 1 mod 8, we get x 4 3 12 4 mod 8. Problem 1(iii): Find all solutions of the congruence 6x 3 mod 15. Solution: Since (6, 15) = 3, we can t apply the theorem above directly again. However, canceling out 3, we obtain 2x 1 mod 5. Note that (2, 5) = 1. Therefore we can apply the theorem above to the new equation. Since 2 3 1 mod 5, we get x 1 3 3 mod 5. Problem 1(iv): Find all solutions of the congruence 8x 7 mod 18. Solution: Since (8, 18) = 2, we can t apply the theorem above directly. We now note that 8x 7 mod 18 is equivalent to 8x 18y = 7, which is impossible, since the left-hand side is divisible by 2, whereas the right-hand side is not. So, this equation has no solutions. Problem 1(v): Find all solutions of the congruence 9x + 23 28 mod 25. Solution: We first rewrite this congruence as 9x 5 mod 25. Note that (9, 25) = 1. Therefore we can apply the theorem above. Since 9 14 1 mod 25, we get x 5 14 70 20 mod 25. Problem 2: What is the last digit of 4321 4321? Solution: It is obvious that 4321 1 mod 10, therefore by property 5 we have 4321 4321 1 4321 1 mod 10. This means that the last digit is 1. Problem 3: Prove that there is no perfect square a 2 which is congruent to 2 mod 4. Solution: By the property 4(a) each integer number is congruent to 0, 1, 2, or 3 mod 4. Consider all these cases and use property 5 : If a 0 mod 4, then a 2 0 2 0 mod 4. If a 1 mod 4, then a 2 1 2 1 mod 4. If a 2 mod 4, then a 2 2 2 0 mod 4. If a 3 mod 4, then a 2 3 2 1 mod 4. So, a 2 0 or 1 mod 4. Therefore a 2 2 mod 4. Problem 4: Prove that there is no perfect square a 2 whose last digit is 2. Solution: By the property 4(a) each integer number is congruent to 0, 1, 2,..., 8 or 9 mod 10. Consider all these cases and use property 5 : If a 0 mod 10, then a 2 0 2 0 mod 10. If a 1 mod 10, then a 2 1 2 1 mod 10. If a 2 mod 10, then a 2 2 2 4 mod 10. If a 3 mod 10, then a 2 3 2 9 mod 10. If a 4 mod 10, then a 2 4 2 6 mod 10. If a 5 mod 10, then a 2 5 2 5 mod 10. If a 6 mod 10, then a 2 6 2 6 mod 10. If a 7 mod 10, then a 2 7 2 9 mod 10. If a 8 mod 10, then a 2 8 2 4 mod 10. If a 9 mod 10, then a 2 9 2 1 mod 10. So, a 2 0, 1, 4, 5, 6 or 9 mod 10. Therefore a 2 2 mod 10, and the result follows. 5

Problem 5: Prove that 888... 882 is not a perfect square. Solution 1: We have 888... 882 = 4k + 2. Therefore it is congruent to 2 mod 4 by property 4(a), which is impossible by Problem 3. Solution 2: The last digit is 2, which is impossible by Problem 4. Problem 6 : Prove that there is no perfect square a 2 whose last digits are 85. Solution: It follows from problem 4 that a 2 5 mod 10 only if a 5 mod 10. Therefore a 2 85 mod 100 only if a 5, 15, 25,..., 95 mod 100. If we consider all these cases and use property 5 is the same manner as in problem 4, we will see that a 2 25 mod 100. Therefore a 2 85 mod 100, and the result follows. Problem 7(i): Prove that the equation x 2 3y = 5 has no solutions in integer numbers. Solution: Rewrite this equation as x 2 = 3y + 5, which means that x 2 5 2 mod 3. By the property 4(a) each integer number is congruent to 0, 1, or 2 mod 3. Consider all these cases and use property 5 : If a 0 mod 3, then a 2 0 2 0 mod 3. If a 1 mod 3, then a 2 1 2 1 mod 3. If a 2 mod 4, then a 2 2 2 1 mod 3. So, a 2 0 or 1 mod 3. Therefore a 2 2 mod 3. Problem 7(ii): Prove that the equation 3x 2 4y = 5 has no solutions in integer numbers. Solution: Rewrite this equation as 3x 2 = 4y + 5, which means that 3x 2 5 1 mod 4. On the other hand, by Problem 3 we have x 2 0 or 1 mod 4, hence 3x 2 0 or 3 mod 4. Therefore x 2 1 mod 4. Problem 7(iii): Prove that the equation x 2 y 2 = 2002 has no solutions in integer numbers. Solution: By Problem 3 we have x 2 0 or 1 mod 4, hence x 2 y 2 0, 1 or -1 mod 4. On the other hand, 2002 2 mod 4. Therefore x 2 y 2 2002 mod 4, Problem 8: Prove that 10 11 10 1. Solution: We have 11 1 mod 10, therefore by property 5 we get 11 10 1 10 1 mod 10, which means that 10 11 10 1. Problem 9 : Prove that 1100 11 10 1. Solution: We have 11 10 1 = (11 5 + 1)(11 5 1) = (11 5 + 1)(11 1)(11 4 + 11 3 + 11 2 + 11 + 1). ( ) Since 11 1 mod 10, by property 5 we get 11 n 1 mod 10. Therefore by property 5 we obtain 11 4 + 11 3 + 11 2 + 11 + 1 5 mod 10. Note that 11 5 + 1 is divisible by 2 and 11 1 is divisible by 10. Therefore the right-hand side of ( ) is divisible by 2 10 5 = 100. On the other hand, by Fermat s Little Theorem, 11 10 1 is divisible by 11. Since (11, 100) = 1, the whole expression is divisible by 1100. Problem 10: Prove that 17 a 80 1 for any a Z + with (a, 17) = 1. Solution: By Fermat s Little theorem we have a 16 1 mod 17, therefore by property 5 we get a 16 5 1 5 1 mod 17, and the result follows. Problem 11: What is the remainder after dividing 3 50 by 7? Solution: By Fermat s Little theorem we have 3 6 1 mod 7, therefore by property 5 we get 3 6 8 1 48 1 mod 7, therefore 3 50 9 2 mod 7. 6