# Some Properties and Algorithms for Twin Primes
## 2 Twin Primes
** _The jump extension \(\dot{r}_{n}^{e}\) is invariant for each \(n\) and it is equal to 3, then there are two missing successive elements in \(r_{n}\) for each jump size._Proof.As a direct consequence of (12), we have that \(r_{n}\) is made up of two types of terms, and that is, singletons \(\{i\}\) and subsets centered in \((2k_{n}+1)m\) with subsets from \([(2k_{n}+1)m-(n-1)]\) to \([(2k_{n}+1)m+(n-1)]\). The case \(n=1\) is trivial. Indeed, \(r_{1}=\{\{1\}\cup\{2\}\cup\{2k_{1}+1\}m\), \(\forall m\in\mathbb{N},k_{1}=1\}=\{1,2,3,6,9,\ldots\}\). Then, by using (13) we have  
\[\dot{r}_{1}^{e}=6-3=9-6=\ldots=3.\]  
For this reason, there are two missing elements between two successive subsequences. With the same reasoning, we can write  
\[\dot{r}_{n}^{e}=[(2k_{n}+1)(m+1)-(n-1)]-[(2k_{n}+1)m+(n-1)]=2k_{n}+1-2(n-1).\]  
The element \(k_{n}\) at the nth level coincides with the value of \(n\) and we have  
\[P(n):\dot{r}_{n}=3n+1.\]0  
Therefore, there are two missing elements between two successive subsequences. \(\square\)  
The following theorem characterizes the jump size. **Theorem of the jump size. **_The jump size_  
\[P(n):\dot{r}_{n}=3n+1.\]1  
_and, therefore, is strictly increasing._  
Proof.The truth of this proposition follows immediately from the structure (12) of \(r_{n}\). Indeed, we see that it is made up of the union of \(n+1\) singletons and \(2n-1\) subsets of the type \(\{(2k_{n}+1)m\pm\gamma\}\) with \(\gamma=0,..,n-1\). If \((2k_{n}+1)m=(2n+1)m\) is the central term, as \(\gamma\) varies, there will be \(n-1\) subsets \((2k_{n}+1)m+\gamma\) and \(n-1\) subsets \((2k_{n}+1)m-\gamma\). Thus, they, with the addition of the central term, are in total \(2n-1\). The difference between the two following holes is given from \(2n-1\) by adding the two holes, that is \((2n-1)+2=2n+1\) as we would prove. In addition, for the symmetries of the structure, the same result is obtained by making the difference between the two following centroids \((i.e\,(2k_{n}+1)m)\) for each subset. For example, we have \(c_{2}(r_{1})-c_{1}(r_{1})=6-3\), where \(c_{i}\big{(}r_{j}\big{)}\) is the i-th centroid of \(r_{j}\). Moreover, \(c_{2}(r_{2})-c_{1}(r_{2})=6\), \(c_{2}(r_{3})-c_{1}(r_{3})=7\), etc. Finally, from (14), we deduce that \(\dot{r}_{n}^{s}\) is an increasing function. \(\square\)  
Now, we deduce the following property. **Remark. **_By observing that \(\dot{r}_{n}^{s}\) is strictly increasing, the holes will be increasingly rarer. In other words, in \(r_{1}\) we have that the distance between holes is 3, in \(r_{2}\) is 5 and so on. This means that as you progress with the lines there are fewer and fewer holes. Therefore, \(r_{n}\to\mathbb{N}\) if \(n\to\infty\)._  
**Corollary. **_The rows \(r_{n},\ \forall n\in\mathbb{N}\), are made up of a number of subsets equal to \(3n\)._  
Proof.It is possible to note, from (12), that each \(r_{n}\) is made up of a number of subsets equal to \(3n\). Indeed, we have \(n+1\) singleton and \(2n-1\) of the type \((2k_{n}+1)m\pm\gamma\). Therefore, we have \(n+1+2n-1=3n\). \(\square\)  
**3. Smart Algorithm for Finding Twin Primes**  
In this section, we develop an algorithm using the definition of twin primes, i.e., \(p=q+2\) with \(p\) and \(q\) prime numbers, in a way that is easier from a computational point of view. We have seen that, once \(k\) is fixed, two numbers \(p\) and \(q\) are twins if they are of the type \(p=2k-1\) and \(q=2k+1\) with \(k\in\cap_{i=1}^{\infty}r_{i}\). As we have seen, from the first and second condition, we deduce that a necessary condition for \(k\) to generate a pair of twins is that it is a multiple of 3 with the last digit equal to 0, 1, 4, 5, 6, 9. Condition (11), therefore, can be simplified in order to obtain an effective algorithm. Indeed, rather than considering the infinite intersection, it will be sufficient to stop at a certain \(r_{j}\) to check whether \(\overset{\sim}{k}\) generates a pair of twins.