Jump to content

Lucas-Lehmer test: Difference between revisions

no edit summary
(→‎{{header|Perl}}: add Perl 6 entry)
No edit summary
Line 1:
{{task|Prime Numbers}}[[Category:Arbitrary precision]][[Category:Arithmetic operations]]
Lucas-Lehmer Test: for <math>p</math> aan 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>.
 
The following programs calculate all Mersenne primes up to the implementation's
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.