Songklanakarin Journal of Science and Technology SJST R1 KANYAMEE. Numerical methods for finding multiplicative inverses of a modulo N

Size: px
Start display at page:

Download "Songklanakarin Journal of Science and Technology SJST R1 KANYAMEE. Numerical methods for finding multiplicative inverses of a modulo N"

Transcription

1 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Numerical methods for finding multiplicative inverses of a modulo N Journal: Songklanakarin Journal of Science and Technology Manuscript ID SJST-0-0.R Manuscript Type: Original Article Date Submitted by the Author: -Jul-0 Complete List of Authors: Prempreesuk, Bencharat; Silpakorn University - Sanam Chandra Palace Campus, Mathematics Pongsriiam, Prapanpong ; Silpakorn University - Sanam Chandra Palace Campus, Mathematics KANYAMEE, NAIRAT; Silpakorn University - Sanam Chandra Palace Campus, Mathematics Keyword: modular multiplicative inverse, Newton s method, secant method, binary representation, Zeckendorf representation

2 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Numerical methods for finding multiplicative inverses of modulo Bencharat Prempreesuk, Prapanpong Pongsriiam, and Nairat Kanyamee * Department of Mathematics, Faculty of Science, Silpakorn University, Nakhon Pathom, Thailand. * Corresponding author, address: kanyamee_n@su.ac.th Abstract In this work, we propose new methods which are based on the root-finding methods in numerical analysis to calculate the inverses of an integer modulo for any positive integer. We apply Newton's and secant methods with a power-reduction process and Newton's and secant methods together with the binary representation and Zeckendorf representation to determine the inverse of an integer modulo. The numerical results confirm an accuracy compared to the analytical results. In addition, the two methods with the binary and Zeckendorf representations give better CPU times than Newton s and secant methods with power-reduction for large. Keyword: modular multiplicative inverse, Newton s method, secant method, binary representation, Zeckendorf representation

3 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Introduction Modular multiplicative inverse is often seen in number theory and it is desirable to be able to calculate it quickly. This motivates us to search for an efficient method in finding the modular multiplicative inverse. On the other hand, numerical analysis involves algorithms that are used in approximating the solutions to a particular problem. So, there should be some connections between the two fields of number theory and numerical analysis. Let Z and, Z. We write mod if. Assume further that,=. Then it is a well-known result (Rosen, 00) in number theory that there exists an integer such that mod. The integer is called the modular multiplicative inverse (or simply the inverse) of modulo and it is denoted by or. For example, mod, so the inverse of modulo is, that is, mod. By the fundamental theorem of arithmetic (Rosen, 00), we can write =, where,,, are distinct primes and,,, are positive integers. We can first calculate the inverse of modulo,,,, respectively, and then apply Chinese remainder theorem (Rosen, 00) to obtain the inverse of modulo. Apart from the Euclidean algorithm to calculate the inverse, some researchers have introduced an interesting application of numerical analysis to number theory. In numerical analysis, we have the classical root-finding methods such as Newton's method and secant method to find a zero of a function or to find a solution of = 0. The concept of iterative root-finding methods is to construct a sequence

4 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE ,,, that will converge to a zero of in [,]. In 0, Knapp and Xenophontos calculated the inverses of an integer modulo using the rootfinding methods such as Newton s method, secant method, fixed-point iteration and higherorder convergent method (Knapp & Xenophontos, 0). Newton s method is suitable for calculating the inverse of an integer modulo when = for =,,, and some positive integer. The secant method is used to find the inverse of modulo, when the inverses of mod and mod are already known. The higher-order convergent method of order is suitable to calculate an inverse of modulo when = for =,,, and some positive integer. In 0, Dumas studied fast algorithms for the computation of modular inverses by using Newton-Raphson iteration (Dumas, 0). He designed four algorithms with a few operations used. He claimed that his hybrid algorithm is % faster than any direct method. In this paper, we extend the work from Knapp et al. by using Newton s and secant methods with a power-reduction calculation and Newton's and secant methods together with the binary representation and Zeckendorf representation to determine the inverse of an integer modulo for any positive integer by splitting into its prime factor form and calculate the inverse in terms of modulo. To do this, we consider into two cases. First case, we represent as the sum of distinct powers of. For the second case, we represent as the Zeckendorf representation (Griffiths, 0). Then we use the root-finding methods to calculate inverses modulo. Furthermore, we show the algorithms in MATLAB to calculate the inverse of modulo and compare the CPU times of each method.

5 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Rootfinding methods for the inverse of modulo In this section, we establish root-finding methods with a power-reduction calculation to calculate the inverse of an integer modulo. The methods are based on the root-finding methods in Knapp et al. (Knapp & Xenophontos, 0). For our problem, we are looking for an integer for which mod or mod. Following the methods in Knapp et al., a suitable choice for the function is =. The goal is to solve the equation =0.. Newton s method with a power-reduction calculation Newton s method is one of the most powerful and well-known numerical method for root-finding problems. We combine this method with a process of modular calculation to reduce power of to find the inverse mod. Newton s method relies on the continuity of,. According to (Burden & Faires, ), the iteration for Newton s method to locate a zero of is given by =, =,,, with a suitable initial value. This iteration generates a sequence { } which converges to a zero of. To apply the method, we first find =. The iteration for Newton s method becomes = =, =,,, (.) Here, we obtain the sequence { } which converges to a solution of =0.

6 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Theorem... Let >0 and suppose that is an inverse of modulo. Then given by (.) is an inverse of modulo. Proof. See Knapp and Xenophontos (0). Theorem.. implies that if we know the inverse of modulo, then we can use Newton s method to calculate the inverse of modulo, modulo, modulo and so on. For simplicity, we choose the initial guess to be the inverse of modulo and apply Newton s method in (.) to determine the inverse of modulo, modulo, modulo and so on. As a result, this method is suitable for calculating the inverse of an integer modulo when =, =,,,. It is known that the method converges at a quadratic rate for a simple root (Burden & Faires, ). In addition to Newton s method in Knapp et al., we construct the algorithm in order to find the inverse of an integer modulo for any integer, other than the form of. We first apply Newton s method in (.) to calculate the inverse of an integer modulo where << for some positive integer. Then, we begin to reduce the power of from down to. Since mod, it follows that mod. The reduction process applies this idea together with the congruence property to search for the smallest positive number in the same congruent class as modulo (shown in line 0 (referred to line ) in Algorithm ). By continuing this process, we finally arrive with the inverse of an integer modulo. The algorithm (Algorithm ) to determine such an inverse is shown in Table below. (Table ) Table : Algorithm for Newton s method with a power-reduction calculation

