CoCalc Public FilesPollard P-1 .sagewsOpen with one click!
Author: Liljana Babinkostova
Views : 119
Compute Environment: Ubuntu 20.04 (Default)
def pminone(R,a,rounds): b = a - 1 for j in range(1,rounds+1): b= (ZZ(power_mod(b+1,j,R))-1) %R p = gcd(b,R) if p==R: print("Pollard p-1 attack fails") return None elif p>1: print("Discovered in round {0}".format(j)) return p print ("Not found in {0}".format(rounds)) return None
R = 15056208191 p=pminone(R,37462,3463) print("One of the prime fac")
Discovered in round 3463 34631