Sexy Prime Calculator

Primes

sexy prime pairs up to 10015
largest pair in range83 and 89
sexy prime quadruplets in range4
twin prime pairs at the same limit, for comparison8
How this was calculated
  1. Sieve all primes up to 100.
  2. A sexy prime pair is two primes with a gap of 6 - the name comes from sex, Latin for six, not from anything else.
  3. Count the primes p where p + 6 is also prime and in range: both prime at a gap of 6 gives 15 pairs, the largest 83 and 89.
  4. Four in a row spaced by 6 (a sexy quadruplet) is rarer still: 4 in range, and only one pattern of residues mod 5 lets four primes sit 6 apart without one hitting a multiple of 5.

A sexy prime pair is a pair of prime numbers that are six apart, such as 83 and 89. The name comes from sex, the Latin word for six. This calculator finds sexy prime pairs in any range you enter and shows you the pairs themselves, so you can see exactly which primes qualify. The counts grow with the size of the range: there are 15 sexy prime pairs up to 100, 74 up to 1,000 and 411 up to 10,000. It also covers sexy prime quadruplets, four primes each spaced by 6, which number just 4 up to 100, 7 up to 1,000 and 24 up to 10,000. The largest sexy pair up to 1,000 is 991 and 997; up to 10,000 it is 9,967 and 9,973.

The method behind the calculator is the accepted standard for this kind of calculation: it tests each candidate number for primality and then checks whether the number six above it is also prime, which is how sexy prime pairs are defined. Sexy primes sit between twin primes (gap 2) and cousin primes (gap 4) in the family of prime pairs classified by their gap, so the same approach underlies all of these checks. This page shows the formula, the step-by-step workings, worked examples and sources, so you can follow the arithmetic yourself and confirm every result rather than taking a number on trust.

Worked examples

Sexy prime pairs up to 100

(100)

sexy prime pairs up to 10015
largest pair in range83 and 89
sexy prime quadruplets in range4
twin prime pairs at the same limit, for comparison8

Sexy prime pairs up to 1,000

(1000)

sexy prime pairs up to 1,00074
largest pair in range991 and 997
sexy prime quadruplets in range7
twin prime pairs at the same limit, for comparison35

Sexy prime pairs up to 10,000

(10000)

sexy prime pairs up to 10,000411
largest pair in range9,967 and 9,973
sexy prime quadruplets in range24
twin prime pairs at the same limit, for comparison205

What are sexy primes?

A sexy prime is one half of a pair of prime numbers that are six apart. The smallest example most people meet first is the pair 83 and 89: both are prime, and 89 − 83 = 6. Any two primes separated by exactly six qualify, so the pair can be written as (p, p + 6) whenever both numbers are prime. That single rule is the whole definition — nothing about the size of the primes, their digits, or where they sit on the number line changes it.

The name has nothing to do with anything suggestive. It comes from sex, the Latin word for six, the same root behind words like sextet and semester. Mathematicians borrowed it to label pairs by their gap, so a gap of six became a "sexy" gap. The label describes arithmetic, not attitude, and it has been used this way for well over a century.

Sexy primes are not rare, but they thin out as the numbers grow. There are 15 sexy prime pairs up to 100, 74 up to 1,000 and 411 up to 10,000. The count rises steadily while the density falls, which is what you would expect from any pattern built on primes. The pairs also cluster near the top of each range: the largest sexy pair up to 1,000 is 991 and 997, and up to 10,000 it is 9,967 and 9,973.

Sexy primes belong to a family of prime pairs sorted by the gap between the two members. Twin primes are two apart, cousin primes are four apart, and sexy primes are six apart. Seeing them side by side makes the naming system click: each type is defined by one number, and that number is the only thing that separates the categories. A given prime can belong to more than one pair, since it may have a partner two, four or six away.

The pattern extends beyond pairs. A sexy prime quadruplet is four primes spaced by six, and these are far rarer: just 4 up to 100, 7 up to 1,000 and 24 up to 10,000. Longer clusters get rarer still, because every extra prime in the chain has to land on a number that survives every divisibility test. That is also why the pairs themselves, common as they look at small sizes, become harder to find the further out you search.

Quick check: 83 and 89 are both prime, and 89 − 83 = 6 — so they form a sexy prime pair, named from sex, Latin for six.

Counting sexy primes by sieve

A sieve is the natural way to count sexy prime pairs. You start by writing down every whole number up to your limit and crossing out the multiples of 2, then the multiples of 3, then 5, and so on, leaving only the primes standing. From that list, counting a sexy prime is a matter of checking each prime p and asking a single question: is p + 6 also still standing? If it is, the two numbers form a pair six apart, like 83 and 89. The name, as you may have guessed, comes from sex, the Latin word for six.

Running that check at three convenient limits gives a clear picture of how the sexy primes thin out as the numbers grow. Up to 100 there are 15 sexy prime pairs. Up to 1,000 the count rises to 74, and up to 10,000 it reaches 411. The pairs keep appearing, but each new thousand yields fewer of them than the one before, the same gradual thinning that the primes themselves show.

The table below collects those counts so you can compare the three limits side by side.

Two details are worth adding for anyone who wants to check the sieve by hand. The largest sexy pair up to 1,000 is 991 and 997, and up to 10,000 the largest is 9,967 and 9,973, so the final pair before each limit sits close to the top of the range. Sexy primes also belong to a broader family of prime pairs sorted by their gap: twin primes are two apart, cousin primes are four apart, and sexy primes fall between them with a gap of six.

LimitSexy prime pairs
10015
1,00074
10,000411
The count of sexy primes grows with the limit, but more slowly each time: 15 pairs up to 100, 74 up to 1,000 and 411 up to 10,000.

Triplets and quadruplets

A sexy prime chain is what you get when you keep stepping by six. Two primes six apart form a sexy prime pair, such as 83 and 89, and the name comes from sex, the Latin word for six. Stack more links on the same ladder and you get longer structures: three primes each six apart make a sexy prime triplet, and four make a sexy prime quadruplet. These chains are the reason the sexy prime label covers more than simple pairs — the same gap of 6 that defines a pair can repeat several times in a row.

The arithmetic of a chain is easy to follow. Start with a prime p, then check p + 6, p + 12 and p + 18. If all four numbers are prime, you have a sexy prime quadruplet. Because every step adds 6, the four numbers always land in four different residue classes modulo 5 — unless one of them is 5 itself. That single observation is what limits quadruplets so sharply. Among any five consecutive integers, exactly one is divisible by 5, so a run of four primes spaced by 6 cannot avoid hitting a multiple of 5 somewhere. If that multiple is larger than 5, it is composite and the chain breaks. The only escape is for the multiple of 5 to be the prime 5 itself, which is why only one residue pattern modulo 5 can survive as a quadruplet of primes.

In practice this keeps quadruplets rare. Sexy prime quadruplets — four primes spaced by 6 — number just 4 up to 100, 7 up to 1,000 and 24 up to 10,000. Compare that with the pairs: there are 15 sexy prime pairs up to 100, 74 up to 1,000 and 411 up to 10,000. The gap between those counts shows how much harder it is to keep a chain going than to find a single pair. Triplets fall between the two, more common than quadruplets but still far scarcer than pairs, because each extra link adds another chance for a composite number to appear.

It helps to place these chains in the wider family of prime pairs classified by their gap. Sexy primes sit between twin primes, which have a gap of 2, and cousin primes, which have a gap of 4. The largest sexy pair up to 1,000 is 991 and 997; up to 10,000 it is 9,967 and 9,973. Longer chains inherit the same spacing, so a triplet or quadruplet is simply a cluster of sexy pairs sharing primes. When you test a candidate chain with the calculator, remember the modulo 5 rule: a quadruplet needs its multiple of 5 to be the number 5, and any other arrangement will fail once the numbers grow.

Only one residue pattern mod 5 allows a sexy prime quadruplet: the run of four numbers spaced by 6 must contain 5 itself as its multiple of 5. Any other starting point puts a larger multiple of 5 inside the chain, and that number is composite.

Sexy, twin and cousin primes compared

Prime pairs are often sorted by the size of the gap between the two primes, and that sorting puts sexy primes in the middle of a small family. Twin primes are two apart, cousin primes are four apart, and sexy prime pairs are six apart, like 83 and 89. The name comes from sex, the Latin word for six, so a sexy prime is simply a prime with another prime six numbers above it. Reading the three families side by side is a quick way to see how the gaps differ and how the counts behave as the numbers grow.

