If $N-1$ could be factored easily with several small prime factors, then what is the fastest way to check $N$ for primality?


I'm aware of Pocklington primility test which is not good for small factors. I'm looking for a reduction in modular exponentitation when $N-1$ has several small factors.

  • 1
    $\begingroup$ Are you familiar with the Pocklington test, en.wikipedia.org/wiki/Pocklington_primality_test ? $\endgroup$ Dec 3, 2012 at 9:59
  • $\begingroup$ It is not fast, since finally it requires modular exponentiation with $N-1$ in exponent, which requires the same time of Fermat Little Theorem PRP test. $\endgroup$ Dec 3, 2012 at 10:15
  • 1
    $\begingroup$ The pocklington test relies on the fact that $N-1$ is divisible by some relatively large prime, which doesn't seem to be the case. $\endgroup$
    – Arthur
    Dec 3, 2012 at 11:05
  • 1
    $\begingroup$ @Arthur: See the section "Generalized Pocklington method" in the Pocklington Test Wikipedia article. This removes youe restriction. $\endgroup$
    – TonyK
    Dec 3, 2012 at 11:11
  • 1
    $\begingroup$ @Arthur: You should do these exponentiation in parallel, to save even more time. I don't mean using multiple processors, I mean exponentiating them all at once by incorporating the successive square only in those results that have the appropriate bit set. (If you are familiar with square-and-multiply exponentiation, this might make some sense!) $\endgroup$
    – TonyK
    Dec 3, 2012 at 11:15


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy