PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: No information on entry rating
[parent] Pollard's $p - 1$ algorithm (Algorithm)

Pollard's $p - 1$ method is an integer factorization algorithm devised by John Pollard in 1974 to take advantage of Fermat's little theorem. Theoretically, trial division always returns a result (though of course in practice the computing engine's resources could be exhausted or the user might not to be around to care for the result). Pollard's $p - 1$ algorithm, on the other hand, was designed from the outset to cope with the possibility of failure to return a result.

Choose a test cap $B$ and call Pollard's $p - 1$ algorithm with a positive integer.

  1. Use a simple method (such as the sieve of Eratosthenes) to find primes $p < B$ , or even probable primes.
  2. Choose an integer $a$ coprime to $n$ . If $n$ is odd (which can be tested easily enough by looking at the least significant bit) then one possible choice is $a = 2$ . For even $n$ , we could choose $\lfloor \sqrt{n} \rfloor + 1$ .
  3. Find the exponent $e$ such that $p^e \le B$ . Then for each $p < B$ , compute $b = a^{p^e} \mod n$ and see if $1 < \gcd(b - 1, n) < n$ . If that's the case, return those results of the greatest common divisor function, exit.
  4. If the GCD function consistently returned 1s, one could try a higher test cap and try again from step 1.
  5. If the GCD function consistently returned $n$ itself, this could indicate that $a$ is in fact not coprime to $n$ , in which case one could try going back to step 2 to pick a different $a$ .
  6. Throw a failure exception.

For example, $n = 221$ . Of course it's overkill to use the Pollard $p - 1$ algorithm on such a small number, but it helps to keep the example simple. Since the running time of the algorithm is exponential, Crandall and Pomerance suggest picking small $B$ . So for this example let's pick $B = 10$ , the primes are then 2, 3, 5, 7, and the exponents are 3, 2, 1, 1. Since 221 is odd, we try $a = 2$ . So we see that $2^8 \mod 221 = 35$ , and $\gcd(34, 221) = 17$ . We also see $3^9 \mod 221 = 14$ and $\gcd(13, 221) = 13$ . Multiplication immediately verifies that $13 \times 17 = 221$ .

As of version 5.2, Pollard's $p - 1$ algorithm is one of the methods used by Mathematica's FactorInteger function after ferreting out small factors by trial division.

Bibliography

1
R. Crandall & C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001: 5.4.1




"Pollard's $p - 1$ algorithm" is owned by PrimeFan.
(view preamble | get metadata)

View style:

Other names:  Pollard $p - 1$ algorithm, Pollard's p minus 1 algorithm, Pollard p minus 1 algorithm, Pollard $p - 1$ method, Pollard's p minus 1 method, Pollard p minus 1 method, Pollard's $p - 1$ method

This object's parent.

Attachments:
examples of Pollard's $p - 1$ algorithm on a few integers (Example) by PrimeFan
Log in to rate this entry.
(view current ratings)

Cross-references: factors, Mathematica's, multiplication, exponential, running, number, function, greatest common divisor, exponent, least significant bit, odd, coprime, probable primes, even, primes, sieve of Eratosthenes, simple, integer, positive, trial division, Fermat's little theorem, John Pollard, algorithm, integer factorization
There are 2 references to this entry.

This is version 5 of Pollard's $p - 1$ algorithm, born on 2007-02-22, modified 2008-06-27.
Object id is 8951, canonical name is PollardsP1Algorithm.
Accessed 5349 times total.

Classification:
AMS MSC11A41 (Number theory :: Elementary number theory :: Primes)

Pending Errata and Addenda
None.
[ View all 3 ]
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add example | add (any)