What benefits does the two stage variant of Pollard's p-1 have? How is it different?

258 Views Asked by At

There is a two stage variant of Pollard's p-1. In terms of application what is the difference between it and the normal one? Is the two stage variant faster? Is the only practical difference that it can find one more factor larger than the bound $B1$?

There are many two-stage implementations but I'm having trouble following the code. Some of the programming languages I don't get and some I suspect have bugs (because variables appear out of no where):

  1. Python example in Question
  2. Two more Python examples in Answers
  3. Scheme language implementation?
  4. Haskell language implementation

In the first few links there is a "cache", what does cache have anything to do with it?

Can anyone provide me with an example of using the two-stage variant in a situation where the one stage would fail?

2

There are 2 best solutions below

8
On

The two-stage-version usually finds a nontrivial factor , if there is a prime factor $p$ such that $p-1$ splits into prime factors not exceeding B1 and a single prime factor that is not exceeding B2 (often 100 times B1, but we can choose this B2 also larger).

This , of course , improves the chance to find a prime factor.

I do not know the details of stage 2 (because I only understood stage 1), but stage 2 must be faster than it would be the case if we simply would increase B1. Otherwise stage 2 would not make sense.

5
On

The basic reason to use the 2 stage version is that a significant amount of numbers have all but 1 factor small. Since P-1 won't be the last factorization technique you will use, the question is what bounds for B1 and B2 will get the highest anime of non-primes for the least effort.