Talk:Lucas-Lehmer test: Difference between revisions

Content added Content deleted
No edit summary
m (added whitespace, used subscript for M23209 in section header, made a sub-header section to a header section.)
Line 1: Line 1:
== M23,209 is 36 CPU hours ≡ 1979 ==
== M<small><sub>23,209</sub></small> &nbsp; is &nbsp; 36 &nbsp; CPU hours ≡ 1979 ==
Welcome to 1979!
Welcome to 1979!
:Yeah. I know. :-) --[[User:Short Circuit|Short Circuit]] 07:55, 21 February 2008 (MST)
:Yeah. I know. :-) --[[User:Short Circuit|Short Circuit]] 07:55, 21 February 2008 (MST)

===List of known Mersenne primes===
==List of known Mersenne primes==
The table below lists all known Mersenne primes:
The table below lists all known Mersenne primes:
{| class="wikitable"
{| class="wikitable"
Line 325: Line 326:


== Java precision ==
== Java precision ==

The Java version is still limited by types. Integer.parseInt(args[0]) limits p to 2147483647. Also the fact that isMersennePrime takes an int limits it there too. For full arbitrary precision every int needs to be a BigInteger or BigDecimal and a square root method will need to be created for them. The limitation is OK I think (I don't think we'll be getting up to 2<sup>2147483647</sup> - 1 anytime soon), but the claim "any arbitrary prime" is false because of the use of ints. --[[User:Mwn3d|Mwn3d]] 07:45, 21 February 2008 (MST)
The Java version is still limited by types. Integer.parseInt(args[0]) limits p to 2147483647. Also the fact that isMersennePrime takes an int limits it there too. For full arbitrary precision every int needs to be a BigInteger or BigDecimal and a square root method will need to be created for them. The limitation is OK I think (I don't think we'll be getting up to 2<sup>2147483647</sup> - 1 anytime soon), but the claim "any arbitrary prime" is false because of the use of ints. --[[User:Mwn3d|Mwn3d]] 07:45, 21 February 2008 (MST)



== Speeding things up ==
== Speeding things up ==

The main loop in Lucas-Lehmer is doing (n*n) mod M where M=2^p-1, and p > 1. '''But we can do it without division'''.
The main loop in Lucas-Lehmer is doing (n*n) mod M where M=2^p-1, and p > 1. '''But we can do it without division'''.