7 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Example : Let =,= and =. We want to calculate the inverse of modulo. We choose the initial value = since mod. Observe that <<. We apply Newton s method to find the inverse of modulo and so on until as follows: mod mod mod. After we obtain, we use the power-reduction calculation and finally get the inverse of modulo as.. The secant method with a power-reduction calculation Secant method is designed to converge almost as fast as Newton s method, but involves only not (Atkinson, ). In a similar way to Newton s method, we also combine this method with a modular calculation to reduce the power of. The iteration for secant method is given by =, =,,, The method requires two initial values and to generate a sequence { } which converges to a zero of. By setting =, the iteration for secant method is given by = = +, =,,, (.) Equation (.) provides a sequence { } which converges to a root of =0.

8 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Theorem... Suppose that mod and that mod. Then, with given by (.), we have mod. Proof. See Knapp and Xenophontos (0). From this theorem, we can use secant method to find the inverse of modulo if we know the inverse of modulo and modulo. We first choose and such that mod, and mod. Then, we iterate from secant method which will be the inverse of modulo, and continue the process. Since it is simpler to calculate the inverse of modulo, both initial values and for secant method are chosen to be the inverse of modulo. Then, we apply secant method to calculate which is the inverse of modulo. By continuing the process, we obtain the inverse of modulo, modulo, modulo and so on. In fact, the iterated values,, are the inverses in which the powers of are the Fibonacci numbers. This method is known to provide a convergence of order. (Atkinson, ). In addition to the secant method in Knapp et al., we construct the algorithm in order to find the inverse of an integer modulo for any positive integer, other than the form of or where is a Fibonacci number. Recall that the Fibonacci sequence is defined by the recurrence relation = + for and the initial values = =. We first apply the secant method in (.) to calculate the inverse of an integer modulo where << for some positive integer. Then, we use the reduction process (mentioned in section.) to reduce the power of from down to in order to obtain the inverse of an integer modulo. The algorithm (Algorithm ) to determine such an inverse is shown in Table. (Table )

9 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Table : Algorithm for the secant method with a power-reduction calculation Example : Let =,= and =. We want to calculate the inverse of modulo. We choose the initial value =, = because mod. Notice that <<. We apply the secant method to find the inverse of modulo, modulo and so on until modulo as follows: mod mod mod mod mod. Once we obtain, we use the power-reduction calculation and finally get the inverse of modulo as.. Calculating the inverse of mod and mod In this section, we use the methods in section. and section. to calculate the inverse of modulo for any positive integer. We consider into two cases. For the first case, we represent as the sum of distinct powers of. For the second case, we represent in the form of Zeckendorf representation.. Using binary representation Since we know that every positive integer can be represented as the sum of distinct powers of (Rosen, 00), we first express in a binary system. If is a positive integer and the digit,,, exist, the binary expansion of is given by (Mathew, ) = ,

10 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE where each digit is either a 0 or. This can also be written in a binary notation as =. Therefore = (.) or =. (.) The form in (.) consists of a prime number with the power of. We can apply Newton s method in Algorithm to calculate the inverse of an integer modulo for each in which in (.) is not zero. The secant method in Theorem.. and Algorithm are then applied to determine the inverse of each pair of modulo until the largest power term. The algorithm (Algorithm ) to calculate the inverse using the binary representation is presented in Table. (Table ) Table : Algorithm for calculating the inverse using binary representation Example : Let =,= and =. We want to calculate the inverse of modulo. We choose the initial value =, since mod. The binary representation of in this problem is == +=. Observe that the representation contains the terms and. We apply Newton s method and Theorem... to find the inverses of modulo, as follows: mod or mod mod or mod mod or mod.

11 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Using the secant method and Theorem... with and as the initial conditions to calculate the inverse of modulo yields = mod Therefore, is the inverse of modulo.. Using the Zeckendorf representation In view of the fact that any positive integer can be expressed as the sum of Fibonacci numbers (Rosen, 00). In this section, we represent the integer in the form of the Zeckendorf representation. Theorem... (Zeckendorf s Theorem (Rosen, 00; Griffiths, 0)) Every positive integer can be represented uniquely as the sum of one or more distinct Fibonacci numbers in such a way that the sum does not include any two consecutive Fibonacci numbers. More precisely, if is any positive integer, there exist positive integers, with > + for every {0,,,,} such that = where is the Fibonacci number. Such a sum is called the Zeckendorf representation of. In fact, the greedy algorithm always leads to Zeckendorf representation. Proof. See Rosen (00) and Griffiths (0). Example : Consider the number =. There are several ways to express this number as a sum of Fibonacci numbers. Notice that =+++= and =+++= are not Zeckendorf representations because,, and, are consecutive Fibonacci numbers.

12 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE However, =++= + + is a Zeckendorf representation which is uniquely determined. From the greedy algorithm and Zeckendorf s theorem, we can construct an algorithm to write in form of the Zeckendorf representation. We first construct a Fibonacci sequence starting from and contains numbers closest to. The binary search algorithm is applied to find the largest Fibonacci numbers,, that is less than or equal to. Then repeat the process to find the largest Fibonacci numbers,, that is less than or equal to. By continuing this process, we arrive with the Zeckendorf representation = for some N. Algorithm in Table provides the process of finding such a representation. (Table ) Table : Algorithm for representing with the Zeckendorf representation Once we have the Zeckendorf representation from Algorithm. The secant method in section. is applied to find the inverse of an integer modulo for each Fibonacci number in Algorithm. Then, we apply the secant method again to find the inverse of an integer modulo. The algorithm (Algorithm ) that includes the secant method to find the inverse of an integer modulo is shown in Table. (Table ) Table : Algorithm for calculating the inverse using Zeckendorf representation Example : Let =,= and =. We want to calculate the inverse of modulo. We choose the initial value = and = because mod. We have that =++. Then, we use the secant method and Theorem... to

