Crates.io | primenumbe-rs |
lib.rs | primenumbe-rs |
version | 0.1.2 |
source | src |
created_at | 2022-03-02 14:27:02.689654 |
updated_at | 2023-04-23 10:59:05.158078 |
description | Generate the nth prime number |
homepage | |
repository | https://github.com/Hawk453/primenumbe-rs |
max_upload_size | |
id | 542308 |
size | 4,924 |
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).
use primenumbe_rs::Primenumber;
fn main(){
let n: u64 = 100;
let result = Primenumber::nthprime(n);
println!("The {n}th prime is {result}");
}