Skip to main content

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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trprimes-0.1.1.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trprimes-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for trprimes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a983cdc73b1b0fe1c50ba31abbdc661a8f20fbbf9840697490bc4feae714c351
MD5 79ddafa92df1e04ac421e40463774761
BLAKE2b-256 192cfbd2e7d50a17977bbf41d4214448627a11cfffbc4b7a281b325994a15fea

See more details on using hashes here.

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

Hashes for trprimes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76688a734f17657dfcff37d9e0ec59f256d93f007388c440df76d30150158beb
MD5 cbe7bb222a1fa0426fd88891d82db4a1
BLAKE2b-256 2de627468da12527d8dbd37a44fbc329153e6863db12212271ba5cb7bbb7aea2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

0.0.1

1 file

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