Mersenne Prime Search

I am a fourth-year undergraduate student majoring in EECS. Thus, I don't have a specific research area, but I am in interested in algorithm design and mathematical uses for computers in general. My primary motivation for taking this course is to learn how to tune algorithms for parallel computers.

1 What is a Mersenne Prime?

A Mersenne Prime is a prime of form 2n - 1. Marin Mersenne (1588-1648) was a French monk who once conjectured that the numbers 2n - 1 were prime for n = 2, 3, 5, 7, 17, 19, 31, 67, 127, and 257, and composite for all n > 257.

Clearly, he was wrong.

In fact, the 43rd known Mersenne prime was just found on December 15, 2005: 230,402,457 - 1. Dr. Curtis Cooper and Dr. Steven Boone, professors at Central Missouri State University, found this 9,152,052 digit behemoth using 700 PCs. They are part of a large group known as GIMPS (The Great Internet Mersenne Prime Search). GIMPS currently coordinates thousands of volunteers' PCs to use their idle cycles to test newer and bigger primes.

 

2 Why search for Mersenne Primes?

Mersenne Primes are directly related to perfect numbers (numbers whose factors add up to themselves). There exists a theorem that states that k is an even perfect number if and only if it has the form 2n-1(2n-1) and 2n-1 is prime.

Other than that...I'm pretty sure primes have pretty properties, but I couldn't name another one if you really pressed me. I'm no mathematician. I wanted to be, but my parents talked me out of it. Thanks, Dad.

Even the prime fanatics can't really give good answers beyond "the glory of it all". Save one.

Let me direct you to #7 on their list:

"There are a few who seek primes just for the money. There are prizes for the first proven ten-million digit prime ($100,000), the first hundred-million digit prime ($150,000), and the first billion digit prime ($250,000)."

Now, I know the chances of finding the next 10,000,000 digit prime is slim. In fact, it's almost zero. But what if we do?

 

3 Details on the Algorithm

If you're reading this, the professor and Rajesh probably didn't read about my base mercernary traits yet. So I'll cut to the chase:

3.1 Finding Primes

Thanks to Fermat's little theorem, we know that if 2p - 1 is a prime, p is a prime. Therefore, all we need to do is compile a list of primes. Since we're only interested in 10,000,000 digit primes, we must gather a list of primes greater than 35,000,000.

3.2 Lucas-Lehmer

Once we have gathered a large set of primes, we perform the Lucas-Lehmer test on each of the numbers specified by the primes. The Lucas-Lehmer test states that for p > 2, 2p - 1 is prime iff Sp-2 is zero in this sequence: S0 = 4, SN = (SN-12 - 2) mod (2p - 1). In other words, to find whether a number is a Mersenne Prime, all we have to do is calculate squares of huge numbers modulo 2n - 1 efficiently.

So far, the fastest known algorithm for squaring large numbers is to transform the large number into an array, perform a Fast Fourier Transform (FFT) on the array, then perform an inverse Fourier Transform on the array. This means that the speed of the algorithm will depend on the speed of the fastest Fourier transform possible on the machine we use. Hopefully, we will be able to parallelize these FFTS and make them very quick. If not, we can parallelize the search by searching many different numbers at a time.

 

4 Current efforts

Right now, GIMPS claims to have the equivalent of a 21000 Gigaflop machine checking Mersenne primes by sending various numbers to idle computers. However, this number is probably inflated quite a bit, as the computers used in GIMPS are not actively searching for primes all the time. Furthermore, many of the machines are actually dedicated to double-checking that certain numbers are Mersenne primes rather than searching for new primes.

Our search will probably fail. However, there is no good reason why our machine cannot check several 10,000,000 digit numbers if our algorithm is well-tuned. Who knows, maybe one of them will be the winning number!