mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2016-05-21, 08:07   #1
GP2
 
GP2's Avatar
 
Sep 2003

5·11·47 Posts
Default Lucas-Lehmer sequences starting with s0 other than 4

The sequence used in the Lucas-Lehmer test is s0 = 4, si = siāˆ’12 āˆ’ 2.

Raphael Robinson, discoverer of the first Mersenne primes found by computer in the early 1950s (M521, 607, 1279, 2203, 2281), mentioned that "Alternatively, we may start with S1 = 10; or, if n == 3 (mod 4), we may also use S1 = 3." Some of the early hand-computed Mersenne calculations used a starting value of 3, for instance, H.S. Uhler finding M199 to be composite.

These alternative starting values are of no use for GIMPS in general because they produce residues completely different from the ones that you get with the conventional starting value of 4, unless you are verifying a Mersenne prime, in which case the residue will be zero as expected.

I tried to look up various proofs of the Lucas-Lehmer test, but couldn't really understand them, e.g., Terry Tao and a paper by John H. Jaroma. The latter mentions various variants but does not explicitly mention alternative starting values. Nor does the Wikipedia article.

There was an earlier discussion of this topic on this board itself many years ago, but it seemed inconclusive.

The Mersenne wiki mentions the OEIS sequence A018844 of possible starting values for Lucas-Lehmer sequences, including 4, 10, 52, 724, 970, etc. I tried these on very small Mersenne primes with a very simple program and they seemed to work.

I think it would be simple to alter the prime95/mprime source code just for fun, I believe the relevant line would be:
Code:
commonb.c

restart_test:	dbltogw (&lldata.gwdata, 4.0, lldata.lldata);
However, I haven't tried to compile the source yet.

My questions would be:

1) Is the idea of using alternative starting values (other than 4) mathematically sound?

2) When the next Mersenne prime is found, would there be any value in doing a verification run with a modified prime95/mprime program that uses a different starting value? This might be slightly superior to a normal verification run that merely uses a different shift count, because with a different starting value all the bits are entirely different at each iteration rather than the same bits merely being shifted. Naturally additional verification with cudaLucas or mlucas is still needed.
GP2 is offline   Reply With Quote
Old 2016-05-21, 08:14   #2
Nick
 
Nick's Avatar
 
Dec 2012
The Netherlands

2×23×37 Posts
Default

Quote:
Originally Posted by GP2 View Post
1) Is the idea of using alternative starting values (other than 4) mathematically sound?
See Bas Jansen's PhD thesis:
http://www.math.leidenuniv.nl/scripties/PhDJansen.pdf

(The front matter and initial summary are in Dutch, but the main body of the document is in English.)
Nick is offline   Reply With Quote
Old 2016-05-21, 08:22   #3
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

11000001101002 Posts
Default

Quote:
Originally Posted by GP2 View Post
2) When the next Mersenne prime is found, would there be any value in doing a verification run with a modified prime95/mprime program that uses a different starting value? This might be slightly superior to a normal verification run that merely uses a different shift count, because with a different starting value all the bits are entirely different at each iteration rather than the same bits merely being shifted. Naturally additional verification with cudaLucas or mlucas is still needed.
But both the different shift value and a different starting value cause "all the bits [to be] entirely different at each iteration", so no difference there that I can see. But even so, there is still the need to use different software (and preferably different hardware architecture also) to verify. It would be terrible to have some weird and obscure P95 bug show prime for all shifts and/or starting values.when it actually isn't.
retina is online now   Reply With Quote
Old 2016-05-21, 08:53   #4
axn
 
axn's Avatar
 
Jun 2003

5,051 Posts
Default

P95 already supports alternate start values. See this post (and thread)

Last fiddled with by axn on 2016-05-21 at 08:54 Reason: ?
axn is online now   Reply With Quote
Old 2016-05-21, 10:26   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by GP2 View Post
The sequence used in the Lucas-Lehmer test is s0 = 4, si = siāˆ’12 āˆ’ 2.
you can also divide all even value starts by 2 ( that are used in x^2-2 versions) and have versions that use the step 2*x^2-1 that almost mimics what's done in mersenne TF I've even made pari code to do LL and TF with the same code using a flag but it's not fast.
science_man_88 is offline   Reply With Quote
Old 2016-05-21, 16:37   #6
GP2
 
GP2's Avatar
 
Sep 2003

A1916 Posts
Default

Quote:
Originally Posted by axn View Post
P95 already supports alternate start values. See this post (and thread)
Ah, very nice. I hope it doesn't send the "residues from an alternate universe" to PrimeNet though.

I notice it's not documented, even in undoc.txt. Actually, even worktodo.add is undocumented, although it's mentioned in whatsnew.txt. Maybe we need an undocundoc.txt
GP2 is offline   Reply With Quote
Old 2016-05-21, 17:00   #7
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

61278 Posts
Default

Quote:
Originally Posted by GP2 View Post
Ah, very nice. I hope it doesn't send the "residues from an alternate universe" to PrimeNet though.

I notice it's not documented, even in undoc.txt. Actually, even worktodo.add is undocumented, although it's mentioned in whatsnew.txt. Maybe we need an undocundoc.txt
It is probably best if most people do not know how to change the initialvalue since then we will start getting residue miss matches due to that. But the worktodo.add should be added to undoc.txt or readme.txt imo.

Did you see in that thread that there are 2 infinite series of initial values starting at 4 and 10:
A(1)=4, A(2)=52, A(N)=14*A(N-1)-A(N-2)
B(1)=10, B(2)=970, B(N)=98*B(N-1)-B(N-2)

Last fiddled with by ATH on 2016-05-21 at 17:00
ATH is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lucas-Lehmer Primes henryzz And now for something completely different 42 2019-06-03 14:09
Lucas-Lehmer test Mathsgirl Information & Answers 23 2014-12-10 16:25
lucas-lehmer theorem Robot2357 Math 6 2013-06-15 03:10
Lucas-Lehmer Test storm5510 Math 22 2009-09-24 22:32
Lucas-Lehmer Dougal Information & Answers 9 2009-02-06 10:25

All times are UTC. The time now is 18:18.


Fri Jul 16 18:18:30 UTC 2021 up 49 days, 16:05, 1 user, load averages: 3.13, 2.56, 2.15

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.