13 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of find the inverses of modulo, where is a Fibonacci number less than or equal as follows: mod mod mod mod. Next, we apply the secant method and Theorem... again to find the inverse of modulo and modulo. This yields the inverse = mod. Therefore, is the inverse of modulo. In the next example, we compare the CPU times of each method used to find the inverse of modulo by using MATLAB. The calculations are carried out with an Intel Core i CPU@ GHz RAM GB computer. The results are represented in Example. Example : Let =, =. We choose the initial value = and =, since mod. The CPU times are recorded in seconds. (Table ) Table : CPU times in finding the inverse of modulo of the four methods. From the Table, Newton s method is the fastest method to calculate the inverses when is the power of and is not too large due to less number of operations to execute than the other methods. In this example, we can see that when = and, Newton s method gives the smallest time to calculate the results. If we consider the secant method, it has the best time when is a Fibonacci number and not too large. We can see that this method gives us the smallest time to find the inverses

14 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE when =, and. The binary and Zeckendorf representation methods can calculate the inverses for every and the CPU time is increased a bit at a time when is larger. These last two methods are the best way to calculate the inverses of modulo, especially when is not in a power of or a Fibonacci number or when is large. The figures below also confirm our discussion above. Figure (a) shows the graphs of the CPU times for the four methods versus when =,,,0. The CPU time in the graph of Newton s method drops when =,,,, and it jumps up due to the power-reduction process. For example, the method uses low CPU time when =, but it takes much longer time when = since it first calculates the inverse of modulo then it reduces the power down to =. Similarly, the CPU time in the graph of the secant method drops when =,,,,, and it jumps up in a similar manner. If we consider the graphs of the CPU times for the binary and Zeckendorf representation methods, the graphs are quite stable and do not increase much. It takes less CPU times than the first two methods as increases. Figure (b) illustrates the behavior of CPU times of these methods when =,,,0. We can see from the graphs that the times taken do not rise up when gets larger. They are time efficient and very stable to calculate the inverse of modulo for any number. (Figure (a)) (Figure (b)) (a) (b) Figure : (a) The graphs of CPU times of the four methods versus when =,,,0. (b) The graphs of CPU times of the binary and Zeckendorf representations versus when =,,,0.

15 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of We end the section with an example to calculate the inverse of an integer modulo where =. Example : Let = and =0. The prime factorization of is =. We would like to find an integer such that mod. We break it down into finding mod, mod, mod. By using our algorithms, we can find the inverses of each case as mod, mod, mod. Then we combine them by using the Chinese remainder theorem. Let =, =, =, =, =, =. From the Chinese remainder theorem (Rosen, 00), we define = = = = = = = = = = = =. To determine the inverse of, denoted by, we solve mod, which is equivalent to mod. So mod. Next, we find the inverse of, denoted by, by solving mod, which is equivalent

16 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE to mod. So mod. The inverse of, denoted by, is calculated by solving mod, or equivalently, mod. Then 0 mod. Therefore, according to the Chinese remainder theorem, the inverse of modulo 0 is + + mod ++0 mod mod mod.. Conclusion and Discussion This work introduces new methods to calculate inverses modulo for any positive integer. We express in its prime factorization as =, where,,, are distinct prime numbers and,,, are positive integers. Then, we calculate the inverse by breaking it down to find the inverse of mod, mod,, and mod and combine them using the Chinese remainder theorem. The four methods proposed to calculate the inverse of mod are designed based on the Newton's and secant methods. We also construct the algorithms for each method to help calculating the inverses of modulo based on the MATLAB program and present them in the example of each method. In addition, we compare the CPU times of each method in Example. Newton s method with a power-reduction calculation is good for the case when = for =,,,. The secant method with a power-reduction calculation is used to find the inverse of modulo when the inverses of mod and

17 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page 0 of mod are already obtained. In fact, it is good for the case when is a Fibonacci number. However, these two methods may take time when is not in such a form because of the power-reduction process. The method that expresses as a binary representation followed by Newton s and secant methods is suitable for any numbers because every number can be represented in base. The method does not include power-reduction calculation. As a result, it is time efficient and very stable to calculate the inverse for any number, especially when is large or is not in a power of or a Fibonacci number. Similarly, the method that expresses as a Zeckendorf representation followed by the secant method is suitable for any numbers because every number has its Zeckendorf representation. This method is also as good as the method that expresses in a binary representation. Acknowledgement We would like to thank Dr. Pinyo Taeprasartsit for his helpful suggestions in programming throughout this work. References Atkinson, K. E. (). An Introduction To Numerical Analysis ( nd ed). USA: John Wiley&Sons. Burden, R. L.,& Faires, J. D. (). Numerical Analysis. Pacific Grove, USA: Brooks/Cole. Dumas, J. G. (0). On Newton-Raphson Iteration for Multiplicative Inverses Modulo Prime Powers. IEEE Transations on Computers, (), 0-. doi:./tc.0.

18 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Griffiths, M. (0). The Zeckendorf Representation of a Beatty-Related Finonacci Sum. Fibonacci Quart. (), 0-. MSC0: B, B. Knapp, M. P.& Xenophontos, C. (0). Numerical analysis meets number theory: Using rootfinding methods to calculate inverses mod. Appl. Anal. Discrete Math. (), -. doi:./aadm00k Mathew, J. H. (). Numerical Methods For Mathematics, Science, And Engineering. New Jersey, USA: Prentice-Hall. Rosen, K. H. (00). Elementary Number Theory And Its Application. USA: Addison- Wesley.

19 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of SJST MANUSCRIPT TEMPLATE FOR A FIGURE FILE Figure (a) Figure (b) Figure : (a) The graphs of CPU times of the four methods versus when,,,0. (b) The graphs of CPU times of the binary and Zeckendorf representations versus when,,,0.

