pub fn nthprime(nth: u64) -> u64 {
    let mut total_prime: u64 = 0;
    let mut size_factor: u64 = 2;

    let mut s: u64 = nth * size_factor;
    let mut primes: Vec<u64> = Vec::new();

    let n: u64 = nth;

    while total_prime < n {
        primes = get_primes(s).to_vec();

        total_prime = primes[2..].iter().sum();
        size_factor += 1;
        s = n * size_factor;
    }

    count_prime(primes, n).unwrap()
}
// Generate the nth prime number.
// Algorithm is inspired by the the optimized version of the Sieve of Eratosthenes.
Generate the nth prime number.
Algorithm is inspired by the the optimized version of the Sieve of Eratosthenes.
Generate the nth prime number . Algorithm is inspired by the the optimized version of the Sieve of Eratosthenes .
pub fn nthprime(nth: u64) -> u64 {
    let mut total_prime: u64 = 0;
    let mut size_factor: u64 = 2;
    let mut s: u64 = nth * size_factor;
    let mut primes: Vec<u64> = Vec::new();
    let n: u64 = nth;
    while total_prime < n {
        primes = get_primes(s).to_vec();
        total_prime = primes[2..].iter().sum();
        size_factor += 1;
        s = n * size_factor;
    }
    count_prime(primes, n).unwrap()
}
pub fn nthprime ( nth : u64 ) -> u64 { let mut total_prime : u64 = 0 ; let mut size_factor : u64 = 2 ; let mut s : u64 = nth * size_factor ; let mut primes : Vec < u64 > = Vec :: new ( ) ; let n : u64 = nth ; while total_prime < n { primes = get_primes ( s ) . to_vec ( ) ; total_prime = primes [ 2 .. ] . iter ( ) . sum ( ) ; size_factor += 1 ; s = n * size_factor ; } count_prime ( primes , n ) . unwrap ( ) }
Generate the nth prime number.
Generate the nth prime number .
nth
u64
nth
u64