next up previous
Next: Pollard's Method in Action! Up: Lecture 30: Using Elliptic Previous: Power-Smoothness

Pollard's $ (p-1)$-Method

Let $ N$ be an integer that we wish to factor. Choose a positive integer $ B$ (usually $ \leq 10^6$ in practice). The Pollard $ (p-1)$-method hunts for prime divisors $ p$ of $ N$ such that $ p-1$ is $ B$-power-smooth. Here is the strategy. Suppose that $ p\mid N$ and $ a>1$ is an integer that is prime to $ p$. By Fermat's Little Theorem,

$\displaystyle a^{p-1}\equiv 1\pmod{p}.
$

Assume that further that $ p-1$ is $ B$-power-smooth and let $ m=\lcm(1,2,3,\ldots B)$. Then $ B\mid m$, so $ p-1\mid m$, and so

$\displaystyle a^m \equiv 1 \pmod{p}.
$

Thus

$\displaystyle p\mid \gcd(a^m-1,N) > 1.
$

Usually $ \gcd(a^m-1,N)<N$ also, and when this is the case we have split $ N$. In the unlikely case when $ \gcd(a^m-1,N)=N$, then $ a^m\equiv 1\pmod{q^r}$ for every prime power divisor of $ N$. In this case, repeat the above steps but with a smaller choice of $ B$ (so that $ m$ is smaller). Also, it's a good idea to check from the start whether or not $ N$ is not a perfect power $ M^r$, and if so replace $ N$ by $ M$.

In practice, we don't know $ p$. We choose a $ B$, then an $ a$, cross our fingers, and proceed. If we split $ N$, great! If not, increase $ B$ or change $ a$ and try again.

For fixed $ B$, this algorithm works when $ N$ is divisible by a prime $ p$ such that $ p-1$ is $ B$-power-smooth. How many primes $ p$ have the property that $ p-1$ is $ B$-power-smooth? Is this very common or not? Using the above two functions, we find that roughly 15% of primes $ p$ between $ 10^{15}$ and $ 10^{15}+10000$ are such that $ p-1$ is $ 10^6$ power-smooth.

\\ Count the number of B-power-smooth numbers an interval.
{cnt(B)= s=0;t=0; 
   for(p=10^15, 10^15+10000,  
      if(isprime(p), 
         t++;if(ispowersmooth(p-1,B),s++)
      )
   ); 
   s/t*1.0
}
? cnt(10^6)
%5 = 0.1482889733840304182509505703
Thus the Pollard $ (p-1)$-method with $ B=10^6$ is blind to 85% of the primes around $ 10^{15}$. There are nontrivial theorems about densities of power-smooth numbers, but I will not discuss them today.


next up previous
Next: Pollard's Method in Action! Up: Lecture 30: Using Elliptic Previous: Power-Smoothness
William A Stein 2001-11-27