Institute of Information and Mathematical Sciences. Prime Number Search Algorithms

Size: px
Start display at page:

Download "Institute of Information and Mathematical Sciences. Prime Number Search Algorithms"

Transcription

1 Institute of Information and Mathematical Sciences Prime Number Search Algorithms (Mersenne Primes Search) Jun Li June, 2012

2 Contents CHAPTER 1 INTRODUCTION BACKGROUND MERSENNE PRIME STUDY HISTORY Early history [4] Modern History Recent History... 4 CHAPTER 2 METHODOLOGY DEFINITION AND THEOREMS DISTRIBUTION LAW ALGORITHMS Trial Division Sieve of Eratosthenes Pollard's (P-1) method Lucas-Lehmer Test GREAT INTERNET MERSENNE PRIME SEARCH A little bit about GIMPS How GIMPS Works GIMPS and Grid Computing CHAPTER 3 EXPERIMENT AND RESULTS LUCAS-LEHMER TEST WITH GMP AND GLUCAS Lucas-Lehmer test with GMP Glucas Lucas-Lehmer test with GMP vs Glucas Experiment conclusion UNDISCOVERED BETWEEN MERSENNE PRIMES 41ST AND 42ND Basic method Experiment Conclusion STUDY MERSENNE PRIMES ON GPU Introduction to GPU GPU Computing Experiments on GPU Conclusion CHAPTER 4 DISCUSSION AND FUTURE WORK SUMMARY OF EXPERIMENTS MEANING OF STUDY MERSENNE PRIMES FUTURE WORK REFERENCES APPENDIX A. PROGRAMS B. TABLES C. FIGURES... 43

3 Chapter 1 Introduction Although math doesn't bring excitement breakthrough very often, sometimes we can still hear the news that mathematicians discover a new super-large prime number. Those numbers are usually with a form which called Mersenne primes. 1.1 Background On April 12th, 2009, the 47th known Mersenne prime number 2 42,643,801 1 was found by Odd Magnar Strindmo, a Norwegian IT professional, through Great Internet Mersenne Prime Search (GIMPS). It was confirmed by Great Internet Mersenne Prime Search (GIMPS) project organizer George Woltman on June 7, The 47th Mersenne prime number is a 12,837,064 digit number, the second largest Mersenne prime number, which will be more than 50 kilometers if we use ordinary font size to write it down. [1] 1.2 Mersenne Prime There are some concepts and their relationship we have to be clear before we start our project: Prime Number, Mersenne Number and Mersenne Prime. Prime Number: In mathematics, a prime number, according to wolframalpha, that A positive integer that has exactly one positive integer divisor other than 1 (i.e., no factors other than 1 and itself.) [2] For example, 2, 3, 5, 7, 11 are prime numbers, as only 1 and themselves can divide them. However 4 is composite, since it has the divisors 2 and 2 in addition to 1 and 4. Usually people just call prime numbers as primes. Mersenne Number: In mathematics, a Mersenne number, named after Marin Mersenne (a French theologian and mathematician, who began the study of these numbers in the early 17th century, but known for his work on acoustics), is a number of the form, M p = 2 p 1, where p is an integer. The first few Mersenne numbers are 1, 3, 7, 15, 31, 63, 127, 255 and so on. Mersenne Prime: In mathematics, a Mersenne prime is a Mersenne number that is prime. The form is just like below, 1

4 where M p and p are primes. M p = 2 p 1, Marin Mersenne compiled a list of primes in the form of 2 p 1 (exponent p 257), but it is wrongly included M 67 and M 257 which are not primes and missed M 61, M 89 and M 107. [3] The Mersenne number is not necessarily a prime number, the following examples show very clear that Mersenne number can be a prime number or a non-prime number. Prime number:m 2 = = 3 M 3 = = 7 Non-prime number: M 4 = = Study History Mersenne prime was first proposed in order to solve perfect number. The history of searching Mersenne prime can be traced back to 350 BC. However, even till today, human beings have found only 47 Mersenne primes. Twelve of them are found before 1952 by mankind using pen and paper to calculate. The rest are found by computer Early history [4] Over 2300 years ago, Euclid, the ancient Greek mathematician, started to study a number of the form 2 p 1 (the first time people study about 2 p 1in history) when he discussed about perfect number in his book "Euclid's Elements". In the 17th century, the famous French mathematician, founder of the French Academy of Sciences, Marin Mersenne ( ), the first people who studied 2 p 1 deeply and systematically. To commemorate him, the mathematical community named the number of this form M p = 2 p 1 (M p and p are primes) as Mersenne primes. As the core issue of number theory, Mersenne number can be described as the focus of research. It has been a thought that for all n, the number in the form of 2 n 1 is a prime number. This is obviously wrong. There are new error conjectures and extrapolations have been generated during the period people keeping studied about this issue. The known results, theories and the available computational tools are closely related to of Mersenne primes research progress. The early research experience can be seen from Table l. Since Marin Mersenne stated his conjecture in 1644, it has been taken 300 years to completely resolve this conjecture. In 1947, the range given by Mersenne had been finished checking and determined a correct Mersenne prime list as follow: n=2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107 and

5 Table 1: Early History Year Discoverer Conclusion/Guess Notes 1536 Hudalricus Regius 1603 Pietro Cataldi 1640 Fermat 1644 Marin Mersenne 1738 Euler 1750 Euler Proved that = 2047 was not prime. Verified that and were both primes. Stated that when n=23, 29, 31 and 37, 2 n -1 was also prime. Proved that wrong when n=23, 37. Pietro Cataldi was Mersenne stated in the preface to his Cogitata Physica-Mathematica (1644) that the numbers 2 n -1 were prime for n = 2, 3, 5, 7, 13, 17, 19, 31, 67, 127 and 257 and were composite for all other positive integers n < 257. Proved that Pietro Cataldi was wrong when n=29. Verified that the next number on Mersenne's and Regius' lists, , was prime. It is 23*89. Correct Incorrect The list was wrong, with missing primes and composite numbers in the list Lucas Verified that was also prime Pervouchine Showed that was prime Powers Showed that and was also prime. Mersenne missed. Mersenne missed Modern History From 1930 to September, 1996(just before the Great Internet Mersenne Prime Search started), the research results and discoveries can be found in Table 2. 3

6 Table 2: Modern History Year Discoverer Conclusion 1930 Derrick Lehmer Based on the theory which was initiated by Lucas in the late 1870's,Luhmer brought forward a simple way to test Mersenne Prim Lucas-Lehmer Test.* 1963 Donald B. Gillies Discover the 23 rd Mersenne prime Bryant Tuckerman Discover the 24 th Mersenne prime Landon Curt Noll & Laura Nickel David Slowinski 1988 Walter Colquitt & Luke Welsh Discover the 25 th and 26 th Mersenne prime. Discover the 30 th and 31 st Mersenne prime. Wrote a version of the Lucas test that he has convinced many Cray labs around the world to run in their spare time. Discover the 29 th Mersenne prime. * Lucas-Lehmer Test: For p an odd prime, the Mersenne number 2 p 1 is prime if and only if 2 p 1 divides S(p-1) where S(n+1) = S(n) 2-2, and S(1) = 4 [4] Lucas-Lehmer Test is an important way to discover new Mersenne prime and we can write a C program to test Mersenne prime based on this theory. More details about Lucas-Lehmer Test will be presented in Chapter Recent History In recent 60 years, people wrote computer programs and developed databases to solve the calculation of Mersenne prime. David Slowinski, who works for Cray computers, is the first person who thought about using multiple computers to search Mersenne prime. In the late 1995, George Woltman (a number theory enthusiasts, a computer programmer in Florida) collected and combined the distributed prime s databases and posted it on the Internet in 1996 with a free and highly optimized program which can be used for searching Mersenne primes. This is the sign of the beginning of Great Internet Mersenne Prime Search. A person who has a computer which can access to Internet can join this project. More details about Great Internet Mersenne Prime Search will be presented in Chapter 2. Mersenne primes using GIMPS found are shown in Table 3. 4

7 Table 3: Recent History (Using GIMPS) [5] # Date Discover p M p Digits 35 November 13 rd, 1996 Joel Armengaud 1,398, , August 24 th, 1997 Gordon Spence 2,976, , January 27 th,1998 Roland Clarkson 3,021, , June 1 st,1999 Nayan Hajratwala 6,972,593 2,098, November 14 th,2001 Michael Cameron 13,466,917 4,053, November 17 th, 2003 Michael Shafer 20,996,011 6,320, May 15 th,2004 Josh Findley 24,036,583 7,235,733 42* February 18 th,2005 Martin Nowak 25,964,951 7,816,230 43* December 15 th, * September 4 th, * September 6 th,2008 Curtis Cooper & Steven Boone Curtis Cooper & Steven Boone Hans-Michael Elvenich 30,402,457 9,152,052 32,582,657 9,808,358 37,156,667 11,185,272 46* April 12 nd,2009 Odd M. Strindmo 42,643,801 12,837,064 47* August 23 rd,2008 Edson Smith 43,112,609 12,978,189 *It is still not known if there is an undiscovered Mersenne primes smaller than this one. As can be seen from Table 1, 2, 3, the Mersenne primes are not always found in increasing order. The full table of known Mersenne primes can be found in reference. [4] 5

8 Chapter 2 Methodology 2.1 Definition and theorems Many ancient cultures found that there is a correlation between the number and its divisor, usually giving an incredible rendition. [4] Such as a prefect number, its factors contain Mersenne number, which is the source of the Mersenne numbers. Definition 1: When 2 n -1 is prime, n is a prime, then it is said to be a Mersenne prime. For example, for n= 2,3,5,7,1 3,17,19,3l,61,89,107,127, 2 n 1 is Mersenne prime. Definition 2: A positive integer n is called a perfect number if it is equal to the sum of all of its positive divisors, excluding n itself.[4] For example, because 6=1+2+3; 28= , so 6 and 28 are perfect numbers. Similarly, 496 and 8128 are also perfect numbers. (6, 28, 496 and 8128 are perfect numbers has already been known before BC.) Discuss: The factors form of above four numbers (6, 28, 496 and 8128) separately are 2*3, 4*7, 16*31and 64*127. It is obvious that they can be writing in the form: 2 n 1 (2 n 1) (for n = 2, 3, 5, and 7 respectively). And that 2 n 1 was a Mersenne prime in each case. [4] It is not difficult to prove the following two theorems: Theorem 1: k is an even perfect number if and only if it has the form 2 n 1 (2 n 1) and 2 n 1 is prime.[4] Two thousand and three hundred years ago, Euclid proved that if 2 k 1 is a prime number (it would be a Mersenne prime), then 2 k 1 (2 k 1) is a perfect number. Two hundred and fifty years ago, Euler proved the converse that every even perfect number has this form. However, right now people still do not know if there are any odd perfect numbers. [4] The proof can be found in reference [6] and from this we can know that Mersenne primes are implicated in the even perfect numbers. Theorem 2: If 2 n -1 is prime, then so is n. 6

9 Proof: Let r and s be positive integers, then the polynomial x rs 1 is x s 1 times x s(r 1) + x s(r 2) + x s + 1. So if n is composite (say rs with 1<s<n), then 2 n 1 is also composite because it is divisible by2 s 1. [7] But this contradicts with the precondition, so the theorem can be proofed. Discuss: Observe the above perfect numbers (6, 28, 496 and 8128), all end with either the digit 6 or the digit 8. In binary, these perfect numbers will be presented like: 110, 11100, , The common form is 2n 1(2n 1), for n = 2, 3, 5, 7. Therefore, expression in binary is an intuitionistic representation of theorem 1. Inference 1: Let a and n be integers greater than one. If a n 1 is prime, then a is 2 and n is prime. Theorem 3: Let p and q be primes. If q dividesm p = 2 p 1, then q=+/-1 (mod 8) and q=2kp + 1, k is integer. Notes: When checking Mersenne number is prime or not, usually check the small divisor first. The above theorem given by Euler and Fermat favored this consideration. The proof of this theorem can be found in reference [8]. Theorem 4: Let p = 3 (mod 4) be prime. 2p+1 is also prime if and only if 2p+1 divides Mp. 2.2 Distribution law For the integer between 2 and 127(2 n 127), there are 31 primes and has 12 corresponding Mersenne primes. After that, next Mersenne prime (M 521 ) comes up until prime n=521(there are 66 primes between 127 and 521). Then after 12 primes the next Mersenne prime (M 607 ) appears. Later, M 1279 presents itself but it has already jumped another 95 primes. After a long-term interval (another 120 primes), M 2203 comes on the scene As can be seen from the known Mersenne primes, the distribution of these special primes in the positive integer is irregular, sometimes scatter and sometimes gather. Therefore, it seems that it is more difficult to find the nature of Mersenne primes distribution law than to find a new Mersenne prime. During the long-term exploration of studying Mersenne primes, there are some conjectures have been proposed by mathematicians, but none of them has been proofed is correct. For example, In 1964, Donald B. Gillies made the following conjecture about the distribution of prime divisors of Mersenne numbersm p = 2 p 1: 7

10 Conjecture: If A < B M p, as B/A and M p, the number of prime divisors of M in the interval [A, B] is Poisson distributed with mean log((logb)/log(max(a,2p))). He noted that his conjecture would imply that: (1) The number of Mersenne primes less than x is ~ 2 log 2 loglogx (2) The expected number of Mersenne primes in the interval [x, 2x] in p is 2+2log ( log 2x log x ) which is ~ 2 2 log 2p (3) The probability that M p is prime is ~ p log Algorithms Trial Division Trial division is the most backbreaking but the easiest way to understand of the integer factorization algorithms. An individual integer being tested is called a trial divisor. Its principle is like this: Suppose if there is an integer n, we use any integer greater than one but less than n to divide the integer n. If there is a factor, then the integer n is a composite number, otherwise it is a prime. [10] Therefore, assume there is a random prime p, we can use trial division to determine M p = 2 p 1 is Mersenne prime or not. A simple C program is just like below: #include <stdio.h> #include <math.h> void main () { int number=0, p=0, j=0; printf ("This is a Trial Division example program!\n") ; printf ("Please input an exponent : ") ; scanf ("%d", &p) ;//Input exponent "p" number = (int) pow (2, p) -1; int NUMBER = (int) sqrt (number) ; for (int i = 2; i <= NUMBER; i++) {//Determine Mp=2p-1 is prime or not if (number % i == 0) {//If the number can divided by i, then Mp=2p-1 is not prime j=0; 8

11 break;//find a factor, then exit loop } else j=1; } if (j) printf ("When p is %d, Mp is Mersenne prime!\n", p) ; else printf ("When p is %d, Mp is not Mersenne prime!\n", p) ; } Figure 1: A trial division example program In a sense, trial division is a very low efficient algorithm. If n has prime factors which their values are very close, trial division is unlikely to be implemented. However, when n has at least one small value factor, this factor can be found very quickly by using trail division. It is worthy to notice that for a random n, there is a 50% probability that 2 is a factor of n, and a 33% chance that 3 is a factor, and so on. It can be concluded that 88% of all positive integers have a factor less than 100, and that 92% have a factor less than [11] Sieve of Eratosthenes In mathematics, the sieve of Eratosthenes is a simple algorithm for finding all prime numbers up to a specified integer. [12] It is one of the most efficient ways to find all of the smaller primes (below 10 million or so). To implement this algorithm, it will work like this: 9

12 1. Make a list of consecutive integers less than or equal to n (and greater than one), for example, from 2 to n: (2, 3, 4,, n) 2. Strike off the multiples of all primes less than or equal to n 3. The left numbers that are the primes. In order to make it easier to understand this algorithm, here is an example: 1. Generate a list of integers from 2 to 25: First prime in the list is 2, so cross out all the multiples of 2: Next prime in the list after 2 is 3, so cross out all the multiples of 3: Next prime in the list after 3 is 5, so cross out all the multiples of 5: Because 5 is equal to n, so after step 4 the numbers left not crossed out in the list are all the prime numbers: We can easily write a C program to print all the primes less than a number user input by using this algorithm, the example program as follow: #include <stdio.h> #include <math.h> int main(void) { int i=0, j=0, k=0; printf ("This is a Sieve of Eratosthenes example program!\n") ; printf ("The program will calculate all prime in the range between 0 to the number you input.\n") ; printf ("Please input a number: ") ; scanf ("%d",&k) ; int a[k+1]; for (i = 1; i <= k; i++) // Assign the array elements a[i] = i; for (i = 2; i < sqrt(k); i++)// Use i as a divisor for (j = i + 1; j <= k; j++)// Determine numbers are the multiples of i or not { if (a[i]!= 0 && a[j]!= 0) if (a[j] % a[i] == 0) 10

13 } a[j] = 0; // If it is multiple of i, then cross out it } printf ("All primes between 0 and %d are as below:\n", k) ; int n = 0; // Count output primes in order to output every 10 primes on 1 line for (i = 2; i <= k; i++) // Output primes { if (a[i]!= 0) { printf("%-5d", a[i]); // Output primes n++; } if (n == 10) { printf("\n");// Output 10 primes each line n = 0; } } printf("\n"); return 0; Figure 2: A Sieve of Eratosthenes example program 11

14 Although using this algorithm can easily and quickly calculate all the prime numbers less than the integer n, the space and time consuming will become enormous with the integer n increase. With minor modifications the program will be able to find Mersenne prime less than the integer n, but it is inefficient Pollard's (P-1) method This algorithm was invented by John M. Pollard in It is based on Fermat's Little Theorem. The idea [14] is that for any prime number we choose, p, and any other number, a, which means that, a (p 1) = 1 (mod p) a (p 1) 1 = 0 (mod p) For example, p is a factor of the left hand side. Actually all we need to do is that checking out the converse. Suppose that the number N which we want to factor has some unknown prime factor, p. We just try a large number of a k-1 numbers and see if there is a common factor with N among them. If so, we got p. This method can be simply described as below: 1. Choose a number, N, which we want to factor 2. Choose a number, 1 < a < N, for example, a = 2 3. Choose a number, k, for example, k = 2 4. If GCD(a, N) is not 1, we have a factor. Otherwise, go to step Let t = a k mod N 6. Let d = GCD ( t-1, N ) 7. Use division algorithm to see if d is a factor of N. If it is, then we found a factor. Otherwise, change a or k and go back to step 4. More details about this method can be found in [15] Lucas-Lehmer Test In mathematics, the Lucas Lehmer test (LLT) is a primality test for Mersenne numbers. It is the most powerful method right now. The test was originally developed by Édouard Lucas in 1856, and subsequently improved by Lucas in 1878 and Derrick Henry Lehmer (American mathematician and number theorist) in the 1930s. The Lucas Lehmer test works as below: [16] Let p be an odd prime. M p is prime if and only if S(p-1) = 0 (mod M p ) where S 1 = 4 and S n = S n A simple program can be written like this: 12

15 Lucas_Lemer (int p) //p is a prime which in M p { int s=4; int i,s1; s1=pow(2,p)-1; for(i=3;i<=p;i++) { s=((int)pow(s,2)-2)%s1; } return (s==0? 1:0); //Return 1 when M p is prime; return 0 when M p is composite number } For example, determine is prime or not (2 7-1=127). S0 = 4 S1 = (4*4-2) mod 127=14 S2 = (14*14-2) mod 127=67 S3 = (67*67-2) mod 127=42 S4 = (42*42-2) mod 127=111 S5 = (111*111-2) mod 127=0 2.4 Great Internet Mersenne Prime Search Great Internet Mersenne Prime Search (GIMPS) is a distributed computing project dedicated to finding Mersenne primes. The project was founded by George Woltman, an outstanding programmer and organizer, who also wrote the software Prime95 (upgrade to version 27 on May 15, 2012) for this project A little bit about GIMPS The first version software of GIMPS is basically user preserves the exponent and reports the result. The currently used method is using PrimeNet to implement grid computing which allowed worldwide volunteers who is interested in Mersenne primes search to join in. PrimeNet is a distributed computing platform which was set up by Scott Kurowski in It can automate the selection of extents and reporting of results for GIMPS. As of April, 2012, GIMPS has a sustained throughput of approximately 86.7 teraflops, which theoretically let GIMPS (here regard as a virtual supercomputer) has a place among the TOP 500 most powerful supercomputers in the world. [17] 13

16 2.4.2 How GIMPS Works The algorithms used in GIMPS are very efficient in order to search for Mersenne primes. Therefore, it is necessary and important to know how these algorithms being used and worked behind GIMPS. The following stages describe the process of how GIMPS program works to find Mersenne prime and all the math concepts, theorems and algorithms related we have explained in section 2.1 and 2.3. Creating an Exponent List Mersenne number is a number of the form, M p = 2 p 1, where p is an integer. We have already known this in Chapter 1, but p is prime or not is still a question. Therefore, we have to test the exponent p. It is easy to prove that if 2 P -1 is prime, then P must be a prime. In GIMPS, the first step is to create a list of prime exponents to test. [18] Trial Factoring Trial factoring actually is using a modified Sieve of Eratosthenes. According to Theorem 3, each bit representing a potential 2kp+1 factor. The sieve can eliminate any potential prime factors 2kp+1 under 40,000. Also, bits representing potential factors of 3 or 5 mod 8 are removed. This process will exclude around 95% of potential factors. [18] The remained potential factors will be checked by using a high efficiency algorithm which is used for determine a number can be divisible by 2 n 1. Here we will use an example to explain this. For example, when prime p equals 89, does it divisible by or not? In binary, 11 is represented as Starting from the top (left) bit 1, repeat the following steps: 1. Square 2. Remove that top bit 3. If that bit is 1, then multiply the value by 2, otherwise, just go to step 4 4. Use the value from step 3 to mod 89. After that, if the reminder is 1, then q is a factor of M p. The result is shown in Table 4. P-1 Factoring This is another factoring method which has being used in GIMPS. The method s basic idea has been introduced in section and it is used for finding factors and therefore avoiding costly primality tests. According to Theorem 3, if q is a factor of a number, then the factor q is of the form 2kp+1. If q-1 is highly composite (it only has 14

17 small factors), precisely k is highly composite of the form 2kp+1, then the P-1 method will find the factor q. Here is a procedure description of this method from [18] Stage 1: P-1 factoring will find the factor q as long as all factors of k are less than B1 (k is called B1-smooth). 1. Choose a bound B1 2. Compute E - the product of all primes less than B1 3. Compute x = 3 E*2*P 4. Check the GCD (x-1, 2P-1) to see if a factor was found Stage 2: 1. Uses a second bound B2 2. Check if k has only one factor between B1 and B2 and all remaining factors are below B or not 3. If step 2 is yes then it will find the factor q Table 4: Test when prime p=89 is divisible by or not Square Remove top bit Multiply by 2 as you need Mod 89 1*1= *2=2 2 2*2= No 4 4*4= *2= *32= *2= Lucas-Lehmer Primality Testing GIMPS first will use trial factoring and P-1 factoring to test the Mersenne number, try to find a factor and thereby discard the prime exponent p from the testing list. If after the above two tests, it still cannot eliminate some Mersenne number then it will execute the comparatively costly Lucas-Lehmer primality test to check that Mersenne number is prime or not. The concept, method and example related to Lucas-Lehmer primality testing can be seen in section Double-Checking 15

18 Double-checking was adopted in GIMPS in order to confirm that a first-time Lucas-Lehmer primality test was performed without error. Usually this job is assigned to low speed computers GIMPS and Grid Computing Grid computing is a field of computer science that using many computers in a network (or access to Internet) to deal with a single scientific or technical problem (usually the problem need to process very large amounts of data, like Search for Extraterrestrial Intelligence and Great Internet Mersenne Prime Search ) at the same time. GIMPS is one of the earliest and most successful world-wide grid computing project in the world. It is supported by the PrimeNet, the longest-running and all-volunteer scientific research grid in the world, running 24x7 at 42 teraflops on about 100,000 computers worldwide. [19] (It seems that Scott Kurowski has not updated the data for a long time. According to primenet s status, it has maintained at 86.7 teraflops for last 7 days and in the last 30 days it actually teraflops is around ) Thanking the PrimeNet for letting GIMPS such powerful and has discovered 13 largest known Mersenne primes. Therefore, it is worth knowing the mechanism of PrimeNet grid computing. The Mechanism of PC grid computing can be seen in Fig The grid nodes which join in the project download the special software and install on the local computer. For GIMPS, user needs download Prime95 from the GIMPS homepage. 2. Local grid node send request to the central server of GIMPS ask for sending program and data to the nodes. 3. The central server of GIMPS resolves the steps of Mersenne prime search into multiple smaller tasks (work unit which is made of parallel processing programs and data) at a reasonable size and then sends to different grid nodes. 4. Grid nodes receive sub-tasks and keep them as the lowest priority tasks. These tasks will be executed when the CPU is idle. The most commonly used method is to call these tasks when the computer goes into screen saver. 5. When the calculating is completed, the Prime95 on the grid nodes will return the results to the central server of GIMPS and request for new data, then return to step The central server of GIMPS collect, collate and save the results obtained from the grid nodes which involved in the calculation. 16

19 Figure 3: Mechanism of PC Grid Computing [20] Here is an example describe how to arrange in the main program and through grid computing to search Mersenne primes when exponent between 4000 and Step 1: Calculate how many primes between 4000 and 5000, N=119(119 primes between 4000 and 5000, they are 4001, ), keep them in p[i] (i=1, 2, 3 119). Step 2: Send primes from p[i] (i=1, 2, 3 119) to N=129 nodes and execute respectively. (Notes: The i (i=1, 2, 3 119) node test and verify2 p[i] 1 is prime or not, the result return back to r[i] (i=1, 2, 3 119) which in main program) Step 3: If r[i] (i=1, 2, 3 119) is 0, then 2 p[i] 1 is not a Mersenne prime; is 1, then 2 p[i] 1 is a Mersenne prime. In this example, p[33] = 4253 is 19 th Mersenne prime (Distributed execution return r[33] = 1); p[52] = 4423 is 20 th Mersenne prime (Distributed execution return r[52] = 1). 17

20 Chapter 3 Experiment and results 3.1 Lucas-Lehmer test with GMP and Glucas Lucas-Lehmer test with GMP and Glucas are two common methods for people to study primality test. In this section, a brief introduction will be presented Lucas-Lehmer test with GMP Lucas-Lehmer test using GMP library (The GNU Multiple Precision Arithmetic Library) is the easiest and most intuitive way to implement. The method of implement Lucas-Lehmer test has introduced in section Here we only discuss about GMP. GMP is a free portable library written in C for arbitrary precision arithmetic on integers, rational numbers, and floating-point numbers. It aims to provide the fastest possible arithmetic for all applications that need higher precision than is directly supported by the basic C types, which is exactly what we need in our program. [21] GMP is designed to give good performance by choosing algorithms based on the sizes of the operands, and by carefully keeping the overhead at a minimum. Although Lucas-Lehmer test uses millions of bits, it still fast by using GMP. Simply programmer can use gcc compiler to compile the program just like below: gcc program_name.c -lgmp -lm-o executable_name In order to run the executable program, just type the following command in terminal:./executable_name Exponent where Exponent is the exponent number programmer wants to test. If programmers want to check the execution time, just add time before the command: time./executable_name Exponent A comparison of running this program on two different CPU can be seen in Table Glucas Glucas is a free program to test primality of Mersenne numbers (numbers with the form 2 n 1) and will write the result into a text file to notify user whether a Mersenne number is a prime number. Glucas is the first program use YEAFFT library and using it in an optimized way. YEAFFT (Yet Another Fast Fourier Transform) is a library 18

21 designed to perform integer multiplication of very big numbers using FFT (Fast Fourier Transforms). Glucas and YEAFFT are written by the same author. In order to use Glucas to implement our experiments, there are some notes about Glucas we need to know: 1. The Glucas package includes GNU tools from automake and autoconf and scripts to make the build and install tasks as easy as possible. As usual, the steps are configure, make and install. But in the configure step, there are lots of options can be chosen. In order to make a comparison, we compile a version Glucas with no thread--- Glucas and a version Glucas use OpenMP threads--- Glucas_pthread. If programmer wants to use Glucas_pthread, he should make sure has a multiprocessor system. More detailed description can be found in [22]. 2. After the above three steps, programmer can start to use Glucas do some experiments. For example, programmer test an exponent with Glucas with no thread, just use the following command in terminal: time../src/glucas Exponent where Exponent is the exponent number programmer want to test, time is to check the time consuming. The result will automatically write into a file named result.txt. Alternatively, one can use work directory to do the test. The advantage of using this method is that it can test a with a group candidate exponents. The command is simply like this: time../src/glucas -W. Exponents.txt where W is enable to use work directory and Exponents.txt is the place to store a bunch of candidate exponents. For Glucas_pthread version, it has to enable number_of_threads threads by -T thread number. The example command as shown below: time../src/glucas_pthread -T 4 -W. Exponents.txt Lucas-Lehmer test with GMP vs Glucas In the previous sections, we introduced using two different methods to test primality of Mersenne numbers. Here we implement them into a comparison experiment. The experiment machine detail is shown in Table 6. 19

22 # Exponent Table 5: Lucas-Lehmer test using GMP on different CPU Intel(R) Core(TM) i5-2410m Intel(R) Pentium(R) 4 CPU 3.00GHz m0.009s 0m0.029s m0.010s 0m0.031s m0.025s 0m0.072s m0.053s 0m0.143s m0.058s 0m0.156s m0.378s 0m1.142s m0.396s 0m1.261s m0.541s 0m1.652s m2.413s 0m7.503s m2.956s 0m9.351s m3.729s 0m11.198s m18.541s 0m57.258s m41.468s 5m0.852s m3.718s 9m28.154s m45.544s 15m24.032s m8.054s 51m23.976s m0.815s 992m25.108s m39.170s 1295m55.493s m40.110s 3076m41.033s m24.889s 4120m34.487s Table 6: Experiment machine detail Processor Intel(R) Core(TM) i5-2410m Memory 4.00 GB System type 64-bit Operating System Operating System Windows 7 Ultimate Service Pack 1/Ubuntu Graphic Card GeForce GT 550M Table 7 shows a time comparison by using Lucas Lehmer test with GMP and Glucas with different threads to test different exponents. 20

23 # Expone nt Table 7: Comparison between Lucas Lehmer test with GMP and Glucas Lucas Lehmer test With GMP Glucas No thread 1 thread 2 thread 3 thread 4 thread m0.009s * * * * * m0.010s * * * * * m0.025s * * * * * m0.053s 0m0.037s 0m0.109s * * * m0.058s 0m0.039s 0m0.043s * * * m0.378s 0m0.127s 0m0.177s 0m0.244s * * m0.396s 0m0.146s 0m0.180s 0m0.284s * * m0.541s 0m0.157s 0m0.168s 0m0.297s * * m2.413s 0m0.275s 0m0.383s 0m0.641s 0m0.790s 0m0.967s m2.956s 0m0.300s 0m0.462s 0m0.684s 0m0.909s 0m1.102s m3.729s 0m0.444s 0m0.523s 0m0.913s 0m1.088s 0m1.332s m18.541s 0m1.752s 0m1.942s 0m3.577s 0m3.707s 0m3.892s m41.468s 0m7.595s 0m7.565s 0m8.630s 0m9.488s 0m10.146s m3.718s 0m11.075s 0m12.367s 0m13.543s 0m14.538s 0m15.710s m45.544s 0m16.170s 0m17.276s 0m19.514s 0m20.744s 0m21.740s m8.054s 0m43.779s 0m46.971s 0m52.837s 0m53.340s 0m54.479s m0.815s 9m8.263s 10m3.007s m39.170s m s 1542m s 11m s 23m5.019s 30m s 12m s 24m s 33m s * means exponent are too small for this version 10m s 13m s 25m s 36m s 10m s 13m s 25m s 37m s 10m s 13m s 26m0.245s 37m s Figure 4 shows a difference of time consuming between implement Lucas Lehmer test with GMP and Glucas with no thread. 21

24 Lucas Lehmer testwith GMP Glucas with No thread Time:Seconds Lucas Lehmer testwith GMP Glucas with No thread Time: Minutes Figure 4: Lucas Lehmer test with GMP vs Glucas with no thread Figure 5 shows a difference of time consuming among implement Glucas with different threads. 22

25 No thread 1 thread thread 3 thread 4 thread Time: 0 Figure 5: Glucas with no thread vs Glucas with different threads Experiment conclusion As we can see from Fig.4, the time consuming of using Lucas Lehmer test with GMP increased dramatically after the exponent Conversely, the trend of using Glucas with no thread just slightly grew. And the most important thing is with the exponent increased, the test time took so long by using Lucas Lehmer test with GMP. It was nearly 57 times that of Glucas with no thread when exponent is Therefore, it is obvious that Glucas has a better performance and more useful than Lucas Lehmer test with GMP in the practical test. As can be seen from Fig.5, the time consuming of using Glucas with different threads have a very similar performance. As the thread increased, the time spent shows an upward tendency. However, this is not the result what we expected, because we want get speed-up by using parallel method OpenMP. The reason causes this situation is because the communication between threads is too heavy or something else? Therefore, we did another comparison experiment on a different architectures machine. The result can be seen in Table 8. 23

26 Table 8: Glucas with different threads on Computer Vision lab machine # Exponent Glucas thread 4 thread 8 thread m0.545s * * m1.128s 0m1.523s * m1.248s 0m1.850s * m1.494s 0m2.454s * m3.712s 0m5.528s 0m9.072s m10.592s 0m12.777s 0m21.322s m16.737s 0m18.134s 0m30.369s m22.997s 0m24.934s 0m39.290s m50.360s 0m52.720s 1m21.321s m47.138s 7m53.449s 11m22.893s m27.565s 9m34.264s 14m42.188s m46.772s 17m2.749s 25m54.023s m45.069s 23m19.353s 32m38.578s * means exponent are too small for this version thread 4 thread 8 thread Time : Minutes Figure 6: Glucas with different threads on Computer Vision lab machine 24

27 As we can see from the above Table 8 and Fig. 6, the 4 thread version Glucas actually spent less time on the calculating (according from the results and tendency) than the 2 thread and 8 thread version. The result is different from the previous experiment and which gives us a cue to find the reason. The reason causes this difference I think is because the CPU architectures. The performance is directly related to the core number the CPU contains and how many cores we are using. In Table 8, the 4 thread version did the best job in the experiment as we use all four cores of the CPU. But in Table 7, no thread version consumed the minimum time as we only use one core in the test. It is a very interesting result and we will do a further comparison experiment to see whether this surmise is correct or not. 3.2 Undiscovered between Mersenne primes 41st and 42nd It is still not known whether any undiscovered Mersenne primes exist between the 41st (M ) and 42nd (M ). Therefore, it is worth to do an experiment to check it Basic method Here we present a basic method of implement the experiment. The method can be divided in three steps: create prime number exponent list, using factor5 to eliminate exponents, using Glucas to test primality Experiment 1. Create prime number exponent list The first thing we need to do is create an exponent list. The exponents are the prime numbers between and We can write a simple program to calculate and output the primes between this ranges. Alternatively, there is an existed prime number list in [23]. We can download it and choose the part which we need. There are primes between the ranges, so we separate these primes into 29 samples. The first sample has 3996 exponents, the last one has 1181primes and each of the other 27 samples has 4000 primes. 2. Using factor5 to eliminate exponents Factor5 is a program that performs trial factoring of Mersenne numbers. It is capable of trial factoring very large numbers, many billions of digits. Factor5 asks for the exponent of the Mersenne number to be tested, for starting and ending bit depths, and number of threads. It writes statistical lines on the screen, and outputs results on the "results.txt" 25

28 file. Each 150 seconds a stand-alone thread updates the "status.txt" file. [24] The example command is like below: factor5 <exponent> <start_bit> <stop_bit> <number of threads to use> Here we use the first sample to do the trial factoring, in order to do this we have to use a shell script called ReadExponent.sh to let the program read from a text file and do the factoring until no element left in the text file. An example code can be found here: #!/bin/bash for i in `cat Sample-1.txt` do./ factor5 $i <start_bit> <stop_bit> <number of threads to use> done It took 5986 minutes to calculate the first sample (3996 exponents) start from 1 bit to 56 bit with 1 thread and 2150 exponents are removed from the list because they have factors. After that, we can do the second round trial factoring by increased the end bit which will eliminate more exponents. An experiment shows that if we increased the end bit to 62, it will take around 81 minutes to do the trial factoring for one exponent. 3. Using Glucas to test primality As we mentioned in section 3.1.2, we can use work directory to deal with a group of candidate exponents. After the previous step, we got a list of candidate exponents which need to be test primality. But the list will be longer than the length work directory can handle (work directory supports up to 128 elements) and has to be separate. Then does the primality test like we discuss in section Conclusion In this section, we presented a method of how to discover or check Mersenne Primes between Mersenne primes 41st and 42nd. Because the primality test will took up an enormous amount of time, we only test one exponent ,036,641 in the experiment. It took 32,641 minutes to finish the primality test and proved that it is not a Mersenne prime. For example, after six years of M 41 was discovered, it is confirmed as the 41st Mersenne prime number. Therefore, checking the undiscovered Mersenne primes is a very time consuming and challenging work. A better way to do it is join GIMPS, which assign different work to the clients all over the world. 26

29 3.3 Study Mersenne Primes on GPU As we have known that there is a limitation of current hardware (CPU) to discover Mersenne Primes, therefore, GPU (Graphical Processing Units) has led into the project Introduction to GPU The GPU is a specialized circuit designed to accelerate the image output in a frame buffer intended for output to a display. The modern GPU has the following functions: rendering polygons, texture mapping, coordinate transformations and accelerated video decoding. The main manufacturers are NVIDIA and ATI. The reason we mentioned this is because the product of different manufactures are using different versions code to do the trial factoring and Lucas-Lehmer test GPU Computing GPU computing is the use of a GPU (graphics processing unit) as a co-processor to accelerate CPUs for general-purpose scientific and engineering computing. [24] The reason application can run faster because it is using the massively parallel processing power of the GPU to improve performance. The current CPU usually consists of two to eight CPU cores, while the GPU includes hundreds of smaller cores. This massively parallel architecture gives GPU a high compute performance. A core comparison between CPU and GPU can be seen in Fig. 7. [24] Figure 7: Core comparison between a CPU and a GPU The physical layout may different among GPU, but there is a general idea: [25] GPU divided into blocks 27

30 Each block contains one or more streaming multiprocessors Each SM has a number of streaming processors all share the same control logic and instruction cache within an SM All SPs from all SMs have access to up to 4 GB GDDR DRAM global memory GDDR: Graphics double data rate DRAM: Dynamic random access memory Experiments on GPU Scientific and engineering computing experiment on GPU is a new concept in recent years. Right now there are not too much documents and implementation about using GPU to study Mersenne Primes and therefore it is worthwhile to implements some experiments on GPU. Table 9 provides a data sheet which shows available GPU implementations related to Mersenne Primes. Manufacture NVIDIA Table 9: GPU implementation related to Mersenne Primes Implementation Type Idea propose Time First release Current version Language Trial Factoring Early in 2007 At the end of CUDA Primality Testing Unknown 16, Oct, CUDA ATI Trial Factoring 07,Jun, , Aug, OpenCL In the experiment, we will implement trial factoring and primality testing on the experiment machine (machine detail has shown in Table 6). 1. Trial Factoring Trial factoring implementation on NVIDIA GPU is called mfaktc (Mersenne number faktoring with CUDA). It is a very fast program which takes advantage of the many cores available on modern graphics cards. It is working on Windows and Linux platform and the program has some options can be chose as Fig. 8 shows. 28

31 Figure 8: Run mfaktc on Windows platform An example of how to use mfaktc can be seen in Table 10 and the result is shown as Fig. 9. Name Version Restrictions Example Call Capable mfaktc Table 10: Example of using mfaktc 0.17(Because GT 550M supports up to CUDA 3.2, 0.18 require CUDA4.0) Exponents: 1,000,000<Exponent<2 32 and prime, Factor size: Factor size 2 95 C:\Users\John\Desktop\CUDA\mfaktc-0.17.win64\mfaktc-0.17\mfaktc-win-64.e xe tf Around 37.9 GHz days/day Figure 9: Trial factoring M from 2 1 to

32 Alternatively, we can get assignment from the manual assignments page and it will write into a file called worktodo.txt file. Simply we just need to configure the mfaktc.ini file to let the program read the worktodo.txt file when the program is running. Example call command is mfaktc-win-64.exe. Table 11 shows a comparison between using CPU and GPU to eliminate exponents like in section As we can see, mfaktc is faster than factor5 in three different experiments. Especially mfaktc are more efficient with bigger bit ranges and it will be a better way to eliminate exponents in the experiment of section 3.2. Table 11: A comparison between CPU and GPU of implement trail factoring Items Factor 5 mfaktc Sample 1(1~56bit) 5896 minutes 3472 minutes Start from 1 bit and end to 56 bit Start from 1 bit and end to 62 bit Around 1 minute 29seconds Around 81 minutes Around 52seconds Around 2 minutes and 50 seconds Notes Run on CPU Run on GPU When the end bit is bigger than 65, the way mfaktc works has a little different. Let us use M as a sample to factoring from 1 bit to 68 bit. Table 12: Trial factoring M from 2 1 to 2 68 M ~ ~ ~ ~2 68 Time 24m1.194s 14m28.908s 26m53.751s 52m16.797s Total time 117m40.65s As can be seen from Table 12, mfaktc will calculate each bit separately after the bit is bigger than 65. From 2 1 to 2 65 from 2 65 to

33 From 2 66 to 2 67 from 2 67 to 2 68 Figure 10: Trial factoring M from 2 1 to 2 68 One thing need to be mentioned is that mfaktc actually uses both CPU and GPU resources. Factoring is done by letting the CPU prepare an array of factor candidates, which is passed to the GPU for parallel trial factoring. The CPU's task is mainly to eliminate composite numbers from the list of factor candidates by using a prime sieve. 2. Primality Testing The current available code running on GPU to do the primality test is called CUDALucas. It tests an exponent by using a command line argument. If you want to test multiple exponents, you have to use a batch file because the version in this experiment does not support to use a worktodo file. The latest 2.01 version supports input via file. An example can be seen in Table 13. Name Version Restricti ons Table 13: Example of using CUDALucas CUDALucas 1.2b(Because GT 550M supports up to CUDA 3.2, 2.01 require CUDA4.0) Exponents: 2<=Exponent< 151,150,000 Example Call Capable Upper limit to be verified. Also depends on VRAM size. C:\Users\John\Desktop\CUDA\LL\CUDALucas.1.2b\CUDALucas.cuda3.2.sm_13.WIN64.exe c (It means check file every iterations, Exponent 24,036,641) Around 4.5 GHz days/day 31

34 Figure 11: Primality Testing M Figure 11 is a screen shot of running CUDALucas to test M s primality. In this comparison experiment, we test M by using Glucas and CUDALucas to see how efficient CUDALucas can perform. The result is record in Table 14. Table 14: A comparison between CPU and GPU of implement primality testing Items Glucas CUDALucas M ,641 minutes 11,422 minutes Run on Intel(R) Pentium(R) 4 CPU 3.00GHz GeForce GT 550M As we can see from Table 14, CUDALucas presents a much better performance and almost three times faster than Glucas. As we all know that the reason cause this is the architecture difference between hardware, but it gives researchers a new and powerful method to study Mersenne Primes. Another interesting experiment has implemented is using Glucas and CUDALucas to test some specified exponents. The result is shown in Table 15. As we can see from Table 15 and Fig. 12, CUDALucas has a relatively stable performance for all the exponents. It is interesting to find that we can come up with a ratio equation that Runtime/Exponent (Every iteration takes minute) based on Table 14. However, this equation is not correct when the exponent up to (the ratio is around 4.75). Due to the time limitation, we cannot test full range of large exponent, but it is still need to pay attention to this trend. 32

35 By comparison, Glucas performs a better result in small exponents range, but with the exponents increased the time consuming also grew rapidly. It is obvious that Glucas spent less time than CUDALUCAS when the exponent smaller than a certain number. When the exponent is bigger than that number, Glucas will lose efficiency. This can be seen from Fig.12 and Fig. 13. Table 15: Glucas vs CUDALucas # Exponent Glucas CUDALucas m43.779s 25m11.648s m8.263s 89m31.521s m51.770s 99m28.619s m5.019s 146m7.610s m44.519s 164m11.523s m36.175s 343m6.364s m18.627s 363m7.203s m37.007s 793m30.734s Glucas CUDALucas Time: Minutes Figure 12: Time Comparison between using Glucas and CUDALucas 33

36 Trend(Glucas) Trend(CUDALucas) Figure 13: The Time Spent Trend of Glucas and CUDALucas The CUDALucas test results can be seen in Fig. 14. Exponent = Exponent = Exponent = Exponent =

Final Math Paper. James Marden. December 3, Introduction. Mersenne primes are a set of primes which are of the form: (2 p ) 1 = M

Final Math Paper. James Marden. December 3, Introduction. Mersenne primes are a set of primes which are of the form: (2 p ) 1 = M Final Math Paper James Marden December 3, 2016 Introduction Mersenne primes are a set of primes which are of the form: (2 p ) 1 = M There are currently only 49 known Mersenne primes, the smallest of which

More information

Modular Arithmetic. Kieran Cooney - February 18, 2016

Modular Arithmetic. Kieran Cooney - February 18, 2016 Modular Arithmetic Kieran Cooney - kieran.cooney@hotmail.com February 18, 2016 Sums and products in modular arithmetic Almost all of elementary number theory follows from one very basic theorem: Theorem.

More information

Sheet 1: Introduction to prime numbers.

Sheet 1: Introduction to prime numbers. Option A Hand in at least one question from at least three sheets Sheet 1: Introduction to prime numbers. [provisional date for handing in: class 2.] 1. Use Sieve of Eratosthenes to find all prime numbers

More information

Formulas for Primes. Eric Rowland Hofstra University. Eric Rowland Formulas for Primes / 27

Formulas for Primes. Eric Rowland Hofstra University. Eric Rowland Formulas for Primes / 27 Formulas for Primes Eric Rowland Hofstra University 2018 2 14 Eric Rowland Formulas for Primes 2018 2 14 1 / 27 The sequence of primes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

More information

Grade 6 Math Circles. Divisibility

Grade 6 Math Circles. Divisibility Faculty of Mathematics Waterloo, Ontario N2L 3G1 Introduction Grade 6 Math Circles November 12/13, 2013 Divisibility A factor is a whole number that divides exactly into another number without a remainder.

More information

PROPERTIES OF MERSENNE NUMBERS AND PRIMES

PROPERTIES OF MERSENNE NUMBERS AND PRIMES PROPERTIES OF MERSEE UMBERS AD PRIMES If one looks at the sequence of numbers- = 3, 7, 31, 127, 2047, 8291, 131071, 524287 one notices that its elements are, with the exception of 2047, prime numbers defined

More information

Table of Contents. Table of Contents 1

Table of Contents. Table of Contents 1 Table of Contents 1) The Factor Game a) Investigation b) Rules c) Game Boards d) Game Table- Possible First Moves 2) Toying with Tiles a) Introduction b) Tiles 1-10 c) Tiles 11-16 d) Tiles 17-20 e) Tiles

More information

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

Proof that Mersenne Prime Numbers are Infinite and that Even Perfect Numbers are Infinite Proof that Mersenne Prime Numbers are Infinite and that Even Perfect Numbers are Infinite Stephen Marshall 7 November 208 Abstract Mersenne prime is a prime number that is one less than a power of two.

More information

Wilson s Theorem and Fermat s Theorem

Wilson s Theorem and Fermat s Theorem Wilson s Theorem and Fermat s Theorem 7-27-2006 Wilson s theorem says that p is prime if and only if (p 1)! = 1 (mod p). Fermat s theorem says that if p is prime and p a, then a p 1 = 1 (mod p). Wilson

More information

A4M33PAL, ZS , FEL ČVUT

A4M33PAL, ZS , FEL ČVUT Pseudorandom numbers John von Neumann: Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. For, as has been pointed out several times, there is no such

More information

CUDA Threads. Terminology. How it works. Terminology. Streaming Multiprocessor (SM) A SM processes block of threads

CUDA Threads. Terminology. How it works. Terminology. Streaming Multiprocessor (SM) A SM processes block of threads Terminology CUDA Threads Bedrich Benes, Ph.D. Purdue University Department of Computer Graphics Streaming Multiprocessor (SM) A SM processes block of threads Streaming Processors (SP) also called CUDA

More information

Computational Efficiency of the GF and the RMF Transforms for Quaternary Logic Functions on CPUs and GPUs

Computational Efficiency of the GF and the RMF Transforms for Quaternary Logic Functions on CPUs and GPUs 5 th International Conference on Logic and Application LAP 2016 Dubrovnik, Croatia, September 19-23, 2016 Computational Efficiency of the GF and the RMF Transforms for Quaternary Logic Functions on CPUs

More information

Number Theory and Security in the Digital Age

Number Theory and Security in the Digital Age Number Theory and Security in the Digital Age Lola Thompson Ross Program July 21, 2010 Lola Thompson (Ross Program) Number Theory and Security in the Digital Age July 21, 2010 1 / 37 Introduction I have

More information

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

The Strong Finiteness of Double Mersenne Primes and the Infinity of Root Mersenne Primes and Near-square Primes of Mersenne Primes The Strong Finiteness of Double Mersenne Primes and the Infinity of Root Mersenne Primes and Near-square Primes of Mersenne Primes Pingyuan Zhou E-mail:zhoupingyuan49@hotmail.com Abstract In this paper

More information

Launchpad Maths. Arithmetic II

Launchpad Maths. Arithmetic II Launchpad Maths. Arithmetic II LAW OF DISTRIBUTION The Law of Distribution exploits the symmetries 1 of addition and multiplication to tell of how those operations behave when working together. Consider

More information

Primitive Roots. Chapter Orders and Primitive Roots

Primitive Roots. Chapter Orders and Primitive Roots Chapter 5 Primitive Roots The name primitive root applies to a number a whose powers can be used to represent a reduced residue system modulo n. Primitive roots are therefore generators in that sense,

More information

Chapter 4 Number Theory

Chapter 4 Number Theory Chapter 4 Number Theory Throughout the study of numbers, students Á should identify classes of numbers and examine their properties. For example, integers that are divisible by 2 are called even numbers

More information

Solutions for the Practice Final

Solutions for the Practice Final Solutions for the Practice Final 1. Ian and Nai play the game of todo, where at each stage one of them flips a coin and then rolls a die. The person who played gets as many points as the number rolled

More information

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

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number. PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number. (PT.1) If a number m of the form m = 2 n 1, where n N, is a Mersenne number. If a Mersenne number m is also a

More information

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography Mathematics Explorers Club Fall 2012 Number Theory and Cryptography Chapter 0: Introduction Number Theory enjoys a very long history in short, number theory is a study of integers. Mathematicians over

More information

Cryptography, Number Theory, and RSA

Cryptography, Number Theory, and RSA Cryptography, Number Theory, and RSA Joan Boyar, IMADA, University of Southern Denmark November 2015 Outline Symmetric key cryptography Public key cryptography Introduction to number theory RSA Modular

More information

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

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively. Solutions to Exam 1 Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers. Prove that m φ(n) + n φ(m) 1 (mod mn). Solution: a) Fermat s Little

More information

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

Assignment 2. Due: Monday Oct. 15, :59pm Introduction To Discrete Math Due: Monday Oct. 15, 2012. 11:59pm Assignment 2 Instructor: Mohamed Omar Math 6a For all problems on assignments, you are allowed to use the textbook, class notes, and other

More information

IMPLEMENTATION OF SOFTWARE-BASED 2X2 MIMO LTE BASE STATION SYSTEM USING GPU

IMPLEMENTATION OF SOFTWARE-BASED 2X2 MIMO LTE BASE STATION SYSTEM USING GPU IMPLEMENTATION OF SOFTWARE-BASED 2X2 MIMO LTE BASE STATION SYSTEM USING GPU Seunghak Lee (HY-SDR Research Center, Hanyang Univ., Seoul, South Korea; invincible@dsplab.hanyang.ac.kr); Chiyoung Ahn (HY-SDR

More information

Number Theory/Cryptography (part 1 of CSC 282)

Number Theory/Cryptography (part 1 of CSC 282) Number Theory/Cryptography (part 1 of CSC 282) http://www.cs.rochester.edu/~stefanko/teaching/11cs282 1 Schedule The homework is due Sep 8 Graded homework will be available at noon Sep 9, noon. EXAM #1

More information

NUMBER THEORY AMIN WITNO

NUMBER THEORY AMIN WITNO NUMBER THEORY AMIN WITNO.. w w w. w i t n o. c o m Number Theory Outlines and Problem Sets Amin Witno Preface These notes are mere outlines for the course Math 313 given at Philadelphia

More information

Practice Midterm 2 Solutions

Practice Midterm 2 Solutions Practice Midterm 2 Solutions May 30, 2013 (1) We want to show that for any odd integer a coprime to 7, a 3 is congruent to 1 or 1 mod 7. In fact, we don t need the assumption that a is odd. By Fermat s

More information

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

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012 CMPSCI 250: Introduction to Computation Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012 The Chinese Remainder Theorem Infinitely Many Primes Reviewing Inverses and the

More information

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

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013 CMPSCI 250: Introduction to Computation Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013 The Chinese Remainder Theorem Infinitely Many Primes Reviewing Inverses and the Inverse

More information

Public Key Encryption

Public Key Encryption Math 210 Jerry L. Kazdan Public Key Encryption The essence of this procedure is that as far as we currently know, it is difficult to factor a number that is the product of two primes each having many,

More information

Distribution of Primes

Distribution of Primes Distribution of Primes Definition. For positive real numbers x, let π(x) be the number of prime numbers less than or equal to x. For example, π(1) = 0, π(10) = 4 and π(100) = 25. To use some ciphers, we

More information

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

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory - Divisibility - Congruences June 23, 2014 Primes - Divisibility - Congruences Definition A positive integer p is prime if p 2 and its only positive factors are itself and 1. Otherwise, if p 2, then p

More information

CALCULATING SQUARE ROOTS BY HAND By James D. Nickel

CALCULATING SQUARE ROOTS BY HAND By James D. Nickel By James D. Nickel Before the invention of electronic calculators, students followed two algorithms to approximate the square root of any given number. First, we are going to investigate the ancient Babylonian

More information

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

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand. Midterm #: practice MATH Intro to Number Theory midterm: Thursday, Nov 7 Please print your name: Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating

More information

MAT199: Math Alive Cryptography Part 2

MAT199: Math Alive Cryptography Part 2 MAT199: Math Alive Cryptography Part 2 1 Public key cryptography: The RSA algorithm After seeing several examples of classical cryptography, where the encoding procedure has to be kept secret (because

More information

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

Cryptography. 2. decoding is extremely difficult (for protection against eavesdroppers); 18.310 lecture notes September 2, 2013 Cryptography Lecturer: Michel Goemans 1 Public Key Cryptosystems In these notes, we will be concerned with constructing secret codes. A sender would like to encrypt

More information

Perspective platforms for BOINC distributed computing network

Perspective platforms for BOINC distributed computing network Perspective platforms for BOINC distributed computing network Vitalii Koshura Lohika Odessa, Ukraine lestat.de.lionkur@gmail.com Profile page: https://www.linkedin.com/in/aenbleidd/ Abstract This paper

More information

Fibonacci Numbers ANSWERS Lesson 1 of 10, work individually or in pairs

Fibonacci Numbers ANSWERS Lesson 1 of 10, work individually or in pairs Lesson 1 of 10, work individually or in pairs In 1202, the mathematician Leonardo Pisano Fibonacci (pronounced fi-buh-nah-chee) published a book with the famous Fibonacci sequence in it. (A sequence is

More information

FACTORS AND PRIMES IN TWO SMARANDACHE SEQUENCES RALF W. STEPHAN Abstract. Using a personal computer and freely available software, the author factored

FACTORS AND PRIMES IN TWO SMARANDACHE SEQUENCES RALF W. STEPHAN Abstract. Using a personal computer and freely available software, the author factored FACTORS AND PRIMES IN TWO SMARANDACHE SEQUENCES RALF W. STEPHAN Abstract. Using a personal computer and freely available software, the author factored some members of the Smarandache consecutive sequence

More information

High Performance Computing for Engineers

High Performance Computing for Engineers High Performance Computing for Engineers David Thomas dt10@ic.ac.uk / https://github.com/m8pple Room 903 http://cas.ee.ic.ac.uk/people/dt10/teaching/2014/hpce HPCE / dt10/ 2015 / 0.1 High Performance Computing

More information

Game Mechanics Minesweeper is a game in which the player must correctly deduce the positions of

Game Mechanics Minesweeper is a game in which the player must correctly deduce the positions of Table of Contents Game Mechanics...2 Game Play...3 Game Strategy...4 Truth...4 Contrapositive... 5 Exhaustion...6 Burnout...8 Game Difficulty... 10 Experiment One... 12 Experiment Two...14 Experiment Three...16

More information

Fermat s little theorem. RSA.

Fermat s little theorem. RSA. .. Computing large numbers modulo n (a) In modulo arithmetic, you can always reduce a large number to its remainder a a rem n (mod n). (b) Addition, subtraction, and multiplication preserve congruence:

More information

Factorization myths. D. J. Bernstein. Thanks to: University of Illinois at Chicago NSF DMS Alfred P. Sloan Foundation

Factorization myths. D. J. Bernstein. Thanks to: University of Illinois at Chicago NSF DMS Alfred P. Sloan Foundation Factorization myths D. J. Bernstein Thanks to: University of Illinois at Chicago NSF DMS 0140542 Alfred P. Sloan Foundation Sieving and 611 + for small : 1 2 2 3 4 2 2 3 5 6 2 3 5 7 7 8 2 2 2 9 3 3 10

More information

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext Cryptography Codes Lecture 4: The Times Cipher, Factors, Zero Divisors, and Multiplicative Inverses Spring 2014 Morgan Schreffler Office: POT 902 http://www.ms.uky.edu/~mschreffler New Cipher Times Enemy

More information

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees.

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees. 7 Symmetries 7 Permutations A permutation of a set is a reordering of its elements Another way to look at it is as a function Φ that takes as its argument a set of natural numbers of the form {, 2,, n}

More information

Solutions for the Practice Questions

Solutions for the Practice Questions Solutions for the Practice Questions Question 1. Find all solutions to the congruence 13x 12 (mod 35). Also, answer the following questions about the solutions to the above congruence. Are there solutions

More information

ALGEBRA: Chapter I: QUESTION BANK

ALGEBRA: Chapter I: QUESTION BANK 1 ALGEBRA: Chapter I: QUESTION BANK Elements of Number Theory Congruence One mark questions: 1 Define divisibility 2 If a b then prove that a kb k Z 3 If a b b c then PT a/c 4 If a b are two non zero integers

More information

Numbers 01. Bob Albrecht & George Firedrake Copyright (c) 2007 by Bob Albrecht

Numbers 01. Bob Albrecht & George Firedrake Copyright (c) 2007 by Bob Albrecht Numbers 01 Bob Albrecht & George Firedrake MathBackpacks@aol.com Copyright (c) 2007 by Bob Albrecht We collect and create tools and toys for learning and teaching. Been at it for a long time. Now we're

More information

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

The covering congruences of Paul Erdős. Carl Pomerance Dartmouth College The covering congruences of Paul Erdős Carl Pomerance Dartmouth College Conjecture (Erdős, 1950): For each number B, one can cover Z with finitely many congruences to distinct moduli all > B. Erdős (1995):

More information

18.204: CHIP FIRING GAMES

18.204: CHIP FIRING GAMES 18.204: CHIP FIRING GAMES ANNE KELLEY Abstract. Chip firing is a one-player game where piles start with an initial number of chips and any pile with at least two chips can send one chip to the piles on

More information

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

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., Binary exponentiation An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., What are the last two digits of the number 2 284? In the absence

More information

FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M.

FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M. Mathematics Revision Guides Factors, Prime Numbers, H.C.F. and L.C.M. Page 1 of 17 M.K. HOME TUITION Mathematics Revision Guides Level: GCSE Higher Tier FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M. Version:

More information

Lecture 20: Combinatorial Search (1997) Steven Skiena. skiena

Lecture 20: Combinatorial Search (1997) Steven Skiena.   skiena Lecture 20: Combinatorial Search (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Give an O(n lg k)-time algorithm

More information

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

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method Exercises Exercises 1. Show that 15 is an inverse of 7 modulo 26. 2. Show that 937 is an inverse of 13 modulo 2436. 3. By inspection (as discussed prior to Example 1), find an inverse of 4 modulo 9. 4.

More information

Solutions for the 2nd Practice Midterm

Solutions for the 2nd Practice Midterm Solutions for the 2nd Practice Midterm 1. (a) Use the Euclidean Algorithm to find the greatest common divisor of 44 and 17. The Euclidean Algorithm yields: 44 = 2 17 + 10 17 = 1 10 + 7 10 = 1 7 + 3 7 =

More information

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained.

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained. THE CHINESE REMAINDER THEOREM INTRODUCED IN A GENERAL KONTEXT Introduction The rst Chinese problem in indeterminate analysis is encountered in a book written by the Chinese mathematician Sun Tzi. The problem

More information

ON SPLITTING UP PILES OF STONES

ON SPLITTING UP PILES OF STONES ON SPLITTING UP PILES OF STONES GREGORY IGUSA Abstract. In this paper, I describe the rules of a game, and give a complete description of when the game can be won, and when it cannot be won. The first

More information

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

Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes 4.1 Introduction Much of the pioneering research on cyclic codes was carried out by Prange [5]inthe 1950s and considerably

More information

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

Math 255 Spring 2017 Solving x 2 a (mod n) Math 255 Spring 2017 Solving x 2 a (mod n) Contents 1 Lifting 1 2 Solving x 2 a (mod p k ) for p odd 3 3 Solving x 2 a (mod 2 k ) 5 4 Solving x 2 a (mod n) for general n 9 1 Lifting Definition 1.1. Let

More information

FAST RADIX 2, 3, 4, AND 5 KERNELS FOR FAST FOURIER TRANSFORMATIONS ON COMPUTERS WITH OVERLAPPING MULTIPLY ADD INSTRUCTIONS

FAST RADIX 2, 3, 4, AND 5 KERNELS FOR FAST FOURIER TRANSFORMATIONS ON COMPUTERS WITH OVERLAPPING MULTIPLY ADD INSTRUCTIONS SIAM J. SCI. COMPUT. c 1997 Society for Industrial and Applied Mathematics Vol. 18, No. 6, pp. 1605 1611, November 1997 005 FAST RADIX 2, 3, 4, AND 5 KERNELS FOR FAST FOURIER TRANSFORMATIONS ON COMPUTERS

More information

Kenken For Teachers. Tom Davis January 8, Abstract

Kenken For Teachers. Tom Davis   January 8, Abstract Kenken For Teachers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles January 8, 00 Abstract Kenken is a puzzle whose solution requires a combination of logic and simple arithmetic

More information

Math 1111 Math Exam Study Guide

Math 1111 Math Exam Study Guide Math 1111 Math Exam Study Guide The math exam will cover the mathematical concepts and techniques we ve explored this semester. The exam will not involve any codebreaking, although some questions on the

More information

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

MA/CSSE 473 Day 9. The algorithm (modified) N 1 MA/CSSE 473 Day 9 Primality Testing Encryption Intro The algorithm (modified) To test N for primality Pick positive integers a 1, a 2,, a k < N at random For each a i, check for a N 1 i 1 (mod N) Use the

More information

The Pigeonhole Principle

The Pigeonhole Principle The Pigeonhole Principle Some Questions Does there have to be two trees on Earth with the same number of leaves? How large of a set of distinct integers between 1 and 200 is needed to assure that two numbers

More information

Console Games Are Just Like Mobile Games* (* well, not really. But they are more alike than you

Console Games Are Just Like Mobile Games* (* well, not really. But they are more alike than you Console Games Are Just Like Mobile Games* (* well, not really. But they are more alike than you think ) Hi, I m Brian Currently a Software Architect at Zynga, and CTO of CastleVille Legends (for ios/android)

More information

The $1,000,000 MathPickle Problems

The $1,000,000 MathPickle Problems The $1,000,000 MathPickle Problems The MathPickle is in the process of proposing 13 unsolved problems in mathematics (one for each grade, K-12). These are problems that can be understood by students in

More information

Week 1. 1 What Is Combinatorics?

Week 1. 1 What Is Combinatorics? 1 What Is Combinatorics? Week 1 The question that what is combinatorics is similar to the question that what is mathematics. If we say that mathematics is about the study of numbers and figures, then combinatorics

More information

The Unreasonably Beautiful World of Numbers

The Unreasonably Beautiful World of Numbers The Unreasonably Beautiful World of Numbers Sunil K. Chebolu Illinois State University Presentation for Math Club, March 3rd, 2010 1/28 Sunil Chebolu The Unreasonably Beautiful World of Numbers Why are

More information

Application of Maxwell Equations to Human Body Modelling

Application of Maxwell Equations to Human Body Modelling Application of Maxwell Equations to Human Body Modelling Fumie Costen Room E, E0c at Sackville Street Building, fc@cs.man.ac.uk The University of Manchester, U.K. February 5, 0 Fumie Costen Room E, E0c

More information

Like Mobile Games* Currently a Distinguished i Engineer at Zynga, and CTO of FarmVille 2: Country Escape (for ios/android/kindle)

Like Mobile Games* Currently a Distinguished i Engineer at Zynga, and CTO of FarmVille 2: Country Escape (for ios/android/kindle) Console Games Are Just Like Mobile Games* (* well, not really. But they are more alike than you think ) Hi, I m Brian Currently a Distinguished i Engineer at Zynga, and CTO of FarmVille 2: Country Escape

More information

Mark Kozek. December 7, 2010

Mark Kozek. December 7, 2010 : in : Whittier College December 7, 2010 About. : in Hungarian mathematician, 1913-1996. Interested in combinatorics, graph theory, number theory, classical analysis, approximation theory, set theory,

More information

Improving Loop-Gain Performance In Digital Power Supplies With Latest- Generation DSCs

Improving Loop-Gain Performance In Digital Power Supplies With Latest- Generation DSCs ISSUE: March 2016 Improving Loop-Gain Performance In Digital Power Supplies With Latest- Generation DSCs by Alex Dumais, Microchip Technology, Chandler, Ariz. With the consistent push for higher-performance

More information

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

PRIMES IN SHIFTED SUMS OF LUCAS SEQUENCES. Lenny Jones Department of Mathematics, Shippensburg University, Shippensburg, Pennsylvania #A52 INTEGERS 17 (2017) PRIMES IN SHIFTED SUMS OF LUCAS SEQUENCES Lenny Jones Department of Mathematics, Shippensburg University, Shippensburg, Pennsylvania lkjone@ship.edu Lawrence Somer Department of

More information

Math 127: Equivalence Relations

Math 127: Equivalence Relations Math 127: Equivalence Relations Mary Radcliffe 1 Equivalence Relations Relations can take many forms in mathematics. In these notes, we focus especially on equivalence relations, but there are many other

More information

Sensible Chuckle SuperTuxKart Concrete Architecture Report

Sensible Chuckle SuperTuxKart Concrete Architecture Report Sensible Chuckle SuperTuxKart Concrete Architecture Report Sam Strike - 10152402 Ben Mitchell - 10151495 Alex Mersereau - 10152885 Will Gervais - 10056247 David Cho - 10056519 Michael Spiering Table of

More information

Ideas beyond Number. Teacher s guide to Activity worksheets

Ideas beyond Number. Teacher s guide to Activity worksheets Ideas beyond Number Teacher s guide to Activity worksheets Learning objectives To explore reasoning, logic and proof through practical, experimental, structured and formalised methods of communication

More information

Math Fundamentals for Statistics (Math 52) Unit 2:Number Line and Ordering. By Scott Fallstrom and Brent Pickett The How and Whys Guys.

Math Fundamentals for Statistics (Math 52) Unit 2:Number Line and Ordering. By Scott Fallstrom and Brent Pickett The How and Whys Guys. Math Fundamentals for Statistics (Math 52) Unit 2:Number Line and Ordering By Scott Fallstrom and Brent Pickett The How and Whys Guys Unit 2 Page 1 2.1: Place Values We just looked at graphing ordered

More information

Three of these grids share a property that the other three do not. Can you find such a property? + mod

Three of these grids share a property that the other three do not. Can you find such a property? + mod PPMTC 22 Session 6: Mad Vet Puzzles Session 6: Mad Veterinarian Puzzles There is a collection of problems that have come to be known as "Mad Veterinarian Puzzles", for reasons which will soon become obvious.

More information

Outline Introduction Big Problems that Brun s Sieve Attacks Conclusions. Brun s Sieve. Joe Fields. November 8, 2007

Outline Introduction Big Problems that Brun s Sieve Attacks Conclusions. Brun s Sieve. Joe Fields. November 8, 2007 Big Problems that Attacks November 8, 2007 Big Problems that Attacks The Sieve of Eratosthenes The Chinese Remainder Theorem picture Big Problems that Attacks Big Problems that Attacks Eratosthene s Sieve

More information

UK JUNIOR MATHEMATICAL CHALLENGE. April 26th 2012

UK JUNIOR MATHEMATICAL CHALLENGE. April 26th 2012 UK JUNIOR MATHEMATICAL CHALLENGE April 6th 0 SOLUTIONS These solutions augment the printed solutions that we send to schools. For convenience, the solutions sent to schools are confined to two sides of

More information

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

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m. Great Theoretical Ideas In Computer Science Steven Rudich CS - Spring Lecture Feb, Carnegie Mellon University Modular Arithmetic and the RSA Cryptosystem p- p MAX(a,b) + MIN(a,b) = a+b n m means that m

More information

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

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02 Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02 Public Polynomial congruences come up constantly, even when one is dealing with much deeper problems

More information

Zhanjiang , People s Republic of China

Zhanjiang , People s Republic of China Math. Comp. 78(2009), no. 267, 1853 1866. COVERS OF THE INTEGERS WITH ODD MODULI AND THEIR APPLICATIONS TO THE FORMS x m 2 n AND x 2 F 3n /2 Ke-Jian Wu 1 and Zhi-Wei Sun 2, 1 Department of Mathematics,

More information

UNIT 1. numbers. multiples and factors NUMBERS, POSITIONS AND COLUMNS DIGITS

UNIT 1. numbers. multiples and factors NUMBERS, POSITIONS AND COLUMNS DIGITS numbers. multiples and factors UNIT 1 NUMBERS, POSITIONS AND COLUMNS Our number system is called the decimal system.it is based on tens. This is probably because we have ten fingers and thumbs. A digit

More information

SOLUTIONS TO PROBLEM SET 5. Section 9.1

SOLUTIONS TO PROBLEM SET 5. Section 9.1 SOLUTIONS TO PROBLEM SET 5 Section 9.1 Exercise 2. Recall that for (a, m) = 1 we have ord m a divides φ(m). a) We have φ(11) = 10 thus ord 11 3 {1, 2, 5, 10}. We check 3 1 3 (mod 11), 3 2 9 (mod 11), 3

More information

Sequences. like 1, 2, 3, 4 while you are doing a dance or movement? Have you ever group things into

Sequences. like 1, 2, 3, 4 while you are doing a dance or movement? Have you ever group things into Math of the universe Paper 1 Sequences Kelly Tong 2017/07/17 Sequences Introduction Have you ever stamped your foot while listening to music? Have you ever counted like 1, 2, 3, 4 while you are doing a

More information

STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES

STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES FLORIAN BREUER and JOHN MICHAEL ROBSON Abstract We introduce a game called Squares where the single player is presented with a pattern of black and white

More information

MACHINE LEARNING Games and Beyond. Calvin Lin, NVIDIA

MACHINE LEARNING Games and Beyond. Calvin Lin, NVIDIA MACHINE LEARNING Games and Beyond Calvin Lin, NVIDIA THE MACHINE LEARNING ERA IS HERE And it is transforming every industry... including Game Development OVERVIEW NVIDIA Volta: An Architecture for Machine

More information

How to Become a Mathemagician: Mental Calculations and Math Magic

How to Become a Mathemagician: Mental Calculations and Math Magic How to Become a Mathemagician: Mental Calculations and Math Magic Adam Gleitman (amgleit@mit.edu) Splash 2012 A mathematician is a conjurer who gives away his secrets. John H. Conway This document describes

More information

Towards Real-time Hardware Gamma Correction for Dynamic Contrast Enhancement

Towards Real-time Hardware Gamma Correction for Dynamic Contrast Enhancement Towards Real-time Gamma Correction for Dynamic Contrast Enhancement Jesse Scott, Ph.D. Candidate Integrated Design Services, College of Engineering, Pennsylvania State University University Park, PA jus2@engr.psu.edu

More information

Monte Carlo based battleship agent

Monte Carlo based battleship agent Monte Carlo based battleship agent Written by: Omer Haber, 313302010; Dror Sharf, 315357319 Introduction The game of battleship is a guessing game for two players which has been around for almost a century.

More information

Plan 9 in Technicolor

Plan 9 in Technicolor Plan 9 in Technicolor Russ Cox Harvard College Bell Labs, Lucent Technologies rsc@plan9.bell-labs.com August 23, 1999 Bitblt 1 Invented in 1975 at Xerox PARC. Used on the Blit and in released Plan 9. bitblt(dst,

More information

GF Machining Solutions Speed of Development : The Future of Machine Building. Sergei Schurov 23/06/2016

GF Machining Solutions Speed of Development : The Future of Machine Building. Sergei Schurov 23/06/2016 GF Machining Solutions Speed of Development : The Future of Machine Building Sergei Schurov 23/06/2016 Heritage Innovation Outlook Machine Tools Industry: Journey Through the Time Heritage Swiss Trains

More information

New Methods in Finding Binary Constant Weight Codes

New Methods in Finding Binary Constant Weight Codes Faculty of Technology and Science David Taub New Methods in Finding Binary Constant Weight Codes Mathematics Master s Thesis Date/Term: 2007-03-06 Supervisor: Igor Gachkov Examiner: Alexander Bobylev Karlstads

More information

1. The chance of getting a flush in a 5-card poker hand is about 2 in 1000.

1. The chance of getting a flush in a 5-card poker hand is about 2 in 1000. CS 70 Discrete Mathematics for CS Spring 2008 David Wagner Note 15 Introduction to Discrete Probability Probability theory has its origins in gambling analyzing card games, dice, roulette wheels. Today

More information

Utilization-Aware Adaptive Back-Pressure Traffic Signal Control

Utilization-Aware Adaptive Back-Pressure Traffic Signal Control Utilization-Aware Adaptive Back-Pressure Traffic Signal Control Wanli Chang, Samarjit Chakraborty and Anuradha Annaswamy Abstract Back-pressure control of traffic signal, which computes the control phase

More information

Final exam. Question Points Score. Total: 150

Final exam. Question Points Score. Total: 150 MATH 11200/20 Final exam DECEMBER 9, 2016 ALAN CHANG Please present your solutions clearly and in an organized way Answer the questions in the space provided on the question sheets If you run out of room

More information

Multiples and Divisibility

Multiples and Divisibility Multiples and Divisibility A multiple of a number is a product of that number and an integer. Divisibility: A number b is said to be divisible by another number a if b is a multiple of a. 45 is divisible

More information

MAS336 Computational Problem Solving. Problem 3: Eight Queens

MAS336 Computational Problem Solving. Problem 3: Eight Queens MAS336 Computational Problem Solving Problem 3: Eight Queens Introduction Francis J. Wright, 2007 Topics: arrays, recursion, plotting, symmetry The problem is to find all the distinct ways of choosing

More information

SOLUTIONS FOR PROBLEM SET 4

SOLUTIONS FOR PROBLEM SET 4 SOLUTIONS FOR PROBLEM SET 4 A. A certain integer a gives a remainder of 1 when divided by 2. What can you say about the remainder that a gives when divided by 8? SOLUTION. Let r be the remainder that a

More information