Prime Triplet Calculator
Primes
- A prime triplet is a constellation of three primes inside a span of six: either (p, p + 2, p + 6) or (p, p + 4, p + 6) - the only two patterns that dodge divisibility by 3.
- Sieve the primes up to 100 and test both constellation patterns at every prime p with p + 6 in range.
- Counting gives 4 of type A and 4 of type B, 8 triplets in total.
- When both patterns fire at once around one prime the triplet pair overlaps into a prime quadruplet - the constellation one size up.
This Prime Triplet Calculator finds every prime triplet up to the limit you enter. A prime triplet is three primes inside a span of six, and only two patterns work: (p, p + 2, p + 6) or (p, p + 4, p + 6). These are the only arrangements that dodge divisibility by 3, so no other three-prime pattern in a six-number window can survive. The calculator scans the primes up to your limit, sorts each match into type A or type B, and returns the full list with counts. The numbers show how the patterns behave: there are 8 prime triplets up to 100, 4 of type A and 4 of type B, and 30 up to 1,000, split 15 and 15. Up to 50 there are 7 triplets, 4 of type A and 3 of type B. The largest triplet up to 100 is (67, 71, 73); up to 1,000 it is (881, 883, 887).
The method is the accepted standard for this kind of calculation because it rests on the definition of a prime triplet itself: test each candidate p, check whether p, p + 2 and p + 6 are all prime, then check p, p + 4 and p + 6, and keep only the patterns that fit. That is exactly the divisibility-by-3 reasoning above, applied prime by prime, with no shortcuts and no guesswork. It also catches the case where both patterns fire around the same prime, so the two triplets overlap into a prime quadruplet, and the results stay consistent with the counts listed here. This page shows the formula, the step-by-step workings, worked examples and sources, so you can follow each stage of the calculation and check the output yourself rather than trusting a black box.
Worked examples
Prime triplets up to 100
(100)
| prime triplets up to 100 | 8 |
| type A triplets (p, p + 2, p + 6) | 4 |
| type B triplets (p, p + 4, p + 6) | 4 |
| largest triplet in range | (67, 71, 73) |
Prime triplets up to 1,000
(1000)
| prime triplets up to 1,000 | 30 |
| type A triplets (p, p + 2, p + 6) | 15 |
| type B triplets (p, p + 4, p + 6) | 15 |
| largest triplet in range | (881, 883, 887) |
Prime triplets up to 50
(50)
| prime triplets up to 50 | 7 |
| type A triplets (p, p + 2, p + 6) | 4 |
| type B triplets (p, p + 4, p + 6) | 3 |
| largest triplet in range | (41, 43, 47) |
What is a prime triplet?
A prime triplet is a set of three prime numbers packed into a span of six. Only two arrangements are possible: (p, p + 2, p + 6), often called type A, and (p, p + 4, p + 6), called type B. In each case the three primes sit at the two ends of the six-number window and at one interior position, leaving one gap of two and one gap of four between consecutive members. So (5, 7, 11) is a type A triplet and (7, 11, 13) is a type B triplet.
The reason there are exactly two patterns comes down to divisibility by 3. In any run of six consecutive numbers, one of the positions is always a multiple of 3. For three primes to survive in that window, the multiple of 3 must be the number 3 itself, or it must fall on one of the three spots you leave empty. Place your primes at any other combination of three positions and you are forced to include an even number or a multiple of 3 larger than 3 - and that number cannot be prime. The two surviving layouts are precisely the ones that dodge divisibility by 3, which is why the span-6 definition has no third case.
The counts stay small as you climb. There are 8 prime triplets up to 100, split evenly into 4 of type A and 4 of type B. Up to 1,000 the total rises to 30, again split 15 and 15 - a balance between the two patterns that holds in this range. The largest triplet up to 100 is (67, 71, 73), and up to 1,000 it is (881, 883, 887). Note that these records are stated for the given bounds; a larger triplet may of course exist above 1,000.
Over shorter ranges the picture is similar. Up to 50 there are 7 triplets, 4 of type A and 3 of type B, so the two families stay close together even at small sizes. Because the patterns are so tightly constrained, the interesting structure appears when they interact: when both patterns fire around the same prime, the two triplets overlap and merge into a prime quadruplet, a denser cluster of four primes.
If you are checking a candidate by hand, the practical test is to confirm that the three numbers are prime and that they fit one of the two layouts exactly. Any three primes whose largest minus smallest is not six belong to some other constellation, not to a prime triplet.
- Type A: (p, p + 2, p + 6), for example (5, 7, 11)
- Type B: (p, p + 4, p + 6), for example (7, 11, 13)
- Up to 50: 7 triplets - 4 of type A, 3 of type B
- Up to 100: 8 triplets - 4 of type A, 4 of type B; largest is (67, 71, 73)
- Up to 1,000: 30 triplets - 15 of type A, 15 of type B; largest is (881, 883, 887)
- Overlapping patterns around one prime form a prime quadruplet
How triplets are counted
Counting prime triplets starts with a sieve. The calculator first marks every prime up to the chosen limit, then walks through those primes one at a time. At each prime p it checks whether p + 6 still falls inside the range. If it does, the tool tests both candidate patterns directly against the sieve: type A is (p, p + 2, p + 6) and type B is (p, p + 4, p + 6). A pattern counts only when all three of its numbers are marked prime. Because the sieve already holds the answer for every number, each test is a quick lookup rather than a fresh primality check.
That two-pattern test is not arbitrary. A prime triplet is three primes inside a span of six, and (p, p + 2, p + 6) and (p, p + 4, p + 6) are the only two patterns that dodge divisibility by 3. Any other arrangement of three numbers within a span of six puts one of them on a multiple of 3, so it cannot survive as a triplet beyond the smallest cases. Restricting the search to these two shapes keeps the count exact and skips candidates that could never qualify.
The results are easy to check against known counts. Up to 50 there are 7 triplets, 4 of type A and 3 of type B. Up to 100 there are 8 prime triplets, again 4 of type A and 4 of type B. Up to 1,000 the total reaches 30, split evenly at 15 and 15. The largest triplet up to 100 is (67, 71, 73), and up to 1,000 it is (881, 883, 887). Reproducing these figures is a simple sanity check that the sieve and the pattern tests agree with the published counts.
One more behavior is worth noting. When both patterns fire around the same prime, the two triplets overlap into a prime quadruplet. The counting routine can flag that overlap rather than silently listing two separate triplets, so the output stays clear about what was found. In practice this means the calculator reports each qualifying pattern at every prime p with p + 6 in range, and separately notes where the two patterns coincide.
- Sieve all primes up to the limit, then visit each prime p with p + 6 still in range.
- Test type A, (p, p + 2, p + 6), and type B, (p, p + 4, p + 6), using the sieve for instant lookups.
- Count only patterns where all three numbers are prime, and flag overlaps that form a prime quadruplet.
Triplet counts by range
Counting prime triplets is a matter of checking every prime p and asking whether the numbers six steps ahead fit one of the two allowed shapes. Because a triplet must sit inside a span of six, there are only two patterns to test: (p, p + 2, p + 6), called type A here, and (p, p + 4, p + 6), called type B. Any other arrangement of three primes within that span would include a multiple of 3, so those two patterns are the only ones that survive. Splitting the counts by type shows how the two families compare as the range grows.
Up to 50, a prime triplet search finds 7 triplets in total, made up of 4 of type A and 3 of type B. Doubling the ceiling to 100 adds just one more, for 8 prime triplets up to 100, and this time the split is even: 4 of type A and 4 of type B. The largest triplet up to 100 is (67, 71, 73).
By the time the range reaches 1,000, the count has grown to 30 triplets, split 15 and 15 between the two types. The largest triplet up to 1,000 is (881, 883, 887). The table below collects these figures by range and by type, using only the counts established for each ceiling.
One more feature of the definition is worth keeping in mind while reading the table. When both patterns fire around the same prime, the two triplets overlap into a prime quadruplet. That overlap is why the two types are usually counted separately rather than merged, and why a range can show an uneven split at one ceiling and an even one at the next.
| Range | Type A | Type B | Total | Largest triplet |
|---|---|---|---|---|
| Up to 50 | 4 | 3 | 7 | — |
| Up to 100 | 4 | 4 | 8 | (67, 71, 73) |
| Up to 1,000 | 15 | 15 | 30 | (881, 883, 887) |
Triplets, quadruplets and prime constellations
A prime triplet does not sit alone in the world of close-prime patterns. It belongs to a family of constellations — clusters of primes packed into a short span — and seeing it alongside its relatives makes the definition easier to hold onto. The core rule for a triplet is that three primes must fit inside a span of six, and only two arrangements survive. They are (p, p + 2, p + 6) and (p, p + 4, p + 6). These are the only two patterns that dodge divisibility by 3, which is why every prime triplet you will ever meet looks like one of them. Calculators and references often call the first arrangement type A and the second type B.
The rest of the family is built on the same idea of small gaps between primes. Twin primes are two primes two apart, such as 11 and 13. Cousin primes are two primes four apart, such as 7 and 11. Sexy primes are two primes six apart, such as 5 and 11 — the name comes from the Latin word for six, not from anything romantic. A prime quadruplet is tighter and more demanding: it packs four primes into the shortest span possible. When both triplet patterns fire around the same prime, the two triplets overlap into a prime quadruplet. That overlap is the bridge between the three-prime and four-prime cases, and it shows why quadruplets are rarer than triplets.
Counting makes the family relationships concrete. Up to 50 there are 7 triplets, 4 of type A and 3 of type B. Up to 100 the total rises to 8 prime triplets — 4 of type A and 4 of type B. Up to 1,000 there are 30, split evenly at 15 and 15. Those numbers show that triplets are uncommon but far from vanishing; they keep appearing as you climb the number line, even as the primes themselves thin out.
The largest examples in each range are worth memorizing because they make good sanity checks. The largest triplet up to 100 is (67, 71, 73). Up to 1,000 it is (881, 883, 887). Notice that each of these is a type B pattern: the middle prime sits four above the first and two below the last. Spotting that shape by eye is a quick way to tell a genuine triplet from three primes that merely happen to be close together.
- Twin primes: two primes two apart, e.g. 11 and 13
- Cousin primes: two primes four apart, e.g. 7 and 11
- Sexy primes: two primes six apart, e.g. 5 and 11
- Prime triplet: three primes in a span of six, in pattern (p, p + 2, p + 6) or (p, p + 4, p + 6)
- Prime quadruplet: four primes, formed when both triplet patterns overlap around the same prime
FAQs
How many prime triplets are there up to 100?
There are 8 prime triplets up to 100. Four of them follow the pattern (p, p + 2, p + 6), and the other 4 follow the pattern (p, p + 4, p + 6). These two patterns are the only possible arrangements of three primes within a span of six numbers, since any other such pattern would include a multiple of 3.
How many prime triplets are there up to 1,000?
There are 30 prime triplets up to 1,000, split evenly between the two patterns: 15 of the form (p, p + 2, p + 6) and 15 of the form (p, p + 4, p + 6). The count grows slowly as the numbers increase, because triplets require three primes packed closely together.
What is the largest prime triplet below 100?
The largest prime triplet below 100 is (67, 71, 73). Its three members are all prime, and it fits the pattern (p, p + 4, p + 6) with p equal to 67. No triplet with a larger starting value falls entirely below 100.
Why are there only two triplet patterns?
Among any three numbers in the other span-6 patterns, one is always divisible by 3. That means such a pattern cannot consist entirely of primes once the numbers are above 3. Only the two listed patterns, (p, p + 2, p + 6) and (p, p + 4, p + 6), can be all prime above 3.
What is a prime quadruplet?
A prime quadruplet is two overlapping triplets: (p, p + 2, p + 6, p + 8), where all four numbers are prime. Because the triplets share primes, a quadruplet contains more than one triplet. For example, the first three numbers and the last three numbers each form a valid triplet within the same span of eight.
Are there infinitely many prime triplets?
It is conjectured but unproven that there are infinitely many prime triplets. This question is part of the prime k-tuple conjecture, which predicts how often clusters of primes appear. No proof exists yet, so the answer remains open even though triplets keep appearing as you search larger numbers.