Fylfy Fractals

An equilateral triangle is a rep-tile, because it can be tiled completely with smaller copies of itself. Here it is as a rep-4 rep-tile, tiled with four smaller copies of itself:

Equilateral triangle as rep-4 rep-tile


If you divide and discard one of the sub-copies, then carry on dividing-and-discarding with the sub-copies and sub-sub-copies and sub-sub-sub-copies, you get the fractal seen below. Alas, it’s not a very attractive or interesting fractal:

Divide-and-discard fractal stage #1


Stage #2


Stage #3


Stage #4


Stage #5


Stage #6


Stage #7


Stage #8


Stage #9


Divide-and-discard fractal (animated)


You can create more attractive and interesting fractals by rotating the sub-triangles clockwise or anticlockwise. Here are some examples:









Now try dividing a square into four right triangles, then turning each of the four triangles into a divide-and-discard fractal. The resulting four-fractal shape is variously called a swastika, a gammadion, a cross cramponnée, a Hakenkreuz and a fylfot. I’m calling it a fylfy fractal:

Divide-and-discard fractals in the four triangles of a divided square stage #1


Fylfy fractal #2


Fylfy fractal #3


Fylfy fractal #4


Fylfy fractal #5


Fylfy fractal #6


Fylfy fractal #7


Fylfy fractal #8


Fylfy fractal (animated)


Finally, you can adjust the fylfy fractals so that each point in the square becomes the equivalent point in a circle:



















Absolutely Sabulous

The Hourglass Fractal (animated gif optimized at ezGIF)


Performativizing Paronomasticity

The title of this incendiary intervention is a paronomasia on the title of the dire Absolutely Fabulous. The adjective sabulous means “sandy; consisting of or abounding in sand; arenaceous” (OED).

Elsewhere Other-Accessible

Hour Re-Re-Re-Re-Powered — more on the hourglass fractal
Alas, Pour Horic — an earlier paronomasia for the fractal

Game of Throwns

In “Scaffscapes”, I looked at these three fractals and described how they were in a sense the same fractal, even though they looked very different:

Fractal #1


Fractal #2


Fractal #3


But even if they are all the same in some mathematical sense, their different appearances matter in an aesthetic sense. Fractal #1 is unattractive and seems uninteresting:

Fractal #1, unattractive, uninteresting and unnamed


Fractal #3 is attractive and interesting. That’s part of why mathematicians have given it a name, the T-square fractal:

Fractal #3 — the T-square fractal


But fractal #2, although it’s attractive and interesting, doesn’t have a name. It reminds me of a ninja throwing-star or shuriken, so I’ve decided to call it the throwing-star fractal or ninja-star fractal:

Fractal #2, the throwing-star fractal


A ninja throwing-star or shuriken


This is one way to construct a throwing-star fractal:

Throwing-star fractal, stage 1


Throwing-star fractal, #2


Throwing-star fractal, #3


Throwing-star fractal, #4


Throwing-star fractal, #5


Throwing-star fractal, #6


Throwing-star fractal, #7


Throwing-star fractal, #8


Throwing-star fractal, #9


Throwing-star fractal, #10


Throwing-star fractal, #11


Throwing-star fractal (animated)


But there’s another way to construct a throwing-star fractal. You use what’s called the chaos game. To understand the commonest form of the chaos game, imagine a ninja inside an equilateral triangle throwing a shuriken again and again halfway towards a randomly chosen vertex of the triangle. If you mark each point where the shuriken lands, you eventually get a fractal called the Sierpiński triangle:

Chaos game with triangle stage 1


Chaos triangle #2


Chaos triangle #3


Chaos triangle #4


Chaos triangle #5


Chaos triangle #6


Chaos triangle #7


Chaos triangle (animated)


When you try the chaos game with a square, with the ninja throwing the shuriken again and again halfway towards a randomly chosen vertex, you don’t get a fractal. The interior of the square just fills more or less evenly with points:

Chaos game with square, stage 1


Chaos square #2


Chaos square #3


Chaos square #4


Chaos square #5


Chaos square #6


Chaos square (anim)


But suppose you restrict the ninja’s throws in some way. If he can’t throw twice or more in a row towards the same vertex, you get a familiar fractal:

