In number theory, a prime triplet is a set of three prime numbers in which the smallest and largest of the three differ by 6. In particular, the sets must have the form (p, p + 2, p + 6) or (p, p + 4, p + 6). With the exceptions of (2, 3, 5) and (3, 5, 7), this is the closest possible grouping of three prime numbers, since one of every three sequential odd numbers is a multiple of three, and hence not prime (except for 3 itself).

**Examples**

The first prime triplets are

(5, 7, 11), (7, 11, 13), (11, 13, 17), (13, 17, 19), (17, 19, 23), (37, 41, 43), (41, 43, 47), (67, 71, 73), (97, 101, 103), (101, 103, 107), (103, 107, 109), (107, 109, 113), (191, 193, 197), (193, 197, 199), (223, 227, 229), (227, 229, 233), (277, 281, 283), (307, 311, 313), (311, 313, 317), (347, 349, 353), (457, 461, 463), (461, 463, 467), (613, 617, 619), (641, 643, 647), (821, 823, 827), (823, 827, 829), (853, 857, 859), (857, 859, 863), (877, 881, 883), (881, 883, 887)

**Subpairs of primes**

A prime triplet contains a single pair of:

* Twin primes: (p, p + 2) or (p + 4, p + 6);

* Cousin primes: (p, p + 4) or (p + 2, p + 6); and

* Sexy primes: (p, p + 6).

**Higher-order versions**

A prime can be a member of up to three prime triplets - for example, 103 is a member of (97, 101, 103), (101, 103, 107) and (103, 107, 109). When this happens, the five involved primes form a prime quintuplet.

A prime quadruplet (p, p + 2, p + 6, p + 8) contains two overlapping prime triplets, (p, p + 2, p + 6) and (p + 2, p + 6, p + 8).

]]>