Pollard Rho Calculator

Probabilistic factoring

CalculatorsFreeNo Signup
4.3(332 reviews)
All Tools

Loading tool...

About Pollard Rho Calculator

A Pollard rho factorization calculator using Floyd's cycle detection on f(x)=x²+c mod n. Expected O(n^{1/4}) operations. Shows the iteration sequence, cycle detection, and found factors. Semi-prime and composite number factoring. Client-side.

Pollard Rho Calculator Features

  • Factorization
  • Cycle detection
  • Step trace
  • Floyd's method
  • Trial division fallback
Pollard's rho: factor n by iterating x←x²+c (mod n) with two pointers (Floyd's cycle detection). When |x_slow−x_fast| shares a factor with n, we've found a divisor! Expected O(n^{1/4}) — much faster than trial division's O(n^{1/2}).

How to Use

Enter a composite number:

  • Factor: A nontrivial divisor
  • Trace: Iteration steps
  • Full: Complete factorization

Birthday Paradox

Why O(n^{1/4})? If p|n, the sequence mod p has ~p values. By birthday paradox, collision after ~√p steps. Since p≤√n, we need ~n^{1/4} steps. The 'rho' name comes from the shape of the iteration trajectory (ρ).

Variants

  • Brent's improvement: faster cycle detection
  • Multiple polynomials: retry with different c
  • GCD batching: accumulate products, GCD less often

Step-by-Step Instructions

  1. 1Enter composite n.
  2. 2Run iterations.
  3. 3Detect cycle.
  4. 4Find factor.
  5. 5Repeat for cofactor.

Pollard Rho Calculator — Frequently Asked Questions

When does Pollard's rho fail?+

It can fail if n is prime (no factors to find) or if the particular polynomial f(x)=x²+c creates a cycle with gcd=n (trivial factor). Solution: try different c values. It rarely fails in practice for composites.

How does it compare to trial division?+

Trial division: O(√n). Pollard rho: O(n^{1/4}). For a 30-digit semiprime, trial division needs ~10^{15} steps (infeasible), but Pollard rho needs ~10^{7.5} (seconds). For very large numbers, use GNFS instead.

Can it factor RSA numbers?+

Not directly — RSA numbers are products of two primes of similar size p≈q≈√n. Pollard rho needs O(p^{1/2})≈O(n^{1/4}) steps, which is too many for 2048-bit n. The General Number Field Sieve (GNFS) is needed for RSA-size numbers.

Share this tool: