The Lucas - Lehmer Test

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu
10/12/08

tu=TimeUsed[];z=1;Do[n=Prime[k];
If[Nest[Function[s,Mod[s^2-2,2^n-1]],4,n-2]==0,s=TimeUsed[]-tu;z++;If[s>=120,Print[z,"\t",n, "\t" ,IntegerPart[s/60]," min."],Print[z,"\t",n, "\t" ,s," sec."]];,],{k,1,10000}]