integer factorization using Pollard's rho algorithm with Brent cycle detection, Miller–Rabin primality test