Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A primer for prime numbers

Project Description

Brute force functions for teaching purposes. Not performant.

To use as a package:

>>> import primer
>>> primer.primes(10)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
>>> primer.prime(10)
29
>>> primer.primorial(10)
6469693230
>>> primer.sieve(40)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
>>>

To use as a script:

$ python -m primer [-h] [-t] [N]

Display the first N primes.

positional arguments:
N Number of primes to generate (default: 100)
optional arguments:
-h, --help show this help message and exit
-t Display elapsed time (default: False)

Version 1.4.4 2015-04-09

  • Factor out generator function. (cbc)

Version 1.4.3 2015-04-02

  • Refactor functions into module. (cbc)
  • Refactor main namespace in tests. (cbc)
  • Added VERSION.txt. (cbc)
  • Added download_url to setup. (cbc)

Version 1.4.2 2015-04-01

  • Make installed tests runnable as script. (cbc)

Version 1.4.1 2015-04-01

  • Make reduce readable. HAFD. (cbc)

Version 1.4 2015-03-26

  • Single version for Python 2/3. (cbc)

Version 1.3 2015-03-25

  • Add sieve function. (cbc)
  • Rename test methods. (cbc)

Version 1.2.1 2015-03-25

  • Update README. (cbc)

Version 1.2 2015-03-25

  • Mark prime generator function private. (cbc)
  • Update docstrings. (cbc)
  • Fix test module name. (cbc)
  • Rename test data. (cbc)

Version 1.1.1 2015-03-25

  • Update README. (cbc)

Version 1.1 2015-03-25

  • Add primorial function. (cbc)

Version 1.0.2 2015-03-25

  • Fix keywords. (cbc)

Version 1.0.1 2015-03-25

  • Release testing. (cbc)

Version 1.0 2015-03-23

  • Initial release. (cbc)
Release History

Release History

This version
History Node

1.4.4

History Node

1.4.3

History Node

1.4.2

History Node

1.4.1

History Node

1.4

History Node

1.3

History Node

1.2.1

History Node

1.2

History Node

1.1.1

History Node

1.1

History Node

1.0.2

History Node

1.0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
primer-1.4.4.zip (16.1 kB) Copy SHA256 Checksum SHA256 Source Apr 9, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting