# On a Dynamical Approach to Some Prime Number Sequences

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

**Prime spirals and the residue classes of linear congruences.**The Ulam spiral [18] is make by writing integers in a square spiral and marking the particular position of the prime numbers (see Figure 1 for an illustration). Using this representation, S. Ulam found that prime numbers tend to distribute and appear mostly on the diagonals of the spiral.

**The transitions between Pythagorean and Gaussian primes.**Once the sequence of Gaussian and Pythagorean primes (modulus $k=4$) has been extracted, we can consider the sequence of transitions between these two classes. This new symbolic sequence now has 4 symbols, one per transition, i.e., the set $\{AA,AB,BA,BB\}$. We construct this sequence by sliding a block-2 window and assigning to each pair of consecutive symbols a new symbol, for instance the consecutive primes 3 and 5 map into the symbol $AB$, because 3 is a Gaussian prime (A) and 5 is a Pythagorean prime (B). This new sequence will be called the transition sequence. The reason for doing this is inspired in envisaging primes as the result of a Markov Chain defined over a two-state network with certain transition rates, which would in this case be equivalent to the frequencies of each block-2 string (see Figure 3).

**Residue classes of gaps mod k: twins, cousins and sexies.**Two consecutive primes on the integer line separated by a gap $g=2$ are known as twin primes (for example $3,5$ are twins). Consecutive primes on the integer line separated by a gap $g=4$ or 6 are known as cousin primes and sexy primes respectively (for example $7,11$ are cousins and $23,29$ are sexies). An illustration of the occurrence of twin, cousin and sexy prime pairs is shown in Figure 4.

## 2. Tools from Nonlinear and Symbolic Dynamics

#### 2.1. Enumerating Blocks: Spectrum of Renyi Entropies

**s**and P(

**s**) is the probability of each one of them. This entropy weights logarithmically the measure of each type of block, it is thus a metric entropy. A traditional definition of a chaotic process is associated with a finite, positive value of $h\left(1\right)$, and under suitable conditions this quantity is, according to Pesin identity [26], equivalent to the sum of positive Lyapunov exponents of the underlying (hidden) chaotic system.

#### 2.2. Iterated Function Systems (IFS) and the Chaos Game

## 3. Results

#### 3.1. Null Models: What to Expect if Primes Lack Structure?

#### 3.1.1. Type I: Symbols i.i.d. with Uniform and Non-Uniform Probability Densities

#### 3.1.2. Type II: Transitions

- Generate a random sequence via a type I null model with two symbols A and B (where asymptotically $p\left(A\right)=p\left(B\right)$, however for finite size series one should account for Tchebytchev bias),
- Then construct the resulting sequence with $p=4$ symbols $\{AA,AB,BA,BB\}$.

#### 3.1.3. Type III: Cramer Null Model

#### 3.1.4. Some Fully Chaotic Maps

#### 3.2. Results and Interpretation for the Transition Sequence

#### 3.3. Results and Interpretation for the Primes Mod k

#### 3.4. Results and Interpretation for the Gaps Residue Sequence

#### 3.4.1. Entropic Analysis

**Explaining forbidden patterns.**Some observed low order forbidden patterns are enumerated in Table 1. The first forbidden pattern is for a block of size $m=2$ and consists in $(4,4)$. A forbidden pattern in the gaps residue sequence such as $(4,4)$ actually relates to an infinite set of forbidden patterns in the prime sequence. First, all gap pairs $(f,{f}^{\prime})$ with $f=6n+4,\phantom{\rule{4pt}{0ex}}{f}^{\prime}=6{n}^{\prime}+4,\phantom{\rule{4pt}{0ex}}\forall n,{n}^{\prime}$ are congruent to $(4,4)$, that is, consecutive gaps such as $(4,4)$, $(4,10)$, $(4,16)$, $(10,4)$, etc. are all forbidden. In the prime sequence, each of these forbidden gap pairs is associated with a forbidden prime triple of the form $(q,q+f,q+{f}^{\prime})$, with q prime.

**Monotonic dependence on $\beta $ and the distribution of blocks.**In order to find an analytical expression for $h(\beta >0)$ which would allow us to elucidate whether the Renyi spectrum is indeed non-trivial or, on the contrary, whether this is just a finite size effect which while not present in the null models might be present for finite size statistics of gaps residue sequences but vanish asymptotically. We would need to be able to find an analytical expression for the frequencies of each admissible block.

**Prime**$\mathit{m}$-

**tuple conjecture**. The amount of prime constellations $[p,p+2{g}_{1},\dots ,p+2{g}_{m}]$ found for $p\le x$ is given asymptotically by

#### 3.4.2. IFS

## 4. Discussion

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Silverman, J.H. The Arithmetic of Dynamical Systems. In Graduate Texts in Mathematics; Springer: New York, NY, USA, 2007. [Google Scholar]
- Schroeder, M. Number Theory in Science and Communication, 5th ed.; Springer: Berlin/Heidelberg, Germany, 2009. [Google Scholar]
- France, M.; Van der Poorten, A.J. Arithmetic and analytic properties of paper folding sequences. Bull. Aust. Math. Soc.
**1981**, 24, 123–131. [Google Scholar] [CrossRef] - Ostafe, A.; Shparlinski, I.E. On the degree growth in some polynomial dynamical systems and nonlinear pseudorandom number generators. Math. Comp.
**2010**, 79, 501–511. [Google Scholar] [CrossRef] - Number Theory and Physics Archive. Available online: http://empslocal.ex.ac.uk/people/staff/mrwatkin/zeta/physics.htm (accessed on 19 February 2018).
- Dyson, F.J. A Brownian Motion Model for the Eigenvalues of a Random Matrix. J. Math. Phys.
**1962**, 3, 1191–1198. [Google Scholar] [CrossRef] - Montgomery, H.L. The pair correlation of zeros of the zeta function. Proc. Symp. Pure
**1973**, 41, 181–193. [Google Scholar] - Odlyzko, A.M. On the distribution of spacings between zeros of the zeta function. Math. Comput.
**1999**, 48, 273–308. [Google Scholar] [CrossRef] - Julia, B.L. Statistical theory of Numbers, Number Theory and Physics; Springer: Berlin, Germany, 1990. [Google Scholar]
- Berry, M.V.; Keating, J.P. The Riemann zeros and eigenvalue asymptotics. Siam Rev.
**1999**, 41, 236–266. [Google Scholar] [CrossRef] - Wolf, M. Multifractality of prime numbers. Physica A
**1989**, 160, 24–42. [Google Scholar] [CrossRef] - Mertens, S. Phase transition in the number partitioning problem. Phys. Rev. Lett.
**1998**, 81, 4281–4284. [Google Scholar] [CrossRef] - Luque, B.; Lacasa, L.; Miramontes, O. Phase transition in a stochastic prime number generator. Phys. Rev. E
**2007**, 76, 010103R. [Google Scholar] [CrossRef] [PubMed] - Luque, B.; Miramontes, O.; Lacasa, L. Number theoretic example of scale-free topology inducing self-organized criticality. Phys. Rev. Lett.
**2008**, 101, 158702. [Google Scholar] [CrossRef] [PubMed] - Lacasa, L.; Luque, B. Phase transition in the Countdown problem. Phys. Rev. E
**2012**, 86, 010105R. [Google Scholar] [CrossRef] [PubMed] - Luque, B.; Torre, I.G.; Lacasa, L. Phase transitions in Number Theory: from the Birthday Problem to Sidon Sets. Phys. Rev. E
**2013**, 88, 052119. [Google Scholar] [CrossRef] [PubMed] - Garcia-Perez, G.; Serrano, M.A.; Boguna, M. Complex architecture of primes and natural numbers. Phys. Rev. E
**2014**, 90, 022806. [Google Scholar] [CrossRef] [PubMed] - Stein, M.L.; Ulam, S.; Wells, M.B. A Visual Display of Some Properties of the Distribution of Primes. Am. Math. Mon.
**1964**, 71, 516–520. [Google Scholar] [CrossRef] - Hao, B.L.; Zheng, W.M. Applied Symbolic Dynamics and Chaos; World Scientific Publishing: Singapore, 1998. [Google Scholar]
- Ares, S.; Castro, M. Hidden structure in the randomness of the prime number sequence? Physica A
**2006**, 360, 285–296. [Google Scholar] [CrossRef] - Lemke Oliver, R.J.; Soundararajan, K. Unexpected biases in the distribution of consecutive primes. Proc. Natl. Acad. Sci. USA
**2016**, 113, E4446–E4454. [Google Scholar] [CrossRef] [PubMed] - Shiu, D.K.L. Strings of congruent primes. J. Lond. Math. Soc.
**2000**, 61, 359–373. [Google Scholar] [CrossRef] - Maynard, J. Dense clusters of primes in subsets. Compos. Math.
**2016**, 152, 1517–1554. [Google Scholar] [CrossRef] - Ash, A.; Beltis, L.; Gross, R.; Sinnott, W. Frequencies of successive pairs of prime residues. Exp. Math.
**2011**, 20, 400–411. [Google Scholar] [CrossRef] - Hardy, G.H.; Littlewood, J.E. Some Problems of ‘Partitio Numerorum’; III. On the Expression of a Number as a Sum of Primes. Acta Math.
**1923**, 44, 1–70. [Google Scholar] [CrossRef] - Beck, C.; Schlogl, F. Thermodynamics of Chaotic Systems; Cambridge University Press: Cambridge, UK, 1993. [Google Scholar]
- Barnsley, M. Fractals Everywhere; Academic Press: Cambridge, MA, USA, 1988. [Google Scholar]
- Peitgen, H.O.; JŸrgens, H.; Saupe, D. The chaos Game: How Randomness Creates Deterministic Shapes. In Chaos and Fractals; Springer: New York, NY, USA, 1992; pp. 297–352. [Google Scholar]
- Jeffrey, H.J. Chaos game visualization of sequences. Comput. Gr.
**1992**, 16, 25–33. [Google Scholar] [CrossRef] - Rubinstein, M.; Sarnak, P. Chebyshev’s bias. Exp. Math.
**1994**, 3, 173–197. [Google Scholar] [CrossRef] - Cramér, H. On the order of magnitude of the difference between consecutive prime numbers. Acta Arith.
**1936**, 2, 23–46. [Google Scholar] [CrossRef] - Jost, J. Dynamical Systems: Examples of Complex Behavior; Springer: Berlin, Germany, 2005. [Google Scholar]

**Figure 1.**(

**a**) The Ulam spiral for the sequence 1, 2 … 12, with primes in red; (

**b**) A full 200 × 200 Ulam spiral showing the primes as individual black dots. Notice the emergent diagonal pattern where the primes tend to accumulate.

**Figure 2.**(

**a**) The diagonal spiral for the sequence 1, 2 … 13, with primes in red. (

**b**) The diagonal spiral for $N=\{2\dots 100\}$, with primes in blue. The upper-left spiral arm agglutinates primes of the form $4n+3$, called Gaussian primes. The bottom-right agglutinates the rest of the primes with form $4n+1$, called Pythagorean primes.

**Figure 3.**A network representation of the prime numbers sequence and state transitions. The sequence of gaps can be interpreted as a particular realisation of an underlying Markov Chain defined over a two-state network with certain transition rates. In Figure 4 we depict an illustration of such a Markov Chain process. Jumps from “A” to “B” are associated to either twin or sexy pairs, whereas self-loops are associated to cousin pairs.

**Figure 5.**Iterated Function Systems (IFS) attractor for (

**a**) a type I null model with $p=4$ symbols, (

**b**) a type II null model with $p=4$ symbols, (

**c**) a type I null model with $p=3$ symbols.

**Figure 6.**(

**a**) Block entropies ${H}_{m}\left(1\right)/m$ for different symbolic sequences; (

**b**) Renyi block entropies ${H}_{m}\left(\beta \right)/m$ for different values of m and $\beta $. All curves seem to converge to $log2$.

**Figure 7.**IFS chaos game-like attractor for the prime transition sequence. The attractor has a fractal shape instead of being space-filling, however a type II null model can account for such shape, as shown in Figure 5.

**Figure 8.**(

**a**) Block entropies ${H}_{m}\left(0\right)/m$ for symbolic sequences primes mod k, with different values of k. We find that the topological entropy is always $log2$, suggesting that there are no forbidden patterns in primes modulo k; (

**b**) Empirical Renyi block entropies ${H}_{m}\left(\beta \right)/m$ for different values of m and $\beta $, extracted from the primes modulo 4. The spectrum does not collapse into a single value; (

**c**) Empirical Renyi block entropies ${H}_{m}\left(\beta \right)/m$ for different values of m and $\beta $, extracted from the fully chaotic logistic map ${x}_{t+1}=4{x}_{t}(1-{x}_{t})$ after symbolisation with $p=2$ symbols. Results have been computed over a symbolic sequence of $N={10}^{6}$ points, the same size as the one for the primes in the middle and left panels. The spectrum in this case collapses $h\left(\beta \right)=log2,\phantom{\rule{4pt}{0ex}}\forall \beta $ as expected according to the topological conjugacy of the fully chaotic logistic map with the binary shift.

**Figure 10.**(

**a**) ${H}_{m}\left(\beta \right)/m$ associated to the primes gaps modulo 6; (

**b**) Spectrum of Renyi entropies associated to the primes gaps modulo 6.

**Figure 11.**(

**a**) IFS chaos game-like attractor for the type I null model with $p=3$ symbols. In this case the attractor is the Sierpinski triangle; (

**b**) IFS chaos game-like attractor for the prime gap sequence and a symbolic sequence extracted from other chaotic maps. The IFS associated to the prime gap sequence is a subset of the attractor. The similarity with the tent map is again notable, where in this case the attractor of the tent map is a subset of the attractor of the prime gap sequence. As a comparison, we have included a different chaotic map (the Gauss map) which shows no similarities with the gaps.

**Table 1.**Set of forbidden blocks $\mathcal{F}\left(m\right)=\{({s}_{1}\dots {s}_{m}),{s}_{i}\in \{0,2,4\}\}$ of size $m=1,2,3,4$ in the sequence of gap residues modulo 6.

m | $\mathbf{F}\left(\mathit{m}\right)$ | $\mathbf{F}\left(\mathit{m}\right)$ |

ine 1 | ∅ | 0 |

2 | {(4,4)} | 1 |

3 | $\left\{\right(0,2,2),(0,4,4),(2,0,2),(2,2,0),(2,2,2),(2,4,4),(4,0,4),(4,2,2),(4,4,0),(4,4,2),(4,4,4\left)\right\}$ | 11 |

4 | $\left\{\right(0,0,2,2),(0,0,4,4),(0,2,0,2),(0,2,2,0),(0,2,2,2),(0,2,2,4),(0,2,4,4),(0,4,0,4),(0,4,2,2),(0,4,4,0),$ | 49 |

$(0,4,4,2),(0,4,4,4),(2,0,0,2),(2,0,2,0),(2,0,2,2),(2,0,2,4),(2,0,4,4),(2,2,0,0),(2,2,0,2),(2,2,0,4),$ | ||

$(2,2,2,0),(2,2,2,2),(2,2,2,4),(2,2,4,0),(2,2,4,4),(2,4,0,4),(2,4,2,2),(2,4,4,0),(2,4,4,2),(2,4,4,4),$ | ||

$(4,0,0,4),(4,0,2,2),(4,0,4,0),(4,0,4,2),(4,0,4,4),(4,2,0,2),(4,2,2,0),(4,2,2,2),(4,2,2,4),(4,2,4,4),$ | ||

$(4,4,\dots ,\dots )\}$ |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Lacasa, L.; Luque, B.; Gómez, I.; Miramontes, O.
On a Dynamical Approach to Some Prime Number Sequences. *Entropy* **2018**, *20*, 131.
https://doi.org/10.3390/e20020131

**AMA Style**

Lacasa L, Luque B, Gómez I, Miramontes O.
On a Dynamical Approach to Some Prime Number Sequences. *Entropy*. 2018; 20(2):131.
https://doi.org/10.3390/e20020131

**Chicago/Turabian Style**

Lacasa, Lucas, Bartolome Luque, Ignacio Gómez, and Octavio Miramontes.
2018. "On a Dynamical Approach to Some Prime Number Sequences" *Entropy* 20, no. 2: 131.
https://doi.org/10.3390/e20020131