Generate consecutive primes, measure their gaps, classify notable pairs, inspect records, and export a complete mathematical analysis.
| Index | Current prime | Next prime | Gap | Gap type | Record gap | Formula |
|---|---|---|---|---|---|---|
| Run a calculation to populate the table. | ||||||
| Gap | Frequency | Share |
|---|---|---|
| No data. | ||
The prime gap after the nth prime is gn = pn+1 − pn. The calculator first generates ordered primes. It then subtracts each prime from the next prime.
For example, 11, 13, 17, and 19 produce gaps 2, 4, and 2. A gap of 2 identifies a twin-prime pair. Gap 4 identifies a cousin-prime pair. Gap 6 identifies a sexy-prime pair.
Select a range, fixed prime count, or surrounding-gap mode. Enter valid whole numbers. Apply optional exact-gap or minimum-gap filters. You can also show only record gaps or twin-prime gaps.
Press Calculate to generate the prime list and gap table. Click any sortable table heading to reorder results. Export the results as CSV or PDF when finished.
Prime numbers are integers greater than one with exactly two positive divisors. Consecutive primes do not appear at fixed distances. Their changing distances form a prime gap sequence. This makes prime gaps useful for exploring number patterns and computational number theory.
The calculator creates an ordered prime list first. Each displayed gap equals the next prime minus the current prime. The pair 13 and 17 has gap four. The pair 17 and 19 has gap two. Except for the first gap between two and three, gaps between consecutive primes are even. Every prime greater than two is odd. Subtracting two odd numbers produces an even result.
A gap of two produces twin primes. Examples include 11 and 13. A gap of four produces cousin primes. A gap of six produces sexy primes. The calculator labels these common cases automatically. Larger gaps can also be studied through frequency counts and record-gap markers.
The maximum gap shows the widest spacing inside the selected data. The minimum shows the smallest observed spacing. Average and median values summarize typical gap sizes. Frequency counts reveal which gaps appear most often. Record gaps identify new largest gaps as the prime sequence grows.
Try increasing the ending value and compare the new results. You can search for exact gaps, impose minimum thresholds, or inspect only records. These options make the calculator useful for lessons, demonstrations, sequence study, and quick experiments. CSV export supports further analysis. PDF export creates a portable report for printing or sharing.
| Prime pair | Calculation | Gap | Classification |
|---|---|---|---|
| 2, 3 | 3 − 2 | 1 | Initial odd gap |
| 3, 5 | 5 − 3 | 2 | Twin prime |
| 7, 11 | 11 − 7 | 4 | Cousin prime |
| 23, 29 | 29 − 23 | 6 | Sexy prime |
| 89, 97 | 97 − 89 | 8 | Even prime gap |
A prime gap is the difference between two consecutive prime numbers.
All primes greater than two are odd. The difference between two odd numbers is even.
A gap of two creates a twin-prime pair, such as 11 and 13.
It is a gap larger than every earlier gap encountered in the generated sequence.
Yes. Enter a value in the exact gap filter before calculating.
Yes. Use the CSV or PDF download buttons above the results.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.