View Single Post
Old 2020-10-01, 20:15   #4
"James Short"
Mar 2019

17 Posts

Originally Posted by jshort View Post
Suppose we're factoring an integer via the p-1 method and we've already completed the first stage ie. L = a^{B!} mod(n) where n is the composite we wish to factor.

In the 2nd stage, we assume that there is one prime factor remaining q > B and go on to compute L^{p} for various prime integers.

If q-1 is fairly smooth, would it not be more worthwhile to consider the set (L^{2^{b!}}, L^{3^{b!}}, L^{4^{b!}},. . .,L^{a^{b!}}) for some considerably smaller integer b < B and then compute gcd(L^{i^{b!}} - L^{j^{b!}},n) for all 1 < i < j < a?

Keep in mind that we can perform another kind of "2nd stage" on this as well. ie assume that b! captures most of the prime factors of q-1 and then use a 2nd stage (3rd stage?) by computing (L^{2^{p(b!)}}, L^{3^{p(b!)}}, L^{4^{p(b!)}},. . . ,L^{a^{p(b!)}}) for various primes p > b and again computing gcd(L^{i^{p(b!)}} - L^{j^{p(b!)}},n) for all 1 < i < j < a.
I know its bad form to write answers to your own question. To be honest I don't have a straightforward answer as to whether or not this way of conducting a 2nd-stage to the p-1 method is faster than the standard way.

However I also think that we can easily implement both.

25% of all prime integers have the form 1 + 12k. This can be proved using Dirichlet's theorem on arithmetic progressions -

Thus we could set the b = 4! / 2 = 12 and compute (L^{2^{12p}}, L^{3^{12p}}, L^{4^{12p}},. . . ,L^{a^{12p}}) for various primes p up to some limit. Most programs search for primes 100 < p < 1000 in the 2nd stage of the p-1 test. If we did the same here and if we're only checking for primes of the form 1 + 12k in the range (100,1000)than p would only have to be a prime up in the range (11,83).

One thing I should mention is that obviously you'd want to start at 11 and then work your way up since just as in the standard 2nd stage of the test, you can use previous terms to save time in computing future terms.

For example, let T_{11} = (L^{2^{11(12)}}, L^{3^{11(12)}}, L^{4^{11(12)}},. . . ,L^{a^{11(12)}}) = (s_{1}, s_{2}, . . . , s_{a}).

Then T_{13} = (s_{1}^{2^{12(13-11)}}, s_{2}^{3^{12(13-11)}}, . . . , s_{a}^{a^{12(13-11)}} and so on.

As for the other 75% of the primes in the range (100,1000), we could either run this same alternative 2nd stage as we just did. However if this proves to be slower, we can just use the standard 2nd stage that is commonly used to check the remaining primes individually.
jshort is offline   Reply With Quote