Exam 2 Solutions. In class questions

Size: px
Start display at page:

Download "Exam 2 Solutions. In class questions"

Transcription

1 Math 5330 Spring 2018 Exam 2 Solutions In class questions 1. (15 points) Solve the following congruences. Put your answer in the form of a congruence. I usually find it easier to go from largest to smallest modulus. (a) x 5 pmod 21q x 6 pmod 25q Solution: Starting with x 6 pmod 25q, we have x 6 ` 25k 5 pmod 21q, which reduces to 4k 1 20 pmod 21q, so k 5 pmod 21q. Next, k 5 ` 21m so x 6 ` 25p5 ` 21mq 131 ` 525m. Thus, x 131 pmod 525q. If we use the first congruence first, then x 5 ` 21k 6 pmod 25q and we can try to do something clever like write 21k as 4k or just convert to a Diophantine equation: 21k 1`25j so k j` 1`4j 1`4j. We can write y or 21y 1`4j Ñ j 5y ` y 1. Setting y 1 gives j 5, k 6. More to the point, k 6 ` 25n 4 so x 5 ` 21p6 ` 25nq 131 ` 525n or x 131 pmod 525q. (b) x 5 pmod 7q x 2 pmod 12q x 8 pmod 13q Solution: Again, I ll start with the largest congruence. We have x 8`13k 2 pmod 12q, or k 6 6 pmod 12q. This means x 8 ` 13p6 ` 12jq 86 ` 156j 5 pmod 7q. Reducing, 2j 3 10 pmod 7q, or j 5 ` 7m. Thus, x 86 ` 156p5 ` 7mq 866 ` 1092m. We have x 866 pmod 1092q. As an aside, given an answer, you can check it. That is, you can check that x 866 is congruent to 5 modulo 7, 2 modulo 12, and 8 modulo (20 points) This problem considers the range of Euler s φ function. Note 1 is the only odd number in the range (φpnq 3 has no solutions, for example. It turns out not all even numbers are in the range either, with 14 being the smallest number with φpnq 14 having no solutions. Here, we show that 76 is not in the range. We proceed in steps. (a) Recall that if p n, then p 1 φpnq. For which primes p does p 1 divide 76? Solution: The divisors of are 1, 2, 4, 19, 38 and 76. Adding 1 gives 2, 3, 5, 20, 39, 77. Selecting the primes gives p 2, 3, 5 as primes with p 1 dividing 76.

2 Page 2 (b) If p 2 n then ppp 1q φpnq. For which primes p does ppp 1q divide 76? Solution: Since we need p 1 to be a possible divisor of 76, the only choices are 2, 3, 5. Of these, 3 and 5 do not divide 76 leaving only 2. (c) Use parts (a) and (b) to show φpnq 76 has no solutions. There might still be several cases to check. Solution: One approach: By parts (a) and (b), we must have n 2 a 3 b 5 c where only a can be larger than 1, and b, c could possibly be 0. If c 1 then n 5m so φpnq 4φpmq 76 meaning φpmq 19, an odd number, so this can t happen, and n 2 a or n 3 2 a. In these cases, φpnq 2 a 1 or φpnq 2 2 a 1 2 a. Either way, φpnq is a power of 2 but 76 is not a power of 2 so there are no solutions. An alternative approach is to ask how 19 gets to be a factor of φpnq. There are only two ways: Either 19 2 divides n or p n for some p with p 1 being a multiple of 19. But the only primes that can divide n by part (a) are 2, 3, 5, and these don t have the desired property so again there are no solutions. A proof from the class that was very nice: Again by parts (a), (b), n 2 a 3 b 5 c with a ď 3, b, c ď 1. The largest φpnq could possibly be is φp q ă 76 so there are no solutions. (d) Find another even m different from 14 and 76 for which φpnq m has no solutions. Hint: m 2p sometimes works. Solution: In fact, if 2p ` 1 is not prime then φpnq 2p has no solution n. The reason: The divisors of 2p are 1, 2, p, 2p, which means the only possible prime divisors of n would be 2, 3, p ` 1, 2p ` 1. But p ` 1 is even, and if 2p ` 1 is not prime, this only leaves 2 and 3 as possible prime divisors of n. As in part (c), this means φpnq must be a power of 2 and 2p is not a power of 2 so there are no solutions n. Numbers of this form (where 2p ` 1 is not prime) are p 7 (giving the 14 mentioned above), 13, 17, 19, 31,... leading to m values of 14, 26 (the most common answer on the exam), 38, 62,...

