PrimePi
The prime-counting function: how many primes are ≤ n.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wikipedia
Prime-counting functionMathWorldPrimeCountingFunctionWikidataQ251922DLMF27.1227.2.E2FungrimPrimePi✓Fungrim entry04427b4fa169✓OEISA000720Wolfram LanguagePrimePi!Typed signatures
| Type | Package | Applies |
|---|---|---|
(real) -> integer | compute-engine | always |
(real) -> integer | number-theoryreplaces compute-engine | always |
Details
- Inverse of NthPrime: .
- Asymptotically , the prime number theorem.
- Counts exactly up to (the Deléglise–Rivat combinatorial count, seconds at the top); past that the call stays unevaluated.
- n need not be an integer or prime itself -- PrimePi(n) counts primes up to whatever real value is given.
- Threads element-wise over a list, as Wolfram's Listable heads do.
Plot
Examples
15 more kept as data, checked against the oraclesProperties #
Still 4: the primes up to 10 are 2, 3, 5, 7
live ↗InOut
Known value · Wolfram MathematicalFunctionData, PrimePi
Possible issues #
Past the exact tiers decline, so the call stays unevaluated at once instead of counting for minutes
live ↗InOut
About
| Examples | 36 |
|---|---|
| Checked against | Wolfram Language 34 agree2 differSageMath 33 agree2 unevaluatedSymPy 31 agree4 errormpmath 27 agree6 errormathlib4 22 agree11 errorRust 26 agree9 error |
| Crosswalk | WikipediaMathWorldWikidataDLMF ×2FungrimFungrim entry ×2OEISWolfram LanguageSageMathSymPympmathRust |
Implementation
mapped
wolframpackages/oracle/src/mappings.tsmapped
sympypackages/oracle/src/mappings.tsmapped
sagepackages/oracle/src/mappings.tsmapped
mathlib4packages/oracle/src/mappings.tsmapped
rustpackages/oracle/src/mappings.tsmapped
mpmathpackages/oracle/src/mappings.ts