Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 2.4.14 (Pollard rho method)
Exercise 2.4.14 (Pollard rho method)
Use the Pollard rho method to locate proper divisors of the following numbers:
Answers
Proof. The Pollard rho method in its simplest form gives the program
from math import gcd def rho_pollard(n): def f(x): return x*x+1 x, y, d = 2, 2, 1 while d==1: x = f(x) % n y = f(f(y)) % n d = gcd(x-y, n) return d
See
https://en.wikipedia.org/wiki/Pollard%27s_rho_algorithm
We obtain
□
2024-08-22 13:40