# Is the size of duplicate-free set {minGapOfPrime1, minGapOfPrime2, minGapOfPrime3, …} finite?

Let $p_i$ denote the $i$-th prime: $p_1 = 2, p_2 = 3, p_3 = 5, \ldots$ Then define the following function (assuming that $i$ is greater than or equal to 2):

$$F(p_i)=\min((p_{i+1}-p_i), (p_i-p_{i-1}))$$

Consider the following set $S$:

$$\{F(p_2),F(p_3),F(p_4),F(p_5),F(p_6),F(p_7),F(p_8),F(p_9),\ldots\} = \{1,2,2,2,2,2,2,4,\ldots\}$$

The question is: does $S$ have its maximum element? In other words, if one removes all duplicate numbers from $S$, will its size be finite? If yes (or no), how to prove this? And if yes, is it possible to estimate the value of such maximum element?

• Why all those repetitions of {\rm{ }} ? And {F(p_2)} instead of F(p_2), etc.? $\qquad$ – Michael Hardy Feb 2 '17 at 5:39

it does not, we just need to prove that for every value of $n$ there is a prime $p>n$ such that none of the integers $p-1,p-2,\dots,p-n$ is a prime and none of the elements $p+1,p+1.\dots p+n$ is a prime.

We can prove this with a combination of CRT and dirichlet's theorem.ㅡ

First pick $2n$ primes $p_1,p_2,\dots, p_{2n}$ and let $q$ be the solution to this system of equations:

$q\equiv 1 \bmod p_{1}^2$

$q\equiv 1 \bmod p_{2}^2$

$\dots$

$q\equiv 1 \bmod p_{n}^2$

$q\equiv -1\bmod p_{n+1}^2$

$\dots$

$q\equiv -1\bmod p_{2n}^2$

By CRT there exists a solution $x\bmod p_1^2\dots p_{2n}^2$ to that system of congruences. By dirichlet's theorem there exists a prime $p>n$ that is congruent to $x\bmod p_1^2\dots p_{2n}^2$and clearly none of $p\pm1,\dots p\pm n$ is a prime.

• I feel that Dirchlet's theorem might be overkill. Any thoughts about a simpler approach? – S.C.B. Feb 2 '17 at 6:30