3 Page 3 3. (15 points) Consider the number n ˆ 109. (a) How many steps of the p 1 method are needed to factor n? Why? Solution: If p 11 then p 1 10, a divisor of 5! so it should take 5 steps. One might ask about the other prime, q 109. In this case, In order to pick up the second and third factors of 3, we would need k 9. that is, q 1 divides 9! but not 8! so we really should factor n in 5 steps. In fact, I did the calculation: 2 1! 2, 2 2! 4, 2 3! 64, 2 4! 808, 2 5! 826. If we subtract 1 from each of these and find the greatest common divisor of the result with 1111 we get 1, 1, 1, 1, 11, so we factor the number in 5 steps. (b) How many steps of Fermat s method are need to factor n? (Use x 0 r? 1199s 35.) Solution: We need px yqpx ` yq 11 ˆ 109 so x y 11, x ` y 109 Ñ 2x 120. Thus, x 60. We check x 35, x 36,..., x 60, so it takes = 26 steps. One person actually applied Fermat s method, factoring 1199 in 26 steps. (c) Fill out the following table, where a k a 2 k 1 ` 1 pmod 11q for each k. k a k a k{ a k a k{ Based on the table, how many steps does the rho method take to factor n? Explain. Solution: Based on the 0 s in the bottom line the rho method takes 8 steps (or 4 if one does double steps or counts only the steps where a subtraction/gcd is performed). The reason what the table shows is that a 8 a 4 0 pmod 11q, so when calculating gcdpa 8 a 4, nq this number will be divisible by 11. I did check: Here is the table with entries modulo 1199 rather than 11: k a k a k{ a k a k{ gcd

4 Page 4 Extra credit. 4. (5 points) Find the largest number m for which p 4 1 pmod mq for all primes p ą 5. Solution: One person noted that , ˆ 61. This puts 240 as the largest possibility for m. To actually prove that m 240 we need to prove that p 4 1 pmod 240q for every prime p ą 5. To that end, note that for p ą 5, p pmod 5q by Fermat s Little Theorem. This means 5 m. Similarly, p pmod 3q, so p 4 1 pmod 3q, and 3 m. Finally, p 4 1 pp 1qpp ` 1qpp 2 ` 1q, the product of three even numbers. Moreover, one of two consecutive even numbers is divisible by 4, giving another factor of 2. This means 16 m. Putting these together, m is divisible by 16, 3, and 5, so m is divisible by 240, showing that m (5 points) We call b the inverse of a modulo n if ab 1 pmod nq. (a) If a is relatively prime to n prove that the inverse of a is a φpnq 1 pmod nq. Solution: One of the easiest extra credit problems you will find! Let b a φpnq 1. Then ab a φpnq 1 pmod nq, as desired. (b) Use the binary squaring method and part a to find the inverse of 23 modulo 100. Solution: φp100q φp25qφp4q 20 ˆ 2 40, so by part (a), we want pmod 100q. The calculation goes like this: exponent value so ˆ 23 2 ˆ 23 4 ˆ ˆ 29 ˆ 41 ˆ pmod 100q. That is, the inverse of 23 is (6 points) Consider the first 10 odd primes: 3, 5,..., 31. (a) In what order do these primes appear when using the p 1 method? Hint: 3 appears first (after two steps). Solution: This was actually fairly straightforward. For each p, figure out k so p 1 divides k!. The only minor points: a prime like 17 has p 1 16 and it takes prime till 6! to get enough 2 s. k-value

5 Page 5 (b) In what order do these primes appear when using the rho method? Hint: 3 still appears first (after two steps). Solution: This is more involved that for the p 1 method. I calculated the first several x-values: x 1 2, x 2 5, x 3 26, x 4 677, x ` 1 and x 6 p677 2 ` 1q 2 ` 1. Now x 2 x 1 3, x 4 x and x 6 x 3 p677 2`1q2 52 p qp677 2`6q I found divisors 5, 7, 31 and 97 here. For the rest of the primes, I just made out charts as in problem 3(c). prime I got the following table. steps (4 points) Prove that φpnq 2 32 has no odd solutions n, though there are even solutions. Hint: If p divides n, show that p must be a Fermat number. Also, the fifth Fermat number, F 5 is not prime. Solution: I think this is a cute problem. Since φpnq is a power of 2, the only possible prime divisors of n are primes with p 1 being a power of 2, or p 1 ` 2 k for some k. We talked about these in class a tiny bit they are called Fermat numbers, and for a Fermat number to be prime, you need the exponent to be a power of 2. The following are Fermat primes: ` 1, ` 1, ` 1, ` 1 and ` 1. Euler showd that the next one, 2 32 ` 1 is not prime. Next, n can t be divisible by the square of an odd prime because that prime would have to divide φpnq in that case, so these primes can only occur to the first power. But even if we multiply them all together, φp q ă Thus, there are no odd solutions. Note that there are lots of even solutions: n 2 33 works, as does various products of Fermat primes times appropriate powers of 2.

6 Page 6 Take Home Exam Questions 1. (15 points) This problem concerns numbers of the form T n 3 n 2 n. Have a look at the notes related to Mersenne numbers and the notes on congruences for help with this question. (a) How many vanes of n can you find for which T n is prime? Solution: I checked values of n ď 10, 000 and found the values n: 2, 3, 5, 17, 29, 31, 53, 59, 101, 277, 647, 1061, 2381, 2833, 3613, 3853, 3929, 5297, A student in the class mentioned that this sequence can be found in the On- Line Encyclopedia of Integer Sequences, which lists several more values: 90217, , , , , , , That cite notes that these are really values for which T n is a probable prime, with T n proved to be prime for only those values of n ă That is, it has not been currently proven that T is prime. (b) Use the fact that 3 n 2 n pmod T n q to show that T n divides T m n for all positive integers m and n. Solution: Since T n 3 n 2 n, 3 n 2 n pmod T n q. Raising this to the m th power, 3 mn 2 mn pmod T n q, or 3 mn 2 mn T mn 0 pmod T n q. Thus, T n T mn. (c) Prove that T n is prime only when n is prime. Solution: If n is not prime, say n km with k, m ą 1 then T n T km is divisible by T m. We should rule out the possibility that T m 1 or T m T n. This follows from the fact that T m`1 3T m ` 2 m, showing that T m ě 3 m 1 ą 1 for all m ě 2. (d) Use paper/pen or pencil/calculator (Mathematica, Maple, etc not allowed) and the binary squaring algorithm to show that 2 T 7 1 ı 1 pmod T 7 q. (Showing T 7 is not prime.) Solution: We have T ` 8 ` 2 ` 1. We have k k with the bottom row being congruences modulo So ˆ2 8ˆ ˆ 256 ˆ pmod 2059q. Since we did not get 1, T 7 is not prime.

