Exercise 2.4.14 (Pollard rho method)

Use the Pollard rho method to locate proper divisors of the following numbers:

( a ) 8 , 131 ; ( d ) 16 , 019 ; ( b ) 7 , 913 ; ( e ) 10 , 277 ; ( c ) 7 , 807 ; ( f ) 199 , 934 , 971 .

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

rho _ pollard ( 8131 ) = 173 , ( 8131 = 47 × 173 ) , rho _ pollard ( 7913 ) = 41 , ( 7913 = 41 × 193 ) , rho _ pollard ( 7807 ) = 37 , ( 7807 = 37 × 211 ) , rho _ pollard ( 16019 ) = 83 , ( 16019 = 83 × 193 ) , rho _ pollard ( 10277 ) = 43 , ( 10277 = 43 × 239 ) , rho _ pollard ( 199934971 ) = 16193 , ( 199934971 = 12347 × 16193 ) .
User profile picture
2024-08-22 13:40
Comments