<s>
Lucas	B-Algorithm
pseudoprimes	I-Algorithm
and	O
Fibonacci	O
pseudoprimes	O
are	O
composite	O
integers	O
that	O
pass	O
certain	O
tests	O
which	O
all	O
primes	O
and	O
very	O
few	O
composite	O
numbers	O
pass	O
:	O
in	O
this	O
case	O
,	O
criteria	O
relative	O
to	O
some	O
Lucas	B-Algorithm
sequence	I-Algorithm
.	O
</s>
<s>
Baillie	O
and	O
Wagstaff	O
define	O
Lucas	B-Algorithm
pseudoprimes	I-Algorithm
as	O
follows	O
:	O
Given	O
integers	O
P	O
and	O
Q	O
,	O
where	O
P	O
>	O
0	O
and	O
,	O
</s>
<s>
let	O
Uk(P, Q )	O
and	O
Vk(P, Q )	O
be	O
the	O
corresponding	O
Lucas	B-Algorithm
sequences	I-Algorithm
.	O
</s>
<s>
These	O
are	O
the	O
key	O
facts	O
that	O
make	O
Lucas	B-Algorithm
sequences	I-Algorithm
useful	O
in	O
primality	B-Algorithm
testing	I-Algorithm
.	O
</s>
<s>
The	O
congruence	O
(	O
)	O
represents	O
one	O
of	O
two	O
congruences	O
defining	O
a	O
Frobenius	B-Algorithm
pseudoprime	I-Algorithm
.	O
</s>
<s>
Hence	O
,	O
every	O
Frobenius	B-Algorithm
pseudoprime	I-Algorithm
is	O
also	O
a	O
Baillie-Wagstaff-Lucas	O
pseudoprime	O
,	O
but	O
the	O
converse	O
does	O
not	O
always	O
hold	O
.	O
</s>
<s>
Some	O
good	O
references	O
are	O
chapter	O
8	O
of	O
the	O
book	O
by	O
Bressoud	O
and	O
Wagon	O
(	O
with	O
Mathematica	B-Language
code	O
)	O
,	O
pages	O
142	O
–	O
152	O
of	O
the	O
book	O
by	O
Crandall	O
and	O
Pomerance	O
,	O
and	O
pages	O
53	O
–	O
74	O
of	O
the	O
book	O
by	O
Ribenboim	O
.	O
</s>
<s>
A	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
for	O
a	O
given	O
(	O
P	O
,	O
Q	O
)	O
pair	O
is	O
a	O
positive	O
composite	O
integer	O
n	O
for	O
which	O
equation	O
(	O
)	O
is	O
true	O
(	O
see	O
,	O
page	O
1391	O
)	O
.	O
</s>
<s>
This	O
is	O
especially	O
important	O
when	O
combining	O
a	O
Lucas	O
test	O
with	O
a	O
strong	B-Algorithm
pseudoprime	I-Algorithm
test	O
,	O
such	O
as	O
the	O
Baillie	B-Algorithm
–	I-Algorithm
PSW	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
.	O
</s>
<s>
In	O
this	O
case	O
,	O
either	O
n	O
is	O
prime	O
or	O
it	O
is	O
a	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
.	O
</s>
<s>
As	O
is	O
the	O
case	O
with	O
any	O
other	O
probabilistic	O
primality	B-Algorithm
test	I-Algorithm
,	O
if	O
we	O
perform	O
additional	O
Lucas	O
tests	O
with	O
different	O
D	O
,	O
P	O
and	O
Q	O
,	O
then	O
unless	O
one	O
of	O
the	O
tests	O
proves	O
that	O
n	O
is	O
composite	O
,	O
we	O
gain	O
more	O
confidence	O
that	O
n	O
is	O
prime	O
.	O
</s>
<s>
In	O
this	O
case	O
19	O
is	O
prime	O
,	O
so	O
it	O
is	O
not	O
a	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
.	O
</s>
<s>
However	O
,	O
119	O
=	O
7·17	O
is	O
not	O
prime	O
,	O
so	O
119	O
is	O
a	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
for	O
this	O
(	O
P	O
,	O
Q	O
)	O
pair	O
.	O
</s>
<s>
A	O
strong	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
is	O
also	O
a	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
(	O
for	O
the	O
same	O
(	O
P	O
,	O
Q	O
)	O
pair	O
)	O
,	O
but	O
the	O
converse	O
is	O
not	O
necessarily	O
true	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
strong	O
test	O
is	O
a	O
more	O
stringent	O
primality	B-Algorithm
test	I-Algorithm
than	O
equation	O
(	O
)	O
.	O
</s>
<s>
There	O
are	O
infinitely	O
many	O
strong	O
Lucas	B-Algorithm
pseudoprimes	I-Algorithm
,	O
and	O
therefore	O
,	O
infinitely	O
many	O
Lucas	B-Algorithm
pseudoprimes	I-Algorithm
.	O
</s>
<s>
Then	O
there	O
is	O
a	O
positive	O
constant	O
(	O
depending	O
on	O
and	O
)	O
such	O
that	O
the	O
number	O
of	O
strong	O
Lucas	B-Algorithm
pseudoprimes	I-Algorithm
not	O
exceeding	O
is	O
greater	O
than	O
,	O
for	O
sufficiently	O
large	O
.	O
</s>
<s>
We	O
can	O
set	O
Q	O
=	O
−1	O
,	O
then	O
and	O
are	O
P-Fibonacci	O
sequence	O
and	O
P-Lucas	O
sequence	O
,	O
the	O
pseudoprimes	O
can	O
be	O
called	O
strong	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
in	O
base	O
P	O
,	O
for	O
example	O
,	O
the	O
least	O
strong	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
with	O
P	O
=	O
1	O
,	O
2	O
,	O
3	O
,	O
...	O
are	O
4181	O
,	O
169	O
,	O
119	O
,	O
...	O
</s>
<s>
An	O
extra	B-Algorithm
strong	I-Algorithm
Lucas	I-Algorithm
pseudoprime	I-Algorithm
is	O
also	O
a	O
strong	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
for	O
the	O
same	O
pair	O
.	O
</s>
<s>
Before	O
embarking	O
on	O
a	O
probable	O
prime	B-Algorithm
test	I-Algorithm
,	O
one	O
usually	O
verifies	O
that	O
n	O
,	O
the	O
number	O
to	O
be	O
tested	O
for	O
primality	O
,	O
is	O
odd	O
,	O
is	O
not	O
a	O
perfect	O
square	O
,	O
and	O
is	O
not	O
divisible	O
by	O
any	O
small	O
prime	O
less	O
than	O
some	O
convenient	O
limit	O
.	O
</s>
<s>
We	O
choose	O
a	O
Lucas	B-Algorithm
sequence	I-Algorithm
where	O
the	O
Jacobi	O
symbol	O
,	O
so	O
that	O
δ(n )	O
=	O
n	O
+	O
1	O
.	O
</s>
<s>
When	O
D	O
,	O
P	O
,	O
and	O
Q	O
are	O
chosen	O
as	O
described	O
above	O
,	O
the	O
first	O
10	O
Lucas	B-Algorithm
pseudoprimes	I-Algorithm
are	O
(	O
see	O
page	O
1401	O
of	O
)	O
:	O
</s>
<s>
To	O
calculate	O
a	O
list	O
of	O
extra	B-Algorithm
strong	I-Algorithm
Lucas	I-Algorithm
pseudoprimes	I-Algorithm
,	O
set	O
.	O
</s>
<s>
Although	O
this	O
congruence	O
condition	O
is	O
not	O
,	O
by	O
definition	O
,	O
part	O
of	O
the	O
Lucas	O
probable	O
prime	B-Algorithm
test	I-Algorithm
,	O
it	O
is	O
almost	O
free	O
to	O
check	O
this	O
condition	O
because	O
,	O
as	O
noted	O
above	O
,	O
the	O
value	O
of	O
Vn+1	O
was	O
computed	O
in	O
the	O
process	O
of	O
computing	O
Un+1	O
.	O
</s>
<s>
Provided	O
GCD(n, Q )	O
=	O
1	O
then	O
testing	O
for	O
congruence	O
(	O
)	O
is	O
equivalent	O
to	O
augmenting	O
our	O
Lucas	O
test	O
with	O
a	O
"	O
base	O
Q	O
"	O
Solovay	O
–	O
Strassen	O
primality	B-Algorithm
test	I-Algorithm
.	O
</s>
<s>
k	O
applications	O
of	O
the	O
Miller	B-Algorithm
–	I-Algorithm
Rabin	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
declare	O
a	O
composite	O
n	O
to	O
be	O
probably	O
prime	O
with	O
a	O
probability	O
at	O
most	O
(	O
1/4	O
)	O
k	O
.	O
</s>
<s>
There	O
is	O
a	O
similar	O
probability	O
estimate	O
for	O
the	O
strong	O
Lucas	O
probable	O
prime	B-Algorithm
test	I-Algorithm
.	O
</s>
<s>
By	O
combining	O
a	O
Lucas	B-Algorithm
pseudoprime	I-Algorithm
test	O
with	O
a	O
Fermat	B-Algorithm
primality	I-Algorithm
test	I-Algorithm
,	O
say	O
,	O
to	O
base	O
2	O
,	O
one	O
can	O
obtain	O
very	O
powerful	O
probabilistic	O
tests	O
for	O
primality	O
,	O
such	O
as	O
the	O
Baillie	B-Algorithm
–	I-Algorithm
PSW	I-Algorithm
primality	I-Algorithm
test	I-Algorithm
.	O
</s>
<s>
If	O
n	O
is	O
congruent	O
to	O
2	O
or	O
3	O
modulo	O
5	O
,	O
then	O
Bressoud	O
,	O
and	O
Crandall	O
and	O
Pomerance	O
point	O
out	O
that	O
it	O
is	O
rare	O
for	O
a	O
Fibonacci	O
pseudoprime	O
to	O
also	O
be	O
a	O
Fermat	B-Algorithm
pseudoprime	I-Algorithm
base	O
2	O
.	O
</s>
<s>
However	O
,	O
when	O
n	O
is	O
congruent	O
to	O
1	O
or	O
4	O
modulo	O
5	O
,	O
the	O
opposite	O
is	O
true	O
,	O
with	O
over	O
12%	O
of	O
Fibonacci	O
pseudoprimes	O
under	O
1011	O
also	O
being	O
base-2	O
Fermat	B-Algorithm
pseudoprimes	I-Algorithm
.	O
</s>