Chaos game with square, ban on throwing towards same vertex, stage 1


Chaos square, ban = v+0, #2


Chaos square, ban = v+0, #3


Chaos square, ban = v+0, #4


Chaos square, ban = v+0, #5


Chaos square, ban = v+0, #6


Chaos square, ban = v+0 (anim)


But what if the ninja can’t throw the shuriken towards the vertex one place anti-clockwise of the vertex he’s just thrown it towards? Then you get another familiar fractal — the throwing-star fractal:

Chaos square, ban = v+1, stage 1


Chaos square, ban = v+1, #2


Chaos square, ban = v+1, #3


Chaos square, ban = v+1, #4


Chaos square, ban = v+1, #5


Game of Throwns — throwing-star fractal from chaos game (static)


Game of Throwns — throwing-star fractal from chaos game (anim)


And what if the ninja can’t throw towards the vertex two places anti-clockwise (or two places clockwise) of the vertex he’s just thrown the shuriken towards? Then you get a third familiar fractal — the T-square fractal:

Chaos square, ban = v+2, stage 1


Chaos square, ban = v+2, #2


Chaos square, ban = v+2, #3


Chaos square, ban = v+2, #4


Chaos square, ban = v+2, #5


T-square fractal from chaos game (static)


T-square fractal from chaos game (anim)


Finally, what if the ninja can’t throw towards the vertex three places anti-clockwise, or one place clockwise, of the vertex he’s just thrown the shuriken towards? If you can guess what happens, your mathematical intuition is much better than mine.


Post-Performative Post-Scriptum

I am not now and never have been a fan of George R.R. Martin. He may be a good author but I’ve always suspected otherwise, so I’ve never read any of his books or seen any of the TV adaptations.

Scaffscapes

A fractal is a shape that contains copies of itself on smaller and smaller scales. You can find fractals everywhere in nature. Part of a fern looks like the fern as a whole:

Fern as fractal (source)


Part of a tree looks like the tree as a whole:

Tree as fractal (source)


Part of a landscape looks like the landscape as a whole:

Landscape as fractal (source)


You can also create fractals for yourself. Here are three that I’ve constructed:

Fractal #1


Fractal #2


Fractal #3 — the T-square fractal


The three fractals look very different and, in one sense, that’s exactly what they are. But in another sense, they’re the same fractal. Each can morph into the other two:

Fractal #1 → fractal #2 → fractal #3 (animated)


Here are two more fractals taken en route from fractal #2 to fractal #3, as it were:

Fractal #4


Fractal #5


To understand how the fractals belong together, you have to see what might be called the scaffolding. The construction of fractal #3 is the easiest to understand. First you put up the scaffolding, then you take it away and leave the final fractal:

Fractal #3, scaffolding stage 1


Fractal #3, stage 2


Fractal #3, stage 3


Fractal #3, stage 4


Fractal #3, stage 5


Fractal #3, stage 6


Fractal #3, stage 7


Fractal #3, stage 8


Fractal #3, stage 9


Fractal #3, stage 10


Fractal #3 (scaffolding removed)


Construction of fractal #3 (animated)


Now here’s the construction of fractal #1:

Fractal #1, stage 1


Fractal #1, stage 2


Fractal #1, stage 3

Construction of fractal #1 (animated)


Fractal #1 (static)


And the constructions of fractals #2, #4 and #5:

Fractal #2, stage 1


Fractal #2, stage 2


Fractal #2, stage 3

Fractal #2 (animated)


Fractal #2 (static)


Fractal #4, stage 1


Fractal #4, stage 2


Fractal #4, stage 3

Fractal #4 (animated)


Fractal #4 (static)


Fractal #5, stage 1


Fractal #5, stage 2


Fractal #5, stage 3

Fractal #5 (animated)


Fractal #5


Root Pursuit

Roots are hard, powers are easy. For example, the square root of 2, or √2, is the mysterious and never-ending number that is equal to 2 when multiplied by itself:

• √2 = 1·414213562373095048801688724209698078569671875376948073...

It’s hard to calculate √2. But the powers of 2, or 2^p, are the straightforward numbers that you get by multiplying 2 repeatedly by itself. It’s easy to calculate 2^p:

• 2 = 2^1
• 4 = 2^2
• 8 = 2^3
• 16 = 2^4
• 32 = 2^5
• 64 = 2^6
• 128 = 2^7
• 256 = 2^8
• 512 = 2^9
• 1024 = 2^10
• 2048 = 2^11
• 4096 = 2^12
• 8192 = 2^13
• 16384 = 2^14
• 32768 = 2^15
• 65536 = 2^16
• 131072 = 2^17
• 262144 = 2^18
• 524288 = 2^19
• 1048576 = 2^20
[...]

But there is a way to find √2 by finding 2^p, as I discovered after I asked a simple question about 2^p and 3^p. What are the longest runs of matching digits at the beginning of each power?

131072 = 2^17
129140163 = 3^17
1255420347077336152767157884641... = 2^193
1214512980685298442335534165687... = 3^193
2175541218577478036232553294038... = 2^619
2177993962169082260270654106078... = 3^619
7524389324549354450012295667238... = 2^2016
7524012611682575322123383229826... = 3^2016

There’s no obvious pattern. Then I asked the same question about 2^p and 5^p. And an interesting pattern appeared:

32 = 2^5
3125 = 5^5
316912650057057350374175801344 = 2^98
3155443620884047221646914261131... = 5^98
3162535207926728411757739792483... = 2^1068
3162020133383977882730040274356... = 5^1068
3162266908803418110961625404267... = 2^127185
3162288411569894029343799063611... = 5^127185

The digits 31622 rang a bell. Isn’t that the start of √10? Yes, it is:

• √10 = 3·1622776601683793319988935444327185337195551393252168268575...

I wrote a fast machine-code program to find even longer runs of matching initial digits. Sure enough, the pattern continued:

• 316227... = 2^2728361
• 316227... = 5^2728361
• 3162277... = 2^15917834
• 3162277... = 5^15917834
• 31622776... = 2^73482154
• 31622776... = 5^73482154
• 3162277660... = 2^961700165
• 3162277660... = 5^961700165

But why are powers of 2 and 5 generating the digits of √10? If you’re good at math, that’s a trivial question about a trivial discovery. Here’s the answer: We use base ten and 10 = 2 * 5, 10^2 = 100 = 2^2 * 5^2 = 4 * 25, 10^3 = 1000 = 2^3 * 5^3 = 8 * 125, and so on. When the initial digits of 2^p and 5^p match, those matching digits must come from the digits of √10. Otherwise the product of 2^p * 5^p would be too large or too small. Here are the records for matching initial digits multiplied by themselves:

32 = 2^5
3125 = 5^5
• 3^2 = 9

316912650057057350374175801344 = 2^98
3155443620884047221646914261131... = 5^98
• 31^2 = 961

3162535207926728411757739792483... = 2^1068
3162020133383977882730040274356... = 5^1068
• 3162^2 = 9998244

3162266908803418110961625404267... = 2^127185
3162288411569894029343799063611... = 5^127185
• 31622^2 = 999950884

• 316227... = 2^2728361
• 316227... = 5^2728361
• 316227^2 = 99999515529

• 3162277... = 2^15917834
• 3162277... = 5^15917834
• 3162277^2 = 9999995824729

• 31622776... = 2^73482154
• 31622776... = 5^73482154
• 31622776^2 = 999999961946176

• 3162277660... = 2^961700165
• 3162277660... = 5^961700165
• 3162277660^2 = 9999999998935075600

The square of each matching run falls short of 10^p. And so when the digits of 2^p and 5^p stop matching, one power must fall below √10, as it were, and one must rise above:

3 162266908803418110961625404267... = 2^127185
3·162277660168379331998893544432... = √10
3 162288411569894029343799063611... = 5^127185

In this way, 2^p * 5^p = 10^p. And that’s why matching initial digits of 2^p and 5^p generate the digits of √10. The same thing, mutatis mutandis, happens in base 6 with 2^p and 3^p, because 6 = 2 * 3:

• 2.24103122055214532500432040411... = √6 (in base 6)

