In Pollard's p-1 algorithm, a large exponent containing many small factors makes divisible by a prime factor whose predecessor divides , by Fermat's little theorem. A greatest common divisor with the number being factored can then separate that prime factor from the others.
Choose base and build factorial exponents using modular exponentiation. The successive exponents , , and giveThe first two greatest common divisors are . At the next step the Euclidean algorithm givesHenceHere the element order of modulo is , which divides , even though does not divide . The algorithm only needs the element order to divide the chosen exponent; divisibility by the full predecessor is a sufficient condition, not a necessary one.