find all multiplicands and multipliers for a number

Paul Rubin at nospam.invalid
Sun Apr 12 19:23:30 CEST 2015

Paul Rubin < at nospam.invalid> writes:
>            ...  d = gcd(abs(x-y), n) ...
>    print pollard(2778562183799360736577L)
> finds the factor 25781083 almost instantly.  

Whoops, you need this too:

    def gcd(x,y):
        while True:
            x,y = y,x%y
            if y==0: return x

More information about the Python-list mailing list