![]() |
![]() |
#1 |
"W. Byerly"
Aug 2013
81*2^3174353-1
13310 Posts |
![]()
I have been looking into how the Lucas Lehmer test works. The test states to define a sequence sn where s0= 4 and sn= sn-12-2 and if sn-2 evently divides Mn then Mn is prime.
What I am wondering is if it is possible to modify the test to instead prove Mn prime iff Mn+1 evenly divides sn-2 Last fiddled with by Trilo on 2014-11-03 at 01:38 |
![]() |
![]() |
![]() |
#2 |
Aug 2006
10111011001002 Posts |
![]()
The basic idea of most compositeness tests (aside from trial division!) is to work in the ring $(\mathbb{Z}/N\mathbb{Z})^*$ and show that it isn't a field. The basic idea of most primality tests is to work in the same ring and show that it must be a field. Neither of these ideas work if you use a modulus other than the number itself.
|
![]() |
![]() |
![]() |
#3 | |
"W. Byerly"
Aug 2013
81*2^3174353-1
7×19 Posts |
![]() Quote:
Last fiddled with by Trilo on 2014-11-03 at 02:51 |
|
![]() |
![]() |
![]() |
#4 |
Aug 2006
22·3·499 Posts |
![]()
Probably not, since the moduli are coprime and
|
![]() |
![]() |
![]() |
#5 | ||
∂2ω=0
Sep 2002
República de Califo
22·2,939 Posts |
![]() Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#6 | ||
"Forget I exist"
Jul 2009
Dartmouth NS
5×13×131 Posts |
![]() Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#7 | |
"W. Byerly"
Aug 2013
81*2^3174353-1
7·19 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#8 | |
Undefined
"The unspeakable one"
Jun 2006
My evil lair
23·857 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#9 |
Romulan Interpreter
"name field"
Jun 2011
Thailand
2·5,179 Posts |
![]()
Even it would not be so, doing n (mod 2^x-1) where n is a*2^x+b, is equivalent with doing a+b. Which is only a bit split/shift and one addition. For example, 39 mod 15 is 2*16+7 mod 15, or 2+7=9 mod 15. In binary, you just split 100111 into 10 and 0111 and add them. The equivalent calculus could be done for (mod 2^x+1) too. Where you lose the time is actually squaring part, and not taking the mod. Taking the mod is trivial.
Last fiddled with by LaurV on 2014-11-04 at 12:05 |
![]() |
![]() |
![]() |
#10 |
"Forget I exist"
Jul 2009
Dartmouth NS
5×13×131 Posts |
![]()
the only alteration I can think of is using algebra and starting from the end result of a mersenne prime:
which can use to figure out the next results: this can be reduced more and then use (a*b+c)^2-2 to figure it out from there but I think figuring it out algebraically is going to be slower than what is already implemented. Last fiddled with by science_man_88 on 2014-11-04 at 15:48 |
![]() |
![]() |
![]() |
#11 |
∂2ω=0
Sep 2002
República de Califo
22×2,939 Posts |
![]()
Anyone who's ever implemented the IBDWT knows it's not trivial, and to do it efficiently even less so. But yes, once you've got an efficient implementation the implicit-mod is nearly free (say < 10% of runtime, and costing O(n) vs the FFT's O(n lg n)).
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
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 |