#prime #number-theory #lower-bounds

deprecated slow_primes

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).

15 releases

Uses old Rust 2015

0.1.14 May 16, 2015
0.1.13 May 16, 2015
0.1.12 Apr 8, 2015
0.1.11 Mar 4, 2015
0.1.4 Nov 20, 2014

#9 in #lower-bounds

Download history 175/week @ 2023-12-13 69/week @ 2023-12-20 22/week @ 2023-12-27 129/week @ 2024-01-03 129/week @ 2024-01-10 382/week @ 2024-01-17 396/week @ 2024-01-24 186/week @ 2024-01-31 148/week @ 2024-02-07 150/week @ 2024-02-14 270/week @ 2024-02-21 245/week @ 2024-02-28 147/week @ 2024-03-06 324/week @ 2024-03-13 489/week @ 2024-03-20 562/week @ 2024-03-27

1,560 downloads per month
Used in 6 crates (4 directly)

MIT/Apache

105KB
2K SLoC

Deprecated in favour of primal.

slow_primes

Build Status Coverage Status

Extremely simplistic and relatively unoptimised handling of basic tasks around primes:

  • 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 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.)

Documentation

Dependencies

~470KB