Skip to main content

Generate and test for prime numbers.

Project description

The pyprimes package offers a variety of algorithms for generating prime numbers and fast primality test, written in pure Python.

Prime numbers are those positive integers which are not divisible exactly by any number other than itself or one. Generating primes and testing for primality has been a favourite mathematical pastime for centuries, as well as of great practical importance for encrypting data.

pyprimes includes the following features:

  • Produce prime numbers lazily, on demand.

  • Effective algorithms including Sieve of Eratosthenes, Croft Spiral, and Wheel Factorisation.

  • Efficiently test whether numbers are prime, using both deterministic (exact) and probabilistic primality tests.

  • Examples of what not to do are provided, including naive trial division, Turner’s algorithm, and primality testing using a regular expression.

  • Factorise small numbers into the product of prime factors.

  • Suitable for Python 2.4 through 3.2 from one code base.

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

pyprimes-0.2.0a.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyprimes-0.2.0a.linux-i686.exe (110.8 kB view details)

Uploaded Source

File details

Details for the file pyprimes-0.2.0a.tar.gz.

File metadata

  • Download URL: pyprimes-0.2.0a.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyprimes-0.2.0a.tar.gz
Algorithm Hash digest
SHA256 952c3ee6a1d14a5fd342d7089379e11d412763c1d9b45bfcdf8319595b5bfee7
MD5 5a2617b5d5c3c83db89f39abdde7cee9
BLAKE2b-256 28b618c096bbf2f25e1e209d5880ce554ced3fcf3cf4f1df673af4a038b35143

See more details on using hashes here.

File details

Details for the file pyprimes-0.2.0a.linux-i686.exe.

File metadata

File hashes

Hashes for pyprimes-0.2.0a.linux-i686.exe
Algorithm Hash digest
SHA256 77f2f5f3e72d971f18c9e9d4a6d11259f708a78f2f59daccbaaf595c40bdcda7
MD5 d0f70bdff03c85117e602513f8e3c3ca
BLAKE2b-256 d6a29eca90d8cd0373bd094e4c306364baa60a930561626f1031a62a952b4a39

See more details on using hashes here.

Supported by

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