An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g.,

Similar documents
To be able to determine the quadratic character of an arbitrary number mod p (p an odd prime), we. The first (and most delicate) case concerns 2

Practice Midterm 2 Solutions

SOLUTIONS TO PROBLEM SET 5. Section 9.1

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

Primitive Roots. Chapter Orders and Primitive Roots

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

An elementary study of Goldbach Conjecture

Public Key Encryption

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number.

Applications of Fermat s Little Theorem and Congruences

University of British Columbia. Math 312, Midterm, 6th of June 2017

Solutions for the Practice Questions

Wilson s Theorem and Fermat s Theorem

Discrete Math Class 4 ( )

The Strong Finiteness of Double Mersenne Primes and the Infinity of Root Mersenne Primes and Near-square Primes of Mersenne Primes

NUMBER THEORY AMIN WITNO

Modular Arithmetic. Kieran Cooney - February 18, 2016

1.6 Congruence Modulo m

MAT Modular arithmetic and number theory. Modular arithmetic

Goldbach Conjecture (7 th june 1742)

Distribution of Primes

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

SOLUTIONS FOR PROBLEM SET 4

LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI

CHAPTER 2. Modular Arithmetic

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02

Foundations of Cryptography

Assignment 2. Due: Monday Oct. 15, :59pm

by Michael Filaseta University of South Carolina

Number Theory. Konkreetne Matemaatika

Data security (Cryptography) exercise book

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

Number Theory/Cryptography (part 1 of CSC 282)

Constructions of Coverings of the Integers: Exploring an Erdős Problem

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017

MATH 135 Algebra, Solutions to Assignment 7

Discrete Square Root. Çetin Kaya Koç Winter / 11

Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes

Congruence. Solving linear congruences. A linear congruence is an expression in the form. ax b (modm)

Math 127: Equivalence Relations

PROPERTIES OF MERSENNE NUMBERS AND PRIMES

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m.

Introduction to Modular Arithmetic

Proof that Mersenne Prime Numbers are Infinite and that Even Perfect Numbers are Infinite

Power = 36² mod 99 Power = 9 5 a 5 = 0 x = 81 Power = 9² mod 99 Power = 81 6 a 6 = 1 x = 81 x 81 mod 99 x = 27 7 a 7 = 1 x = 27 x 27 mod 99 x = 36

The Chinese Remainder Theorem

Sheet 1: Introduction to prime numbers.

CSE 20 DISCRETE MATH. Fall

#A3 INTEGERS 17 (2017) A NEW CONSTRAINT ON PERFECT CUBOIDS. Thomas A. Plick

Cryptography. 2. decoding is extremely difficult (for protection against eavesdroppers);

Modular Arithmetic. claserken. July 2016

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

Exam 1 7 = = 49 2 ( ) = = 7 ( ) =

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers.

Multiples and Divisibility

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005

Permutation Groups. Every permutation can be written as a product of disjoint cycles. This factorization is unique up to the order of the factors.

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

ALGEBRA: Chapter I: QUESTION BANK

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

Solutions for the Practice Final

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey

Two congruences involving 4-cores

UNIVERSITY OF MANITOBA DATE: December 7, FINAL EXAMINATION TITLE PAGE TIME: 3 hours EXAMINER: M. Davidson

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

The covering congruences of Paul Erdős. Carl Pomerance Dartmouth College

Discrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Midterm 2 Solutions

PRIMES IN SHIFTED SUMS OF LUCAS SEQUENCES. Lenny Jones Department of Mathematics, Shippensburg University, Shippensburg, Pennsylvania

Goldbach conjecture (1742, june, the 7 th )

A STUDY OF EULERIAN NUMBERS FOR PERMUTATIONS IN THE ALTERNATING GROUP

ELEMENTS OF NUMBER THEORY & CONGRUENCES. Lagrange, Legendre and Gauss. Mth Mathematicst

On repdigits as product of consecutive Fibonacci numbers 1

Solutions for the 2nd Practice Midterm

