![]() |
|
|
#12 |
|
Aug 2006
135338 Posts |
It wouldn't surprise me if (with a horrendous amount of effort) one could code a LL-like test which worked mod M_p + 1 instead of M_p and ran, say, 5% faster by cutting out the rest of the reduction cost. There's just the little issue by which the result would tell you nothing about the primality of the number...!
|
|
|
|
|
|
#13 | |
|
"W. Byerly"
Aug 2013
1423*2^2179023-1
23×13 Posts |
Quote:
Consider the moduli and divisions (with decimal truncated) after each iteration of the Lucas-Lehmer test of 210-1, where x is the x-th iteration through the test: Sx (mod Mn)------Mn/Sx ---------------------------------------
Now consider Sx (mod Mn+1). Note that the x-th iteration was performed using x-1 iterations of the Lucas Lehmer test and the final iteration was performed with a Sx (mod Mn+ 1) rather than Sx (mod Mn). Sx (mod Mn+1)---(Mn+1)/Sx ------------------------------------------
Looking at this raw data, one can make a few observations. lets define d0 = Mn/Sx, d1 = (Mn+1)/Sx m0 = Sx (mod Mn) m1= Sx (mod Mn+1) One may notice that when d0=d1= 0, m0= m1. This is obvious. Additionally, notice that either d0= d1 or d0= d1+1. Upon further inspection, one finds d0= d1 + 1 if m0 - d0 < 0 and d0= d1 if m0 - d0 >= 0 one may also notice m1= m0+ d0 if d0= d1 and m1= (m0+ d0 - 1) - Mn if d0= d1 + 1 From the previous observation, one may substitute the if conditions to obtain m1= m0+ d0 if m0 - d0 >= 0 and m1= (m0+ d0 - 1) - Mn if m0 - d0 < 0 Like mentioned in a previous post, calculating moduli and division by powers of 2 is extremely trivial to do on a computer (along with addition and subtraction), so this is a very simple way of calculating n (mod) Mn. The question now is will this be a faster implementation of modulus than the previous algorithm, and can my observations be proven? I may prove them later; I suspect most of the observations can be proven by induction, so it should be a fairly trivial proof. Apologies if I got any of the math formatting wrong, I am in high school, and I still have a lot of practicing to do to get good at writing my observations in mathematical terms! If my hypothesis is wrong, I suspect the issue may lie in writing it mathematically rather than an issue with the hypothesis itself. I also tested this out on many more (and larger) Lucas Lehmer tests than just 210-1 but I posted this small one as an example so you could follow my hypothesis with me. Just 8 iterations is not enough data to draw any conclusions upon indeed. |
|
|
|
|
|
|
#14 |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
22×1,549 Posts |
|
|
|
|
|
|
#15 | |
|
"W. Byerly"
Aug 2013
1423*2^2179023-1
1508 Posts |
Quote:
Last fiddled with by Trilo on 2014-11-06 at 00:39 |
|
|
|
|
|
|
#16 | |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
Quote:
Last fiddled with by science_man_88 on 2014-11-06 at 00:56 |
|
|
|
|
|
|
#17 | |
|
"W. Byerly"
Aug 2013
1423*2^2179023-1
23×13 Posts |
Quote:
|
|
|
|
|
|
|
#18 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
|
|
|
|
|
|
#19 | ||
|
Romulan Interpreter
Jun 2011
Thailand
22×33×89 Posts |
Quote:
![]() First thing, have a look to Quote:
(and don't look to me, I am just a big mouth, but some big guns here also started like that, even if they don't want to recognize it anymore). The key is to work hard and learn new things...
Last fiddled with by LaurV on 2014-11-06 at 04:05 |
||
|
|
|
|
|
#20 | |
|
Apr 2014
100000002 Posts |
Quote:
Keep on plugin' on… |
|
|
|
|
|
|
#21 |
|
Feb 2017
3×5×11 Posts |
The fact that the Lucas-Lehmer iteration works suggests to me that the distribution of mersenne prime numbers are "regular', dependant on the outcome of the LL iteration, but never-the-less "regular".
My question would be if anybody has ever looked or found any "marker/s" in the set of values generated by each mersenne prime iteration. Such things as say the term nearest to the "square root" position value of the set of iterations being of a certain relationship to the value of the successful value which would yield a return of "0", or any other relationship between the values comprising the set of iterations for a specific mersenne prime. Any such marker could then either reduce the time needed to "prove" primality, or be an indicator whether it would be fruitful to continue with that iteration. |
|
|
|
|
|
#22 | |
|
∂2ω=0
Sep 2002
República de California
103·113 Posts |
Quote:
One could just as well argue that "trial division up to sqrt(N) fails for N prime - thus there must a pattern!" Last fiddled with by ewmayer on 2018-03-07 at 02:58 |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lucas-Lehmer test | Mathsgirl | Information & Answers | 23 | 2014-12-10 16:25 |
| proof the lucas lehmer test | kurtulmehtap | Math | 13 | 2009-10-02 12:12 |
| Lucas-Lehmer Test | storm5510 | Math | 22 | 2009-09-24 22:32 |
| Lucas-Lehmer Test proof | alpertron | mersennewiki | 16 | 2006-03-18 07:23 |
| Lucas-Lehmer primality test | CMOSMIKE | Math | 5 | 2002-09-06 18:46 |