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.2a.tar.gz (31.0 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.2a.linux-i686.exe (110.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for pyprimes-0.2.2a.tar.gz
Algorithm Hash digest
SHA256 6ff2f6cbcf55a05eb0109a4f57444035494ced14b6e15182eac27185fcb54c5f
MD5 10abe400fbf55708326be021fe6b2aa4
BLAKE2b-256 e3a13b6ff416458d2811b4ebd32a5a8695edef531fb03d0cdad5449210c70453

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyprimes-0.2.2a.linux-i686.exe
Algorithm Hash digest
SHA256 ba7ac5606b53d1cd313c583515016187d2eb66ff31706dfc5961c0e99261249d
MD5 adf5f8947f9ef4bcffa377cf8250cc2e
BLAKE2b-256 208f703449a51394276fed27a7475f28560c4cd17fe977c04d1f9ea23a9ca0ae

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