Section22.3Types of Primes

There are many types of primes we have encountered up to this point. For instance:

  • Germain
  • Mersenne
  • repunit
Notice that for MANY of these types, we don't know if there are finitely many or not! Are there any conjectures for how often certain types of primes might appear?

Subsection22.3.1Twin Primes

Consider primes in an arithmetic progression \(ax+b\). Can one say anything about the constants involved in these progressions? Since \(b\) is pretty arbitrary, we would focus on \(a\). Here are some natural questions to consider.

  • Find some primes that look like \(2x+b\) for some \(b\) and several consecutive \(x\).
  • How many \(x\) can you do?
  • How about for \(3x+b\)?
  • What about \(4x+b\)?
  • Are the primes you get in these cases ever consecutive?
Hopefully it's pretty clear that you can't do every possible combination of \(b\) and \(a\), nor can every such progression go on indefinitely! Why?

Thinking about this and the Sieve of Eratosthenes led the French mathematician Alphonse de Polignac to the following.

Conjecture: Every even number is the difference between consecutive primes in infinitely many ways.

We have no proof of this. In fact, even the most basic case is one of the most celebrated questions in number theory.

Twin prime conjecture: There are infinitely many consecutive odd prime numbers.
Definition22.3.1
Pairs of primes \(p\) and \(q\) such that \(p+2=q\) are called twin primes.

There are lots of twin primes. The following cell computes pairs of the second of a twin prime pair, and which twin prime pair it is. The pair 17 and 19 is the fourth pair, for example.

But are there infinitely many?

You can see above that it's certainly possible to approximate the twin prime counting function in a similar way to how we approximated the prime counting function \(\pi\). There is a mysterious constant I've used; it will be explained below.

Subsection22.3.2Heuristics for twin primes

In fact, there is a nice little rule of thumb that gets us to these things. Notice this is very much not a proof!

  • First, one might want to estimate how many primes there are up to a certain point to start, but using a different idea than just looking at tables!
  • Well, one can say the following:
    • About half the numbers less than \(n\) are not divisible by 2.
    • About 2/3 the numbers less than \(n\) are not divisible by 3.
    • About 4/5 the numbers less than \(n\) are not divisible by 5.
    • Etc. for each prime less than \(\sqrt{n}\ldots\)
  • In fact, you might even expect that \[\prod_{p<\sqrt{x}}\left(1-\frac{1}{p}\right)\] is a good approximation of the probability that a given number \(x\) is prime.

Unfortunately, it isn't. In fact, this product turns out to be asymptotic to \(2e^{-\gamma}/\ln(x)\), for very good reasons. Still, this might help us make ideas for how many twin primes there are.

For instance, one might take into account that it's not really a probability. After all, if \(p>2\) is prime, then with one hundred percent probability the next number is not prime! And for \(p\) and \(p+2\) to be both prime, they must also both be odd; so if \(p\) is odd, then \(p+2\) is much more likely than a random number to be prime.

So we do the following analysis instead.

  • Although one would expect for 1/4 of all pairs separated by two to both be odd, \(n+2\) has the same parity as \(n\) so we should expect 1/2 the pairs to both be odd.
  • The chances that \(n\) and \(n+2\) are both not divisible by three is 1/3 (what form must \(n\) have for this to happen?).
  • The chances that \(n\) and \(n+2\) are both not divisible by five is 3/5 (what residues modulo five must \(n\) avoid?).
  • And so forth.
So we might expect that \[\frac{1}{2}\prod_{p<\sqrt{x},p>2}\left(1-\frac{2}{p}\right)\] is a good approximation of the probability that a given pair is prime.

Now we do some algebra to turn this into something that looks like something with logs: \[\left(1-\frac{2}{p}\right)=\left(1-\frac{1}{(p-1)^2}\right)\left(1-\frac{1}{p}\right)^2\] So we could approximate the number of twin primes less than \(x\) by \[\frac{1}{2}\prod_{p<\sqrt{x},p>2}\left(1-\frac{1}{(p-1)^2}\right)\prod_{p\text{ prime}}\left(1-\frac{1}{p}\right)^2\] And since we already know the right-hand part is more or less the square of the number of primes, we come up with a reasonable suggestion that we should approximate by \[\frac{1}{2}\prod_{p<\sqrt{x},p>2}\left(1-\frac{1}{(p-1)^2}\right)\left(\frac{x}{\ln(x)}\right)^2\]

Subsection22.3.3Even more with twin primes

A little further massaging of this would involve the logarithmic integral equivalent, which involves \(\int_2^x dt/(\ln(t))^2\). The graph above shows how good it gets, using the constant \[C_2=2\prod_{p>2}\left( 1-\frac{1}{p-1}^2\right)\, .\] This is finite; it is called the twin prime constant.

Remark22.3.2

Incidentally, there is some inconsistency in the literature about whether the 2 in front is part of the twin prime constant or not.

This also leads to a conjecture of Hardy and Littlewood - that the number of ways to write an even number \(2k\) as a sum of primes is asymptotic to the same thing! This would provide a very overwhelming proof of the so-called Goldbach Conjecture.

Conjecture: Any even number can be written in at least one way as a sum of two primes.

Returning to the twin prime constant, there is an interesting very real-life application this had.

Computing this constant to arbitrary precision led to the discovery of the infamous Pentium chip bug. This is a quite surprising "application" of number theory!

There is another constant affiliated with twin primes. Although there may be infinitely many of them, the sum of their reciprocals \[\sum_{p,p+2 \text{ both prime}} \frac{1}{p}+\frac{1}{p+2}\] is actually a constant, which at the very least means they must be pretty rare. This is called Brun's constant.

Subsection22.3.4Other types of primes

There are many other such heuristics. Here is a sampling.

  • As one example, consider the chance that \(n\) and \(2n+1\) are both not divisible by a prime \(p\). This is basically the same as that \(n\) and \(n+2\) are both not divisible by \(p\), so it turns out that Germain primes may also be distributed in the same way as twin primes.
  • Using similar ideas, one can get a heuristic that Mersenne primes are distributed as \[e^{\gamma}\ln(\ln(x))/ln(2)\] This is known as Wagstaff's conjecture.
  • Bizarrely, one can use the same idea to get a heuristic for factorial primes. These are primes of the form \(n! \pm 1\), like 5, 7, 23, and 719. It's conjectured that there are \(e^{\gamma}\ln(n)\) such primes less than \(n\).
  • These even seem to apply to the so-called primorial primes - primes of the form \(p\#\pm 1\), like 3, 5, 7, 29, 31, 211, etc. It's truly weird, yet also cool.

So much to explore, so little time!