Counting pairs up to a round limit shows how common each gap is. The table below uses the sexy prime pair counts from the brief and leaves the twin and cousin columns to the calculator's own results, since only the gap-6 figures are fixed here.

The gap-6 counts rise steadily: there are 15 sexy prime pairs up to 100, 74 up to 1,000 and 411 up to 10,000. The largest sexy pair up to 1,000 is 991 and 997; up to 10,000 it is 9,967 and 9,973. Tighter groupings exist too. Sexy prime quadruplets, four primes spaced by 6, number just 4 up to 100, 7 up to 1,000 and 24 up to 10,000, which shows how much rarer longer clusters are than single pairs.

What all three families share is that no one has proved there are infinitely many of them. Twin primes, cousin primes and sexy primes are each conjectured to go on forever, but each remains unproved. The counts above show the pattern holding over the ranges we can check, not a guarantee about what lies beyond. That is why the sexy prime family is best described as sitting between twin primes (gap 2) and cousin primes (gap 4) in a classification that is simple to state and surprisingly hard to settle.

Use the calculator to test a number or a range and see the pairs it produces. The gap-6 counts give you a reference point, and comparing them with the twin and cousin results for the same limit shows how the three families stack up.

  • Twin primes: gap 2, the tightest pair spacing.
  • Cousin primes: gap 4, one step wider.
  • Sexy primes: gap 6, named from the Latin word for six.
  • Sexy prime pairs: 15 up to 100, 74 up to 1,000, 411 up to 10,000.
  • Sexy prime quadruplets: 4 up to 100, 7 up to 1,000, 24 up to 10,000.
  • Largest sexy pair: 991 and 997 up to 1,000; 9,967 and 9,973 up to 10,000.
  • All three families are conjectured infinite but unproved.
Twin, cousin and sexy primes differ only by gap — 2, 4 and 6 — yet proving that any of the three families is infinite is still an open problem.

FAQs

What is a sexy prime?

A sexy prime is one of a pair of primes that differ by 6, such as 83 and 89. The name comes from sex, the Latin word for six, referring to the gap between the two primes rather than anything else. Both numbers in the pair must be prime, and either member can be called a sexy prime.

How many sexy prime pairs are there up to 100?

There are 15 sexy prime pairs up to 100. Each pair consists of two primes six apart, such as 5 and 11 or 83 and 89. Counting them is straightforward with a sieve: list the primes below 100 and check which ones have a partner exactly six higher that is also prime.

How many sexy prime pairs are there up to 1,000?

There are 74 sexy prime pairs up to 1,000. The largest of these is the pair 991 and 997, which differ by exactly 6 and are both prime. The count grows steadily as the limit rises, though no one has proved that the pairs continue forever.

What is a sexy prime quadruplet?

A sexy prime quadruplet is four primes in a row, each six apart. The smallest example is 5, 11, 17 and 23. Up to 10,000 there are only 24 such quadruplets, so they are much rarer than ordinary sexy prime pairs. Each consecutive pair within the quadruplet differs by exactly 6.

Are there infinitely many sexy prime pairs?

Nobody knows. Like the twin prime conjecture, the question of whether infinitely many sexy prime pairs exist is unproved. The pairs keep appearing as far as anyone sieves, which suggests there may be infinitely many, but no proof has settled it. It remains an open problem in number theory.

What is the difference between sexy and cousin primes?

The difference is the gap between the two primes. Cousin primes differ by 4, sexy primes differ by 6 and twin primes differ by 2. So 11 and 13 are twin primes, 13 and 17 are cousin primes, and 17 and 23 are sexy primes, each name tied to its specific gap.

Sources

Related calculators

Twin Prime Counter
How many twin prime pairs lie at or below a limit, found by sieve, with the largest pair in range and the pair density.
Cousin Prime Calculator
Count cousin prime pairs - primes differing by 4 - up to a limit by sieve, with the largest pair in range and the twin-prime count at the same limit for comparison.
Factors Calculator
List every factor of a number and count them — with the factor pairs, the divisor sum and whether the number is prime or a perfect square.