Skip to content

Generate the nth prime number

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE
Notifications You must be signed in to change notification settings

Hawk453/primenumbe-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

primenumbe-rs

Crates.io Crates.io

This crate provides a beautifully simplistic API for generating the nth prime number.
primenumbe-rs algorithm is inspired by the the optimized version of the Sieve of Eratosthenes.

Notice

Note: limit of n index stands at [1, 1_000_000).
Disclaimer Not meant for Cryptographic & Security use.

Usage

Add this to your Cargo.toml:

[dependencies]
primenumbe-rs = "0.1.2"

How To Use

use primenumbe_rs::Primenumber;

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

License

Licensed under either of

  • Apache License, Version 2.0

  • MIT license

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Generate the nth prime number

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages