Use gp/pari to achieve pollard_rho_algorithm