Searching for Prime Twins with JavaScript:
nextPrimeTwin(n)

Prime twins (or twin primes) are odd prime numbers that come in pairs: {3, 5}, {11, 13}, {17, 19}, {29, 31}. Primes in each twin pair differ by two. (The exceptional pair {2, 3} is not usually included in prime twins.) One can prove that each prime twin pair except {3, 5} has the form {6x − 1, 6x + 1} for a certain integer x. Most mathematicians believe that there are infinitely many prime twins. This is the so-called twin prime conjecture; nobody has proved it thus far.

You are welcome to investigate the properties of prime twins right here using JavaScript

 

A Famous Prime Twin
The prime number 824633702441, which is a prime twin, is perhaps the most expensive number in history. This number helped discover the floating-point division bug in the Intel Pentium processor, which eventually has cost Intel 475 million dollars! Professor Thomas R. Nicely, the discoverer of the bug, recalls: