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 tests, 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.x 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.1a.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.1a.linux-i686.exe (110.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pyprimes-0.2.1a.tar.gz
Algorithm Hash digest
SHA256 05ca2246f93347532149e0b1c01aec11fc1a447165a3d4e6cf916e059bc4093f
MD5 06dc60d303c27a690bbeff93fd365198
BLAKE2b-256 16f4bf2cab5277d3c0fad627e7954c2c9b7cb80ccf756c53afc5f2585da24aa6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyprimes-0.2.1a.linux-i686.exe
Algorithm Hash digest
SHA256 ebd54c54937b74e879f22230eb22eb5be4dcf01f992d1675e734c34632d5722b
MD5 62f71a331bfe73fa3602c6623312bca4
BLAKE2b-256 5464fa12995b3da41f22cfaf262721ffa385308cce091048267a44dfa820ca27

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