<s>
In	O
computational	O
number	O
theory	O
,	O
Williams	O
's	O
p	O
+	O
1	O
algorithm	O
is	O
an	O
integer	O
factorization	O
algorithm	O
,	O
one	O
of	O
the	O
family	O
of	O
algebraic-group	B-Algorithm
factorisation	I-Algorithm
algorithms	I-Algorithm
.	O
</s>
<s>
It	O
uses	O
Lucas	B-Algorithm
sequences	I-Algorithm
to	O
perform	O
exponentiation	O
in	O
a	O
quadratic	O
field	O
.	O
</s>
<s>
Choose	O
some	O
integer	O
A	O
greater	O
than	O
2	O
which	O
characterizes	O
the	O
Lucas	B-Algorithm
sequence	I-Algorithm
:	O
</s>
<s>
Notice	O
that	O
p+1	B-Algorithm
=	O
140	O
=	O
22	O
5	O
7	O
.	O
</s>
<s>
As	O
can	O
be	O
seen	O
in	O
these	O
examples	O
we	O
do	O
not	O
know	O
in	O
advance	O
whether	O
the	O
prime	O
that	O
will	O
be	O
found	O
has	O
a	O
smooth	O
p+1	B-Algorithm
or	O
p−1	O
.	O
</s>
<s>
Based	O
on	O
Pollard	O
's	O
p	B-Algorithm
−	I-Algorithm
1	I-Algorithm
and	O
Williams	O
's	O
p+1	B-Algorithm
factoring	O
algorithms	O
,	O
Eric	O
Bach	O
and	O
Jeffrey	O
Shallit	O
developed	O
techniques	O
to	O
factor	O
n	O
efficiently	O
provided	O
that	O
it	O
has	O
a	O
prime	O
factor	O
p	O
such	O
that	O
any	O
kth	O
cyclotomic	O
polynomial	O
Φk(p )	O
is	O
smooth	O
.	O
</s>
<s>
The	O
first	O
few	O
cyclotomic	O
polynomials	O
are	O
given	O
by	O
the	O
sequence	O
Φ1(p )	O
=	O
p−1	O
,	O
Φ2(p )	O
=	O
p+1	B-Algorithm
,	O
Φ3(p )	O
=	O
p2+p+1	O
,	O
and	O
Φ4(p )	O
=	O
p2+1	O
.	O
</s>