24 = 2^4
213 = 3^4
225522024 = 2^34 in base 6 = 2^22 in base 10
22225525003213 = 3^34 (3^22)
2241525132535231233233555114533... = 2^1303 (2^327)
2240133444421105112410441102423... = 3^1303 (3^327)
2241055222343212030022044325420... = 2^153251 (2^15007)
2241003215453455515322105001310... = 3^153251 (3^15007)
2241032233315203525544525150530... = 2^233204 (2^20164)
2241030204225410320250422435321... = 3^233204 (3^20164)
2241031334114245140003252435303... = 2^2110415 (2^102539)
2241031103430053425141014505442... = 3^2110415 (3^102539)

And in base 30, where 30 = 2 * 3 * 5, you can find the digits of √30 in three different ways, because 30 = 2 * 15 = 3 * 10 = 5 * 6:

• 5·E9F2LE6BBPBF0F52B7385PE6E5CLN... = √30 (in base 30)

55AA4 = 2^M in base 30 = 2^22 in base 10
5NO6CQN69C3Q0E1Q7F = F^M = 15^22
5E63NMOAO4JPQD6996F3HPLIMLIRL6F... = 2^K6 (2^606)
5ECQDMIOCIAIR0DGJ4O4H8EN10AQ2GR... = F^K6 (15^606)
5E9DTE7BO41HIQDDO0NB1MFNEE4QJRF... = 2^B14 (2^9934)
5E9G5SL7KBNKFLKSG89J9J9NT17KHHO... = F^B14 (15^9934)
[...]
5R4C9 = 3^E in base 30 = 3^14 in base 10
52CE6A3L3A = A^E = 10^14
5E6SOQE5II5A8IRCH9HFBGO7835KL8A = 3^3N (3^113)
5EC1BLQHNJLTGD00SLBEDQ73AH465E3... = A^3N (10^113)
5E9FI455MQI4KOJM0HSBP3GG6OL9T8P... = 3^EJH (3^13187)
5E9EH8N8D9TR1AH48MT7OR3MHAGFNFQ... = A^EJH (10^13187)
[...]
5OCNCNRAP = 5^I in base 30 = 5^18 in base 10
54NO22GI76 = 6^I (6^18)
5EG4RAMD1IGGHQ8QS2QR0S0EH09DK16... = 5^1M7 (5^1567)
5E2PG4Q2G63DOBIJ54E4O035Q9TEJGH... = 6^1M7 (6^1567)
5E96DB9T6TBIM1FCCK8A8J7IDRCTM71... = 5^F9G (5^13786)
5E9NM222PN9Q9TEFTJ94261NRBB8FCH... = 6^F9G (6^13786)
[...]

So that’s √10, √6 and √30. But I said at the beginning that you can find √2 by finding 2^p. How do you do that? By offsetting the powers, as it were. With 2^p and 5^p, you can find the digits of √10. With 2^(p+1) and 5^p, you can find the digits of √2 and √20, because 2^(p+1) * 5^p = 2 * 2^p * 5^p = 2 * 10^p:

•  √2 = 1·414213562373095048801688724209698078569671875376948073...
• √20 = 4·472135954999579392818347337462552470881236719223051448...

16 = 2^4
125 = 5^3
140737488355328 = 2^47
142108547152020037174224853515625 = 5^46
1413... = 2^243
1414... = 5^242
14141... = 2^6651
14142... = 5^6650
141421... = 2^35389
141420... = 5^35388
4472136... = 2^162574
4472135... = 5^162573
141421359... = 2^3216082
141421352... = 5^3216081
447213595... = 2^172530387
447213595... = 5^172530386
[...]

God Give Me Benf’

In “Wake the Snake”, I looked at the digits of powers of 2 and mentioned a fascinating mathematical phenomenon known as Benford’s law, which governs — in a not-yet-fully-explained way — the leading digits of a wide variety of natural and human statistics, from the lengths of rivers to the votes cast in elections. Benford’s law also governs a lot of mathematical data. It states, for example, that the first digit, d, of a power of 2 in base b (except b = 2, 4, 8, 16…) will occur with the frequency logb(1 + 1/d). In base 10, therefore, Benford’s law states that the digits 1..9 will occur with the following frequencies at the beginning of 2^p:

1: 30.102999%
2: 17.609125%
3: 12.493873%
4: 09.691001%
5: 07.918124%
6: 06.694678%
7: 05.799194%
8: 05.115252%
9: 04.575749%

Here’s a graph of the actual relative frequencies of 1..9 as the leading digit of 2^p (open images in a new window if they appear distorted):


And here’s a graph for the predicted frequencies of 1..9 as the leading digit of 2^p, as calculated by the log(1+1/d) of Benford’s law:


The two graphs agree very well. But Benford’s law applies to more than one leading digit. Here are actual and predicted graphs for the first two leading digits of 2^p, 10..99:



And actual and predicted graphs for the first three leading digits of 2^p, 100..999:



But you can represent the leading digit of 2^p in another way: using an adaptation of the famous Ulam spiral. Suppose powers of 2 are represented as a spiral of squares that begins like this, with 2^0 in the center, 2^1 to the right of center, 2^2 above 2^1, and so on:

←←←⮲
432↑
501↑
6789

If the digits of 2^p start with 1, fill the square in question; if the digits of 2^p don’t start with 1, leave the square empty. When you do this, you get this interesting pattern (the purple square at the very center represents 2^0):

Ulam-like power-spiral for 2^p where 1 is the leading digit


Here’s a higher-resolution power-spiral for 1 as the leading digit:

Power-spiral for 2^p, leading-digit = 1 (higher resolution)


And here, at higher resolution still, are power-spirals for all the possible leading digits of 2^p, 1..9 (some spirals look very similar, so you have to compare those ones carefully):

Power-spiral for 2^p, leading-digit = 1 (very high resolution)


Power-spiral for 2^p, leading-digit = 2


Power-spiral for 2^p, ld = 3


Power-spiral for 2^p, ld = 4


Power-spiral for 2^p, ld = 5


Power-spiral for 2^p, ld = 6


Power-spiral for 2^p, ld = 7


Power-spiral for 2^p, ld = 8


Power-spiral for 2^p, ld = 9


Power-spiral for 2^p, ld = 1..9 (animated)


Now try the power-spiral of 2^p, ld = 1, in some other bases:

Power-spiral for 2^p, leading-digit = 1, base = 9


Power-spiral for 2^p, ld = 1, b = 15


You can also try power-spirals for other n^p. Here’s 3^p:

Power-spiral for 3^p, ld = 1, b = 10


Power-spiral for 3^p, ld = 2, b = 10


Power-spiral for 3^p, ld = 1, b = 4


Power-spiral for 3^p, ld = 1, b = 7


Power-spiral for 3^p, ld = 1, b = 18


Elsewhere Other-Accessible…

Wake the Snake — an earlier look at the digits of 2^p

Twi-Phi

Here’s a pentagon:

Stage #1


And here’s the pentagon with smaller pentagons on its vertices:

Stage #2


And here’s more of the same:

Stage #3


Stage #4


Stage #5


Stage #6


Stage #7


Stage #8


Animated fractal


At infinity, the smaller pentagons have reached out like arms to exactly fill the gaps between themselves without overlapping. But how much smaller is each set of smaller pentagons than its mother-pentagon when the gaps are exactly filled? Well, if the radius of the mother-pentagon is r, then the radius of each daughter-pentagon is r * 1/(φ^2) = r * 0·38196601125…

But what happens if the radius relationship of mother to daughter is r * 1/φ = r * 0·61803398874 = r * (φ-1)? Then you get this fractal:

Stage #1


Stage #2


Stage #3


Stage #4


Stage #5


Stage #6


Stage #7


Stage #8


Stage #9


Animated fractal


Plow-Pair

Futoshiki is fun. It’s a number-puzzle where you use logic to re-create a 5×5 square in which every row and column contains the numbers 1 to 5. At first, most or all of the numbers are missing. You work out what those missing numbers are by using the inequality signs scattered over the futoshiki. Here’s an example:


There are no numbers at all in the futoshiki, so where do you start? Well, first let’s establish some vocabulary for discussing futoshiki. If we label squares by row and column, you can say that square (4,5), just above the lower righthand corner, dominates square (4,4), because (4,5) is on the dominant side of the inequality sign between the two squares (futōshiki, 不等式, means “inequality” in Japanese). Whatever individual number is in (4,5) must be greater than whatever individual number is in (4,4).

Conversely, you can say that (4,4) is dominated by (4,5). But that’s not the end of it: (4,4) is dominated by (4,5) but dominates (3,4), which in its turn dominates (2,4). In other words, there’s a chain of dominations. In this case, it’s a 4-chain, that is, it’s four squares long: (4,5) > (4,4) > (3,4) > (2,4), where (4,5) is the start-square and (2,4) is the end-square. Now, because 5 is the highest number in a 5×5 futoshiki, it can’t be in any square dominated by another square. And because 1 is always the lowest number in a futoshiki, it can’t be in any square that dominates another square. By extending that logic, you’ll see that 4 can’t be in the end-square of a 3-chain, (a,b) > (c,d) > (e,f), and 2 can’t be in the start-square of a 3-chain. Nor can 3 be in the start-square or end-square of a 4-chain.

Using all that logic, you can start excluding numbers from certain squares and working out sets of possible numbers in each square, like this:

[whoops: square contains errors that need to be corrected!]


Now look at column 1 and at row 4:


In column 1, the number 5 appears only once among the possibles, in (1,1); in row 4, the number 1 appears only once among the possibles, in (4,1). And if a number appears in only one square of a row or column, you know that it must be the number filling that particular square. So 5 must be the number filling (1,1) and 1 must be the number filling (4,1). And once a square is filled by a particular number, you can remove it from the sets of possibles filling the other squares of the row and column. I call this sweeping the row and column. Voilà:


Now that the 5 in (1,1) and the 1 in (4,1) have swept all other occurrences of 5 and 1 from the sets of possibles in column 1 and row 4, you can apply the only-once rule again. 2 appears only once in row 4 and 5 appears only once in column 4:


So you’ve got two more filled squares:


Now you can apply a more complex piece of logic. Look at the sets of possibles in row 3 and you’ll see that the set {2,3} occurs twice, in square (3,1) and square (3,4):


What does this double-occurrence of {2,3} mean? It means that if 2 is in fact the number filling (3,1), then 3 must be the number filling (3,4). And vice versa. Therefore 2 and 3 can occur only in those two squares and the two numbers can be excluded or swept from the sets of possibles filling the other squares in that row. You could call {2,3} a plow-pair or plow-pare, because it’s a pair that pares 2 and 3 from the other squares. So we have a pair-rule: if the same pair of possibles, {a,b}, appears in two squares in a row or column, then both a and b can be swept from the three other squares in that row or column. Using {2,3}, let’s apply the pair-rule to the futoshiki and run the plow-pare over row 3:


Now the pair-rule applies again, because {4,5} occurs twice in column 5:


And once the plow-pare has swept 4 and 5 from the other three squares in column 5, you’ll see that 3 is the only number left in square (1,5). Therefore 3 must fill (1,5):


Now 3 can be swept from the rest of row 1 and column 5:


And the pair-rule applies again, because {1,2} occurs twice in row 2:


Once 2 is swept from {2,3,4} in square (2,1) to leave {3,4}, 3 must be excluded from square (2,2), because (2,2) dominates (2,1) and 3 can’t be greater than itself. And once 3 is excluded from (2,2), it occurs only once in column 2:


Therefore 3 must fill (5,2), which dominates (5,1) and its set of possibles {2,3,4}. Because 3 can’t be greater than 4 or itself, 2 is the only possible filler for (5,1) and only 3 is left when 2 is swept from (3,1):


And here are the remaining steps in completing the futoshiki:

The complete futoshiki


Animation of the steps required to complete the futoshiki


Afterword

The pair-rule can be extended to a triplet-rule and quadruplet-rule:

• If three numbers {a,b,c} can occur in only three squares of a row or column, then a, b and c can be swept from the two remaining squares of the row or column.
• If four numbers {a,b,c,d} can occur in only four squares of a row or column, then a, b, c and d can be swept from the one remaining square of the row or column (therefore the number e must fill that remaining square).

But you won’t be able to apply the triplet-rule and quadruplet-rule as often as the pair-rule. Note also that the triplet-rule doesn’t work when {a,b,c} can occur in only two squares of a row or column. An n-rule applies only when the same n numbers of a set occur in n squares of a row or column. And n must be less than 5.


Post-Performative Post-Scriptum

Domination. Exclusion. Inequality. — an earlier look at futoshiki