20 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE SJST MANUSCRIPT TEMPLATE FOR A TABLE FILE Algorithm : Newton s method with a power-reduction calculation : Input:,, Z ; N ; intitial value (inverse of mod ); : for k = to M : compute : = ( ); = ; : if <0 : set =; = + ; : while <0 : =+; = +( ) ; : end ; display : else if >0 and < : display ; stop the process : else if >0 and > : set =; = ; : while > : =+; = ( ) ; : end ; display : end : if = : stop the process : else if > 0: repeat line - by replacing with : end : end Table : Algorithm for Newton s method with a power-reduction calculation

21 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Algorithm : The secant method with a power-reduction calculation : Input:,, Z ; N ; intitial value, (inverse of mod ); : =; =; : for k = to M : compute : = + ; = + ;= ; : if <0 : set =; = + ; : while <0 : =+; = +( ) ; : end ; display : else if >0 and < : display ; stop the process : else if >0 and > : set =; = ; : while > : =+; = ( ) ; : end ; display : end : if = : stop the process 0: else if > : repeat line - by replacing with : end : end Table : Algorithm for the secant method with a power-reduction calculation

22 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Algorithm : Inverse of mod using binary representation : Input:,, Z ; N ; intitial value (inverse of mod ); : = vector representing n in base two ; =size of ; : = vector containing indices of nonzero elements in ; =size of ; : Apply Algorithm from line - : Input:,, Z ; N ; intitial value (inverse of mod ) : Output: : if = : display () ; stop the process : else for = to : =( ) ; : end : = ( ) + ( ) ; : Apply Algorithm from line - : Input:,, Z ; N ; intitial value, ; : Output: : for = to : = + ( ) ; : Apply Algorithm from line - : Input:,, Z ; N ; intitial value, ; 0: end : display () ; stop the process : end Table : Algorithm for calculating the inverse using binary representation

23 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Algorithm : Representing with the Zeckendorf representation : Input: N ; : set = ; = ;=;= ; : while : = + ; = ; =+ ; (constructing Fibonacci sequence) : end : while 0 : Find =, the closet value to the number, using binary search algorithm : Input:, : Output: and (index of value in ) : if > : = ; =, ; =, ; : else : = ; =, ; =,; : end : = ; : end : = flip left/right of ; = flip left/right of ; display and (Return, the Zeckendorf representation of and corresponding indices ) Table : Algorithm for representing with the Zeckendorf representation

24 Page of Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Algorithm : Inverse of mod using Zeckendorf representation : Input:, Z ;, N ; intitial value (inverse of mod ) : Apply Algorithm : Input : : Output :,, : Find the closet value to (),, and its index,, using binary search algorithm : Input:,() : Output :, : Apply Algorithm from line -, Change in line to (inv of mod,,, ) : Input:,,() Z ;, N ; intitial value, ; : Output: : = : : if length of = : display () : else = + ; : Apply Algorithm from line - : Input:,, Z ; N ; intitial value, ; : Output: : for = to (length of ) : = + ; 0: Apply Algorithm from line - : Input:,, Z ; N ; intitial value, ; : Output: : end : display () : end Table : Algorithm for calculating the inverse using Zeckendorf representation

25 Songklanakarin Journal of Science and Technology SJST-0-0.R KANYAMEE Page of Methods Newton Secant Base Zeckendorf (mod ) (mod ) (mod ) (mod ) (mod ) > (mod ) (mod ).0 > (mod ) 0. > Table : CPU times in finding the inverse of modulo of the four methods.

Notes on Systems of Linear Congruences

Notes on Systems of Linear Congruences MATH 324 Summer 2012 Elementary Number Theory Notes on Systems of Linear Congruences In this note we will discuss systems of linear congruences where the moduli are all different. Definition. Given the

More information

arxiv: v2 [math.nt] 29 Jul 2017

arxiv: v2 [math.nt] 29 Jul 2017 Fibonacci and Lucas Numbers Associated with Brocard-Ramanujan Equation arxiv:1509.07898v2 [math.nt] 29 Jul 2017 Prapanpong Pongsriiam Department of Mathematics, Faculty of Science Silpakorn University

More information

Elementary Number Theory. Franz Luef

Elementary Number Theory. Franz Luef Elementary Number Theory Congruences Modular Arithmetic Congruence The notion of congruence allows one to treat remainders in a systematic manner. For each positive integer greater than 1 there is an arithmetic

More information

PAijpam.eu THE PERIOD MODULO PRODUCT OF CONSECUTIVE FIBONACCI NUMBERS

PAijpam.eu THE PERIOD MODULO PRODUCT OF CONSECUTIVE FIBONACCI NUMBERS International Journal of Pure and Applied Mathematics Volume 90 No. 014, 5-44 ISSN: 111-8080 (printed version); ISSN: 114-95 (on-line version) url: http://www.ipam.eu doi: http://dx.doi.org/10.17/ipam.v90i.7

More information

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer. CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder

More information

Solving Higher-Order p-adic Polynomial Equations via Newton-Raphson Method

Solving Higher-Order p-adic Polynomial Equations via Newton-Raphson Method Malaysian Journal of Mathematical Sciences 11(1): 41 51 (017) MALAYSIAN JOURNAL OF MATHEMATICAL SCIENCES Journal homepage: http://einspem.upm.edu.my/journal Solving Higher-Order p-adic Polynomial Equations

More information

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

More information

Modular Arithmetic Instructor: Marizza Bailey Name:

Modular Arithmetic Instructor: Marizza Bailey Name: Modular Arithmetic Instructor: Marizza Bailey Name: 1. Introduction to Modular Arithmetic If someone asks you what day it is 145 days from now, what would you answer? Would you count 145 days, or find

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

Applied Cryptography and Computer Security CSE 664 Spring 2018

Applied Cryptography and Computer Security CSE 664 Spring 2018 Applied Cryptography and Computer Security Lecture 12: Introduction to Number Theory II Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline This time we ll finish the

More information

NORTHWESTERN UNIVERSITY Tuesday, Oct 6th, 2015 ANSWERS FALL 2015 NU PUTNAM SELECTION TEST

NORTHWESTERN UNIVERSITY Tuesday, Oct 6th, 2015 ANSWERS FALL 2015 NU PUTNAM SELECTION TEST Problem A1. Show that log(1 + x) > x/(1 + x) for all x > 0. - Answer: We have that (log x) = 1/(1+x), and (x/(1+x)) = 1/(1+x) 2. Since 1/(1+x) > 1/(1 + x) 2 for x > 0, the function log x grows faster than

More information

Numerical analysis meets number theory: using rootfinding methods to calculate inverses mod p n

Numerical analysis meets number theory: using rootfinding methods to calculate inverses mod p n Numerical analysis meets number theory: using rootfinding methods to calculate inverses mod p n This article is dedicated to the memory of George Mackiw June 7, 2004 Introduction In this article we explore

More information

Math 109 HW 9 Solutions

Math 109 HW 9 Solutions Math 109 HW 9 Solutions Problems IV 18. Solve the linear diophantine equation 6m + 10n + 15p = 1 Solution: Let y = 10n + 15p. Since (10, 15) is 5, we must have that y = 5x for some integer x, and (as we

More information

On Newton-Raphson iteration for multiplicative inverses modulo prime powers

On Newton-Raphson iteration for multiplicative inverses modulo prime powers On Newton-Raphson iteration for multiplicative inverses modulo prime powers Jean-Guillaume Dumas To cite this version: Jean-Guillaume Dumas. On Newton-Raphson iteration for multiplicative inverses modulo

More information

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, } Integers and Division 1 The Integers and Division This area of discrete mathematics belongs to the area of Number Theory. Some applications of the concepts in this section include generating pseudorandom

More information

SEVENTH EDITION and EXPANDED SEVENTH EDITION

SEVENTH EDITION and EXPANDED SEVENTH EDITION SEVENTH EDITION and EXPANDED SEVENTH EDITION Slide 10-1 Chapter 10 Mathematical Systems 10.1 Groups Definitions A mathematical system consists of a set of elements and at least one binary operation. A

More information

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element. The first exam will be on Monday, June 8, 202. The syllabus will be sections. and.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive squaring

More information

arxiv: v5 [cs.sc] 15 May 2018

arxiv: v5 [cs.sc] 15 May 2018 On Newton-Raphson iteration for multiplicative inverses modulo prime powers arxiv:109.666v5 [cs.sc] 15 May 018 Jean-Guillaume Dumas May 16, 018 Abstract We study algorithms for the fast computation of

More information

9 Modular Exponentiation and Square-Roots

9 Modular Exponentiation and Square-Roots 9 Modular Exponentiation and Square-Roots Modular arithmetic is used in cryptography. In particular, modular exponentiation is the cornerstone of what is called the RSA system. 9. Modular Exponentiation

More information

3 The fundamentals: Algorithms, the integers, and matrices

3 The fundamentals: Algorithms, the integers, and matrices 3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers

More information

Solutions to Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00

Solutions to Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00 Solutions to 18.781 Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00 1. (Niven 2.3.3) Solve the congruences x 1 (mod 4), x 0 (mod 3), x 5 (mod 7). First we note that 4, 3, and 7 are pairwise relatively

More information

Partitions in the quintillions or Billions of congruences

Partitions in the quintillions or Billions of congruences Partitions in the quintillions or Billions of congruences Fredrik Johansson November 2011 The partition function p(n) counts the number of ways n can be written as the sum of positive integers without

More information

PROBLEMS ON CONGRUENCES AND DIVISIBILITY

PROBLEMS ON CONGRUENCES AND DIVISIBILITY PROBLEMS ON CONGRUENCES AND DIVISIBILITY 1. Do there exist 1,000,000 consecutive integers each of which contains a repeated prime factor? 2. A positive integer n is powerful if for every prime p dividing

More information

Extracting Hexadecimal Digits of π

Extracting Hexadecimal Digits of π Extracting Hexadecimal Digits of π William Malone William Malone is currently a senior Mathematics major at Ball State University. Upon graduation he plans to pursue graduate studies starting in the fall

More information

IMPROVING THE CONVERGENCE ORDER AND EFFICIENCY INDEX OF QUADRATURE-BASED ITERATIVE METHODS FOR SOLVING NONLINEAR EQUATIONS

IMPROVING THE CONVERGENCE ORDER AND EFFICIENCY INDEX OF QUADRATURE-BASED ITERATIVE METHODS FOR SOLVING NONLINEAR EQUATIONS 136 IMPROVING THE CONVERGENCE ORDER AND EFFICIENCY INDEX OF QUADRATURE-BASED ITERATIVE METHODS FOR SOLVING NONLINEAR EQUATIONS 1Ogbereyivwe, O. and 2 Ojo-Orobosa, V. O. Department of Mathematics and Statistics,

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

More information

Putnam Greedy Algorithms Cody Johnson. Greedy Algorithms. May 30, 2016 Cody Johnson.

Putnam Greedy Algorithms Cody Johnson. Greedy Algorithms. May 30, 2016 Cody Johnson. 1 Introduction Greedy Algorithms May 0, 2016 Cody Johnson ctj@math.cmu.edu A greedy algorithm is an algorithm that chooses the optimal choice in the short run. 2 Examples 1. Prove that every nonnegative

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 9 September 30, 2015 CPSC 467, Lecture 9 1/47 Fast Exponentiation Algorithms Number Theory Needed for RSA Elementary Number Theory

More information

cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications

cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications cse 311: foundations of computing Fall 2015 Lecture 11: Modular arithmetic and applications arithmetic mod 7 a + 7 b = (a + b) mod 7 a 7 b = (a b) mod 7 5 6 0 1 2 4 3 + 0 1 2 3 4 5 6 0 0 1 2 3 4 5 6 1

More information

p 1 p 0 (p 1, f(p 1 )) (p 0, f(p 0 )) The geometric construction of p 2 for the se- cant method.

p 1 p 0 (p 1, f(p 1 )) (p 0, f(p 0 )) The geometric construction of p 2 for the se- cant method. 80 CHAP. 2 SOLUTION OF NONLINEAR EQUATIONS f (x) = 0 y y = f(x) (p, 0) p 2 p 1 p 0 x (p 1, f(p 1 )) (p 0, f(p 0 )) The geometric construction of p 2 for the se- Figure 2.16 cant method. Secant Method The

More information

arxiv: v2 [math.ho] 31 Dec 2018

