NthPrime
The nth prime number (NthPrime(1) = 2).
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
Prime numberMathWorldPrimeNumberWikidataQ49008Encyclopedia of MathematicsPrime_numbernLabprime numberBritannicatopic/prime-numberOEISA000040Wolfram LanguagePrime✓Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer) -> integer | compute-engine | always |
(integer) -> integer | number-theoryreplaces compute-engine | always |
Details
- Inverse of PrimePi: .
- Grows asymptotically like , by the prime number theorem.
- n must be a positive integer; compute-engine leaves non-positive n, including NthPrime(0), unevaluated.
- Threads element-wise over a list, as Wolfram's Listable heads do.
Plot
Examples
Scope #
Properties #
The only even prime is , so is the smallest odd prime
live ↗InOut
Known value · Wolfram MathematicalFunctionData, Prime
Starts the twenties-to-thirties stretch
live ↗InOut
Known value · Wolfram MathematicalFunctionData, Prime
Possible issues #
About
| Examples | 42 |
|---|---|
| Checked against | Wolfram Language 42 agreeSageMath 36 agree2 errorSymPy 36 agree1 errorRust 30 agree2 differ1 error |
| Crosswalk | WikipediaMathWorldWikidataEncyclopedia of MathematicsnLabBritannicaOEISWolfram LanguageSageMathSymPyRust |
Implementation
mapped
sympypackages/oracle/src/mappings.tsprime(n) is SymPy's n-th prime.
mapped
sagepackages/oracle/src/mappings.tsmapped
rustpackages/oracle/src/mappings.ts See also: FactorInteger, PrimePi