Enter index and options
Example nth prime values
This quick reference table shows the first few nth primes to give you an idea of how quickly prime numbers grow with their index.
| Index n | nth prime pn |
|---|---|
| 1 | 2 |
| 2 | 3 |
| 3 | 5 |
| 4 | 7 |
| 5 | 11 |
| 10 | 29 |
| 20 | 71 |
| 50 | 229 |
| 100 | 541 |
Formula and method used
There is no simple closed-form formula that directly returns the nth prime. Instead, this calculator uses a combination of analytical bounds and a fast sieving algorithm to locate the exact prime.
For n ≥ 6, we use the inequality
pn < n(\ln n + \ln \ln n) to estimate an upper bound
for the nth prime. Here pn is the nth prime and
\ln denotes the natural logarithm.
After estimating this bound, the calculator applies the classical
Sieve of Eratosthenes from 2 up to the bound, eliminating
composite numbers and collecting primes. Once the list of primes reaches length
n, the last element is the exact nth prime.
The “Approximation” column in the results is based on a refined analytic
estimate:
pn ≈ n(\ln n + \ln \ln n − 1)
for moderately large n. The difference between the exact prime
and this approximation is reported as the error.
How to use this calculator
- Choose one of the modes: single index, index range, first N primes, or “find index of a given prime”.
-
Enter the required input:
- Single index: one value of n.
- Index range: both nstart and nend.
- First N primes: total number of primes to list.
- Prime value: the candidate prime number.
- Click Calculate nth prime. The summary panel shows a quick explanation, and the detailed table lists all numeric details.
- Use Download CSV to export the table for spreadsheets, or Download PDF to share or print the results.
These options make it easy to explore prime positions, create tables for study, and analyse prime gaps or approximations for coursework and coding projects.
Typical use cases
- Checking exact prime positions for number theory coursework or exam preparation.
- Generating prime sequences as inputs for coding interviews or algorithm practice.
- Studying prime gaps and comparing them to analytical approximations.
- Building custom datasets for research, educational material or classroom demonstrations.
Prime index, value and growth
For each index n this tool reports the exact prime pn and shows how quickly prime values grow. Comparing p100, p1000 and higher positions is useful for understanding the long-term behaviour of primes.
Prime gaps around the nth prime
The table includes the previous prime and the gap pn − pn−1. These gaps help illustrate how primes become more sparse, even though there are always infinitely many primes ahead in the number line.
Linking nth primes with factorization
Once you know pn, you can explore factors of nearby composite numbers using a prime factorization calculator . Combining both tools gives a fuller picture of how primes generate all other integers through multiplication.
Checking primality near a chosen index
You might want to test numbers just below or above pn individually. Use a dedicated prime number checker to verify whether neighbouring values are prime or composite while keeping this nth prime table as a reference.
Using nth primes with greatest common divisor
Nth primes are also useful when constructing coprime pairs or testing greatest common divisor behaviour. After exporting the table, you can plug selected values into a GCD calculator to study common factors and coprimality.
Exporting nth prime tables for deeper analysis
The CSV and PDF downloads make it easy to keep ordered lists of pn, prime gaps and approximation errors. You can merge this output with other datasets, visualise prime statistics, or prepare worksheets for teaching and presentations.
Frequently asked questions
1. What does “nth prime number” mean?
The nth prime is simply the prime that appears in position n when primes are listed in ascending order, starting with 2. For example, the 1st prime is 2, the 2nd is 3, the 3rd is 5.
2. How large can n be in this calculator?
For performance reasons the form currently limits n to 200,000. This is already large enough for coursework, contest problems, coding exercises and many analytic experiments with prime indices.
3. Why does the approximation differ from the exact nth prime?
The approximation uses an analytic formula from prime number theory. It captures long-term growth but does not hit every prime exactly. The error column shows the difference pn minus the approximation for each index.
4. Can I use this to test if a number is prime?
This page focuses on finding primes by index. To test a specific number directly, use a dedicated prime number checker , then cross-reference any confirmed primes with the nth-prime table.
5. Why do you show prime gaps in the table?
Prime gaps pn − pn−1 help visualise how primes become more widely spaced as numbers grow. They are important in conjectures such as bounded gaps, twin primes and general questions about prime distribution.
6. Can I combine nth primes with factorization work?
Yes. You can export a segment of primes, then use a prime factorization calculator to study how nearby composite numbers break into prime factors and how those factors relate back to positions in this nth prime sequence.
7. Is this calculator suitable for teaching and homework?
It is well suited for lessons, worksheets and homework. Teachers can generate ready-made tables, while students can verify answers, explore prime gaps and compare analytical estimates with exact values for many different indices.