OFFSET
2,1
COMMENTS
LINKS
Eric Weisstein's World of Mathematics, Pollard rho Factorization Method.
Wikipedia, Pollard's rho algorithm
PROG
(Python)
from gmpy2 import *
def a(n):
c, d, x, y, g = 0, 1, 2, 2, lambda x:pow(x, 2, n)-1
while d == 1:
c, x, y =c+1, g(x), g(g(y))
d = gcd(abs(x-y), n)
return c
CROSSREFS
KEYWORD
nonn
AUTHOR
Darío Clavijo, Mar 29 2023
STATUS
approved