arxiv: v2 [math.ho] 31 Dec 2018 Solutions to Diophantine equation of Erdős Straus Conjecture arxiv:82.0568v2 [math.ho] 3 Dec 208 Abstract Dagnachew Jenber Negash Addis Ababa Science and Technology University Addis Ababa, Ethiopia Email:

More information

Midterm Review. Igor Yanovsky (Math 151A TA)

Midterm Review. Igor Yanovsky (Math 151A TA) Midterm Review Igor Yanovsky (Math 5A TA) Root-Finding Methods Rootfinding methods are designed to find a zero of a function f, that is, to find a value of x such that f(x) =0 Bisection Method To apply

More information

Mathematics for Cryptography

Mathematics for Cryptography Mathematics for Cryptography Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo Waterloo, Ontario, N2L 3G1, Canada March 15, 2016 1 Groups and Modular Arithmetic 1.1

More information

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9.1 Chapter 9 Objectives

More information

4 Number Theory and Cryptography

4 Number Theory and Cryptography 4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.

More information

Journal of Number Theory

Journal of Number Theory Journal of Number Theory 130 (2010) 1737 1749 Contents lists available at ScienceDirect Journal of Number Theory www.elsevier.com/locate/jnt A binary linear recurrence sequence of composite numbers Artūras

More information

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

More information

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635 COMP239: Mathematics for Computer Science II Prof. Chadi Assi assi@ciise.concordia.ca EV7.635 The Euclidean Algorithm The Euclidean Algorithm Finding the GCD of two numbers using prime factorization is

More information

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5) CSE 54 Discrete Mathematics & Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices Integers & Algorithms (Section 2.5) by Kenneth H. Rosen, Discrete Mathematics & its Applications,

More information

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2 8. p-adic numbers 8.1. Motivation: Solving x 2 a (mod p n ). Take an odd prime p, and ( an) integer a coprime to p. Then, as we know, x 2 a (mod p) has a solution x Z iff = 1. In this case we can suppose

More information

Algebra for error control codes

Algebra for error control codes Algebra for error control codes EE 387, Notes 5, Handout #7 EE 387 concentrates on block codes that are linear: Codewords components are linear combinations of message symbols. g 11 g 12 g 1n g 21 g 22

More information

Math 551 Homework Assignment 3 Page 1 of 6

Math 551 Homework Assignment 3 Page 1 of 6 Math 551 Homework Assignment 3 Page 1 of 6 Name and section: ID number: E-mail: 1. Consider Newton s method for finding + α with α > 0 by finding the positive root of f(x) = x 2 α = 0. Assuming that x

More information

Fall 2017 November 10, Written Homework 5

Fall 2017 November 10, Written Homework 5 CS1800 Discrete Structures Profs. Aslam, Gold, & Pavlu Fall 2017 November 10, 2017 Assigned: Mon Nov 13 2017 Due: Wed Nov 29 2017 Instructions: Written Homework 5 The assignment has to be uploaded to blackboard

More information

Integers and Division

Integers and Division Integers and Division Notations Z: set of integers N : set of natural numbers R: set of real numbers Z + : set of positive integers Some elements of number theory are needed in: Data structures, Random

More information

Tewodros Amdeberhan, Dante Manna and Victor H. Moll Department of Mathematics, Tulane University New Orleans, LA 70118

Tewodros Amdeberhan, Dante Manna and Victor H. Moll Department of Mathematics, Tulane University New Orleans, LA 70118 The -adic valuation of Stirling numbers Tewodros Amdeberhan, Dante Manna and Victor H. Moll Department of Mathematics, Tulane University New Orleans, LA 7011 Abstract We analyze properties of the -adic

More information

Continuing discussion of CRC s, especially looking at two-bit errors

Continuing discussion of CRC s, especially looking at two-bit errors Continuing discussion of CRC s, especially looking at two-bit errors The definition of primitive binary polynomials Brute force checking for primitivity A theorem giving a better test for primitivity Fast

More information

CSE525: Randomized Algorithms and Probabilistic Analysis April 2, Lecture 1

CSE525: Randomized Algorithms and Probabilistic Analysis April 2, Lecture 1 CSE525: Randomized Algorithms and Probabilistic Analysis April 2, 2013 Lecture 1 Lecturer: Anna Karlin Scribe: Sonya Alexandrova and Eric Lei 1 Introduction The main theme of this class is randomized algorithms.

More information

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example. Coding Theory Massoud Malek Algebra Congruence Relation The definition of a congruence depends on the type of algebraic structure under consideration Particular definitions of congruence can be made for

More information

Finding simple roots by seventh- and eighth-order derivative-free methods

Finding simple roots by seventh- and eighth-order derivative-free methods Finding simple roots by seventh- and eighth-order derivative-free methods F. Soleymani 1,*, S.K. Khattri 2 1 Department of Mathematics, Islamic Azad University, Zahedan Branch, Zahedan, Iran * Corresponding

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Define and use the congruence modulo m equivalence relation Perform computations using modular arithmetic

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively

More information

#A11 INTEGERS 12 (2012) FIBONACCI VARIATIONS OF A CONJECTURE OF POLIGNAC

#A11 INTEGERS 12 (2012) FIBONACCI VARIATIONS OF A CONJECTURE OF POLIGNAC #A11 INTEGERS 12 (2012) FIBONACCI VARIATIONS OF A CONJECTURE OF POLIGNAC Lenny Jones Department of Mathematics, Shippensburg University, Shippensburg, Pennsylvania lkjone@ship.edu Received: 9/17/10, Revised:

More information

Elementary Number Theory Review. Franz Luef

Elementary Number Theory Review. Franz Luef Elementary Number Theory Review Principle of Induction Principle of Induction Suppose we have a sequence of mathematical statements P(1), P(2),... such that (a) P(1) is true. (b) If P(k) is true, then

More information

Computer Architecture 10. Residue Number Systems

Computer Architecture 10. Residue Number Systems Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =

More information

Numbers. Çetin Kaya Koç Winter / 18

Numbers. Çetin Kaya Koç   Winter / 18 Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 18 Number Systems and Sets We represent the set of integers as Z = {..., 3, 2, 1,0,1,2,3,...} We denote the set of positive integers modulo n as

More information

Newton-Raphson Type Methods

