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\text{.}\) Can one say anything about the constants involved in these progressions? Since \(b\) is pretty arbitrary, we would focus on \(a\text{.}\) Here are some natural questions along these lines.

Question22.3.1.

Consider the following for small values of \(a\text{.}\)

Find some primes that look like \(2x+b\) for some \(b\) and several consecutive \(x\text{.}\) How many \(x\) in a row can you do?

How about for \(3x+b\text{?}\)

What about \(4x+b\text{?}\)

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\text{,}\) 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.

Conjecture22.3.2.Polignac’s Conjecture.

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

There are infinitely many consecutive odd prime numbers.

Definition22.3.4.

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 twin prime pairs, numbered by which twin prime pair it is. The pair 17 and 19 is the fourth pair, for example.

We can use similar searching to try to see whether there are enough that there are infinitely many such pairs. Here are two sample graphics.

You can see in the preceding graphic 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\text{.}\) There is a mysterious constant \(C_2\) I’ve used; it will be explained below.

Subsection22.3.2Heuristics for twin primes

To explain how to get to twin primes, there is a nice little rule of thumb; see e.g. [E.4.5] for what follows. Even though we definitely do not have a proof, we can still give you a good idea of how these ideas come about.

First, one might want to estimate how many primes there are up to a certain point to start. The problem is we should use a different idea than just looking at tables! What can we say that is a little smarter?

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\)

If we take this thinking to its logical extreme, you might even expect that

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}/\log(x)\) (recall that \(\gamma\) from Definition 20.3.10).

Still, this kind of thinking is still helpful, and might help us make ideas for how many twin primes there are – especially if we keep in mind this isn’t 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. (See Exercises 22.4.11 and 22.4.12.)

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\text{.}\)

The chances that \(n\) and \(n+2\) are both not divisible by five is \(3/5\text{.}\)

And so forth.

So, having gotten a little more sophisticated, we might expect that

is a decent approximation of the probability that a given pair of consecutive odd numbers are both prime.

This doesn’t look so recognizable yet, but we can do some algebra to turn this into something that looks better and has logarithms, just like in the prime number theorem. If we substitute

Finally, if we now use the earlier suggestion about the right-hand side being more or less the square of the number of primes, we come up with a reasonable suggestion that looks more familiar.

The graphs in Subsection 22.3.1 use this constant (which is built-in in Sage) as well as a logarithmic integral version of the preceding analysis.

There is some inconsistency in the literature about whether the 2 in front of the formula for \(C_2\) is part of the twin prime constant or not.

This also leads to a conjecture of Hardy and Littlewood.

Conjecture22.3.7.

The number of ways to write an even number \(2k\) as a sum of primes is also asymptotic to \(\frac{1}{2}\prod_{p<\sqrt{x},p>2}\left(1-\frac{1}{(p-1)^2}\right)\left(\frac{x}{\log(x)}\right)^2\text{.}\)

This would provide a very overwhelming proof of the following old suggestion, going back to correspondence between Euler and Prussian/Russian mathematician Christian Goldbach.

Conjecture22.3.8.Goldbach Conjecture.

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

In fact, there are two such conjectures, with the other one suggesting that any positive integer may be written as a sum of three primes. There is a proof claimed^{ 10 } for the latter ‘weak’ conjecture^{ 11 }, but it has not appeared in a peer-reviewed journal yet.

Historical remark22.3.9.The Pentium bug.

Returning to the twin prime constant, computing it (as in the Sage cell below) led to a very interesting real-life application.

Computing this constant to arbitrary precision led to the discovery of the infamous Pentium chip bug^{ 12 }, where some floating-point calculations would be incorrect in high decimal places. This is a quite surprising ‘application’ of number theory! (It turns out manufacturers do use number-theoretic computations to stress-test their products. See also Historical remark 12.1.8.)

Historical remark22.3.10.Twin prime status.

It is still unknown whether there are infinitely many twin prime pairs. In a 2013 result that shocked the mathematics world, (then) unknown mathematician Yitang Zhang proved^{ 13 } that there exists some \(N\) less than seventy million such that there are infinitely many pairs of primes separated by exactly \(N\text{.}\) This was a huge improvement over previous results, and further work of an unusually collaborative nature^{ 14 } have now reduced this bound to \(N\leq 246\text{,}\) but the effort has not continued progress. A related result about polynomials^{ 15 } was proved in 2019, but this doesn’t seem to have led closer to a final resolution, either.

As we finish this subsection, we must mention another constant affiliated with twin primes. Although there may really be infinitely many pairs, the sum of their reciprocals

\begin{equation*}
\sum_{p,p+2 \text{ both prime}} \frac{1}{p}+\frac{1}{p+2}
\end{equation*}

is still a finite constant. At the very least means twin primes must be pretty rare. This (possibly infinite) sum is called Brun’s constant.

Sage note22.3.11.Sage can change.

Originally, this constant was included in Sage. However, as nearly every digit of the constant is conjectural, it was removed as a built-in.

In addition, there are many other heuristics like the ones above. Here is a sampling of those we don’t have space or expertise in this text to dig further into.

As one example, consider the chance that \(n\) and \(2n+1\) are both not divisible by a given prime \(p\text{.}\) Probabilistically, this is basically the same chance as that \(n\) and \(n+2\) are both not divisible by \(p\text{,}\) so it turns out that Germain primes might also be distributed in the same fashion as twin primes.

Using similar ideas, one can get a heuristic that Mersenne primes are distributed as

Bizarrely, one can use the same idea to get a heuristic for factorial primes. These are primes of the form \(n! \pm 1\text{,}\) like 5, 7, 23, and 719. It’s conjectured that there are \(e^{\gamma}\log(n)\) such primes less than \(n\text{.}\)

These rules of thumb even seem to apply to the so-called primorial primes – primes of the form \(p\#\pm 1\text{,}\) like 3, 5, 7, 29, 31, 211, etc. It’s truly weird, yet also cool.

There is so much to explore! There is never a lack of questions for mathematicians to explore when it comes to prime numbers.