Skip to main content

Fast prime factorization using the msieve library

Project description

Pysieve is a simple wrapper of the msieve prime factorization library. It basically gives you a fast factor command and some utilities.

For now it is only tested on OSX with python 2.6 and msieve146 but it should work on Linux as well. It assumes that the msieve library is installed in a standard location (i.e /usr/local/lib, /usr/lib or on OSX with macports /opt/local/lib)

Functions in the package

  • factor(n): returns a list of the prime factors of n

  • dfactor(n): returns a list of distinct prime factors of n (no duplicates)

  • facExponents(n): returns a list of tuples, each containing a prime factor of n and its exponent

TODO

  • _pysieve is installed as seperate package. I somehow can’t

    define it to be a subpackage of pysieve (like pysieve._pysieve)

Credits

The msieve library can be downloaded at http://sourceforge.net/projects/msieve/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySieve-0.5.0.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page