Newton-Raphson Type Methods Int. J. Open Problems Compt. Math., Vol. 5, No. 2, June 2012 ISSN 1998-6262; Copyright c ICSRS Publication, 2012 www.i-csrs.org Newton-Raphson Type Methods Mircea I. Cîrnu Department of Mathematics, Faculty

More information

Numerical Study of Some Iterative Methods for Solving Nonlinear Equations

Numerical Study of Some Iterative Methods for Solving Nonlinear Equations International Journal of Engineering Science Invention ISSN (Online): 2319 6734, ISSN (Print): 2319 6726 Volume 5 Issue 2 February 2016 PP.0110 Numerical Study of Some Iterative Methods for Solving Nonlinear

More information

Fast evaluation of iterated multiplication of very large polynomials: An application to chinese remainder theory

Fast evaluation of iterated multiplication of very large polynomials: An application to chinese remainder theory ANZIAM J. 48 (CTAC2006) pp.c709 C724, 2007 C709 Fast evaluation of iterated multiplication of very large polynomials: An application to chinese remainder theory D. Laing 1 B. Litow 2 (Received 30 August

More information

198 VOLUME 46/47, NUMBER 3

198 VOLUME 46/47, NUMBER 3 LAWRENCE SOMER Abstract. Rotkiewicz has shown that there exist Fibonacci pseudoprimes having the forms p(p + 2), p(2p 1), and p(2p + 3), where all the terms in the products are odd primes. Assuming Dickson

More information

CS March 17, 2009

CS March 17, 2009 Discrete Mathematics CS 2610 March 17, 2009 Number Theory Elementary number theory, concerned with numbers, usually integers and their properties or rational numbers mainly divisibility among integers

More information

MATH 310: Homework 7

MATH 310: Homework 7 1 MATH 310: Homework 7 Due Thursday, 12/1 in class Reading: Davenport III.1, III.2, III.3, III.4, III.5 1. Show that x is a root of unity modulo m if and only if (x, m 1. (Hint: Use Euler s theorem and

More information

MATH 361: NUMBER THEORY FOURTH LECTURE

MATH 361: NUMBER THEORY FOURTH LECTURE MATH 361: NUMBER THEORY FOURTH LECTURE 1. Introduction Everybody knows that three hours after 10:00, the time is 1:00. That is, everybody is familiar with modular arithmetic, the usual arithmetic of the

More information

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time. 8 Modular Arithmetic We introduce an operator mod. Let d be a positive integer. For c a nonnegative integer, the value c mod d is the remainder when c is divided by d. For example, c mod d = 0 if and only

More information

Number theory (Chapter 4)

Number theory (Chapter 4) EECS 203 Spring 2016 Lecture 10 Page 1 of 8 Number theory (Chapter 4) Review Questions: 1. Does 5 1? Does 1 5? 2. Does (129+63) mod 10 = (129 mod 10)+(63 mod 10)? 3. Does (129+63) mod 10 = ((129 mod 10)+(63

More information

ECEN 5022 Cryptography

ECEN 5022 Cryptography Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,

More information

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Algorithms (II) Yu Yu. Shanghai Jiaotong University Algorithms (II) Yu Yu Shanghai Jiaotong University Chapter 1. Algorithms with Numbers Two seemingly similar problems Factoring: Given a number N, express it as a product of its prime factors. Primality:

More information

Winter Camp 2009 Number Theory Tips and Tricks

Winter Camp 2009 Number Theory Tips and Tricks Winter Camp 2009 Number Theory Tips and Tricks David Arthur darthur@gmail.com 1 Introduction This handout is about some of the key techniques for solving number theory problems, especially Diophantine

More information

CHAPTER 3. Congruences. Congruence: definitions and properties

CHAPTER 3. Congruences. Congruence: definitions and properties CHAPTER 3 Congruences Part V of PJE Congruence: definitions and properties Definition. (PJE definition 19.1.1) Let m > 0 be an integer. Integers a and b are congruent modulo m if m divides a b. We write

More information

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B. Relations Binary Relation Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation Let R A B be a relation from A to B. If (a, b) R, we write a R b. 1 Binary Relation Example:

More information

Math.3336: Discrete Mathematics. Mathematical Induction

Math.3336: Discrete Mathematics. Mathematical Induction Math.3336: Discrete Mathematics Mathematical Induction Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018

More information

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them.

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them. Fermat s Little Theorem Fermat s little theorem is a statement about primes that nearly characterizes them. Theorem: Let p be prime and a be an integer that is not a multiple of p. Then a p 1 1 (mod p).

More information

On Aperiodic Subtraction Games with Bounded Nim Sequence

On Aperiodic Subtraction Games with Bounded Nim Sequence On Aperiodic Subtraction Games with Bounded Nim Sequence Nathan Fox arxiv:1407.2823v1 [math.co] 10 Jul 2014 Abstract Subtraction games are a class of impartial combinatorial games whose positions correspond

More information

10 Modular Arithmetic and Cryptography

10 Modular Arithmetic and Cryptography 10 Modular Arithmetic and Cryptography 10.1 Encryption and Decryption Encryption is used to send messages secretly. The sender has a message or plaintext. Encryption by the sender takes the plaintext and

More information

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties: Byte multiplication 1 Field arithmetic A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties: F is an abelian group under addition, meaning - F is closed under

More information

CPSC 518 Introduction to Computer Algebra Asymptotically Fast Integer Multiplication

CPSC 518 Introduction to Computer Algebra Asymptotically Fast Integer Multiplication CPSC 518 Introduction to Computer Algebra Asymptotically Fast Integer Multiplication 1 Introduction We have now seen that the Fast Fourier Transform can be applied to perform polynomial multiplication

More information

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II CS 5319 Advanced Discrete Structure Lecture 9: Introduction to Number Theory II Divisibility Outline Greatest Common Divisor Fundamental Theorem of Arithmetic Modular Arithmetic Euler Phi Function RSA

More information

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5. This homework is due October 6, 2014, at 12:00 noon.

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5. This homework is due October 6, 2014, at 12:00 noon. EECS 70 Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5 This homework is due October 6, 2014, at 12:00 noon. 1. Modular Arithmetic Lab (continue) Oystein Ore described a puzzle

More information

Number Theory Proof Portfolio

Number Theory Proof Portfolio Number Theory Proof Portfolio Jordan Rock May 12, 2015 This portfolio is a collection of Number Theory proofs and problems done by Jordan Rock in the Spring of 2014. The problems are organized first by

More information

201-1A5-MT - Mathematics Summer 2015 HOMEWORK 2 Deadline : Sunday, August 30, 2015 at 12 :30.

201-1A5-MT - Mathematics Summer 2015 HOMEWORK 2 Deadline : Sunday, August 30, 2015 at 12 :30. 01-1A5-MT - Mathematics Summer 015 HOMEWORK Deadline : Sunday, August 30, 015 at 1 :30. Instructions : The assignment consists of five questions, each worth 0 points. Only hardcopy submissions of your

More information

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z: NUMBER SYSTEMS Number theory is the study of the integers. We denote the set of integers by Z: Z = {..., 3, 2, 1, 0, 1, 2, 3,... }. The integers have two operations defined on them, addition and multiplication,

More information

Discrete Structures Lecture Solving Congruences. mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) =

Discrete Structures Lecture Solving Congruences. mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) = First Introduction Our goal is to solve equations having the form aaaa bb (mmmmmm mm). However, first we must discuss the last part of the previous section titled gcds as Linear Combinations THEOREM 6

More information

Public Key Encryption

Public Key Encryption Public Key Encryption 3/13/2012 Cryptography 1 Facts About Numbers Prime number p: p is an integer p 2 The only divisors of p are 1 and p s 2, 7, 19 are primes -3, 0, 1, 6 are not primes Prime decomposition

More information

Fast Fraction-Integer Method for Computing Multiplicative Inverse

Fast Fraction-Integer Method for Computing Multiplicative Inverse Fast Fraction-Integer Method for Computing Multiplicative Inverse Hani M AL-Matari 1 and Sattar J Aboud 2 and Nidal F Shilbayeh 1 1 Middle East University for Graduate Studies, Faculty of IT, Jordan-Amman

More information

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

#A66 INTEGERS 14 (2014) SMITH NUMBERS WITH EXTRA DIGITAL FEATURES

#A66 INTEGERS 14 (2014) SMITH NUMBERS WITH EXTRA DIGITAL FEATURES #A66 INTEGERS 14 (2014) SMITH NUMBERS WITH EXTRA DIGITAL FEATURES Amin Witno Department of Basic Sciences, Philadelphia University, Jordan awitno@gmail.com Received: 12/7/13, Accepted: 11/14/14, Published:

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

Elliptic Curves Spring 2015 Problem Set #2 Due: 02/20/2015

Elliptic Curves Spring 2015 Problem Set #2 Due: 02/20/2015 18.783 Elliptic Curves Spring 2015 Problem Set #2 Due: 02/20/2015 These problems are related to the material covered in Lectures 3-4. I have made every effort to proof-read the problems, but there may

More information

For your quiz in recitation this week, refer to these exercise generators:

For your quiz in recitation this week, refer to these exercise generators: Monday, Oct 29 Today we will talk about inverses in modular arithmetic, and the use of inverses to solve linear congruences. For your quiz in recitation this week, refer to these exercise generators: GCD

More information

SUFFIX PROPERTY OF INVERSE MOD

SUFFIX PROPERTY OF INVERSE MOD IEEE TRANSACTIONS ON COMPUTERS, 2018 1 Algorithms for Inversion mod p k Çetin Kaya Koç, Fellow, IEEE, Abstract This paper describes and analyzes all existing algorithms for computing x = a 1 (mod p k )

More information

This exam contains 5 pages (including this cover page) and 4 questions. The total number of points is 100. Grade Table

This exam contains 5 pages (including this cover page) and 4 questions. The total number of points is 100. Grade Table MAT115A-21 Summer Session 2 2018 Practice Final Solutions Name: Time Limit: 1 Hour 40 Minutes Instructor: Nathaniel Gallup This exam contains 5 pages (including this cover page) and 4 questions. The total

More information

Part II. Number Theory. Year

Part II. Number Theory. Year Part II Year 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2017 Paper 3, Section I 1G 70 Explain what is meant by an Euler pseudoprime and a strong pseudoprime. Show that 65 is an Euler

More information

New Algorithm for Classical Modular Inverse

New Algorithm for Classical Modular Inverse New Algorithm for Classical Modular Inverse Róbert órencz C in Prague CR 9/8/00 CHE 00 1 Introduction - Modular Inverse Inseparable part of cryptographic algorithms. Always needed classical modular inverse

More information

Old and new algorithms for computing Bernoulli numbers

Old and new algorithms for computing Bernoulli numbers Old and new algorithms for computing Bernoulli numbers University of New South Wales 25th September 2012, University of Ballarat Bernoulli numbers Rational numbers B 0, B 1,... defined by: x e x 1 = n

More information

CHAPTER 2 EXTRACTION OF THE QUADRATICS FROM REAL ALGEBRAIC POLYNOMIAL

CHAPTER 2 EXTRACTION OF THE QUADRATICS FROM REAL ALGEBRAIC POLYNOMIAL 24 CHAPTER 2 EXTRACTION OF THE QUADRATICS FROM REAL ALGEBRAIC POLYNOMIAL 2.1 INTRODUCTION Polynomial factorization is a mathematical problem, which is often encountered in applied sciences and many of

More information

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006 Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 2.4 2.6 of Rosen Introduction I When talking

More information

Summary Slides for MATH 342 June 25, 2018

Summary Slides for MATH 342 June 25, 2018 Summary Slides for MATH 342 June 25, 2018 Summary slides based on Elementary Number Theory and its applications by Kenneth Rosen and The Theory of Numbers by Ivan Niven, Herbert Zuckerman, and Hugh Montgomery.

More information

4 Linear Recurrence Relations & the Fibonacci Sequence

4 Linear Recurrence Relations & the Fibonacci Sequence 4 Linear Recurrence Relations & the Fibonacci Sequence Recall the classic example of the Fibonacci sequence (F n ) n=1 the relations: F n+ = F n+1 + F n F 1 = F = 1 = (1, 1,, 3, 5, 8, 13, 1,...), defined

More information