[SciPy-user] prime factorization...

HEMMI, Shigeru textdirected@gmail....
Fri Jun 19 22:40:47 CDT 2009


2009/6/18 fred <fredmfp@gmail.com>

> Hi all,
>
> Is there any function in scipy that gives the prime factorization?
>
> ie 50 -> [5, 5, 2]?
>
> TIA
>
> Cheers,
>
> --
> Fred
> _______________________________________________
> SciPy-user mailing list
> SciPy-user@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>

Let me tell you there is another solution: NZMATH
http://tnt.math.metro-u.ac.jp/nzmath/index.html
which is written in Python.

>>> import nzmath.factor.methods as methods
>>> dir(methods)
['DefaultMethod', 'EllipticCurveMethod', 'MPQSMethod', 'PMinusOneMethod',
'RhoMethod', 'TrialDivision', '__builtins__', '__doc__', '__file__',
'__name__', 'arith1', 'bigrange', 'ecm', 'ecmfind', 'factor', 'find',
'mpqs', 'mpqsfind', 'pmom', 'prime', 'rhomethod', 'trialDivision', 'util']
>>> methods.factor(50)
[(2, 1), (5, 2)]
>>> methods.factor(18440000000000000000)
[(2, 18), (5, 16), (461L, 1)]

Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20090620/d51bf750/attachment.html 


More information about the SciPy-user mailing list