Brent's variation of a factorization algorithm

Irmen de Jong irmen at -nospam-xs4all.nl
Wed Dec 9 18:11:57 EST 2009


On 27-11-2009 16:36, n00m wrote:
> Maybe someone'll make use of it:
>
>
> def gcd(x, y):
>      if y == 0:
>          return x
>      return gcd(y, x % y)
>
> def brent(n):
[...]

[D:\Projects]python brentfactor.py
999999999
== 27 * 37037037

What gives? Isn't this thing supposed to factor numbers into the product 
of two primes?

-irmen



More information about the Python-list mailing list