The prime gap tug of war game is a numerical competition between prime gap increases and prime gap decreases. The increases apparently win most of the time, only to be overtaken by the decreases.... Will one side eventually win the game?
To play prime gap tug of war, let's start with the first prime gap d = prime(2) - prime(1) = 3 - 2 = 1. At this first stage, where the stage number n = 1, the game's score s equals 0. On the second stage, with n = 2, we look at the second prime gap new_d = prime(3) - prime(2) = 5 - 3 = 2. If new_d > d, then there's an increase in the gap, and we add 1 to the score s; if new_d < d, there's a decrease in the gap, and we subtract 1 from s. [In this case, new_d = 2 > d = 1, so s = 1 at stage n = 2.] Then we set d = new_d, and "play" at the next stage n = 3, where now new_d = prime(4) - prime(3). And so on.
In general, at stage n = k, we set: new_d = prime(k + 1) - prime(k); and s = s + 1 if new_d > d, s = s - 1 if new_d < d; and d = new_d.
The first 200 values of s, corresponding to n = 1, ..., 200, are:
0, 1, 1, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1,
2, 1, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 2, 3, 3, 2, 1, 2, 3, 2,
3, 2, 2, 2, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 3, 4, 3, 3, 2, 3, 4, 3,
4, 5, 4, 5, 4, 5, 4, 5, 6, 5, 4, 5, 6, 5, 4, 5, 4, 5, 6, 5, 6, 5, 6, 5, 5, 4,
5, 6, 5, 5, 4, 5, 5, 4, 3, 4, 3, 2, 3, 4, 4, 3, 4, 3, 4, 5, 6, 5, 6, 5, 4, 4,
3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4,
5, 4, 3, 4, 4, 5, 4, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 8, 7, 6,
7, 8, 8, 9, 8, 8, 9, 8, 9, 8, 9, 8, 8, 9, 10, 9, 10, 10It appears that s slowly but surely increases, and will never be negative. But amazingly, s attains its first negative value at n = 41,253 where s = -1. It goes as low as s = -15 at values of n such as 41,723. Then at n = 43,202, s = -1, after which s is again consistently positive for 43,202 < n < 121,142.
The story doesn't end there! Shortly after n = 121,142, the negative values of s outnumber the positive ones, and eventually overwhelm them. For example, at n = 140,000, s = -85. And so on. Will any one side eventually win, or will there just be a perpetual oscillation?
The Significance of the Score s. Recall from the Prime Number Theorem that the average density of primes near x is given by 1/ln(x). Hence, the average distance between primes near x is ln(x), and so on average, the gaps between primes should increase as x increases--slowly, but surely, as ln(x) increases with increasing x. From this consideration, one might suppose (erroneously so) that s will remain positive even after the first stages. However, it turns out that the prime gaps increase very erratically, as is shown by the shifting sign of s. s is thus a measure of how consistently the prime gaps have been increasing.
Heuristically, it appears that s will take on arbitrarily large (positive) values. However, we can't discount the possibility that s can take on infinitely many negative values (but less frequently than positive values). Even in such a case, s eventually increases on average, and the positive values predominate.
In the following figure, the corresponding values of s versus the values of n (the independent variable) from n = 1 to 250,000 are graphed.
![]()
The following graph by Mark Ganson shows only every 10,000-th value, but covers a much wider range, from n = 1 to 10,000,000.
![]()
The shifting (partial) outcomes of the prime gap tug of war is in sharp contrast to "gap tugs of wars" played on other well-known arithmetical functions. For example, gap tugs of war played on the Euler-phi function, the number-of-divisors function, and the sum-of-divisors function result in graphs that are very nearly straight lines. [The last function results in a near-line with negative slope.]
Problems
- Extend the above graph for larger n.
- Is s bounded from below? From above?
- Is s < 0 for infinitely many values of n? Is s > 0 for infinitely many n?
The following Mathematica code was used to generate the above graph.
d = 1;
c = 3;
s = 0;
r = {0};
For[i = 2, i <= 2.5*10^5, i++,
e = Prime[i + 1];
newd = e - c;
c = e;
If[newd > d,
s = s + 1,
If[newd < d,
s = s - 1]];
d = newd;
r = Append[r, s]];
ListPlot[r, PlotJoined -> True]
The following code is faster, but doesn't graph.
d = 1;
c = 3;
s = 0;
For[i = 2, i <= 10^6, i++,
e = Prime[i + 1];
newd = e - c;
c = e;
If[newd > d,
s = s + 1,
If[newd < d,
s = s - 1]];
If[s < 0, Print["s = " <> ToString[s] <> " at i = " <> ToString[i]]];
d = newd]
Joseph L. Pe
iDEN System Engineering Tools and Statistics
Motorola
Arlington Heights, IL
Number of Visits:
![]()
©2002 J. L. Pe. Document created on 18 February 2004 by J. L. Pe. Last updated on 26 February 2004.