Lucas-Lehmer test: Difference between revisions

math in introduction
(math in introduction)
Line 1:
{{task|Prime Numbers}}[[Category:Arbitrary precision]][[Category:Arithmetic operations]]
Lucas-Lehmer Test: for <math>p</math> a 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>.
and only if 2**p-1 divides S(p-1) where S(n+1)=S(n)**2-2, and S(1)=4.
 
The following programs calculate all Mersenne primes up to the implementation's