Pollard's rho

Factoring with x ↦ x² + c, the tortoise, the hare and the birthday paradox.

n
mapx ↦ x² + c, c =start x₀ = 2
…
tortoise xᵢhare x₂ᵢthe sequence mod p: a tail, then a cycle