RosettaCodeData/Task/Lucas-Lehmer-test/00DESCRIPTION
2018-06-22 20:57:24 +00:00

7 lines
389 B
Text

Lucas-Lehmer Test: for <math>p</math> an odd prime, the Mersenne number <math>2^p-1</math> is prime if and only if <math>2^p-1</math> divides <math>S(p-1)</math> where <math>S(n+1)=(S(n))^2-2</math>, and <math>S(1)=4</math>.
;Task:
Calculate all Mersenne primes up to the implementation's
maximum precision, or the 47<sup>th</sup> Mersenne prime &nbsp; (whichever comes first).
<br><br>