1. Introduction
The present work describes the results of a numerical experiment based on the approximate prime counting function presented in [
1]. By searching for a visual representation for the distribution of primes different to the well known staircase plots of the prime counting function, the authors used regular polygons and their relation to prime numbers as described in [
2]. In doing so, fractal polygons and curves have been derived which will be presented in the following.
The distribution of prime numbers is one of the central problems in analytic number theory. Here, the prime counting function
, giving the number of primes less or equal to
, is of special interest. As stated in [
3]:
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
, with
and the fact that
for all
,
.
An improved approximation of
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 of 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 [
4]:
Create a “sound wave” (or more precisely, the von Mangoldt function) which is noisy at prime number times, and quiet 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
based on an additive function as proposed in [
1] with prime number related Fourier polygons used in the context of regularizing polygon transformations as given in [
2,
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]. The distribution of primes and prime-indexed primes is studied in [
10] by mapping primes into a binary image. It is observed that the recurrence plots of prime distribution are similar to the Cantor dust. In the present work, the asymptotic structure becomes visually apparent by the given fractals.
2. Approximations of the Prime Counting Function
This section presents briefly the prime counting function and its classic approximations. Furthermore, an approximate prime counting function based on an additive function is described which yields the starting point in deriving prime related fractals.
Let
denote the set of natural numbers,
, and
the
kth prime number with
, i.e.,
:= 2,
:= 3,
:= 5, etc. For
, the prime counting function is defined as
According to the prime number theorem,
can be approximated by
, i.e., (
1) holds which will be denoted as
. An improved approximation is given by the Eulerian logarithmic integral (
2), i.e.,
. The graphs of the prime counting function and its two approximations are depicted in
Figure 1 for
.
An alternative approximation of
is proposed in [
1]. Its definition is based on an additive function which will be given in the following. Each
can be written as prime factorization
with the prime numbers
and their associated multiplicities
. Here,
denotes the index set of the prime numbers which are part of the factorization of
n. For example, for
it holds that
and
,
.
An additive function
is given by the sum of all prime factors multiplied by their associated multiplicities, i.e.,
Here, additive function means that
implies
. Furthermore, for prime numbers it follows readily that
,
. The arithmetic properties of the function
are discussed in [
11]. Here, this function, also known as integer logarithm, is denoted as
.
Summing
for all
n less or equal to a given real number
and applying proper scaling leads to the definition of
The graph of
is depicted red in
Figure 1. As a central result, it has been shown in [
1] that
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.
3. Polygon Transformations and Fourier Polygons
Regular polygons and their relation to prime numbers are described in [
2] in the context of regularizing polygon transformations. Such transformations, also generalized in [
5], are based on constructing similar triangles on the sides of the polygon to transform. By iteratively applying the transformation, regular polygons are obtained for specific choices of the transformation parameters. Here, a point of a planar polygon can be represented by a complex number, the polygon itself by a vector of complex numbers. As is described briefly in this section, regularizing transformations can be represented by circulant matrices. Hence they are diagonalizable by the discrete Fourier matrix and the limit polygons are linear combinations of column vectors of the discrete Fourier matrix. These column vectors represent regular polygons which are denoted as Fourier polygons. This section gives a short introduction to regularizing polygon transformations and the theoretical background which builds the foundation for a specific choice of basis functions in finding an alternative geometric representation for visualizing polygons and curves related to the distribution of primes.
For a given
,
, let
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
,
, of the polygon are parameterized by a prescribed side subdivision ratio
and a base angle
. This is done by constructing the perpendicular to the right of the side at the subdivision point
. On this perpendicular, a new polygon vertex
is chosen in such a way that the triangle side
and the polygon side
enclose the prescribed angle
. This is depicted on the left side of
Figure 2 for an initial polygon with vertices
marked black. The construction of the first transformation substep leads to a new polygon with vertices
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
and
.
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
Figure 2. Starting from the vertices
of the first transformation substep marked blue, this results in the polygon with vertices
depicted red. As has been shown in [
5], for
, the new polygon vertices obtained by applying these two substeps are given by
respectively, where
denotes the complex conjugate of
w. Both substeps are linear mappings in
and the combined mapping is given by the matrix representation
with
.
The transformation matrix
M is circulant and Hermitian [
5]. Hence, with
denoting the
nth root of unity, it holds that
M is diagonalized by the
unitary discrete Fourier matrix
with entries
and zero-based indices
[
12].
Let
denote the polygon obtained by applying the transformation
ℓ times. If
ℓ tends to infinity, the shape of the scaled limit polygon
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.,
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 [
13]. Furthermore, similar smoothing schemes can also be applied to volumetric meshes. Here, transformations can for example be based on geometric constructions [
14] or on the gradient flow of the mean volume [
15].
For
, the four Fourier polygons are depicted in the upper row of
Figure 3. Since the
jth vertex of
is the
th power of
r,
consists of four times the vertex
, 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,
is the regular counterclockwise oriented quadrilateral,
a doubled segment with vertex multiplicity two.
In contrast to the case
, there is no degenerate polygon in the case
except that for
, as is shown in the lower row of
Figure 3. Since the
kth Fourier polygon is derived by iteratively connecting each
kth vertex defined by the unit roots, and
is a prime number, each polygon vertex has multiplicity one. That is, in the case of prime numbers, all
are either regular
n-gons or star shaped
n-gons if
. This relation between iterative polygon transformation limits and prime numbers is also analyzed in [
2]. Furthermore, the roots of unity form a cyclic group under multiplication. For a given number
n and each prime number
, there is an associated Fourier polygon
defined by (
9). This is the second ingredient in defining prime counting function related fractals.
4. Deriving Prime Fractals
The graph of the approximate prime counting function
depicted in
Figure 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 its scaled counterpart
given by (
6). For
, this sum can be written as
where
denotes the floor function. That is,
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 (
10) for each prime number
using a sieve of Eratosthenes based argument.
The key to prime fractals is to replace the prime numbers
in the representation of
according to (
10) by prime number associated Fourier polygons. This leads to the
polygonal prime fractal
with
denoting the Fourier polygon according to (
9). Here, the Fourier polygon index
consists of the
kth prime number subtracted by one, since zero based indices are used in the discrete Fourier transformation scheme.
For
, the polygonal prime fractal
is depicted in
Figure 4. It is a linear combination of
Fourier polygons
, each weighted with its associated coefficient
as defined in (
10). This polygon consists of
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
is replaced by the Fourier basis function
. This results in the
prime fractal curveFor
, the resulting prime fractal curve is depicted in
Figure 5a. It has been obtained by evaluating
at
equidistant parameters
. In this case,
is the sum of
weighted Fourier basis functions. A zoom of the box marked red in
Figure 5a is depicted in
Figure 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
the number of covering boxes [
16]. For the curve depicted in
Figure 5a, the fractal dimension is estimated by recursively subdividing a tight initial square bounding box of
. For each subdivision level
, this results in a grid of
squares and the associated estimate
, where
denotes the number of grid boxes with nonempty intersections with the fractal curve. The approximate fractal dimension for the finest subdivision grid results to
.
Figure 6 depicts the number of nonempty intersection boxes
versus the grid width
for
using logarithmic scales for both axes. The fractal dimension estimate derived by the slope of the line of best fit of these 21 points amounts to
.
5. Conclusions
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
by the partial sum
based on an additive function as proposed in [
1]. 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 [
2,
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 for a given by the associated Fourier polygons, the polygonal prime fractal 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 is derived which is approximated by . 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 . 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 Fourier transformation which also plays a role in dynamical systems associated to geometric element transformations [
17]. 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. This is also the subject of the subsequent publication [
18] analyzing fractal curves from prime trigonometric series and the distribution of prime numbers.