x 8 (mod 15) x 8 3 (mod 5) eli 2 2y 6 (mod 10) y 3 (mod 5) 6x 9 (mod 11) y 3 (mod 11) So y = 3z + 3u + 3w (mod 990) z = (990/9) (990/9) 1

MA/CSSE 473 Day 9. The algorithm (modified) N 1

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

Variations on a Theme of Sierpiński

Is 1 a Square Modulo p? Is 2?

Math 412: Number Theory Lecture 6: congruence system and

Math 255 Spring 2017 Solving x 2 a (mod n)

SYMMETRIES OF FIBONACCI POINTS, MOD m

Carmen s Core Concepts (Math 135)

MULTIPLES, FACTORS AND POWERS

Mark Kozek. December 7, 2010

N umber theory provides a rich source of intriguing

Diffie-Hellman key-exchange protocol

1 Introduction to Cryptology

Launchpad Maths. Arithmetic II

Modular Arithmetic and Doomsday

Quadratic Residues. Legendre symbols provide a computational tool for determining whether a quadratic congruence has a solution. = a (p 1)/2 (mod p).

Math 319 Problem Set #7 Solution 18 April 2002

Zhanjiang , People s Republic of China

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, CS1800 Discrete Structures Midterm Version C

Modular arithmetic Math 2320

6.2 Modular Arithmetic

Transcription:

Binary exponentiation An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., What are the last two digits of the number 2 284? In the absence of powerful software, it may be very difficult to compute this 86-digit number(!). Luckily, one can answer the question without this computation, since all we require is the standard residue mod 100 of the number. Computing powers mod m is an exercise in artful use of simple operations. In particular, to compute the standard residue a n mod m, we employ a process called binary exponentiation: express the exponent in binary form as a sum of powers of 2, then perform the computation by repeated squaring and reduction of residues. We illustrate with the example above. 2 284 = 2 256+16+8+4 = 2 28 +2 4 +2 3 +2 2 = 2 28 2 24 2 23 2 22 = 4 27 4 23 4 22 4 2 = 16 26 16 22 16 2 16

= 256 25 256 2 256 16 56 25 56 2 56 16 (mod100) 36 24 36 56 16 (mod100) 96 23 36 56 16 (mod100) 16 22 36 56 16 (mod100) 56 2 36 56 16 (mod100) 36 36 56 16 (mod100) 96 56 16 (mod100) 76 16 (mod100) 16 (mod100) Thus, the last two digits of 2 284 are 16. While this procedure is tedious for hand calculation, it is easily programmed into computational sofware.

The Exponential Structure of Arithmetic mod m: Fermat s Little Theorem As we saw in the discussion of the solution of polynomial congruences, the most basic congruences are those with prime moduli. The structure of arithmetic modulo a prime is the simplest of all forms of congruence. As we will see, when we work modulo a prime, the multiplicative structure of the arithmetic (which controls the computation of inverses, for instance) can be simplified considerably by expressing it in terms of the additive structure of powers of numbers, a discrete version of the idea of a logarithm. We provide a number of important and useful theorems that will build up to an explanation of this claim. Wilson s Theorem If p is prime, then (p 1)! 1 (mod p). Proof When p = 2, this is trivial; when p is odd, use the fact that every nonzero congurence class mod p, with the exception of the two classes for ±1, has a unique nonzero multiplicative inverse different from ±1. //

Without doubt, the most versatile result in all number theory is Fermat s Little Theorem (FlT) If p is prime and doesn t divide a, then a p 1 1 (mod p). Proof Let S = {1, 2,, p 1} and consider the map from S to S that sends x to the standard residue of ax mod p. This function is one-to-one, since ax ay (mod p) x y (mod p). But then, the function must also be onto, since domain and range have the same cardinality. It follows that {a,2a,,(p 1)a} is a complete residue system mod p. Therefore, 1 2 3 (p 1) a(2a)(3a) ((p 1)a) (mod p) or more simply, (p 1)! a p 1 (p 1)! (mod p). By Wilson s Theorem, this says that 1 a p 1 (mod p), or a p 1 1 (mod p). // Corollary If p is prime, then for all a, we have a p a (mod p). //

