<s>
In	O
mathematics	O
,	O
the	O
Lucas	B-Algorithm
–	I-Algorithm
Lehmer	I-Algorithm
test	I-Algorithm
(	O
LLT	O
)	O
is	O
a	O
primality	B-Algorithm
test	I-Algorithm
for	O
Mersenne	O
numbers	O
.	O
</s>
<s>
The	O
Lucas	B-Algorithm
–	I-Algorithm
Lehmer	I-Algorithm
test	I-Algorithm
works	O
as	O
follows	O
.	O
</s>
<s>
The	O
primality	O
of	O
p	O
can	O
be	O
efficiently	O
checked	O
with	O
a	O
simple	O
algorithm	O
like	O
trial	B-Algorithm
division	I-Algorithm
since	O
p	O
is	O
exponentially	O
smaller	O
than	O
Mp	O
.	O
</s>
<s>
The	O
Lucas-Lehmer	B-Algorithm
residue	I-Algorithm
calculated	O
with	O
these	O
alternative	O
starting	O
values	O
will	O
still	O
be	O
zero	O
if	O
Mp	O
is	O
a	O
Mersenne	O
prime	O
.	O
</s>
<s>
However	O
,	O
the	O
terms	O
of	O
the	O
sequence	O
will	O
be	O
different	O
and	O
a	O
non-zero	O
Lucas-Lehmer	B-Algorithm
residue	I-Algorithm
for	O
non-prime	O
Mp	O
will	O
have	O
a	O
different	O
numerical	O
value	O
from	O
the	O
non-zero	O
value	O
calculated	O
when	O
s0	O
=	O
4	O
.	O
</s>
<s>
With	O
the	O
modulus	O
out	O
of	O
the	O
way	O
,	O
the	O
asymptotic	O
complexity	O
of	O
the	O
algorithm	O
only	O
depends	O
on	O
the	O
multiplication	B-Algorithm
algorithm	I-Algorithm
used	O
to	O
square	O
s	O
at	O
each	O
step	O
.	O
</s>
<s>
A	O
more	O
efficient	O
multiplication	B-Algorithm
algorithm	I-Algorithm
is	O
the	O
Schönhage	B-Algorithm
–	I-Algorithm
Strassen	I-Algorithm
algorithm	I-Algorithm
,	O
which	O
is	O
based	O
on	O
the	O
Fast	O
Fourier	O
transform	O
.	O
</s>
<s>
An	O
even	O
more	O
efficient	O
multiplication	B-Algorithm
algorithm	I-Algorithm
,	O
Fürer	O
's	O
algorithm	O
,	O
only	O
needs	O
time	O
to	O
multiply	O
two	O
p-bit	O
numbers	O
.	O
</s>
<s>
By	O
comparison	O
,	O
the	O
most	O
efficient	O
randomized	O
primality	B-Algorithm
test	I-Algorithm
for	O
general	O
integers	O
,	O
the	O
Miller	B-Algorithm
–	I-Algorithm
Rabin	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
requires	O
O(k n2 log n log log n )	O
bit	O
operations	O
using	O
FFT	O
multiplication	O
for	O
an	O
n-digit	O
number	O
,	O
where	O
k	O
is	O
the	O
number	O
of	O
iterations	O
and	O
is	O
related	O
to	O
the	O
error	O
rate	O
.	O
</s>
<s>
For	O
constant	O
k	O
,	O
this	O
is	O
in	O
the	O
same	O
complexity	O
class	O
as	O
the	O
Lucas-Lehmer	B-Algorithm
test	I-Algorithm
.	O
</s>
<s>
The	O
most	O
efficient	O
deterministic	O
primality	B-Algorithm
test	I-Algorithm
for	O
any	O
n-digit	O
number	O
,	O
the	O
AKS	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
requires	O
Õ(n6 )	O
bit	O
operations	O
in	O
its	O
best	O
known	O
variant	O
and	O
is	O
extremely	O
slow	O
even	O
for	O
relatively	O
small	O
values	O
.	O
</s>
<s>
The	O
Lucas	B-Algorithm
–	I-Algorithm
Lehmer	I-Algorithm
test	I-Algorithm
verifies	O
this	O
as	O
follows	O
.	O
</s>
<s>
Although	O
M11	O
=	O
2047	O
has	O
nontrivial	O
factors	O
,	O
the	O
Lucas	B-Algorithm
–	I-Algorithm
Lehmer	I-Algorithm
test	I-Algorithm
gives	O
no	O
indication	O
about	O
what	O
they	O
might	O
be	O
.	O
</s>
<s>
It	O
then	O
follows	O
by	B-Algorithm
induction	I-Algorithm
that	O
for	O
all	O
i	O
:	O
</s>
<s>
The	O
Lucas	B-Algorithm
–	I-Algorithm
Lehmer	I-Algorithm
test	I-Algorithm
is	O
one	O
of	O
the	O
main	O
primality	B-Algorithm
tests	I-Algorithm
used	O
by	O
the	O
Great	O
Internet	O
Mersenne	O
Prime	O
Search	O
(	O
GIMPS	B-Application
)	O
to	O
locate	O
large	O
primes	O
.	O
</s>
<s>
In	O
contrast	O
,	O
the	O
equivalently	O
fast	O
Pépin	B-Algorithm
's	I-Algorithm
test	I-Algorithm
for	O
any	O
Fermat	O
number	O
can	O
only	O
be	O
used	O
on	O
a	O
much	O
smaller	O
set	O
of	O
very	O
large	O
numbers	O
before	O
reaching	O
computational	O
limits	O
.	O
</s>
