3 releases

0.1.2 Apr 23, 2023
0.1.1 Mar 4, 2022
0.1.0 Mar 2, 2022

#1252 in Math

MIT license

4KB
57 lines

primenumbe-rs

Generate the nth prime number.
primenumbe-rs algorithm is inspired by the the optimized version of the Sieve of Eratosthenes. Note: limit of n index stands at [1, 1_000_000).

Example

use primenumbe_rs::Primenumber;

fn main(){
    let n: u64 = 100;
    let result = Primenumber::nthprime(n);
    println!("The {n}th prime is {result}");
}

lib.rs:

Generate the nth prime number. Note: limit of n index stands at [1, 1_000_000).

Algorithm

primenumbe-rs crate's algorithm is inspired by the the optimized version of the Sieve of Eratosthenes.

No runtime deps