Expand description
Factorization of 64-bit integers.
See the book entry Primes: sieves, Miller–Rabin and factorisation.
Functions§
- divisors
- All positive divisors of
n ≥ 1, sorted. - euler_
totient - Euler’s totient
φ(n), from the factorization. - factorize
- The prime factorization of
n ≥ 1as(prime, exponent)pairs in increasing order (empty for 1, and for 0, which has no factorization). Small factors are removed by trial division, the remainder is split recursively with Pollard’s rho and certified by deterministic Miller-Rabin. Anyu64factors in milliseconds. - pollard_
rho - A non-trivial factor of the odd composite
nby Pollard’s rho with Brent’s cycle detection and batched gcds, iteratingx ← x² + cfor successivec.