Can my Home PC Handle the Lucas-Lehmer Test by Itself? (or Do I Need GIMPS)

441 Views Asked by At

Last year, the largest Mersenne prime $2^{82,589,933}$ that we now know of was discovered. It contains almost $25,000,000$ digits if expanded out. I do not understand much how GIMPS operates, other than it makes use of the Lucas-Lehmer test algorithm.

My question might be naive, but I ask it anyway: On a PC with 8GB of RAM, am I capable of running the Lucas-Lehmer test on a Mersenne number $M_{p}$ with a prime $p$ of my choice? In theory, I certainly could recursively compute the $(n-1)st$ term of the underlying extended Lucas sequence sequence that GIMPS uses and attempt to divide my chosen $M_{p}$ into it. But can little computers like mine handle such large numbers?

2

There are 2 best solutions below

7
On BEST ANSWER

LLT implementation in Pari/gp

    p = 19937; Mp = 2^p-1; x = 4; 

    moduloM(p,n) = { a= shift(n,-p); b = n-shift(a,p); r = b+a; };
    for(n=1, p-2, x = moduloM(p,moduloM(p,x^2-2))); 

    /* slow version :  
       x = Mod(4,Mp); for(n=1, p-2, x = x^2-2); */

    if(x == Mp, print("2^",p,"-1 is prime"), print("2^",p,"-1 is NOT PRIME")); 
5
On

$25$ million digits is large but within reach of some number theory tools like pari/gp or maple.

So, in principle, you can check such a number with a single normal computer.

Of course, it will take long until the number is checked.

Note that the calculations that have to be done do not exceed the $50$ million digits mark.