Truncatable prime number generators
Project description
Truncatable primes
A Python library that generates that generates sequences of truncatable prime numbers and derivatives of the sequences in the form of a package that can be installed and imported.
A truncatable prime is still prime when number is truncated. For example, 317 is a left truncatable prime because 17 and 7 are prime. It is also a right truncatable prime because 31 and 3 are prime.
The intention of this library is to provide code that is reasonably efficient and readable. It is not difficult to track down cryptic one-liner code that produces identical results.
Getting Started
Python 3 is assumed.
Installing
Using the source code from github
git clone https://github.com/harry-zuzan/trprimes.git
cd trprimes
python setup.py install
Using pip
pip install trprimes
Examples
from trprimes import trunc
# the number of left truncatable primes
trunc.count_ltrunc()
# the largest of left truncatable prime
trunc.largest_ltrunc()
# iterate through left truncatable primes in ascending order
ltp = trunc.ordered_ltrunc()
next(ltp)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trprimes-0.1.1.tar.gz.
File metadata
- Download URL: trprimes-0.1.1.tar.gz
- Upload date:
- Size: 60.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a983cdc73b1b0fe1c50ba31abbdc661a8f20fbbf9840697490bc4feae714c351
|
|
| MD5 |
79ddafa92df1e04ac421e40463774761
|
|
| BLAKE2b-256 |
192cfbd2e7d50a17977bbf41d4214448627a11cfffbc4b7a281b325994a15fea
|
File details
Details for the file trprimes-0.1.1-py3-none-any.whl.
File metadata
- Download URL: trprimes-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76688a734f17657dfcff37d9e0ec59f256d93f007388c440df76d30150158beb
|
|
| MD5 |
cbe7bb222a1fa0426fd88891d82db4a1
|
|
| BLAKE2b-256 |
2de627468da12527d8dbd37a44fbc329153e6863db12212271ba5cb7bbb7aea2
|