All methods defined here return one of a factor of given integer. When 1 is returned, the method has failed to factor, but 1 is a factor anyway.
'verbose' boolean flag can be specified for verbose reports.
The function tries to find a non-trivial factor of n using Algorithm 8.8.2 (p-1 first stage) of Cohen. In case of n = pow(2,i), the function will not terminate. As the nature of the method, a factorization may find only the trivial factor.
Find a non-trivial factor of n using Pollard's rho algorithm. The implementation refers the explanation in Crandall & Pomerance. As the nature of the method, a factorization may find only the trivial factor.
Return a factor of given integer by trial division.
options can be either:
If both options are not given, prime factor is searched from 2 to the square root of the given integer.