Generalization
Based on Pollard's p-1 and Williams' p+1 factoring algorithms, Eric Bach and Jeffrey Shallit developed techniques to factor n efficiently provided that is has a prime factor p such that any kth cyclotomic polynomial Φk(p) is smooth. The first few cyclotomic polynomials are given by the sequence Φ1(p) = p-1, Φ2(p) = p+1, Φ3(p) = p2+p+1, and Φ4(p) = p2+1.
Read more about this topic: Williams' P + 1 Algorithm