https://github.com/huonw/primal
primal puts raw power into prime numbers.
https://github.com/huonw/primal
prime-numbers rust
Last synced: about 1 year ago
JSON representation
primal puts raw power into prime numbers.
- Host: GitHub
- URL: https://github.com/huonw/primal
- Owner: huonw
- License: apache-2.0
- Created: 2015-05-16T12:59:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-09-23T16:01:33.000Z (almost 2 years ago)
- Last Synced: 2025-05-15T00:05:37.432Z (about 1 year ago)
- Topics: prime-numbers, rust
- Language: Rust
- Homepage: http://docs.rs/primal/
- Size: 2.56 MB
- Stars: 116
- Watchers: 5
- Forks: 18
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# primal
[](https://crates.io/crates/primal)
[](https://docs.rs/primal)

`primal` puts raw power into prime numbers.
This crates includes
- optimised prime sieves
- checking for primality
- enumerating primes
- factorising numbers
- estimating upper and lower bounds for π(*n*) (the number of primes
below *n*) and *pk* (the kth prime)
This uses a state-of-the-art cache-friendly Sieve of Eratosthenes
to enumerate the primes up to some fixed bound (in a memory
efficient manner), and then allows this cached information to be
used for things like enumerating and counting primes.
`primal` takes around 2.8 seconds and less than 3MB of RAM to
count the exact number of primes below 1010 (455052511)
on the author's laptop (i7-3517U).
[**Documentation**](http://docs.rs/primal/)