Skip to main content

nth_prime

Function nth_prime 

Source
pub fn nth_prime(n: usize) -> Option<u64>
Expand description

The n-th prime (1-indexed: 1st prime = 2).

ยงExamples

use mathverse_core::integer::nth_prime;

assert_eq!(nth_prime(1), Some(2));
assert_eq!(nth_prime(6), Some(13));
assert_eq!(nth_prime(0), None);