A # twin primes

Twin primes are pairs of prime numbers that differ by two, the first of which are 3 and 5, 5 and 7, 11 and 13, and 17 and 19. The largest example known, as of February 2003, is a pair of 51,090-digit primes discovered by Yves Gallot and Daniel Papp, with the value 33218925 × 2169690±1. Other than the first, all twin primes have the form {6n-1, 6n+1}; also, the integers n and n + 2 form twin primes if and only if 4[(n -1 )! + 1] = -n (mod n(n + 2)).

In 1919 Brun showed that the sum of the reciprocals of the twin primes converges to a sum now known as Brun's constant: (1/3 + 1/5) + (1/5 + 1/7) + (1/11 + 1/13) + (1/17 + 1/19) + ... In 1994, by calculating the twin primes up to 1014, (and discovering the infamous Pentium bug in the process) Thomas Nicely of Lynchburg College estimated Brun's constant to be 1.902160578.

According to the (unsolved) twin-prime conjecture there are infinitely many twin primes. The twin-prime conjecture generalizes to prime pairs that differ by any even number n, and generalizes even further to certain finite patterns of numbers separated by specified even differences. For example, the following triplets of primes all fit the pattern k, k + 2, and k + 6: 5, 7, and 11; 11, 13, and 17; 17, 19, and 23; 41, 43, and 47. It is believed that for any such pattern not outlawed by divisibility considerations there are infinitely many examples. (The pattern k, k + 2, and k + 4 has only one solution in primes, 3, 5, and 7, because any larger such triplet would contain a number divisible by 3.) Quartets of the form k, k + 2, k + 6, and k + 8 (the smallest example is 5, 7, 11, and 13) are thought to be infinite. For some patterns no example is known, or only one.