(Mersenne Primes Search) 11191649 Jun Li June, 2012
Total Page:16
File Type:pdf, Size:1020Kb
Institute of Information and Mathematical Sciences Prime Number Search Algorithms (Mersenne Primes Search) 11191649 Jun Li June, 2012 Contents CHAPTER 1 INTRODUCTION ......................................................................................................... 1 1.1 BACKGROUND .................................................................................................................................... 1 1.2 MERSENNE PRIME ............................................................................................................................. 1 1.3 STUDY HISTORY ................................................................................................................................ 2 1.3.1 Early history [4] ......................................................................................................................... 2 1.3.2 Modern History .......................................................................................................................... 3 1.3.3 Recent History ............................................................................................................................ 4 CHAPTER 2 METHODOLOGY ........................................................................................................ 6 2.1 DEFINITION AND THEOREMS ............................................................................................................. 6 2.2 DISTRIBUTION LAW ........................................................................................................................... 7 2.3 ALGORITHMS ..................................................................................................................................... 8 2.3.1 Trial Division ............................................................................................................................. 8 2.3.2 Sieve of Eratosthenes ................................................................................................................. 9 2.3.3 Pollard's (P-1) method ............................................................................................................. 12 2.3.4 Lucas-Lehmer Test ................................................................................................................... 12 2.4 GREAT INTERNET MERSENNE PRIME SEARCH .............................................................................. 13 2.4.1 A little bit about GIMPS ........................................................................................................... 13 2.4.2 How GIMPS Works .................................................................................................................. 14 2.4.3 GIMPS and Grid Computing ................................................................................................... 16 CHAPTER 3 EXPERIMENT AND RESULTS ................................................................................. 18 3.1 “LUCAS-LEHMER TEST WITH GMP” AND “GLUCAS”.................................................................... 18 3.1.1 Lucas-Lehmer test with GMP .................................................................................................. 18 3.1.2 Glucas ....................................................................................................................................... 18 3.1.3 “Lucas-Lehmer test with GMP” vs “Glucas” ......................................................................... 19 3.1.4 Experiment conclusion ............................................................................................................ 23 3.2 UNDISCOVERED BETWEEN MERSENNE PRIMES 41ST AND 42ND .................................................... 25 3.2.1 Basic method ............................................................................................................................ 25 3.2.2 Experiment ............................................................................................................................... 25 3.2.3 Conclusion ............................................................................................................................... 26 3.3 STUDY MERSENNE PRIMES ON GPU .............................................................................................. 27 3.3.1 Introduction to GPU ................................................................................................................ 27 3.3.2 GPU Computing ....................................................................................................................... 27 3.3.3 Experiments on GPU ............................................................................................................... 28 3.3.4 Conclusion ............................................................................................................................... 35 CHAPTER 4 DISCUSSION AND FUTURE WORK ....................................................................... 36 4.1 SUMMARY OF EXPERIMENTS ........................................................................................................... 36 4.2 MEANING OF STUDY MERSENNE PRIMES ....................................................................................... 36 4.3 FUTURE WORK ................................................................................................................................. 37 REFERENCES .................................................................................................................................. 39 APPENDIX ........................................................................................................................................ 41 A. PROGRAMS .................................................................................................................................... 41 B. TABLES .......................................................................................................................................... 43 C. FIGURES ........................................................................................................................................ 43 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——242,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, 2009. 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, 푝 푀푝 = 2 − 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 푝 푀푝 = 2 − 1, where Mp and p are primes. Marin Mersenne compiled a list of primes in the form of 2푝 − 1 (exponent p≤257), but it is wrongly included M67 and M257 which are not primes and missed M61, M89 and M107. [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. 2 3 Prime number:푀2 = 2 − 1 = 3 푀3 = 2 − 1 = 7 4 Non-prime number: 푀4 = 2 − 1 = 15 1.3 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. 1.3.1 Early history [4] Over 2300 years ago, Euclid, the ancient Greek mathematician, started to study a number of the form 2푝 − 1 (the first time people study about 2푝 − 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 (1588-1648), the first people who studied 2푝 − 1 deeply and systematically. To commemorate him, the mathematical community named the number of this form 푝 푀푝 = 2 − 1 (Mp 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푛 − 1 is a prime number. This is obviously wrong. There are new