Function nthPrime

  • Obtain the nth odd prime.

    Parameters

    • n: number

      1-based ordinal of the nth odd prime, or zero to obtain prime two.

    Returns number

    The nth odd prime number or 2 if n === 0.