User:Bengl/Rho factoring

From Wikipedia, the free encyclopedia

This is pretty easy.

Every description i've found online for this is horrible, they make it sound sooooo complicated but really it's very easy.

Here is the simplified rho factoring algorithm.

Input: a number n to be factored, a polynomial f(x), and a starting number x0 = y0 Output: a factor (or two) of n

The squence of xi's is such that xi = f(xi − 1) mod n and the sequence of yi's is such that yi = f(f(yi − 1)) mod n. Calculate these as you need them. For each xi and yi pair, if | yx | divides n, then HOLY CRAP you've got a factor. If not, then try gcd( | yx | ,n). If there actually is one of those other than 1, then, being a greatest common divisor, it's clearly a factor (divisor) of n. Otherwise, move on to the next pair of xi and yi.

That's all.

Try it a few times and youll see that this is really simple.