A prime twin is a prime number that differs from another prime number by 2. Example of prime twin pairs would be the ordered pairs (3, 5), (11, 13), (41, 43) and (1000000007, 1000000009). Twin prime pairs appear less often as the gap between prime numbers expands; this is in large part due to the Prime Number Theorem.
Your Task:
Investigate prime twins. In doing so, try to answer this question: Are there infinitely many prime twins? If not, then how many prime number pairs are there? You can use the Prime Number applet below, provided by the University of Utah, or check out the webpages listed below.
Links:
http://en.wikipedia.org/wiki/Prime_twins
http://www.math.utah.edu/~pa/math/machine.html
The applet on this page lets you explore the set of prime numbers. You do need a Java compatible browser.
A prime number is a natural number greater than 1 that can be divided without remainder only by itself and by 1. Natural numbers n that can be divided by a number less than n and greater than 1 are composite numbers. The prime machine finds prime numbers using the Sieve of Eratosthenes and lets you study and explore those prime numbers.
When you first click on the above applet a control window pops up. It should look like this:
The most important item in that window is the text field in the center of the second row, the one with the fetching dark red background. Everything happens with respect to the number in that field. Let's call it N. Initially, N=100 (that value lets you explore the prime numbers in a familiar range).
Let's go though the rows of the control panel.
- Row 1.
- The green buttons scroll down or up through the internally computed (rather than downloaded!) list of prime numbers. The number of angular brackets determines the speed of the scroll:
- < or >: a step of 1 down or up; respectively.
- << or >>: down or up to the next prime number.
- <<< or >>> : down or up all the way to the end of the current list. The lower end is of course the smallest prime number, i.e., 2.
- The gray or red button STOP will interrupt a computation of new primes that might be in progress.
- It is effective only when it is red.
- The blue button quit will cause all computation to stop and the control window to disappear. You can achieve the same affect by clicking on the applet, or typing "x", "X", "q", or "Q" in the control window.
- The yellow button draw causes a drawing to be displayed that illustrates the distribution of prime twins and the prime number theorem.
- The Status Label displays the following types of information:
- Green, with the word "Ready". This means all is ready for a new computation.
- Red, possibly with a number in it. This means the Sieve of Eratosthenes is being used to compute prime numbers. The number in the red field indicates the estimated number of seconds to completion. That number changes as time passes, but the estimate is not very reliable. It's usually too high, unless your computer is swapping heavily.
- Blue, possibly with a number in it. This means that the information in the white text labels of the control display are being recomputed. The number indicates the estimated number of seconds to completion. It is computed only once, and not very reliable either.
- Magenta, possibly with the word Memory in it. This means that in the last attempt to extend the range of prime numbers your computer ran out of memory. The program will attempt to restore the display and the list of primes to the previous values. If that does not work then everything is returned to the the default values (corresponding to N=100.
- The green buttons scroll down or up through the internally computed (rather than downloaded!) list of prime numbers. The number of angular brackets determines the speed of the scroll:
- Row 2. N is the number around which everything revolves. You can change it via the green buttons in row 1, or you can just edit the text window. To the left of N (unless N=2 ) is the largest prime number less than N and to the right (unless we are right at the limit of the current range) is the smallest prime number greater than N . The window to the right turns gray if there is no prime number between N and the end of the current range, and the window to the left turns gray when N=2.
- Row 3. This label exhibits the closest Prime Twins above and below N. A prime twin is a pair of prime numbers that differ by 2. Although this question has been much studied, nobody knows how many prime twins there are. There may be finitely many or infinitely many. If you figure out the answer, be sure to drop me a message so I can update this page!
- Row 4 is devoted to illustrating the prime number theorem. phi is the number of primes less than or equal to N. N/log(N), where log is the natural logarithm, denotes an approximation of phi that is known to get arbitrarily accurate, in the sense that the ratio phi/(N/log(N)) converges to 1 as N goes to infinity. That ratio is displayed. For the range of numbers that this applet can handle (up to N = a few tens of millions) the ratio is almost constant and varies from about 1.12 to 1.06.
- Row 5 shows the prime factorization of N.
- Row 6 is dedicated to the Goldbach Conjecture which asserts that every even number greater than 2 can be written as the sum of two prime numbers. If N>2 is even then this row displays the following information:
- The number of ways in which N can be written as the sum of two prime numbers.
- Two prime numbers that add to N. Initially this is the pair where the two prime numbers are as close together as possible. However, you can scroll up and down the list using the + and - buttons.
- Row 7. I increase the version number by an appropriate amount every time there is a significant change. The run number indicates the number of times this program was activated since November 7, 1996.
How does it work?
When starting up the applet computes all prime numbers from 2 to 2N. It does this by using a modification of the Sieve of Eratosthenes that only considers odd numbers and is about twice as fast and uses half as much memory as the original sieve. As mentioned above, the default value of N is 100. If the value of N (perhaps entered though the textfield) exceeds the range of numbers covered a new computation is started automatically. The larger the new value of N, the longer the computation will take, and the more memory it will require.