The fractal nature of an approximate prime counting function

Prime number related fractal polygons and curves are derived by combining two different aspects. One is an approximation of the prime counting function build on an additive function. The other are prime number indexed basis entities taken from the discrete or continuous Fourier basis.


Introduction
The distribution of prime numbers is one of the central problems in analytic number theory. Here, the prime counting function π(x), giving the number of primes less or equal to x ∈ R, is of special interest. As stated in [1]: when the large-scale distribution of primes is considered, it appears in many ways quite regular and obeys simple laws. One of the first central results regarding the asymptotic distribution of primes is given by the prime number theorem, providing the limit which was proved independently in 1896 by Jacques Salomon Hadamard and Charles-Jean de La Vallée Poussin. Both proofs are based on complex analysis using the Riemann zeta function ζ(s) := ∞ n=1 1/n s , with s ∈ C and the fact that ζ(s) = 0 for all s := 1 + iy, y > 0.
An improved approximation of π(x) is given by the Eulerian logarithmic integral This result was first mentioned by Carl Friedrich Gauß in 1849 in a letter to Encke refining the estimate n/ ln(n) of π(n) given by the only 15 years old Gauß in 1792. This conjecture was also stated by Legendre in 1798. In 2007 Terence Tao gave an informal sketch of proof in his lecture "Structure and randomness in the prime numbers" as follows [2]: • Create a "sound wave" (or more precisely, the von Mangoldt function) which is noisy at prime number times, and quite at other times. [...] • "Listen" (or take Fourier transforms) to this wave and record the notes that you hear (the zeroes of the Riemann zeta function, or the "music of the primes"). Each such note corresponds to a hidden pattern in the distribution of the primes.
In the same spirit, the present work tries to paint a picture of the primes. By combining an alternative approximation of the prime counting function π(x) based on an additive function as proposed in [3] with prime number related Fourier polygons used in the context of regularizing polygon transformations as given in [4,5], fractal prime polygons and fractal prime curves are derived. Three types of structures in the distribution of prime numbers are distinguished in [6]. The first is local structure, like residue classes or arithmetic progression [7]. The second is asymptotic structure as provided by the prime number theorem. The third is statistical structure as described for example in [8] reporting an empirical evidence of fractal behavior in the distribution of primes or [9] describing fractal fluctuations in the spacing intervals of adjacent prime numbers generic to diverse dynamical systems in nature. Quasi self similar structures in the distribution of differences of prime-indexed primes with scaling by prime-index order have been observed in [6]. In the present work, the asymptotic structure becomes visually apparent by the given fractals.
According to the prime number theorem, π(x) can be approximated by x/ ln(x), i.e. (1) holds, which will be denoted as π(x) ∼ x/ ln(x). An improved approximation is given by the Eulerian logarithmic integral (2), i.e. π(x) ∼ Li(x). The graphs of the prime counting function and its two approximations are depicted in Fig. 1 for x ∈ [0, 100]. An alternative approximation of π(x) is proposed in [3]. Its definition is based on an additive function, which will be described briefly in the following. Each n ∈ N \ {1} can be written as prime factorization n = k∈I(n) p α k (n) k with the prime numbers p k and their associated multiplicities α k (n) ∈ N. Here, I(n) denotes the index set of the prime numbers, which are part of the factorization of n. For example, for 50 = 2 1 · 5 2 it holds that I(n) = {1, 3} and α 1 (50) = 1, α 3 (50) = 2.
An additive function β α : N → N 0 is given by the sum of all prime factors multiplied by their associated multiplicities, i.e. β α (n) := 0 for n = 1, Here, additive function means that n 1 , n 2 ∈ N implies β α (n 1 n 2 ) = β α (n 1 ) + β α (n 2 ). Furthermore, for prime numbers it follows readily that β α ( Summing β α (n) for all n less or equal to a given real number x > 0 and applying proper scaling leads to the definition of The graph of β αδ (x) is depicted red in Fig. 1. As a central result, it has been shown in [3] that β αδ (x) ∼ π(x), which is due to the representation This approximation of the prime counting function provides the first ingredient for deriving prime related fractals. The second ingredient is given by the following section.

Polygon transformations and Fourier polygons
A geometric transformation scheme for closed polygons based on constructing similar triangles on the sides is proposed by the authors in [5]. By iteratively applying the transformation, regular polygons are obtained for specific choices of the transformation parameters. The proof is based on Fourier polygons, which are also used in the subsequent section in order to derive the prime number related fractals. Therefore, this section gives a short introduction to regularizing polygon transformations and the theoretical background.
For a given n ∈ N, n ≥ 3, let z = (z 0 , . . . , z n−1 ) t ∈ C n denote an arbitrary polygon in the complex plane. In the following, all indices have to be taken modulo n. In the first transformation substep, the similar triangles constructed on each directed side z k z k+1 , k ∈ {0, . . . , n − 1}, of the polygon are parameterized by a prescribed side subdivision ratio λ ∈ (0, 1) and a base angle θ ∈ (0, π/2). This is done by constructing the perpendicular to the right of the side at the subdivision point λz k + (1 − λ)z k+1 . On this perpendicular, a new polygon vertex z k+1 is chosen in such a way that the triangle side z k z k+1 and the polygon side z k z k+1 enclose the prescribed angle θ. This is depicted on the left side of Fig. 2 for an initial polygon with vertices z k marked black. The construction of the first transformation substep leads to a new polygon with vertices z k marked blue. The subdivision points, located on the edges of the initial polygon, are marked by white circles, the associated perpendiculars by dashed lines, and the angles θ by grey arcs. In the given example, the transformation parameters have been set to λ = 1/3 and θ = π/5. The rotational effect of the first transformation substep is compensated by applying a second transformation substep with flipped similar triangles as is depicted on the right side of Fig. 2. Starting from the vertices z k of the first transformation substep marked blue, this results in the polygon with vertices z k depicted red. As has been shown in [5], for w := λ+i(1−λ) tan θ, the new polygon vertices obtained by applying these two substeps are given by z k+1 := wz k + (1 − w)z k+1 and z k := (1 − w)z k + wz k+1 , respectively, where w denotes the complex conjugate of w. Both substeps are linear mappings in C n and the combined mapping is given by the matrix representation with j, k ∈ {0, . . . , n − 1}.
The transformation matrix M is circulant and Hermitian [5]. Hence, with r := exp(2πi/n) denoting the nth root of unity, it holds that M is diagonalized by the n × n unitary discrete Fourier matrix with entries F j,k = r jk / √ n and zero-based indices j, k ∈ {0, . . . , n − 1} [10]. Let z ( ) := M z denote the polygon obtained by applying the transformation times. If tends to infinity, the shape of the scaled limit polygon z (∞) depends on the dominating eigenvalue of M and the associated column of F . In the following, such a kth column of F is denoted as the kth Fourier polygon, i.e. f k := r 0·k , . . . , r (n−1)·k t , k ∈ {0, . . . , n − 1} .
Hence, the Fourier polygons are the prototypes of the limit polygons obtained by iteratively applying M . A full classification of these limit polygons with respect to the choice of the transformation parameters λ and θ is given in [5]. Such transformations leading to regular polygons can for example be used in finite element mesh smoothing [11]. Furthermore, similar smoothing schemes can also be applied to volumetric meshes. Here, transformations can for example be based on geometric constructions [12] or on the gradient flow of the mean volume [13]. For n = 4, the four Fourier polygons are depicted in the upper row of Fig. 3. Since the jth vertex of f k is the jkth power of r, f 0 consists of four times the vertex 1 + 0i, as is indicated by the blue point and the vertex label 0-3. The unit circle is marked by a dashed line, the roots of unity by white circle markers. As can be seen, f 1 is the regular counterclockwise oriented quadrilateral, f 2 a segment with vertex multiplicity two.
In contrast to the case n = 4, there is no degenerate polygon in the case n = 5 except that for k = 0, as is shown in the lower row of Fig. 3. Since the kth Fourier polygon is derived by iteratively connecting each kth vertex defined by the unit roots, and n = 5 is a prime number, each polygon vertex has multiplicity one. That is, in the case of prime numbers, all f k are either regular n-gons or star shaped n-gons if k > 0. This relation between iterative polygon transformation limits and prime numbers is also analyzed in [4]. Furthermore, the roots of unity form a cyclic group under multiplication.

Deriving prime fractals
The graph of the approximate prime counting function β αδ (x) depicted in Fig. 1 gives only an impression for small values of x. Furthermore, it is not suitable to reveal more insight into the inner structure of prime numbers and their distribution. In search for such a graphical representation, a combination of the approximate prime counting function and Fourier polygons is considered in the following.
The main ingredient of the approximate prime counting function β αδ given by (5) is the sum B α (x). For x ∈ N \ {1}, this sum can be written as where · denotes rounding towards zero. That is, B α (n) is a weighted sum of prime numbers. The latter representation can be obtained by collecting all coefficients in the sum on the left side of (9) for each prime number p k using a sieve of Eratosthenes based argument.
The key to prime fractals is to replace the prime numbers p k in the representation of B α (n) according to (9) by prime number associated Fourier polygons. This leads to the polygonal prime fractal with f k denoting the Fourier polygon according to (8). Here, the Fourier polygon index p k − 1 consists of the kth prime number subtracted by one, since zero based indices are used in the discrete Fourier transformation scheme. For n = 10 4 , the polygonal prime fractal F p (10 4 ) is depicted in Fig. 4. It is a linear combination of 1 229 Fourier polygons f p k −1 , each weighted with its associated coefficient w k (n) as defined in (9). This polygon consists of n = 10 4 vertices. The fractal structure of this polygon is already visible for this comparably low value of n. However, due to its discrete nature, self similarity is not that obvious for some parts of the polygon. Therefore, an improved fractal is derived by using the continuous Fourier basis instead of the discrete Fourier basis. That is, the Fourier polygon f k is replaced by the Fourier basis function f k (t) := exp(ikt). This results in the prime fractal curve For n = 10 6 , the resulting prime fractal curve is depicted in Fig. 5a. It has been obtained by evaluating F c (t) at 10 7 equidistant parameters t ∈ (−π, π]. In this case, F c is the sum of 78 498 weighted Fourier basis functions. A zoom of the box marked red in Fig. 5a is depicted in Fig. 5b. The recurring structures show the fractal nature of the curve.
The fractal dimension of a curve, also known as Minkowski-Bouligand dimension, is given by where ε denotes the edge length of the square boxes covering the fractal curve and N (ε) the number of covering boxes [14]. For the curve depicted in Fig. 5a, the fractal dimension is estimated by recursively subdividing a tight initial square bounding box of

Conclusion
In this publication, prime number related fractal polygons and curves have been derived by combining two different results. One is the approximation of the prime counting function π(x) by the partial sum β αδ (x) based on an additive function as proposed in [3]. The other are prime indexed basis functions of the continuous Fourier transform. The motivation for this are the column vectors of the discrete Fourier matrix used for diagonalizing a circulant Hermitian matrix representing a regularizing transformation of polygons in the complex plane.
As has been shown in earlier publications [4,5], there is a relation between the shape of limit polygons of such iteratively applied polygon transformations and prime numbers. This is due to the cyclic group defined by the roots of unity and the exponential representation of the entries of the columns of the discrete Fourier matrix. The latter are called Fourier polygons. For prime number indices, these polygons are star shaped.
By replacing the prime numbers in a scaled representation of β αδ (x) for a given x ∈ N by the associated Fourier polygons, the polygonal prime fractal F p is derived. Its graphical features are increased, if x tends to infinity. Alternatively, by using the prime number related basis functions of the continuous Fourier transform, the prime fractal curve F c is derived, which is approximated by F p . The prime fractal polygon as well as the prime fractal curve show similar patterns on different scales as has been demonstrated graphically. In addition, a numerical estimate for the fractal dimension based on the box counting method was derived for the case n = 10 6 . However, obtaining more detailed results for much larger n would be desirable.
The given result combines aspects from prime number theory, group theory, and circulant Hermitian matrices. It is based on the Fourier transformation, which also plays a role in dynamical systems associated to geometric element transformations [15]. The resulting prime fractals provide an alternative visual representation of an approximation of the prime counting function and with this of prime numbers and their structures itself. It is hoped that these alternative representations provide a basis for further insights into the structure of the distribution of prime numbers. Furthermore, applying similar visualization techniques to other number theory functions might reveal additional insights.