Size Scatters

While I play New Order, let’s view order. Below are some rational fractions ordered by increasing size of denominator (the lower part of the fraction, e.g. the 7 in 3/7) and numerator (the upper part of the fraction, e.g. the 5 in 5/9). Note the positions of 1/2 and 1/7:

1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8, 1/9, 2/9, 4/9, 5/9, 7/9, 8/9, 1/10, 3/10, 7/10, 9/10

Now let’s plot fractions ordered like that on a fract-L, a graph whose axes represent numbers < 1. If both x and y = 1/2, 1/3, 2/3, 1/4, 3/4, 1/5…, you get a line at 45°:

fract-L for x = 1/2, 1/3, 2/3…, y = 1/2, 1/3, 2/3…


If the fractions went to infinity, you’d get a solid line. As it is, you get some interesting splits in the 45° line. And when you plot the fractions like that, it’s easy to see that each point, (x,y), has a unique x and a unique y. But there are other ways to order the rational fractions. Try the same set ordered by the size of the decimal, not the denominator and numerator. In the previous set, 1/2 came before 1/7. Now 1/2 comes after 1/7, because 0.5 = 1/2 > 0.142857… = 1/7:

1/10, 1/9, 1/8, 1/7, 1/6, 1/5, 2/9, 1/4, 2/7, 3/10, 1/3, 3/8, 2/5, 3/7, 4/9, 1/2, 5/9, 4/7, 3/5, 5/8, 2/3, 7/10, 5/7, 3/4, 7/9, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10

Now let’s plot x as the first set of fractions, ordered by size of denominator-and-numerator, and y as the second set of fractions, ordered by the size of the decimal. You’ll see that this kind of size scatters:

fract-L for x = 1/2, 1/3, 2/3, 1/4, 3/4, 1/5…, y = 1/10, 1/9, 1/8, 1/7, 1/6, 1/5, 2/9…


Now the points aren’t compressed into a 1-d line, but beginning to spread in 2-d space. The more fractions you use, the more the points spread. They remind me of papillae on a fractal tongue:

x = 1/2, 1/3, 2/3, 1/4, 3/4, 1/5… < 1/26, y = sizesort(1/2..1/26)


Papillae on a human tongue (image courtesy chatGPT)


x = denumsort(1/2..1/51), y = sizesort(1/2..1/51)


x = denumsort(1/2..101/), y = sizesort(1/2..1/101)


And the points seem to be occurring at the same x or y value. But that’s an artefact of a screen with limited pixels. On an impossible screen with infinite pixels, each (x,y) still has a unique x and unique y. Here are more fract-Ls with more fractions:

x = denumsort(1/2..1/151), y = sizesort(1/2..1/151)


x = denumsort(1/2..1/201), y = sizesort(1/2..1/201)


x = denumsort(1/2..1/251), y = sizesort(1/2..1/251)


finer detail for x = denumsort(1/2..1/251), y = sizesort(1/2..1/251)


x = denumsort(1/2..37/406), y = sizesort(1/2..37/406)


x = denumsort(1/2..1/501), y = sizesort(1/2..1/501)


Finally, to the closing bars of New Order, let’s view order in an animated gif:

x = denumsort(a/b), y = sizesort(a/b) (animated at EZgif)


Post-Performative Post-Scriptum…

In fact, I wasn’t listening to New Order to view order. I’m not a fan of New Order, just a fan of assonance.

Middlemoth

I’ve never read Middlemarch (1871). But I have seen a middlemoth. It was when I was looking at a new way of creating fractLs. A fractL is what I call a graph shaped like a capital L, with the x- and y-axes representing values between 0 and 1, like 1/2 and 1/3 and 8/55. You can also use numbers > 1 to create numbers < 1: 73 → 0.73; 128719 → 0.128719; and so on. But I decided to reverse the integer before converting it: 73 → 0.37; 128719 → 0.917821; and so on. And use different bases for the x- and y-axes. So that’s what I did on a fractL: I mapped fractions converted from integers in one base against fractions converted from integers in another base. The results, as you can see, were spectacularly dull:

fractL for int→frac in base 2 and base 6


fractL for int→frac in base 3 and base 6


fractL b04, b06


fractL b06, b08


So I decided to try some perspectivision, mapping the integer-fractions not on a fractL but on a fractO instead. A fractO is a circle where you find a point inside the circle by using two fractions, fr1 and fr2, to create two radian values: θ1 = fr1 * 2 * π and θ2 = fr2 * 2 * π. Then you use θ1 and θ2 to find two points on the perimeter of the circle, (x1, y1) and (x2, y2), and then find their midpoint, (x3, y3) = ((x1, y1) + (x2, y2)) / 2. The results this time are much more pleasing on the eye:

fractO for integers in base 2 and base 6

↑

fractL b02, b06, for fractO b02, b06


Here’s an animated gif showing the conversion from visually dull fractL to visually interesting fractO:

fractL b02b06 to fractO b02b06 (animated at EZgif)


When I was looking at more fractOs, I found one that was lepidopterally interesting too:

fractO b09, b12 with middlemoth


fractO b09, b12 (middlemoth in green)


You can try spotting more pareidolia in more fractOs from reversed fractintegers:

fractO b03, b15

↑

fractL b03, b15 for fractO above


fractL b03b15 to fractO b03b15 (animated at EZgif)


fractO b02, b10


fractO b02, b12


fractO b02, b14


fractO b03, b06


fractO b03, b12


fractO b03, b21


fractO b04, b06


fractO b04, b20


fractO b06, b08


fractO b09, b15


fractO b10, b24


fractO b12, b16


fractO b15, b20


fractO b24, b28


fractO b42, b78


fractO b02, b18 (fr2 x 3)


fractO b02, b06 (fr2 x 3)

Red Sails in the Subset

Let’s look at a simple arithmetical rule and a simple arithmetical fact. And the complexity they can create. First the rule. Subtracting a negative number is the same as adding the positive form of that number:

7 – +2 = 5
7 – -2 = 7 + 2 = 9

-10 – +4 = -14
-10 – -4 = -10 + 4 = -6

Now the simple arithmetical fact: The reciprocal of positive x, namely 1/x, is less than 1 when x > 1, identical to x when x = 1, and greater than 1 when 0 < x < 1. Negative x, -x, works in the opposite direction:

1/5 = 0.2; 1/-5 = -0.2
1/4 = 0.25; 1/-4 = -0.25
1/3 = 0.333333…; 1/-3 = -0.333333…
1/2 = 0.5; 1/-2 = -0.5

1/1 = 1; 1/-1 = -1

1/0.5 = 2; 1/-0.5 = -2
1/0.25 = 4; 1/-0.25 = -4
1/0.333333.. = 3; 1/-0.333333.. = -3
1/0.2 = 5; 1/-0.2 = -5

Now, the simple arithmetical rule and the simple arithmetical fact explain the wildly different behaviour of these two nearly identical formulae:

Formula #1: x = x + 1/x
Formula #2: x = x – 1/x

If you seed x = x + 1/x with 2, this is what happens:

2 = x
2.5 = 2 + 1/2 = 2 + 0.5
2.9 = 2.5 + 1/2.5 = 2.5 + 0.4
3.244827586206896551724137931… = 2.9 + 1/2.9 = 2.9 + 0.3448275862…
3.553010370478947561288431236…
3.834461842815967366750790750…
4.095254632258778985771918456…
4.339439692724345181049239663…
4.569884190357676650018985962…
4.788708116379690742064597208…
4.997532704493448986664559639…
5.197631445038131469095668466…
5.390026771750770995914851381…
5.575554607204394029915651664…
5.754908962142979073283550015…
5.928673657045750549124213874…
6.097345447373015508408978797…
6.261351244425377152997703626…
6.421061179383957004641284553…
6.576798676981813718180627345…

The value of x steadily (but more and more slowly) increases. But when you seed the other formula, x = x – 1/x, with 2, this is what happens:

+2
+1.5 = 2 – 1/2 = 2 – 0.5
+0.8333333… = 1.5 – 1/1.5 = 1.5 – 0.666666…
-0.3666666… = 0.8333333… – 1/0.8333333… = 0.8333333… – 1.2
+2.3606060606… = -0.3666666… – 1/-0.3666666… = -0.3666666… – -2.72727272… = -0.3666666… + 2.72727272…
+1.936986034932119656124790913…
+1.420720051612810742016492942…
+0.716851616121389735975863550…
-0.678137217705362317788764881…
+0.796490591963802485322149292…
-0.459017018658980935029501857…
+1.719551442531198550688634398…
+1.138004432499332885157841729…
+0.259273233005005595158072588…
-3.597661740227243739940039228…
-3.319703423907923593779727545…
-3.018471695555874174383708009…
-2.687178213005645221877765061…
-2.315040631969854351245993463…
-1.883082770759830608578236571…
-1.352038668223383718148747858…
-0.612414851610188982350276645…

+1.020465208974159220420492697…
+0.040519992610273807119693182…
-24.63865528804984441050796942…
-24.59806865747650234381633987…
-24.55741505926418687092326558…
-24.51669416101057552476382150…
-24.47590562755526483917345018…
-24.43504912094763238695385804…

The value of x swings between positive and negative in an irregular, non-periodic way, alternating between slow deterministic decay and instantaneous jumps to sometimes large positive or negative values. The deterministic decays explains why, as we’ll see, there are beautiful regular curves — parabolic curves — amid the irregularity. When the function creates a positive number x > 1, it nibbles away at x until x x > -1, x becomes positive at the next step and the process continues. Represented as a graph, x = x – 1/x looks like this when seeded with 2 — note the parabolic curves:

x[i] = x[i-1] – 1/x[i-1], x[1] = 2 (click for larger)


A shark-fin and some red sails (images StockCake + Para-Sailing World Championship)


Sydney Opera House (image Wikipedia)


When x > 0, its value is represented in white; when x < 0, its value is represented in red. The curves created remind of me of shark-fins or sails or Sydney Opera House. So you could say the graph contains red sails in the subset, i.e. the set of values of x that are sub-zero. Here are some variations on the formula:

x = x – (1/4)/x, x[1] = 2


x = x – (4/3)/x, x[1] = 2


x = x – (4/5)/x, x[1] = 2


Now try this formula, x = 1 – 1/x. When it’s seeded with 2, it behaves like this:

2
0.5 = 1 – 1/2 = 1 – 0.5
-1 = 1 – 1/0.5 = 1 – 2
2 = 1 – -1/-1 = 1 – -1 = 1 + 1
1/2
-1
2
[…]

The values cycles through 2, 0.5, -1, 2, 0.5… for ever. So try varying the formula. This is what happens with x = 0.1 – 1.7/x, seeded with 2:

+2
-0.75
+2.366666666666666666666666666…
-0.618309859154929577464788732…
+2.849430523917995444191343963…
-0.496610440482852346310656327…
+3.523206323143542441364433927…
-0.382515028663775083373274222…
+4.544269826308639632084352464…
-0.274097504104620631734792447…
+6.302172491695235560374503419…
-0.169748249867834571832745868…
+10.11483079397645866692882142…
-0.068070038404634195480677189…
+25.07427708053510247498559239…

When you look at the graph of x = 0.1 – 1.7/x, you’ll see it’s also cycling, just in a more complicated way:

x = 0.1 – 1.7/x, x[1] = 2 (click for larger)


And here’s how different seeds can change the graph:

x = 2/3 – 1/x, x[1] = 2/3


x = 2/3 – 1/x, x[1] = 3/2


This graph reminds me of vertebrae:

x = 2/5 – 1/x, x[1] = 2


And this graph reminds of a bone:

x = 9/7 – 1/x, x[1] = 2


As Lucretius nearly said: Mathematica Moles et Machina Mundi — Mathematics is the Mass and Body of the World.


Elsewhere Other-Accessible…

• Moto-Motto — what Lucretius did say

Strartifacts

Here’s a sequence of decreasing numbers. Which number comes next?

612 → 600 → 594 → 414 → 398 → 182 → ?

It’s 166, because the numbers decrease by the product of their digits higher than 0:

612 – 6*2 = 612 – 12 = 600 → 600 – 6 = 594 → 594 – 5*9*4 = 594 – 180 = 414 → 414 – 4*4 = 414 – 16 = 398 → 398 – 3*9*8 = 398 – 216 = 166

Eventually the sequence will reached 0 and stop. If you want to see how this function looks on a graph, here it is:

x = n <= 3722, f(i) -= digmul(f(i)) → 0 (click for larger)


The graph represents n on the x-axis, with the red circles marking n = 100 and n = 1000. The sequence of falling digit-products is on the y-axis, but the graph has a special feature there. The y-axis is compressed according to the size of n, so that n = 1000 falls to 0 with n -= digmul(n) in the same height as n = 100. Here’s a graph for the same function in base 7:

x = n <= 3722 in base 7, f(i) -= digmul(f(i)) → 0


Now the red circles represent 7^2 = 49, 7^3 = 343, 7^4 = 2401, i.e. 100b7, 1000b7, 10000b7. And you can try other functions for n = n – func(n) = n -= func(n). Here’s a graph for n -= hailstep(n), where hailstep(n) returns the number of steps in the Collatz sequence for n:

x = n <= 3722 in base 7, f(i) -= hailstep(f(i)) → f(i) < 2


You form a Collatz sequence by starting with a whole number and finding the next number according to two rules:

1. If n(i) is divisible by 2, n(i+1) = n(i) / 2
2. If n(i) is not divisible by 2, n(i+1) = n(i) * 3 + 1

So the Collatz sequence for n = 10 looks like this:

10 → 10 / 2 = 5 → 5 * 3 + 1 = 16 → 16 / 2 = 8 → 8 / 2 = 4 → 4 / 2 = 2 → 2 / 2 = 1.

When you reach 1, you stop. So that’s six steps for n = 10. But does every n reach 1 in the end? It’s a very simple question about a very simple function. But nobody knows and nobody can prove that either all numbers do or at least one number doesn’t. The German mathematician Lothar Collatz (1910-90) conjectured that all numbers do reach 1. But it can take a surprisingly long time, even with small n. This is the Collatz sequence for n = 27:

27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1

Now some more functions for the y-compressed fall-bands, as I call them. If you use the sum of the factors * powers, you get this:

x = n <= 7422, f(i) -= factpowsum(f(i)) → f(i) < 2


The factpowsum(n) is the sum of the factors multiplied by their powers. For example, 37692 = 2^2 * 3^3 * 349, so factpowsum(4188) = 2*2 + 3*3 + 349*1 = 362. Here’s factpowsum for more n:

x = n <= 14822, f(i) -= factpowsum(f(i)) → f(i) < 2


You can also use the very simple function f(i) -= 1, that is, compress the numbers from n to 1 into the y-gap. But if you do that, you’ll get a completely filled screen:

x = n <= 3722, f(i) -= 1 → f(i) = 0


So you can adjust the color of a pixel according to how many times it’s written to:

x = n <= 1862, f(i) -= 1 → f(i) = 0 (color-adjust)


The patterns in the colors are artifacts of the limited resolution of the screen, so I call these patterns strartifacts = strata + artifacts. Here’s another example:

x = n <= 3722, f(i) -= 1 → f(i) = 0 (color-adjust)


Or adjust the greytone of the pixel:

x = n <= 3722, f(i) -= 1 → f(i) = 0 (greytone-adjust)


And so on (in all cases, you can click for a larger image):

x = n <= 1862, f(i) -= blockmul(f(i)) (multiply run-lengths of same digits) → f(i) < 2


x is triangular(n) = 3 to 1734453, y is 1 < triangular numbers <= n


x = n <= , f(i) -= 1 → f(i) < 2


x = n <= 7442, f(i) -= 1 → f(i) < 2


x = n <= 1862, f(i) -= leaddig(f(i)) → f(i) < 2 # 1


x = n <= , f(i) -= leaddig(f(i)) → f(i) < 2 # 2


x = n <= , f(i) -= trailingdigit(f(i)) + 1 → f(i) < 2


x = n <= , f(i) -= trailingdigit(f(i) in base 5) + 3 → f(i) < 2


for triangular(n) = 3 to 6928503, f(i) -= primes → f(i) < 2



x = n <= 1862, f(i) -= blockmul(f(i) in base 5) (multiply run-lengths of same digits) → f(i) < 2


x = n <= 1862, f(i) -= blockmul(f(i) in base 2) → f(i) < 2


x = n <= 1862, f(i) -= digsum(f(i)) → f(i) < 2


x = n <= 3722, f(i) -= func(x = 1/4 → x < 0, x(1) = 4) → f(i) < 2


x = n <= 932, f(i) -= func(x -= 3/x → x < 0, x(1) = 6) → f(i) < 2


Formulas Focal to the Flesh

Here’s an interesting formula:

fr(1) = 1/2; mx = 3
fr(i) = fr(i-1) + 1/fr(i-1)
if fr(i) > mx, fr(i) = fr(i) – mx

Early terms look like this:

0.5, 2.5, 2.9, 3.244827586…, 4.329334628…, 2.081590666…, 2.561992513…, 2.952313716…, 3.291031107…, 3.727089920…, 2.102435627…, 2.578074447…, 2.965960841…, 3.303119709…, 3.602146368…, 2.262872154…, 2.704788415…, 3.074503101…, 13.49676325…, 10.59203071…, 7.723747777…, 4.935444092…, 2.452121378…, 2.859931533…, 3.209590254…, 4.980804482…, 2.485649867…, 2.887959143…, 3.234224430…, 4.503633905…, 2.168689406…

Can you see any patterns emerging? I’d guess not. And I’d guess a thousand more terms wouldn’t help you see any better. It’s hard for humans to see patterns in a jumble of numbers. Our eyes don’t work as well on numbers as on shapes. That’s why you can make that formula focal to the flesh, as it were, by plotting the numbers on a graph. Or part of the numbers, anyway. Suppose you take the fractional parts of each pair of terms and use them to map (x,y) on a FractL (my name for a graph whose arms run from 0 to 1). For example, the terms 4.935444092… and 2.452121378… would yield x = 0.935444092… and y = 0.452121378… (or vice versa). The resultant graph makes the formula focal to the flesh. And it’s replete with patterns:

fr(i)+=1/fr(i-1); if fr(i)>3, fr(i)-=3; x = frac(fr(i)), y = frac(fr(i+1))


I can’t explain the patterns and they may arise from limited precision in the decimal digits. But I like them however they arise. The graph doesn’t change when mx = 4 (although it creates the lines in a different order):

if fr(i)>4, fr(i)-=4


But it does change when mx = 4/3. The lines almost vanish, except for a tiny comet-like mark towards the upper right-hand corner:

if fr(i)>4/3, fr(i)-=4/3


When mx = 7/2, the graph of mx = 3|4 is back in a slightly different form:

if fr(i)>7/2, fr(i)-=7/2


And again with 7/3:

if fr(i)>7/3, fr(i)-=7/3


There’s a big change with 7/4, Most of the lines disappear:

if fr(i)>7/4, fr(i)-=7/4


And only the main lines appear with 9/5:

if fr(i)>9/5, fr(i)-=9/5


And so on till you try fr -= 2/f, as noted below:

if fr(i)>11/5, fr(i)-=11/5


if fr(i)>11/6, fr(i)-=11/6


if fr(i)>15/8, fr(i)-=15/8


if fr(i)>29/15, fr(i)-=29/15


Now try fr += 2/fr and fr += 3/fr. This is what happens:

fr += 2/fr; if fr(i)>3, fr(i)-=3


fr += 2/fr; if fr(i)>8/3, fr(i)-=8/3


fr += 2/fr; if fr(i)>11/4, fr(i)-=11/4


fr += 3/fr; if fr(i)>6, fr(i)-=6


And what about these graphs?




They’re created by seeding a sum, s, with a fraction, then adding more fractions < 1 whose numerators = 1,2,3… and whose denominators are the prime numbers 1, s -= 1. When s > 1, s -= 1. Then you take the fractional parts of s(i) and s(i+1) and graph (x,y) as above.


Post-Performative Post-Scriptum

The title of this post refers to Morbid Angel’s Formulas Fatal to the Flesh (1998). I’ve never heard it, but I like Morbid Angel’s alphabetically alliterative album-titles.

The Bird Dimension

M.C. Escher, Another World / Andere Wereld (1947)


This is almost my favorite image by Escher. But I’d like a frEscher perspective in it: I think the bird should be looking in the other direction, out into the impossibly overlapping universes, not into the cupola and at the viewer.

Third Whirled Warp

Here’s a regular hexagon inside a regular triangle, that is, an equilateral triangle:

Regular hexagon inside regular triangle


Imagine that two points are moving around the perimeter of each polygon, with the hex-point moving half as fast as the tri-point (after adjustment for the incommensurate relative lengths of the perimeters). If you trace the midpoint of the twin spinning points, you get this shape:

v3v6, 1 : 1/2, pol


And if you adjust the midpoint path as though the triangle had been stretched into a circle, you get this shape:

v3v6, 1 : 1/2, circ, pol


Here’s the same when the ratio of speeds is 1/2 to 1/3, that is, 1 to 2/3:

v3v6, 1/2 : 1/3, circ, pol


Without the polygons, it looks like this:

v3v6, 1/2 : 1/3, circ


When the ratio of speeds if -1/3 to 2/3, that is, the tri-point is moving counter-clockwise around the triangle, you get this shape:

v3v6, -1/3 : 2/3, pol


When it’s stretched into a circle, you get this:

v3v6, -1/3 : 2/3, circ, pol


It looks like a moustache:

v3v6, -1/3 : 2/3, circ


Here are more midpoint shapes created with a hexagon inside a triangle:

v3v6, 2/2 : 3/3, circ


v3v6, -1/2 : 3/4, circ


v3v6, 1/4 : 1/5, circ


v3v6, -1/4 : 3/4, circ


v3v6, -1/4 : 4/5, circ


v3v6, 2/3 : 3/4, circ


v3v6, 2/3 : 3/5, circ


v3v6, 3/4 : 4/5, circ


v3v6, 3/4 : 4/5, circ


Now try aligning the nested hexagon like this, so that the sides of the hexagon coincide with the middle third of the sides of the triangle:

v3v6, side alignment


With two points moving in a ratio of 1/3 to 1/4, you get this midpoint shape:

v3v6, sided, 1/3 : 1/4, pol


Here it is without the polygons:

v3v6, sided, 1/3 : 1/4


Now try a regular octagon inside a square:

v4v8, 1/2 : 1/3, circ, pol


v4v8, 1/2 : 1/3, circ


v4v8, -1/3 : 3/4, circ


v4v8, 2/3 : 3/5, circ


Now place a triangle inside a hexagon:

v6v3, 1 : 1/4, pol


If you stretch the midpoint path according to perimeter of the triangle, you get this:

v6v3, 1 : 1/4, circ, pol


v6v3, 1 : 1/4, circ


The three stretching shapes remind me of hands in Egyptian art, like this image of King Tutankhamun and Queen Ankhesenamun:

Detail from the Golden Throne of Tutankhamnun


Here are more midpoint paths:

v6v3, 1 : -1/4, circ


v6v3, 1 : 1/2, circ


v6v3, 1 : 1/3, circ


v6v3, -1 : 1/3, circ


v6v3, -1 : 1/4, circ


v6v3, 1 : 1/5, circ


v6v3, 2/3 : 1/4, circ


Now try a square inside an octagon:

v8v4, 2/3 : 1/4, circ, pol


v8v4, 2/3 : 1/4, circ


v8v4, 2/5 : 1/6, circ


v8v4, 2/5 : 3/7, circ


v8v4, 4/5 : 3/7, circ


Elsewhere Other-Accessible…

• First Whirled Warp — an earlier look at this kind of geometry
• Second Whirled Warp — and another earlier look

The Hex Crystals

To coin a phrase: Never Mind the Bollocks — Here’s the Hex Crystals! And what is a hex crystal? It’s what I call a shape that’s created algorithmo inside a hexagon and looks like a crystal:

A hex crystal


Here are some more hex-crystals:




I came across hex-crystals when I was looking at an interesting little geometrical question. How does sum(vd), the sum of distances to the vertices of a square, vary from different points, (x,y), inside the square? Say the square is created inside a circle of radius = 500 units and centered on (x,y) = (0,0). When the point is at (0,0), the center of the square, sum(vd) is obviously 2000, because the four vertices all fall on the perimeter of the circle at 500 units from the center and 4 * 500 = 2000:
0

sum(vd) = 2000 = sum of distances to vertices from (0,0)


When is sum(vd) at a maximum? When the point is on one or another of the vertices, which are at (+/-354,+/-354) units in relation to the center at (0,0):

sum(vd) = 2414 = sum of distances to vertices from (354,-354)


More precisely, the sum is 2414.213562373… = 1000 * (√2 + 1) units and the vertices are at (+/-353.55339…, +/-353.55339…) units, as simple geometry dictates for a square inside a circle of radius 500. Accordingly, sum(vd) varies between exactly 2000 and 2414.213562373… as the point moves inside the square:

sum(vd) = 2165 from (132,256)


sum(vd) = 2182 from (-135,271)


sum(vd) = 2069 from (177,51)


I wondered what shapes appeared as one traced the route of a point jumping, say, 1/2 towards the vertices according to tests on sum(vd). For example, if the point starts at (0,0) at time t0) and sum(vd) at time ti has to be alternately greater and less than sum(vd) at ti-1 for successive jumps, you get this shape:

jump = 1/2, test = sum(vd,ti) >,< sum(vd,ti-1)


You can use the binary number 10bin to represent the test on sum(vd) at ti-1 and ti-1, i.e. the test at jump 1 is sum(vd,ti) > sum(vd,ti-1), at step 2 is sum(vd,ti) < sum(vd,ti-1), and so on. Using the same test and a jump of 1/3, you get this shape:

jump = 1/3, test = sum(vd,ti,10bin)


Now the shape is clearly a fractal. So are some of the other shapes I found by applying the same kind of tests to a point jumping inside a pentagon:

vertex = 5, jump = 55/144 = fib(10) / fib(12), test on sum(vd) = 10bin


v = 5, j = 55/144, test = 10010bin


v = 5, j = 55/144, test = 11000bin


When test = 10010bin, you read the binary number left-to-right and check for s1><s0,s2<s1,s3<s2,s4>s3,s5<s4. Then you apply the same tests to subsequent jumps, i.e., you return to the beginning of the binary number and read it left-to-right again. Now let’s apply similar tests to hexagons and create some hex-crystals:

v = 6, j = 1/2, test = 10bin


Various hex-crystals (animated gif courtesy EZgif)


I searched an array to calculate the possible routes, so the same test yielded different results depending on dp, the depth of the search. This is because tl, the length of the test, fits more or less well into dp by dp modulo tl, that is, by whether tl is a factor of dp. For example, when the test is 110 and tl = 3, you get this with dp = 9:

v = 6, j = 1/2, test = 110, dp = 9


And you get this when dp = 10 (i.e., dp = 9+1):

v = 6, j = 1/2, test = 110bin, dp = 10dec


Here are some more hex-crystals:

test = 1100bin


test = 1110bin


test = 10010bin


test = 11010bin


test = 11100bin


test = 101000, dp = 12


test = 101100bin


test = 111100bin


test = 111100, dp = 11


test = 1110010bin


test = 1111100bin


test = 10010110bin


test = 10011110bin


test = 11000110bin


test = 11001110bin


test = 11010110bin


test = 11100110bin


test = 11101000bin


test = 11110010bin


test = 100101000bin


test = 100111110bin


test = 110011110bin


test = 110111000bin


test = 1001101010bin


test = 1001111000bin


test = 1001111010bin


test = 1010011110bin


test = 1011101110bin


test = 1101010000bin


test = 1110001110bin


test = 1110101000bin


test = 1110101010bin


test = 1111100010bin


j = 1/3, test = 1 (i.e., for all jumps sum(vd) at ti > sum(vd) at ti-1, center point


j = 2/3, test = 11100bin


j = 2/5, test = 10010bin


Finally, here are some hex-crystals based on a test of sorted distances from (x,y), i.e. how the vertices rank by distance from (x,y):