Skip to content
OneKitly

The Thousandth Prime Is 7919, and the Gaps Have Grown by Half

Published 11/16/2026 · 3 min read · Everyday calculators

Lena Hoffmann

Lena Hoffmann — Science & education writer at OneKitly

Mathematics · Physics

Checked against 2 sources

View profile →
In short

Asking for the first hundred primes ends at 541, and asking for the first thousand ends at 7919. Divide the distance travelled by the number of steps and the average gap between consecutive primes comes out at 5.44 for the first hundred and 7.92 for the first thousand — a 46% increase across one factor of ten. That growth is the counting version of the same law that governs their density: the average gap near n is close to the natural logarithm of n, which is 6.3 near 541 and 8.98 near 7919. The primes are not scattered at random, and they are not on a grid either.

Advertisement

The 100th prime is 541, an average step of 5.44. The 1000th is 7919, an average step of 7.92. Counting primes is how the pattern becomes visible.

Averages hide a wild sequence

Among the first thousand primes the individual gaps run from 1 — between 2 and 3, the only time it happens — to 34, between 1327 and 1361. A gap of 2 appears 174 times in that range, so twin primes are common there even though the average step is nearly eight. The sequence is lumpy at every scale anybody has examined, and the average is a summary of something that never looks like its summary. That is worth remembering whenever a mean is offered as a description of a process rather than of a total.

Why anybody wants the nth prime

Hash tables want a prime near a target size, so that a table of about a thousand slots uses 1009 rather than 1000 and spreads keys evenly whatever their pattern. Cryptographic key generation wants primes of a specified bit length, found by testing random candidates until one passes. Random number generators use prime moduli to reach their full period. In all three cases the demand is not for a particular prime but for one near a size, which is exactly what a list of the first n delivers.

Last one
How far you have to go
How many primesLast oneAverage gap
25973.96
1005415.44
100079197.92

Worked with our own calculator

First n prime numbers

Given

How many primes (1–10000)
50

Result

The nth prime
229
Sum
5,117

These figures are produced by the calculator below, not typed in by hand — they are recomputed whenever the tool changes.

Run it on your own figures →
Advertisement

Frequently asked questions

Is there a formula for the nth prime?
There are formulas, and none of them is useful. Some are correct but require knowing the primes already; others are theoretically valid and need more computation than simply sieving. What does exist is a good estimate: the nth prime is near n times the logarithm of n, which predicts about 6900 for the thousandth against the true 7919 and improves with a correction term. Estimating is cheap and exact answers come from a sieve, which is why every library does it that way.
How does a sieve beat testing each number?
By doing the work once instead of once per number. Eratosthenes's method writes out every number up to a limit and crosses off multiples of each prime as it goes, so each composite is struck a handful of times rather than being tested from scratch. Producing every prime below ten thousand takes a few thousand crossings-out, where trial division on each candidate would take hundreds of thousands of divisions. Batch work beats individual work whenever the answers are wanted together, which is a lesson far wider than primes.

Articles you may find interesting

All guides →

Related tools

Sources

Spotted a mistake in this article?