A fractal sequence by GK
Giorgos Kalogeropoulos:
> Hi Eric,
> yesterday I was trying to make sense of the following sequence that I found.
> I'm sending you some details as I think that you'll enjoy some of the visuals that it produces.
a(1) = 1 and a(n) = prime(a(n-1)+n) mod (a(n-1)+n)
So, in its step we take the (a(n-1)+n)th prime and we find the remainder when we divide it with a(n-1)+n.
Here are the first few terms:
1, 2, 1, 1, 1, 3, 9, 8, 8, 7, 7, 10, 14, 23, 11, 22, 11, 22, 15, 9, 23, 17, 13, 9, 3, 22, 31, 41, 69, 28, 41, 2, 9, 19, 35, 69, 47, 14, 29, 2, 19, 39, 11, 37, 11, 41, 17, 53, 47, 24, 4, 39, 19, 2, 41, 24, 14, 71, 83, 108, 164, 73, 89, 118, 178, 85, 121, 184, 89, 142, 25, 24, 24, 31, 47, 62, 102, 169, 83, 152, 73, 132, 29, 52, 88, 163, 83, 164, 89, 168, 83, 164, 79, 166, 97, 13, 51, 114, 25, 66
Here are some plots that indicate a fractal pattern as we get more terms.
As the number of terms increase, we get the same pattern with more detail:
I don't really know how these boxes are shaped and why (and when) the modulo seems to "jump" to a bigger "box".
Of course, this has nothing to do with primes (most of the times the primes are not responsible for the patterns).
So, I started searching what other functions (that have similar plots with primes) produce the same results and where those boxes come from.
Lets call f(n) those functions: a(n) = f(a[n-1]+n) mod (a[n-1]+n)
For example if f(n) = n log(n) then we get some similar patterns as n logn resembles the primes.
The boxes were still there...
Then I thought about using the simplest function that can gradually produce those squares:
Of course this function is f(n) = n^x.
When x takes values little more than 1, then f behave """like""" the prime function
So, I computed 2000 different sequences a(n) for the values of x= 1.0001, 1.0002, 1.0003...... 1.2000 and animated them to a video.
In the video below, you will see 2000 frames:
Every frame is a different sequence (x changes, so f changes) and you are seeing 100.000 terms of that specific sequence.
All these 2000 seqs behave like fractals seqs. (I stopped at 2000 because it takes a lot of time to compute...)
As the video evolves and x reaches a value that is close to the prime function you will see the fractal of the original sequence.
The boxes at first have a distance and they are joined with a curve, but soon they overlap.
Here is the vid (at around the first min we get our original pattern):
The above video imitates the behavior of the sequence, although it is made out of a function that resembles the prime function.
Look – here is the prime function in blue, the n^x function in orange (video), and the nLogn function in green:
The purpose of the video is to show where these rectangles come from by using the function n^x.
Best,
Best,
GK.
__________
ÉA:
Many thanks for this post, Giorgos – and what a beautiful video!
Commentaires
Enregistrer un commentaire