Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Out of the 78499 prime number under 1 million. There are 32821 prime gaps (difference between two consecutive prime numbers) of a multiple 6. A bar chart of differences and frequency of occurrence shows a local maximum at each multiple of 6. Why is 6 so special?

enter image description here

share|cite|improve this question
On the question editor there is a picturesque icon; if you hover over it it should say something like "add picture." Click it and the rest is easy. – anon Feb 6 '12 at 19:53
@anon Thanks very much for that. – Comic Book Guy Feb 6 '12 at 20:04
up vote 12 down vote accepted

To provide a different perspective on Vhailor's answer: note that if $p$ is a prime $\gt 3$, then $p+6k$ is guaranteed not to be divisible by $2$ or $3$ for any $k$; in effect these gaps are 'pre-sieved' to weed out possible multiples of $2$ and $3$ that could keep the number at the other end from being prime. If you expanded your chart out further you would see similar spikes at the multiples of $30$, since those numbers are also 'pre-sieved' for $5$. (In fact, if you were to expand your table out to all the prims less than $2\times 10^{35}$, you would find the total number of gaps of length $30$ to be more than the number of gaps of length $6$ - see for the details!)

share|cite|improve this answer

All prime numbers except 2 and 3 are of the form $6k±1$, so whenever you fall on a pair $6k+1$, $6l+1$ their difference will be a multiple of $6$, same goes for a pair $6k-1$,$6l-1$.

share|cite|improve this answer

Excepting the first two gaps, all prime gaps are between numbers that are either $1$ or $5$ modulo $6$. Under the assumption that both cases are equally likely, half the prime gaps will be between numbers in the same class, and therefore of size $0$ modulo $6$, and the other half will be between numbers in different classes, which split up into sizes that are $2$ and $4$ modulo $6$. Since each of the latter cases only gets one quarter of the total, it is clear that ignoring all other factors, gaps that are $2$ or $4$ modulo $6$ are about half as likely to occur as gaps of the same approximate magnitude that are $0$ modulo $6$. You can check this in your chart. (Particular gap sizes are also subject to influences of other primes than $2$ or $3$, which explains some other irregularities one can observe.)

share|cite|improve this answer
@MichaelD.Moffitt: I think there is a big difference between expected irregularities and unexpected ones. The article you point to is vague, but I suppose that irregularity cannot be explained by a simple modular consideration of some kind; my point is that here it easily can. – Marc van Leeuwen Mar 16 at 7:51

6 is "special" because it is 3# (primorial, products of the first n primes) = 2*3. The first primorial is 2, and generates all even and odd numbers through 2x + (0,1). The second primorial, 6, generates all primes greater than 3 through 6x + (1,5). Disclaimer: this formula also generates composites.

The third primorial generates all primes greater than 5 with 30x + (1,7,11,13,17,19,23,29)... And so on

The high concentration of prime distances equal to six has more to do with the rarity of "new composites" eliminated by large prime seives. 997, the largest prime sieve to establish all primes under a million, only removes 1 composite under a million. As you get further from 0, the prime patterns are largely preserved. This has led to the twin prime and k-tuple conjectures, among others.

share|cite|improve this answer

Here is a recent paper on how the prime numbers are a perfect example of harmonic acceleration between two poles, where the multiples of 6 (6z, acceleration) is the second derivative of z^3.

Yes, I am the author.

share|cite|improve this answer
Thanks buddy i 'll try go through the paper – Comic Book Guy Mar 7 '12 at 20:44

take any integer $n> 3$, and divide it by $6$. That is, write $n = 6q + r$ where $q$ is a non-negative integer and the remainder $r$ is one of $0$, $1$, $2$, $3$, $4$, or $5$.

If the remainder is $0$, $2$ or $4$, then the number $n$ is divisible by $2$, and can not be prime.

If the remainder is $3$, then the number $n$ is divisible by $3$, and can not be prime.

So if $n$ is prime, then the remainder $r$ is either

  • $1$ (and $n = 6q + 1$ is one more than a multiple of six), or
  • $5$ (and $n = 6q + 5 = 6(q+1) - 1$ is one less than a multiple of six).
share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.