Talk:Lucas–Lehmer test for Mersenne numbers
From Wikipedia, the free encyclopedia
there is a mistake in the article , it supposed to :
not :
—The preceding unsigned comment was added by 85.250.124.207 (talk • contribs) 07:26, 4 November 2005 (UTC).
- I disagree. M3 is prime and also . That is, . However, ; equivalently, . Therefore I think the article is correct as is stands. Eric119 03:35, 5 November 2005 (UTC)
s0 = 4, so is and not .
[edit] Dumbing this down with an example?
I think it might help some people by giving an example of how the Lucas-Lehmer test can prove primality of say... 2^5-1, for instance. As the article stands, not many people without prior experience of advanced mathematical notation and terms, would be able to take anything useful from this.
- Great idea. Dcoetzee 03:24, 10 May 2007 (UTC)
[edit] A bit confused about high speed mod
I'm a bit confused about the high speed mod operation. The article gives this example:
916 mod 25−1 = 1110010100 mod 25−1
= 11100 + 10100 mod 25−1 = 110000 mod 25−1 = 1 + 10000 mod 25−1 = 10001 mod 25−1 = 10001 = 17.
However if I try it with 14 mod 7 I get this: 14 mod 23−1
= 1110 mod 23−1 = 1 + 110 mod 23−1 = 111 mod 23−1 = 7.
Now I know that 7 mod 7 is 0, but how does the ggiven algo generate a zero ? Thanks —Preceding unsigned comment added by 149.173.6.50 (talk) 15:25, 20 November 2007 (UTC)
- That's a good observation, actually - it's possible for the result to be exactly 2n−1, in which case you have to change it to zero. If it were any larger, you'd reduce it by doing another iteration. Dcoetzee 01:23, 21 November 2007 (UTC)
I think, there are little problems whit this reasoning. First of all, if the modulo operation gives us 0 as a result, then this leads to the next: We arrive at 0, then we square it, it becomes 0 again, then we substract 2, then it is -2. Now, due to the [[1]] article, we can define the modulo of -2, so:
-2 = Mp-2 (mod Mp)
but this computation, namely, that we add Mp to the resutl to get a positive integer is much different from the algorithm described in this article.
Morover, this article states:
"since s × s
will never exceed M2 < 22p"
This statement eables, that the value after the squaring operation be M22p, and thus, the value before the squaring operation be M2. So if the resutlt after the modulo operation is Mp, then we dont't need to convert it to 0.
So it would be needed to clarify this article on my opinion.