Factoring Lab

Receipts for factoring ideas: which work, which don’t, and how fast they stop working.

B4 · Methods that workWorks, and here’s how it scales

Pollard’s p − 1

Fast exactly when p − 1 is made only of small primes. Success rate against the bound B.

The idea

Fermat’s little theorem says a^(p−1) ≡ 1 (mod p). If p − 1 divides a number M built from all the small primes up to B, then a^M ≡ 1 (mod p) too, so p divides a^M − 1, and (a^M − 1, N) reveals p. It works exactly when p − 1 is .

Watch it

p − 1 and q − 1 written as products of primes. If every prime of either one is at most B, stage 1 finds that factor.

The test

300 seeded toy numbers with two 24-bit primes. For each B, the share that p − 1 cracks, against the prediction from (either p − 1 or q − 1 smooth).

Fig. B4.2Share of toy numbers p − 1 splits, against the bound B, with the Dickman prediction

Measuring…