On Dec 10, 2:59 am, Irmen de Jong wrote:
> On 12/10/09 12:52 AM, n00m wrote:
>
> > On Dec 10, 1:11 am, Irmen de Jong wrote:
> >> 9
> >> == 27 * 37037037
>
> >> What gives? Isn't this thing supposed to factor numbers into the product
> >> of two primes?
>
> >> -irmen
>
> > Only if you yiel
On 12/10/09 12:52 AM, n00m wrote:
On Dec 10, 1:11 am, Irmen de Jong wrote:
9
== 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 s
On Dec 10, 1:11 am, Irmen de Jong wrote:
> 9
> == 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 =)
> 27 * 37037037
Now you can apply brent() to these numbers, and so on
--
http://
PPS
The code was successfully tested e.g. here:
http://www.spoj.pl/ranks/FACT1/ (see my 2nd and 4th places).
They confused versions: the 2nd is in Python 2.5, not 2.6.2.
PPPS
Funnilly... almost only Python on the 1st page =)
--
http://mail.python.org/mailman/listinfo/python-list
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
9
== 27 * 37037037
What gives? Isn't this thing supposed to factor numbers into the pro
Being an absolute dummy in Theory of Number
for me ***c'est fantastique*** that brent() works =)
PS
1.
Values of magic parameters c = 11 and m = 137
almost don't matter. Usually they choose c = 2
(what about to run brent() in parallel with different
values of "c" waiting for "n" is cracked?)
2.
B
En Tue, 08 Dec 2009 15:51:29 -0300, MRAB
escribió:
Gabriel Genellina wrote:
En Fri, 27 Nov 2009 12:36:29 -0300, n00m escribió:
def gcd(x, y):
if y == 0:
return x
return gcd(y, x % y)
def brent(n): ...
A better place to publish this code would be the Python Cookbook:
http
Gabriel Genellina wrote:
En Fri, 27 Nov 2009 12:36:29 -0300, n00m escribió:
Maybe someone'll make use of it:
def gcd(x, y):
if y == 0:
return x
return gcd(y, x % y)
def brent(n): ...
A better place to publish this code would be the Python Cookbook:
http://code.activestate
En Fri, 27 Nov 2009 12:36:29 -0300, n00m escribió:
Maybe someone'll make use of it:
def gcd(x, y):
if y == 0:
return x
return gcd(y, x % y)
def brent(n): ...
A better place to publish this code would be the Python Cookbook:
http://code.activestate.com
--
Gabriel Genelli
Maybe someone'll make use of it:
def gcd(x, y):
if y == 0:
return x
return gcd(y, x % y)
def brent(n):
c = 11
y, r, q, m = 1, 1, 1, 137
while 1:
x = y
for i in range(1, r + 1):
y = (y * y + c) % n
k = 0
while 1:
10 matches
Mail list logo