mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Reply
 
Thread Tools
Old 2008-03-04, 13:04   #1
kuratkull
 
kuratkull's Avatar
 
Mar 2007
Estonia

2·71 Posts
Unhappy LLR test starting values

Hello, I am in the process of rewriting some primality check proggies for myself.
Rabin-Miller is finished.
Lucas-Lehmer is almost finished...only needs a rewrite in GMP(GNU BigNum lib) to support large integers.

But now I am on Lucas-Lehmer-Riesel tests. The ordinary LL test is easy on the starting value, but for LLRs I could only find this on Wikipedia:
  • If k is equal to 1, and n is odd, then we are dealing with Mersenne numbers, and can take u0 = 4.
  • If n = 3 (mod 4), then we can take u0 = 3.
  • If k = 3, and n = 0 or 3 mod 4 then u0 = 5778.
  • If k = 1 or 5 mod 6 and 3 does not divide N, then we take u0 = (2+sqrt(3))^k + (2-sqrt(3))^k.
  • Otherwise, we are in the case where k is a multiple of 3, and it is more difficult to select the right value of u0
Since I intend my proggie to be compatible with all inputs, it would be nice to know how to calculate the correct numbers.

Any help?

Thanks in advance,
kuratkull
kuratkull is offline   Reply With Quote
Old 2008-03-04, 17:17   #2
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

2×33×109 Posts
Default

can someone rewrite that thing on wikipedia
there have been a few wondering about this
unfortunately i cant find the thread of the last conversation on thiss subject
henryzz is offline   Reply With Quote
Old 2008-03-04, 18:45   #3
m_f_h
 
m_f_h's Avatar
 
Feb 2007

24×33 Posts
Default

Quote:
Originally Posted by henryzz View Post
can someone rewrite that thing on wikipedia
there have been a few wondering about this
unfortunately i cant find the thread of the last conversation on thiss subject
hum, I'd have said to look at the source of llr and found a link,
http://www.mersenne.org/gimps/llrsource.zip
on
http://forums.amd.com/forum/messagev...&enterthread=y

but that file has disappeared... is there a (c) issue?

anyway, in
Lucasian Criteria for the Primality of $\mathcal{N} = h \cdot 2^n - 1$
Hans Riesel
Mathematics of Computation, Vol. 23, No. 108 (Oct., 1969), pp. 869-875
doi:10.2307/2004975

it is suggested to take (for odd k < 2^n >= 4)
u0 = alpha^k+alpha^-k with alpha=(a+b sqrt(D))^2/r, (r/N)(a^2-b^2 D)/r=(D/N)=-1, r=|a^2-b^2 D|, N=k 2^n-1.

PS: D is squarefree, (D/N) is the Legendre symbol. Riesel himself says that he tries out values of D to find a suitable one.

Last fiddled with by m_f_h on 2008-03-04 at 18:59
m_f_h is offline   Reply With Quote
Old 2008-03-04, 19:55   #4
kuratkull
 
kuratkull's Avatar
 
Mar 2007
Estonia

2·71 Posts
Default

Thanks m_f_h,
It's not very clear to me when I look it now, but I will give it another look tomorrow...it's late now :)
Thanks again!
kuratkull is offline   Reply With Quote
Old 2008-03-04, 19:59   #5
m_f_h
 
m_f_h's Avatar
 
Feb 2007

24×33 Posts
Default

Quote:
Originally Posted by kuratkull View Post
It's not very clear (...)
That's basically what is written on wikipedia... ;-)
I'm kidding - one could add these criteria from Riesel's Thm.5 of the cited article, but would this be useful/adequate for WP? I'll put a ref. to Riesel's article, though.

PS: Finally I also found the src of llr - if I looked at the right place, there it is also done using a loop that essentially checks all possibilities until finding one verifying the criteria.

PPS: the thread: http://www.mersenneforum.org/showthread.php?p=123605#12 - the issue ended with
"...(and to help me understand what starting numbers to use)"...

Last fiddled with by m_f_h on 2008-03-04 at 20:17
m_f_h is offline   Reply With Quote
Old 2008-03-04, 20:10   #6
kuratkull
 
kuratkull's Avatar
 
Mar 2007
Estonia

2·71 Posts
Default

Ok, I looked at it now...and with a bit of fiddling, I'm sure I'd get it to work.
Your post hinted me to go to Jean's original page, and there was the source ;)
Thanks.
kuratkull is offline   Reply With Quote
Old 2008-03-05, 13:02   #7
kuratkull
 
kuratkull's Avatar
 
Mar 2007
Estonia

2×71 Posts
Default

Quote:
Originally Posted by m_f_h View Post
it is suggested to take (for odd k < 2^n >= 4)
u0 = alpha^k+alpha^-k with alpha=(a+b sqrt(D))^2/r, (r/N)(a^2-b^2 D)/r=(D/N)=-1, r=|a^2-b^2 D|, N=k 2^n-1.

PS: D is squarefree, (D/N) is the Legendre symbol. Riesel himself says that he tries out values of D to find a suitable one.
Ok, as I understand, I will loop through increasing values of D(while I check if D is square-free and legendre(D/N) == -1), until one fits.
Besides D, I have the value N, k and n.
But how do I get the values a, b and r? I cracked myself over this for some time, but I couldn't figure it out :(

Thanks for any further help :)

-kuratkull
kuratkull is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
mfaktc not starting in Mac OSX bayanne GPU Computing 0 2014-05-10 14:38
Disk starting to go Chuck Hardware 8 2013-05-20 06:40
Starting new bases MrOzzy Conjectures 'R Us 104 2010-03-18 22:11
mprime starting spaz Software 9 2009-05-03 06:41
On the size of values to test by Factorazation Alg ThiloHarich Factoring 6 2009-03-30 17:42

All times are UTC. The time now is 19:22.


Sun Aug 1 19:22:53 UTC 2021 up 9 days, 13:51, 1 user, load averages: 2.00, 1.89, 1.95

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.