Brent's variation of a factorization algorithm
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Wed Dec 9 19:59:04 EST 2009
On 12/10/09 12:52 AM, n00m wrote:
> On Dec 10, 1:11 am, Irmen de Jong<ir... at -nospam-xs4all.nl> wrote:
>> 999999999
>> == 27 * 37037037
>>
>> What gives? Isn't this thing supposed to factor numbers into the product
>> of two primes?
>>
>> -irmen
>
> Only if you yield to it a SEMIprime =)
A 'semiprime' being a product of 2 prime numbers, I suppose.
>> 27 * 37037037
> Now you can apply brent() to these numbers, and so on
Right :) I more or less expected it to do that by itself (didn't look
at the algorithm)
But you wrote that it might run indefinately if you feed it a prime
number. There's no safeguard then against getting into an endless loop
if you keep applying brent() to the factors it produces? Because in the
end one or both factors will be prime...
-irmen
More information about the Python-list
mailing list