Crates.io | slow_primes |
lib.rs | slow_primes |
version | 0.1.14 |
source | src |
created_at | 2014-11-11 06:30:09.724167 |
updated_at | 2015-12-11 23:56:18.321051 |
description | Deprecated in favour of `primal`. A library to generate, identify and handle prime numbers and related properties. This library includes slow enumeration of primes up to a bound, slow factorisation of arbitrary numbers, fast primality tests and state-of-the-art estimation of upper and lower bounds for π(n) (the number of primes below n) and p_k (the k-th prime). |
homepage | https://github.com/huonw/slow_primes |
repository | https://github.com/huonw/slow_primes |
max_upload_size | |
id | 27 |
size | 118,087 |
Deprecated in favour of primal.
Extremely simplistic and relatively unoptimised handling of basic tasks around primes:
This uses a basic Sieve of Eratosthenes to enumerate the primes up to some fixed bound (in a relatively memory efficient manner), and then allows this cached information to be used for things like enumerating the primes, and factorisation via trial division.
(Despite the name, it can sieve the primes up to 109 in about 5 seconds.)