-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimadeit.txt
28 lines (19 loc) · 2.46 KB
/
imadeit.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
I made a swirly thing! It's purely mathematically determined, though it should look pretty nifty to anyone. If the immediate gratification seeker within you complains, skip to about 0:27.
The first 30 seconds are paced slowly to show the habits of the machine, then it goes full throttle. For the sake of completeness, it continues until the frame is filled.
Technical details below, if you give a hoot:
It's a visualization of the first 180 000 Hailstone sequences of the Collatz conjecture as they appear on an Ulam-style square spiral grid.
The Grid:
Each cell on a square spiral grid corresponds uniquely to a positive integer; 1 is dead centre, 2 is directly above that, and the sequence continues in a square spiral that increases as it wraps around. The program that made this video plots hailstone sequences on the spiral grid as follows.
The Sequences:
A Hailstone sequence starts with any "seed" number greater than two. If the seed is even, then the number following the seed in the sequence is half the seed. If the seed is odd, then the following number is three times the seed plus one. So, in a Hailstone sequence, *any* number greater than two has a unique successor, and it continues with the same formula. Here are the first 7 Hailstone sequences using seeds 2 through 5:
{2, 1}
{3, 10, 5, 16, 8, 4, 2, 1}
{4, 2, 1}
{5, 16, 8, 4, 2, 1}
{6, 3, 10, 5, 16, 8, 4, 2, 1}
{7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1}
{8, 4, 2, 1}
The numbers go up and down, and the sequences can be long or short (the sequence starting with 27 is 112 elements long), but they do overlap. If the yet-unproven Collatz conjecture is true, then all Hailstone sequences (using any seed) eventually terminate at 1. For the video, my program plotted numbers as they occur in the order of the example sequences up to the 180000th seed, skipping numbers that it has already plotted (repetition is marked with ".."):
{2, 1, 3, 10, 5, 16, 8, 4, .. 6, .., 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, .. 8, ..}
The Colors:
When a number is plotted on the grid, a bigger seed means a brighter color. For example, the squares for the numbers 3, 10, 8, 4 have a dark color because they are first generated by the seed 3. However, the numbers 7, 22, 11, 34, 17, 52, 26, 13, 40, 20 have a brighter color because they are first generated by seed 7. Notice that the only square plotted with the color corresponding to seed 8 is the number 8, because its following numbers (4, 2, 1) were already plotted.