Prime algorithms
Project description
# 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/
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/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prime_algorithms-1.0.tar.gz
(2.8 kB
view details)
File details
Details for the file prime_algorithms-1.0.tar.gz
.
File metadata
- Download URL: prime_algorithms-1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0871c36cb047c0f551faae7c18fe3d891bcd0d0aa226a0500fcfdc76dc2343f |
|
MD5 | 18320749496840191daf99475805de4a |
|
BLAKE2b-256 | d1194910454df4f06e7cc4441a73f97962672afdcfe6dea92bd43b51868a2338 |