Section 22.3 Types of Primes
ΒΆGermain (Subsection 11.6.4)
Mersenne (Subsection 12.1.3)
repunit (Exercise 6.6.1)
Subsection 22.3.1 Twin 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 along these lines.Question 22.3.1.
Consider the following for small values of a.
Find some primes that look like 2x+b for some b and several consecutive x. How many x in a row can you do?
How about for 3x+b?
What about 4x+b?
Are the primes you get in these cases ever consecutive?
Conjecture 22.3.2. Polignac's Conjecture.
Every even number is the difference between consecutive primes in infinitely many ways.
Conjecture 22.3.3. Twin prime conjecture.
There are infinitely many consecutive odd prime numbers.
Definition 22.3.4.
Pairs of primes p and q such that p+2=q are called twin primes.
xxxxxxxxxx
def twin_primes_upto(n):
v = prime_range(n+1)
L = []
counter = 0
for i in range(len(v)-1):
if v[i+1]-v[i]==2:
counter += 1
L.append((v[i],v[i+1],counter))
return L
β
twin_primes_upto(100)

Subsection 22.3.2 Heuristics for twin primes
ΒΆTo explain how to get to twin primes, there is a nice little rule of thumb; see e.g. [C.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 βnβ¦
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.
The chances that n and n+2 are both not divisible by five is 3/5.
And so forth.
Remark 22.3.6.
The constant part of this formula is finite, and known as the twin prime constant:
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 C2 is part of the twin prime constant or not.
Conjecture 22.3.7.
The number of ways to write an even number 2k as a sum of primes is also asymptotic to 12βp<βx,p>2(1β1(pβ1)2)(xlog(x))2.
Conjecture 22.3.8. Goldbach Conjecture.
Any even number can be written in at least one way as a sum of two primes.
xxxxxxxxxx
2*twinprime.n()
Sage note 22.3.9. 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.
xxxxxxxxxx
brun.n(digits=5)
Because Sage is open source, you can follow discussions about decisions and additions to Sage functionality on the Sage developer Trac or sometimes on the Github organization.
Subsection 22.3.3 Other types of primes
ΒΆIn the quest toward Polignac's Conjecture, researchers have dubbed primes (not necessarily consecutive) with spacing N=4 cousin primes and those N=6 apart sexy primes. In another result of similar vintage to Zhang's (and also collaborative like its refinement), we know (conditional upon the so-called βgeneralized Elliott-Halberstam conjectureβ, which is closely related to our investigations in Subsection 22.2.2) that at least one of the classes of twin, cousin, or sexy primes is infiniteβ2βGo to the video of Tao's interview with Colbert, linked just before Conjecture 22.3.3, again to see Colbert's quite amusing reaction to this fact.. This is a very special case of exploring something called prime constellations; see Exercise 22.4.13. 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. Probabilistically, this is basically the same chance as that n and n+2 are both not divisible by p, 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
eΞ³log(log(x))/log(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!Β±1, like 5, 7, 23, and 719. It's conjectured that there are eΞ³log(n) such primes less than n.
These rules of thumb even seem to apply to the so-called primorial primes β primes of the form p#Β±1, like 3, 5, 7, 29, 31, 211, etc. It's truly weird, yet also cool.