7 Page 7 2. (20 points) This problem deals with the congruence x 2 1 pmod nq. (a) When p is an odd prime, prove that the congruence x 2 1 pmod pq has exactly two solutions. Solution: The key property is that if p is a prime and p mk then p m or p k. In our case, if x 2 1 pmod pq then p x 2 1, so p px 1qpx ` 1q. Thus, p x 1 or p x ` 1. In the first case, x 1 pmod pq, in the second, x 1 p 1 pmod pq, and we have exactly two solutions. (b) Use the Chinese Remainder Theorem and the fact that ˆ 41 to solve the congruence x 2 1 pmod 451q. That is, use solutions to x 2 1 pmod 11q and x 2 1 pmod 41q to build solutions modulo 451. You should get 4 solutions, Mathematica, Maple, Excel, etc are not allowed. Solution: Since ˆ 41, by the" Chinese Remainder * Theorem, x 2 1 x pmod 451q is equivalent to the system 2 1 pmod 11q x 2. By part (a), each 1 pmod 41q of these congruences has two solutions, so we get four systems: x 1 pmod 11q x 1 pmod 11q, x 1 pmod 41q x 1 pmod 41q, x 1 pmod 11q x 1 pmod 11q, x 1 pmod 41q x 1 pmod 41q. The first system has solution x 1 pmod 451q and the last one has solution x pmod 451q. This leaves us with the middle two. For the second, if we start with x 1 pmod 41q, then we have x 1 ` 41k 1 pmod 11q, or 8k 9 pmod 11q. I rewrote this 3k 9 pmod 11q so k 3 8 pmod 11q. Thus, x 1`41p8`11mq 329`451m so x 329 pmod 305q. A cute trick for getting the last solution: If x is a solution, then x must be as well, so the other solution is x pmod 451q. Without the trick, x 1 ` 41k 1 pmod 11q gives 8k 2 pmod 11q. I divided by 2 and then multiplied by 3 to get k 3 pmod 11q, so x 1 ` 41p3 ` 11mq 122 ` 451m, as expected. There are four solutions: 1, 122, 329, 451. I used tricks to solve these problems, but the tricks are not needed. For example, 8k 9 pmod 11q is equivalent to 8k ` 11j 9 so by Euler s method, k 1 j ` 1 3j which leads us to 8i ` 3j 1 or j 2i ` 1 2i. Selecting i gives j 3 and k 3. That is, k 3 8 pmod 11q, as before.

8 Page 8 (c) How many solutions does the congruence x 2 1 pmod 4961q have? Justify your answer. Again, you are not allowed to use symbolic calculators or Excel. Solution: " As with* the previous problem, this one is equivalent to a system x 2 1 pmod 121q x 2. The bottom congruence has exactly two solutions; we 1 pmod 41q need to know how many solutions the top one has. If x 2 1 pmod 121q, then 121 x 2 1, or 121 px 1qpx ` 1q. This means 11 divides the product, so 11 x 1 or 11 x ` 1. Now 11 cannot divide both terms (if it did, then 11 would have to divide px ` 1q px 1q 2.) This means that which ever term is divisible by 11 is also divisible by 121. Thus, we have only two solutions to the congruence x 2 1 pmod 121q, and the original congruence will have 2 ˆ 2 4 solutions. There is one last issue: do these four solutions really have to be different? One way to check is to actually find them. Two are easy: 1 pmod 4961q or 1, The solution with x 1 pmod 121q, x 40 pmod 41q is not too hard to find: x 1 ` 121k 1 pmod 41q ñ 2k 2 pmod 41q so k 1 and x 122 The other will be its negative, -122 or Thus, we have 1, 122, 4839, 4960, four distinct solutions modulo Alternatively, we could give a proof as I do below. (d) Prove that if n km where m ą 2, k ą 2 and gcdpm, kq 1, then x 2 1 pmod nq has at least 4 solutions. Hint: use the Chinese Remainder Theorem. Solution: By the Chinese " Remainder* Theorem, then x 2 1 pmod nq is equivalent to the system 2 1 pmod kq x x 2. Since m ą 2, k ą 2, these congruences 1 pmod mq have at least two solutions: x 1. That is, 1 and -1 are not congruent modulo m or k because if they were, then their difference, 2, would have to be divisible by m or k. Thus, we have the solutions x 1 1 and x 2 km 1, which are different. What about x 3 with x 3 1 pmod mq, x 3 1 pmod kq or x 4 with x 4 1 pmod mq, x 4 1 pmod kq? In this case, x 3 x 1, x 2 because x 3 ı 1 pmod kq as x 1 is, and x 3 ı 1 pmod mq like x 2. Similarly, x 4 is distinct from both x 1 and x 2. Finally, x 3 x 4 because x 3 x 4 2 pmod mq so x 3 ı x 4 pmod mq. (e) If n 2p, where p is an odd prime, how many solutions does x 2 1 pmod nq have? What if n 4p? Solution: Since x 2 1 pmod 2q has a single solution x 1 pmod 2q (that is, x must be odd) and x 2 1 pmod pq has two, the Chinese Remainder Theorem says we have exactly 1 ˆ 2 2 solutions. They are 1 and 2p 1, of course.

9 Page 9 For x 2 1 pmod 4pq, we get two solutions from p and two more from 4: just trying x 0, 1, 2, 3, we see that only 1 and 3 are solutions x 2 1 pmod 4q, so we are back to 4 solutions. These solutions can be given explicitly: 1, 2p 1, 2p ` 1, 4p 1. I probably should have asked about x 2 1 pmod 8pq, which has 8 solutions, and x 2 1 pmod 2 k pq for k ą 3, which also has 8 solutions. That is, as k increases, we have two solutions for k 0, 1, four solutions for k 2 and 8 solutions for all k ě (15 points) This problem introduces a suped up version of Fermats Little theorem. It is the basis for the Miller-Rabin test (given in part c). Let p be an odd prime, and suppose that p 2 k m ` 1, where m is odd. For example, if p 47, then p ` 1, if p 61, then p ` 1, and if p 127, then p ` 1. In these three cases, k 1, m 23 for 47, k 2, m 15 for 61, k 7, m 1 for 127. Given an integer a, with p ffl a, consider the sequence a m, a 2m, a 4m,, a 2km pmod pq. Here are some examples: Let p ` 1. If a 2, then , pmod 41q, pmod 41q, pmod 41q. The sequence is 32, -1, 1, 1. If we had used a 3, then a 5 38, a 10 9, a 20 1, a 40 1, and the sequence would be 38, 9, -1, 1. If we had picked a 10, the sequence would have been 1, 1, 1, 1. Note here that -1 means p 1. Also, one can calculate a m by the binary squaring algorithm, and all subsequent powers are obtained by squaring previous things in the sequence. (a) What is the sequence a m, a 2m, a 4m,, a 2km pmod pq if a 2, p 113? Solution: ` 2 4 ˆ 7, so k 4, m 7. We have pmod 113q, pmod 113q, pmod 113q. The sequence is 15, -1, 1, 1, 1. (b) What is the sequence a m, a 2m, a 4m,, a 2km pmod pq if a 3, p 113? Solution: Here, , , , pmod 113q, so we get 40, 18, 98, -1, 1.

10 Page 10 (c) For general a and p with p ffl a, prove that either the sequence consists of all 1 s, or that the sequence has the form x 0, x 1,..., x j, 1, 1,..., 1. What this says is that the sequence a m, a 2m, a 4m,, a 2km pmod pq must end with 1, and if the sequence is not all 1 s, then it must contain -1. Hint: If we let the sequence be x 0, x 1,..., x k, then Fermat s Little Theorem tells us that x k 1. (Why?) Since each x i is x 2 i 1, we can use problem 2a and work backwards from x k. An alternative might be to use an extension of a factorization like a 40 1 pa 5 1qpa5`1qpa10`1qpa20`1q, which is divisible by 41 if gcdpa, 41q 1. Solution: Following the second hint, if A a m then a p 1 A 2k so a p 1 1 A 2k 1 pa 1qpA ` 1qpA 2 ` 1q pa 2k 1 ` 1q. Since p a p 1 1, p has to divide one of these terms. If it is the first term, then a m 1 pmod pq, and the sequence is all 1 s. If p A 2j ` 1, then x j 1 pmod pq, and the sequence becomes 1 s after that. Alternatively, x k 2 2k m 2 p 1 1 pmod pq, and x 2 k 1 x k pmod pq, so x 2 k 1 1 pmod pq. By problem 2 of the take home, this means x k 1 1 pmod pq. If x k 1 1, then our sequence is x 0,..., x k 2, 1, 1. The alternative is that x k 1 1 pmod pq. Now x 2 k 2 1 pmod pq, so x k 2 1 pmod pq. One possibility is that the sequence of x s is all 1 s. If this is not the case, then some last x j is 1, and the previous x j 1 is not 1. In this case, x 2 j 1 x j 1 pmod pq, so x j 1 1 pmod pq. Since we have said x j 1 ı 1 pmod pq, we are left with x j 1 1. (d) Any number n which does not have the property above for some a is not prime. For example, if n ` 1, then pmod 341q, pmod 341q, so the sequence is 32, 1, 1, which does not pass through -1 to get to 1. This means 341 is not prime, even though it is a base 2 pseudoprime. It can be shown that for every composite number n, there is an a for which either x k ı 1 pmod nq or the sequences of x s does not pass through -1 to get to 1. Find the smallest values of a for the numbers n 561, a Carmichael number, and n Solution: For n ˆ 35 ` 1, we have , , , pmod 561q. The sequence is 263, 166, 67, 1, 1, which does not pass through -1 so 561 can t be prime by this test, even though it is a base 2 pseudoprime. If n ˆ ` 1, picking various values of a we have the table

11 Page 11 a x 0 x 1 x so n passes the test for a 2, 3, 4 but fails for a 5. Some extra credit problems, if you are interested. 4. (3 points) With regard to question 1, prove that if q is a prime divisor of T p, where p is a prime, then q 1 pmod pq. 5. (10 points) Related to question 1, suppose we define R n 2 n ` 3 n and S n 2n ` 3 n, 5 when n is odd. How much of problem 1 can we do? That is, (a) How many n can you find with R n prime? With S n prime? Solution: I only found 1, 2, 4 for R n. With S n there are lots of examples. I found 10 with n ă These are n 3, 7, 11, 83, 149, 223, 599, 647, 1373, (b) Does R n or S n have a multiplicative property? That is, does R n always divide R mn? Does S n always divide S mn? Solution: I don t know of a divisibility property for R n but there is one for S n provided indices are odd numbers. (c) Can you give a necessary condition on n for R n to be prime? For S n to be prime? Solution: I won t prove anything here, but n must be a power of 2 for R n to be prime, and n must be prime for S n to be prime. (d) Must prime divisors of R p or S p congruent to 1 modulo p? 6. (2 points) With regard to problem 2, prove that if p is an odd prime then for all integers n ě 1, x 2 1 pmod p n q has exactly two solutions. You did the case n 1 in 2a. 7. (4 points) Related to problem 3 on the exam, if n pq, where p ą q are two odd primes, find conditions on p, q, and a so that n does not fail the compositeness test in question

12 Page 12 3, as described in 3d. That is, the sequences of x s is either all 1 s or passes through -1 on the way to 1. Use this to find numbers n pq for a 2, a 3, a (4 points) Possibly related to the previous question: (a) Suppose that p and q both divide 2 n 1 and that n p 1, n q 1. Prove that m pq is a base 2 pseudoprime. for example, , and 10 p11 1q, 10 p31 1q so 11 ˆ is a base 2 pseudoprime. (b) How large of a base 2 pseudoprime can you find using this idea? You need m ą 341 for credit and I will give an extra point to the largest base 2 pseudoprime found by this method. 9. (8 points) This problem is related to our factoring homework. Let ωpnq be the number of distinct prime divisors of n. In class, I stated that on average, ωpnq «lnplnpnqq`.261, and this matched our results fairly well on our factoring homework. (a) Knowing how many distinct prime factors a random number has gives information on its largest prime divisor. Suppose that n is an average number with ωpnq distinct prime divisors. Let p be the largest prime divisor of n and suppose that n p n is also average. Then we should have ωpnq ω `1. If ωpnq lnplnpnqq`.261, p what does this tell us about the size of p? Your answer should be p «n α for some α. I have stated in class that α «.632. What I m looking for is the actual number. nÿ (b) To actually find ωpnq, first, show that tn{pu. k 1 ωpkq ÿ pďn (c) How bad of an approximation is it to replace tn{pu by n{p in the sum above? (d) There is a theorem that says ÿ 1 lnplnpnqq`.261`small error. Use this theorem p pďn and parts b, c to show that the average value of ωpkq for k ď n is approximately lnplnpnqq `.261.

Math 5330 Spring Notes Congruences

Math 5330 Spring Notes Congruences Math 5330 Spring 2018 Notes Congruences One of the fundamental tools of number theory is the congruence. This idea will be critical to most of what we do the rest of the term. This set of notes partially

More information

Elementary factoring algorithms

Elementary factoring algorithms Math 5330 Spring 018 Elementary factoring algorithms The RSA cryptosystem is founded on the idea that, in general, factoring is hard. Where as with Fermat s Little Theorem and some related ideas, one can

More information

4.4 Solving Congruences using Inverses

4.4 Solving Congruences using Inverses 4.4 Solving Congruences using Inverses Solving linear congruences is analogous to solving linear equations in calculus. Our first goal is to solve the linear congruence ax b pmod mq for x. Unfortunately

More information

1 Divisibility Basic facts about divisibility The Division Algorithm... 3

1 Divisibility Basic facts about divisibility The Division Algorithm... 3 Contents 1 Divisibility 3 1.1 Basic facts about divisibility................................ 3 1.2 The Division Algorithm.................................. 3 1.3 Greatest Common Divisor and The Euclidean

More information

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today? 2 Mod math Modular arithmetic is the math you do when you talk about time on a clock. For example, if it s 9 o clock right now, then it ll be 1 o clock in 4 hours. Clearly, 9 + 4 1 in general. But on a

More information

Number Theory Math 420 Silverman Exam #1 February 27, 2018

Number Theory Math 420 Silverman Exam #1 February 27, 2018 Name: Number Theory Math 420 Silverman Exam #1 February 27, 2018 INSTRUCTIONS Read Carefully Time: 50 minutes There are 5 problems. Write your name neatly at the top of this page. Write your final answer

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

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CHAPTER 6. Prime Numbers. Definition and Fundamental Results CHAPTER 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results 6.1. Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and the only positive divisors of p are 1 and p. If n

More information

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2:

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2: 03 17 08 3 All about lines 3.1 The Rectangular Coordinate System Know how to plot points in the rectangular coordinate system. Know the

More information

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is

p = This is small enough that its primality is easily verified by trial division. A candidate prime above 1000 p of the form p U + 1 is LARGE PRIME NUMBERS 1. Fermat Pseudoprimes Fermat s Little Theorem states that for any positive integer n, if n is prime then b n % n = b for b = 1,..., n 1. In the other direction, all we can say is that

More information

A Guide to Arithmetic

A Guide to Arithmetic A Guide to Arithmetic Robin Chapman August 5, 1994 These notes give a very brief resumé of my number theory course. Proofs and examples are omitted. Any suggestions for improvements will be gratefully

More information

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0). LARGE PRIME NUMBERS 1. Fast Modular Exponentiation Given positive integers a, e, and n, the following algorithm quickly computes the reduced power a e % n. (Here x % n denotes the element of {0,, n 1}

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

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

Chapter 1 Review of Equations and Inequalities

Chapter 1 Review of Equations and Inequalities Chapter 1 Review of Equations and Inequalities Part I Review of Basic Equations Recall that an equation is an expression with an equal sign in the middle. Also recall that, if a question asks you to solve

More information

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. Chapter 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. If n > 1

More information

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1 MATH 4400 SOLUTIONS TO SOME EXERCISES 1.1.3. If a b and b c show that a c. 1. Chapter 1 Solution: a b means that b = na and b c that c = mb. Substituting b = na gives c = (mn)a, that is, a c. 1.2.1. Find

More information

Table of Contents. 2013, Pearson Education, Inc.

Table of Contents. 2013, Pearson Education, Inc. Table of Contents Chapter 1 What is Number Theory? 1 Chapter Pythagorean Triples 5 Chapter 3 Pythagorean Triples and the Unit Circle 11 Chapter 4 Sums of Higher Powers and Fermat s Last Theorem 16 Chapter

More information

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) 1 Euclid s Algorithm Euclid s Algorithm for computing the greatest common divisor belongs to the oldest known computing procedures

More information

Math 261 Spring 2014 Final Exam May 5, 2014

Math 261 Spring 2014 Final Exam May 5, 2014 Math 261 Spring 2014 Final Exam May 5, 2014 1. Give a statement or the definition for ONE of the following in each category. Circle the letter next to the one you want graded. For an extra good final impression,

More information

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions MATH 11/CSCI 11, Discrete Structures I Winter 007 Toby Kenney Homework Sheet 5 Hints & Model Solutions Sheet 4 5 Define the repeat of a positive integer as the number obtained by writing it twice in a

More information

AN ALGEBRA PRIMER WITH A VIEW TOWARD CURVES OVER FINITE FIELDS

AN ALGEBRA PRIMER WITH A VIEW TOWARD CURVES OVER FINITE FIELDS AN ALGEBRA PRIMER WITH A VIEW TOWARD CURVES OVER FINITE FIELDS The integers are the set 1. Groups, Rings, and Fields: Basic Examples Z := {..., 3, 2, 1, 0, 1, 2, 3,...}, and we can add, subtract, and multiply

More information

Take the Anxiety Out of Word Problems

Take the Anxiety Out of Word Problems Take the Anxiety Out of Word Problems I find that students fear any problem that has words in it. This does not have to be the case. In this chapter, we will practice a strategy for approaching word problems

More information

SOLUTIONS Math 345 Homework 6 10/11/2017. Exercise 23. (a) Solve the following congruences: (i) x (mod 12) Answer. We have

SOLUTIONS Math 345 Homework 6 10/11/2017. Exercise 23. (a) Solve the following congruences: (i) x (mod 12) Answer. We have Exercise 23. (a) Solve the following congruences: (i) x 101 7 (mod 12) Answer. We have φ(12) = #{1, 5, 7, 11}. Since gcd(7, 12) = 1, we must have gcd(x, 12) = 1. So 1 12 x φ(12) = x 4. Therefore 7 12 x

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

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

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

Solutions to Problem Set 4 - Fall 2008 Due Tuesday, Oct. 7 at 1:00 Solutions to 8.78 Problem Set 4 - Fall 008 Due Tuesday, Oct. 7 at :00. (a Prove that for any arithmetic functions f, f(d = f ( n d. To show the relation, we only have to show this equality of sets: {d

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

More information

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory. CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L06, Steve/Courses/2011/S2/CSS322/Lectures/number.tex,

More information

Computing Quotient and Remainder. Prime Numbers. Factoring by Trial Division. The Fundamental Theorem of Arithmetic

Computing Quotient and Remainder. Prime Numbers. Factoring by Trial Division. The Fundamental Theorem of Arithmetic A Crash Course in Elementary Number Theory L. Felipe Martins Department of Mathematics Cleveland State University l.martins@csuohio.edu Work licensed under a Creative Commons License available at http://creativecommons.org/licenses/by-nc-sa/3.0/us/

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

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

Chapter 8. Introduction to Number Theory

Chapter 8. Introduction to Number Theory Chapter 8 Introduction to Number Theory CRYPTOGRAPHY AND NETWORK SECURITY 1 Index 1. Prime Numbers 2. Fermat`s and Euler`s Theorems 3. Testing for Primality 4. Discrete Logarithms 2 Prime Numbers 3 Prime

More information

ORDERS OF ELEMENTS IN A GROUP

ORDERS OF ELEMENTS IN A GROUP ORDERS OF ELEMENTS IN A GROUP KEITH CONRAD 1. Introduction Let G be a group and g G. We say g has finite order if g n = e for some positive integer n. For example, 1 and i have finite order in C, since

More information

Math 324, Fall 2011 Assignment 7 Solutions. 1 (ab) γ = a γ b γ mod n.

Math 324, Fall 2011 Assignment 7 Solutions. 1 (ab) γ = a γ b γ mod n. Math 324, Fall 2011 Assignment 7 Solutions Exercise 1. (a) Suppose a and b are both relatively prime to the positive integer n. If gcd(ord n a, ord n b) = 1, show ord n (ab) = ord n a ord n b. (b) Let

More information

LARGE PRIME NUMBERS. In sum, Fermat pseudoprimes are reasonable candidates to be prime.

LARGE PRIME NUMBERS. In sum, Fermat pseudoprimes are reasonable candidates to be prime. LARGE PRIME NUMBERS 1. Fermat Pseudoprimes Fermat s Little Theorem states that for any positive integer n, if n is prime then b n % n = b for b = 1,..., n 1. In the other direction, all we can say is that

More information

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6 Math 131 notes Jason Riedy 6 October, 2008 Contents 1 Modular arithmetic 2 2 Divisibility rules 3 3 Greatest common divisor 4 4 Least common multiple 4 5 Euclidean GCD algorithm 5 6 Linear Diophantine

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

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

A Readable Introduction to Real Mathematics

A Readable Introduction to Real Mathematics Solutions to selected problems in the book A Readable Introduction to Real Mathematics D. Rosenthal, D. Rosenthal, P. Rosenthal Chapter 7: The Euclidean Algorithm and Applications 1. Find the greatest

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

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2 Contents 1 Recommended Reading 1 2 Public Key/Private Key Cryptography 1 2.1 Overview............................................. 1 2.2 RSA Algorithm.......................................... 2 3 A Number

More information

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 CS 70 Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes wish to work over a

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

Number Theory Homework.

Number Theory Homework. Number Theory Homewor. 1. The Theorems of Fermat, Euler, and Wilson. 1.1. Fermat s Theorem. The following is a special case of a result we have seen earlier, but as it will come up several times in this

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

Quadratic Equations Part I

Quadratic Equations Part I Quadratic Equations Part I Before proceeding with this section we should note that the topic of solving quadratic equations will be covered in two sections. This is done for the benefit of those viewing

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

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

Number Theory Notes Spring 2011

Number Theory Notes Spring 2011 PRELIMINARIES The counting numbers or natural numbers are 1, 2, 3, 4, 5, 6.... The whole numbers are the counting numbers with zero 0, 1, 2, 3, 4, 5, 6.... The integers are the counting numbers and zero

More information

Definition For a set F, a polynomial over F with variable x is of the form

Definition For a set F, a polynomial over F with variable x is of the form *6. Polynomials Definition For a set F, a polynomial over F with variable x is of the form a n x n + a n 1 x n 1 + a n 2 x n 2 +... + a 1 x + a 0, where a n, a n 1,..., a 1, a 0 F. The a i, 0 i n are the

More information

You separate binary numbers into columns in a similar fashion. 2 5 = 32

You separate binary numbers into columns in a similar fashion. 2 5 = 32 RSA Encryption 2 At the end of Part I of this article, we stated that RSA encryption works because it s impractical to factor n, which determines P 1 and P 2, which determines our private key, d, which

More information

MATH 25 CLASS 12 NOTES, OCT Contents 1. Simultaneous linear congruences 1 2. Simultaneous linear congruences 2

MATH 25 CLASS 12 NOTES, OCT Contents 1. Simultaneous linear congruences 1 2. Simultaneous linear congruences 2 MATH 25 CLASS 12 NOTES, OCT 17 2011 Contents 1. Simultaneous linear congruences 1 2. Simultaneous linear congruences 2 1. Simultaneous linear congruences There is a story (probably apocryphal) about how

More information

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. 2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say

More information

IRREDUCIBILITY TESTS IN F p [T ]

IRREDUCIBILITY TESTS IN F p [T ] IRREDUCIBILITY TESTS IN F p [T ] KEITH CONRAD 1. Introduction Let F p = Z/(p) be a field of prime order. We will discuss a few methods of checking if a polynomial f(t ) F p [T ] is irreducible that are

More information

MATH 145 Algebra, Solutions to Assignment 4

MATH 145 Algebra, Solutions to Assignment 4 MATH 145 Algebra, Solutions to Assignment 4 1: a) Find the inverse of 178 in Z 365. Solution: We find s and t so that 178s + 365t = 1, and then 178 1 = s. The Euclidean Algorithm gives 365 = 178 + 9 178

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

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

Elementary Number Theory MARUCO. Summer, 2018

Elementary Number Theory MARUCO. Summer, 2018 Elementary Number Theory MARUCO Summer, 2018 Problem Set #0 axiom, theorem, proof, Z, N. Axioms Make a list of axioms for the integers. Does your list adequately describe them? Can you make this list as

More information

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011 Math 31 Lesson Plan Day 5: Intro to Groups Elizabeth Gillaspy September 28, 2011 Supplies needed: Sign in sheet Goals for students: Students will: Improve the clarity of their proof-writing. Gain confidence

More information

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6 CS 70 Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6 1 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes

More information

22. The Quadratic Sieve and Elliptic Curves. 22.a The Quadratic Sieve

22. The Quadratic Sieve and Elliptic Curves. 22.a The Quadratic Sieve 22. The Quadratic Sieve and Elliptic Curves 22.a The Quadratic Sieve Sieve methods for finding primes or for finding factors of numbers are methods by which you take a set P of prime numbers one by one,

More information

Homework #2 solutions Due: June 15, 2012

Homework #2 solutions Due: June 15, 2012 All of the following exercises are based on the material in the handout on integers found on the class website. 1. Find d = gcd(475, 385) and express it as a linear combination of 475 and 385. That is

More information

Lecture 11 - Basic Number Theory.

Lecture 11 - Basic Number Theory. Lecture 11 - Basic Number Theory. Boaz Barak October 20, 2005 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that a divides b,

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

Some Review Problems for Exam 1: Solutions

Some Review Problems for Exam 1: Solutions Math 3355 Fall 2018 Some Review Problems for Exam 1: Solutions Here is my quick review of proof techniques. I will focus exclusively on propositions of the form p q, or more properly, x P (x) Q(x) or x

More information

MATH 115, SUMMER 2012 LECTURE 12

MATH 115, SUMMER 2012 LECTURE 12 MATH 115, SUMMER 2012 LECTURE 12 JAMES MCIVOR - last time - we used hensel s lemma to go from roots of polynomial equations mod p to roots mod p 2, mod p 3, etc. - from there we can use CRT to construct

More information

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics A Guide To RSA by Robert Yates. Topics Introduction...01/09 What is RSA...01/09 Mod-Exponentiation...02/09 Euler's Theorem...03/09 RSA Algorithm...08/09 RSA Security...09/09 Introduction Welcome to my

More information

Math Circles Cryptography

Math Circles Cryptography Math Circles Cryptography Nickolas Rollick nrollick@uwaterloo.ca March 7, 2018 Introduction Last time, we talked about public key cryptography, an idea from the 1970s that opened the door for encryption

More information

Ma/CS 6a Class 4: Primality Testing

Ma/CS 6a Class 4: Primality Testing Ma/CS 6a Class 4: Primality Testing By Adam Sheffer Send anonymous suggestions and complaints from here. Email: adamcandobetter@gmail.com Password: anonymous2 There aren t enough crocodiles in the presentations

More information

Name: Mathematics 1C03

Name: Mathematics 1C03 Name: Student ID Number: Mathematics 1C03 Day Class Instructor: M. Harada Duration: 2.5 hours April 2018 McMaster University PRACTICE Final Examination This is a PRACTICE final exam. The actual final exam

More information

Exam 1 Solutions. Solution: The 16 contributes 5 to the total and contributes 2. All totaled, there are 5 ˆ 2 10 abelian groups.

Exam 1 Solutions. Solution: The 16 contributes 5 to the total and contributes 2. All totaled, there are 5 ˆ 2 10 abelian groups. Math 5372 Spring 2014 Exam 1 Solutions 1. (15 points) How many abelian groups are there of order: (a) 16 For any prime p, there are as many groups of order p k as there are partitions of k. The number

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

EULER S THEOREM KEITH CONRAD

EULER S THEOREM KEITH CONRAD EULER S THEOREM KEITH CONRAD. Introduction Fermat s little theorem is an important property of integers to a prime modulus. Theorem. (Fermat). For prime p and any a Z such that a 0 mod p, a p mod p. If

More information

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography CIS 6930/4930 Computer and Network Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography 1 Review of Modular Arithmetic 2 Remainders and Congruency For any integer a and any positive

More information

7.2 Applications of Euler s and Fermat s Theorem.

7.2 Applications of Euler s and Fermat s Theorem. 7.2 Applications of Euler s and Fermat s Theorem. i) Finding and using inverses. From Fermat s Little Theorem we see that if p is prime and p a then a p 1 1 mod p, or equivalently a p 2 a 1 mod p. This

More information

Senior Math Circles Cryptography and Number Theory Week 2

Senior Math Circles Cryptography and Number Theory Week 2 Senior Math Circles Cryptography and Number Theory Week 2 Dale Brydon Feb. 9, 2014 1 Divisibility and Inverses At the end of last time, we saw that not all numbers have inverses mod n, but some do. We

More information

Ma/CS 6a Class 4: Primality Testing

Ma/CS 6a Class 4: Primality Testing Ma/CS 6a Class 4: Primality Testing By Adam Sheffer Reminder: Euler s Totient Function Euler s totient φ(n) is defined as follows: Given n N, then φ n = x 1 x < n and GCD x, n = 1. In more words: φ n is

More information

Notes: Pythagorean Triples

Notes: Pythagorean Triples Math 5330 Spring 2018 Notes: Pythagorean Triples Many people know that 3 2 + 4 2 = 5 2. Less commonly known are 5 2 + 12 2 = 13 2 and 7 2 + 24 2 = 25 2. Such a set of integers is called a Pythagorean Triple.

More information

A Few Primality Testing Algorithms

A Few Primality Testing Algorithms A Few Primality Testing Algorithms Donald Brower April 2, 2006 0.1 Introduction These notes will cover a few primality testing algorithms. There are many such, some prove that a number is prime, others

More information

Transposition as a permutation: a tale of group actions and modular arithmetic

Transposition as a permutation: a tale of group actions and modular arithmetic Transposition as a permutation: a tale of group actions and modular arithmetic Jeff Hooper Franklin Mendivil Department of Mathematics and Statistics Acadia University Abstract Converting a matrix from

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

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

base 2 4 The EXPONENT tells you how many times to write the base as a factor. Evaluate the following expressions in standard notation.

base 2 4 The EXPONENT tells you how many times to write the base as a factor. Evaluate the following expressions in standard notation. EXPONENTIALS Exponential is a number written with an exponent. The rules for exponents make computing with very large or very small numbers easier. Students will come across exponentials in geometric sequences

More information

Math 016 Lessons Wimayra LUY

Math 016 Lessons Wimayra LUY Math 016 Lessons Wimayra LUY wluy@ccp.edu MATH 016 Lessons LESSON 1 Natural Numbers The set of natural numbers is given by N = {0, 1, 2, 3, 4...}. Natural numbers are used for two main reasons: 1. counting,

More information

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST JAMES MCIVOR Today we enter Chapter 2, which is the heart of this subject. Before starting, recall that last time we saw the integers have unique factorization

More information

Number Theory A focused introduction

Number Theory A focused introduction Number Theory A focused introduction This is an explanation of RSA public key cryptography. We will start from first principles, but only the results that are needed to understand RSA are given. We begin

More information

SQUARE PATTERNS AND INFINITUDE OF PRIMES

SQUARE PATTERNS AND INFINITUDE OF PRIMES SQUARE PATTERNS AND INFINITUDE OF PRIMES KEITH CONRAD 1. Introduction Numerical data suggest the following patterns for prime numbers p: 1 mod p p = 2 or p 1 mod 4, 2 mod p p = 2 or p 1, 7 mod 8, 2 mod

More information

1. multiplication is commutative and associative;

1. multiplication is commutative and associative; Chapter 4 The Arithmetic of Z In this chapter, we start by introducing the concept of congruences; these are used in our proof (going back to Gauss 1 ) that every integer has a unique prime factorization.

More information

FERMAT S TEST KEITH CONRAD

FERMAT S TEST KEITH CONRAD FERMAT S TEST KEITH CONRAD 1. Introduction Fermat s little theorem says for prime p that a p 1 1 mod p for all a 0 mod p. A naive extension of this to a composite modulus n 2 would be: for all a 0 mod

More information

PMA225 Practice Exam questions and solutions Victor P. Snaith

PMA225 Practice Exam questions and solutions Victor P. Snaith PMA225 Practice Exam questions and solutions 2005 Victor P. Snaith November 9, 2005 The duration of the PMA225 exam will be 2 HOURS. The rubric for the PMA225 exam will be: Answer any four questions. You

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

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 9 February 6, 2012 CPSC 467b, Lecture 9 1/53 Euler s Theorem Generating RSA Modulus Finding primes by guess and check Density of

More information

Algebra. Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Algebra. Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed. This document was written and copyrighted by Paul Dawkins. Use of this document and its online version is governed by the Terms and Conditions of Use located at. The online version of this document is

More information

Solution Sheet (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = (i) gcd (97, 157) = 1 = ,

Solution Sheet (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = (i) gcd (97, 157) = 1 = , Solution Sheet 2 1. (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = 3. 2. (i) gcd (97, 157) = 1 = 34 97 21 157, (ii) gcd (527, 697) = 17 = 4 527 3 697, (iii) gcd (2323, 1679) =

More information

Clock Arithmetic. 1. If it is 9 o clock and you get out of school in 4 hours, when do you get out of school?

Clock Arithmetic. 1. If it is 9 o clock and you get out of school in 4 hours, when do you get out of school? Clock Arithmetic We are going to learn all about clock addition and the relationship to remainders when you divide numbers. 1 Standard Clock Addition 1. If it is 9 o clock and you get out of school in

More information

Inference and Proofs (1.6 & 1.7)

Inference and Proofs (1.6 & 1.7) EECS 203 Spring 2016 Lecture 4 Page 1 of 9 Introductory problem: Inference and Proofs (1.6 & 1.7) As is commonly the case in mathematics, it is often best to start with some definitions. An argument for

More information

3.2 Solving linear congruences. v3

3.2 Solving linear congruences. v3 3.2 Solving linear congruences. v3 Solving equations of the form ax b (mod m), where x is an unknown integer. Example (i) Find an integer x for which 56x 1 mod 93. Solution We have already solved this

More information