Skip to main content
# prime_algorithms

Currently, this package provides a few prime number algorithms.

### Requirements

python >= 2.7 or >= 3.0

### Installation

```
python setup.py install
```

```
from prime_algorithms.algorithms.millerrabin import MillerRabin
from prime_algorithms.algorithms.squareroot import SquareRoot
from prime_algorithms.algorithms.sixk import SixK
from prime_algorithms.algorithms.solovaystrassen import SolovayStrassen


num = 3

//fast methods
MillerRabin().isPrime(num)
SolovayStrassen().isPrime(num)

//slow methods
SquareRoot().isPrime(num)
SixK().isPrime(num)
```

# How to Contribute

- provide a method isPrime to your algorithm.
- ``NameOfYourAlgorithm.isPrime(num)``

### References

- https://math.stackexchange.com/questions/1187491/prime-numbers-6k-1-mod-rule-new-discovery
- https://www.youtube.com/watch?v=lEvXcTYqtKU (00:00 - 00:15 )
- https://en.wikipedia.org/wiki/Miller–Rabin_primality_test
- https://en.wikipedia.org/wiki/Solovay%E2%80%93Strassen_primality_test
- https://coderwall.com/p/utwriw/prime-numbers-with-python
- https://primes.utm.edu/lists/small/

Metadata

Release files for prime_algorithms 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prime_algorithms 1.0
File Size Uploaded Provenance Actions
prime_algorithms-1.0.tar.gz 2.8 kB Without provenance Details for prime_algorithms-1.0.tar.gz

Release files / prime_algorithms-1.0.tar.gz

Download URL prime_algorithms-1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a0871c36cb047c0f551faae7c18fe3d891bcd0d0aa226a0500fcfdc76dc2343f
BLAKE2b-256 checksum
How to use checksums
d1194910454df4f06e7cc4441a73f97962672afdcfe6dea92bd43b51868a2338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for prime_algorithms 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page