Corollary If p is prime and a n 1 (mod p), then a (n, p 1) 1 (mod p). Proof For suitable integers x and y, we can write a (n, p 1) a nx +( p 1)y (a n ) x (a p 1 ) y 1 x 1 y 1 (mod p).// If n is the smallest positive integer for which a n 1 (mod p), we call n the order of a mod p. Corollary The order of a mod p divides p 1. Proof If n is the order of a mod p, then a n 1 (mod p). But then a (n, p 1) 1 (mod p) as well. But since (n, p 1) n and n is the smallest positive integer for which a n 1 (mod p), we must have (n, p 1) = n, whence n p 1. // Fermat formulated his Little Theorem in the course of investigating the primality of the Mersenne numbers M n = 2 n 1. If p is a prime factor of M n, then 2 n 1 (mod p). If in addition, n is prime (recall that if n is composite, then necessarily, M n is composite), then the last corollary asserts that 2 (n, p 1) 1 (mod p), and since we cannot then have (n, p 1) = 1, it must be that (n, p 1) = n, that is, n p 1. But p must be odd, so n is as well, and we can conclude more strongly that 2n p 1. We have proven the

Corollary If n is prime and p is a prime factor of the Mersenne number M n = 2 n 1, then p 1 (mod 2n). // Corollary There are infinitely many primes of the form p 1 (mod 8). Proof Suppose there are only finitely many such primes: p 1, p 2,, p k. Let N = (2p 1 p 2 p k ) 4 +1. If p is a prime factor of N, then (*) (2p 1p 2 p k ) 4 1 (mod p), so (2p 1 p 2 p k ) 8 1 (mod p). But then (2p 1 p 2 p k ) (8, p 1) 1 (mod p). However, (8, p 1) must be one of 1, 2, 4, or 8. Because of (*), we must exclude 1, 2, 4 as options. This means that (8, p 1) = 8, whence 8 p 1, or p 1 (mod 8). But then p must be one of the listed primes above, therefore (*) yields the absurd statement that 0 1(mod p). // Corollary If n is a sum of two relatively prime squares, then every odd prime factor p of n satisfies p 1 (mod 4).

Proof Suppose n = a 2 +b 2 with (a,b ) = 1 and p is an odd prime factor. Then, since p a 2 +b 2, neither a nor b can be multiples of p. So a 2 +b 2 0 (mod p) a 2 b 2 (mod p) ( a 2 ) 1 2 ( p 1) (b 2 ) 1 2 ( p 1) (mod p) ( 1) 1 2 ( p 1) a p 1 b p 1 (mod p) which, using FlT, implies ( 1) 1 2 ( p 1) 1 (mod p). But if p 3 (mod4), then 1 (p 1) is an odd integer, so 2 ( 1) 1 2 ( p 1) = 1, which implies the impossible condition 1 1 (mod p). Therefore we must have p 1 (mod 4). // Corollary If p is an odd prime, then the congruence x 2 1(mod p) has the two solutions x ±[ 1 (p 1)]! (mod p) if p 1 (mod 4), but no 2 solutions if p 3 (mod4). Proof If x 2 1(mod p) is solvable, then p divides the number x 2 +1 with (x,1) = 1, so by the previous result, p 1 (mod 4). To show that the given values of x solve the congruence, put a = [ 1 (p 1)]!; then, it 2 suffices to show that a 2 1(mod p). Clearly, a is a

factor of (p 1)!. If b is the integer for which ab = (p 1)!, then So 1 ( p 1) 2 b = (a +1)(a + 2) (p 2)(p 1) = (p j). 1 ( p 1) 2 b ( j ) ( 1) 1 2 ( p 1) [ 1 (p 1)]! 2 ( 1)1 2 ( p 1) a (mod p), j=1 j=1 and since p 1 (mod 4), we have ( 1) 1 2 ( p 1) = 1, so b a (mod p). It follows that a 2 ab (p 1)! 1 (mod p). //