Let
$$ f(x) = \sum\limits_{n=1}^{\infty} {1 \over 2^{n-1}} e^ {{2\pi i x \over {n}} } $$
$f$ is therefore a complex-valued function of a real variable. (An intuitive explanation at the very bottom of this question)
On a Cartesian plane, I plot all points $(Re(f(x)), Im(f(x)))$ for real $x$ where $0 \leq x \leq 1000$:
All values for the specified reals are first plotted in dark green.
Values of $f(x)$ only for integer values of $x$ between $0$ and $1000$ are overlayed as grayscale dots of varying intensity (explained later on) on the green trajectory.
Values of $f(x)$ only for prime values of $x$ between $0$ and $1000$ are overlayed as red dots on the green trajectory.
A pattern emerges: all prime numbers distribute into $16$ evident clusters (or as I like to call them, constellations - fun to pretend that integers are stars on the night sky), with the exception of $2, 3$ and $5$, whose locations I've highlighted on the plot.
Let us take a closer look at $f(x)$ values for the first $1000000$ integers:
Same story: I first plot the integers in grayscale, and only later the primes in red. It looks like the integers form $60$ elliptical clusters, each of which could be divided into even more clusters.
I thought it'd be good idea to give some specific intensity ($0-255$) to the pixel at $f(x)$, so I've tried calculating it as $255\over{x \mod{60}}$ - this is why some gray pixels are darker and some brighter. As you can see on the plots, pixels belonging to the same cluster have the same intensities, so perhaps such formula can be used to identify which cluster the value of $f(x)$ will belong to.
Here is a closer look at one of the clusters (best viewed in 1:1):
It looks like the aforementioned "elliptical" clusters divide into $42$ clusters, four of which intersect. These clusters divide into yet another $11$ circles...
...then let's see an even deeper zoom at one of these clusters:
Each of the $11$ circles is made of circles again!
Sadly, primes don't exhibit any order at this level of zoom.
Questions:
- What is so special about primes that they gather in these sixteen constellations? Does this function tell us something interesting about primality?
- Could this function be slightly modified so that a more striking structure becomes apparent?
Could this function be extended so that its values have a higher number of dimensions? For example, a one-dimensional version would be: $$ f(x) = \sum\limits_{n=1}^{\infty} {1 \over 2^{n-1}} cos( {{2\pi \over {n}} x} )$$
(whose plot unfortunately is not nearly as interesting)
Intuitive explanation of $f(x)$:
Imagine a stick of length equal to $1$.
It makes a full rotation every one second:
Imagine that another stick of length equal to $1\over{2^{1}}$ was attached to the above stick.
The smaller stick rotates, too: it makes a full rotation every two seconds:
Imagine that another stick of length equal to $1\over{2^{2}}$ was attached to the smaller stick from above.
The new third stick, rotates, too: it makes a full rotation every three seconds:
Repeating this procedure infinitely we get the trajectory of $f(x)$:
Calculating $f(n)$ therefore asks: at which $(x, y)$ does the tip of this curve end up after $n$ seconds worth of time?