View Single Post
 2004-08-01, 12:12 #2 jfollas   Jul 2004 2×7 Posts The LL test will zero out for a prime number Mp on step P-1 if the starting term is from the sequence: A(0)=4, A(1)=52, A(n)=(14*A(n-1) - A(n-2)) mod Mp [Sloane A018844] It is possible that the LL test will zero out before the P-1 step if a starting term other than what's provided by the sequence above is used. For instance, say you started with 194 (the 3rd natural term if you start with 4). Then you can expect two less steps will be required in order to reach the primality conclusion. Note also that some LL test programs (glucas comes to mind, but I'm not sure about Prime95) check to see if you have a zero term (or a two term) before the expected end of test, and if so, declares the test a failure at that point. These programs also randomly shift the starting term of "4" so that two different runs of the LL test can be performed at the same time, which should produce the same end result. However, in the slim chance that one of these shifts turns out to be a natural intermediate term, then you're going to reach a premature end of the LL test from an iterative viewpoint (because you would in fact be starting somewhere in the middle). If the LL sequence begins to loop using a starting term from the sequence above, then the Mersenne being tested is not prime. IOW, the LL sequence modulo a prime Mersenne will contain unique terms all the way to the zero term (P-1), followed by a negative two" term (P), followed then by all "two" terms (P+1 to infinity).