Lucas-Lehmer test: Difference between revisions
m
→Version with trial division and fast modular reduction
Line 2,321:
/* do some trial division up to a reasonable depth. */
for(i = 1, (r/4.)^r\p,
q += d;
if(Mod(2,q)^p == 1, return)
|