Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sethtroisi/prime-gap-verify
Tool to verify large prime gaps
https://github.com/sethtroisi/prime-gap-verify
Last synced: about 2 months ago
JSON representation
Tool to verify large prime gaps
- Host: GitHub
- URL: https://github.com/sethtroisi/prime-gap-verify
- Owner: sethtroisi
- License: apache-2.0
- Created: 2020-10-14T05:23:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T06:52:31.000Z (4 months ago)
- Last Synced: 2024-11-12T00:05:15.301Z (about 2 months ago)
- Language: C++
- Size: 92.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prime Gap Verify
Python library to verify prime gaps for
[prime-gap-project](https://github.com/primegap-list-project/prime-gap-list/)## primegapverify
```python
>>> import primegapverify
>>> primegapverify.sieve(101, 20, 20)
[False, False, True, False, False, True, False, True, True, True, True]>>> [101 + 2 * i for i, v in enumerate(primegapverify.sieve(101, 100, 20)) if v is False]
[101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]>>> import sympy
>>> list(sympy.primerange(100, 101+100+1))
[101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199]
```## Testing
Maybe this works, I've struggled with relative imports for 4+ hours :(
```bash
cd primegapverify
python -m pytest
```## Uploading
```bash
make clean
make all
cd primegapverify
python -m pytest
cd .
pip install .
# Manual Test
python
# Make source distribution
python setup.py sdist
# Make binary wheel
python setup.py sdist bdist_wheel
python -m twine upload dist/*.gz
```## Primes
Either [kimwalisch's](https://github.com/kimwalisch/)
excellent [primesieve](https://github.com/kimwalisch/primesieve)
or a hand rolled version based on a Sieve of Eratosthenes.to use handrolled prime iterator make with `make DEFINES=-DHANDROLLED`
```bash
sudo apt install libprimesieve-dev# for gmpy2
sudo apt install libgmp-dev libmpc-dev libmpfr-dev
sudo pip install gmpy2==2.1.0b5
```## Prime Test
[GMPlib's](https://gmplib.org/)
[`mpz_probab_prime_p`](https://gmplib.org/manual/Number-Theoretic-Functions#Number-Theoretic-Functions)
or [OpenPFGW](https://sourceforge.net/projects/openpfgw/).## TODO
* [ ] `isPrimeLarge` using pfgw
* [ ] Estimated PRP/s using benchmark & interpolation
* [x] Parse string ("123 * 73# / 5# - 1000" to primorial form)