Back to Frac’

Here’s a second serendipitous fractal:

A serendipitous fractal on a fract-L


It looks like (and is related to) the limestone fractal and I found it similarly serendipitously. This time I was looking at continued fractions, a simple yet subtle and seductive way of representing non-integer numbers like 2/3 and 7/9 (or √2 and π). To generate a continued fraction from a/b < 1, you divide a/b into 1 and take away the integer part. Then you repeat with the remainder until nothing is left (or, as with irrationals like 1/√2 and 1/π, you've calculated long enough for your needs). The integers at each stage are the numbers of the continued fraction. Here is the working for contfrac(2/3), the continued fraction of 2/3:

int(1/(2/3)) = int(3/2) = int(1.5) = 1
3/2 – 1 = 1/2
int(1/(1/2)) = int(2) = 2
2 – 2 = 0

contfrac(2/3) = 1, 2

By working backwards with (1, 2), you can use the continued fraction to reconstruct the original number a/b. Start with a/b = 0/1:

1 / (0/1 + 2) = 1 / ((0+2*1)/2) = 1 / (2/1) = 1/2
1 / (1/2 + 1) = 1 / ((1+2*1)/2) = 1 / (3/2) = 2/3

And here’s the working for contfrac(7/9), the continued fraction of 7/9:

int(1/(7/9)) = int(9/7) = int(1.285714…) = 1
9/7 – 1 = 2/7
int(1/(2/7)) = int(7/2) = int(3.5) = 3
7/2 – 3 = 1/2
int(1/(1/2)) = int(2) = 2
2 – 2 = 0

contfrac(7/9) = 1, 3, 2

And here’s the reconstruction of 7/9 from its continued fraction, starting again with a/b = 0/1:

1 / (0/1 + 2) = 1 / ((0+2*1)/2) = 1 / (2/1) = 1/2
1 / (1/2 + 3) = 1 / ((1+2*3)/2) = 1 / (7/2) = 2/7
1 / (2/7 + 1) = 1 / ((2+7*1)/7) = 1 / (9/7) = 7/9

From that simple algorithm arise subtle and seductive things. Look at some continued fractions, cf(a/b), for a/b in simplest form (giving only the first few reciprocals, 1/b, because cf(1/b) = b). Interesting patterns appear, e.g. when a/b uses adjacent or nearly adjacent Fibonacci numbers:

cf(1/3) = 3 = cf(0.333333333…)
cf(2/3) = 1,2 = cf(0.666666666…)
cf(1/4) = 4 = cf(0.25)
cf(3/4) = 1,3 = cf(0.75)
cf(1/5) = 5 = cf(0.2)
cf(2/5) = 2,2 = cf(0.4)
cf(3/5) = 1,1,2 = cf(0.6)
cf(4/5) = 1,4 = cf(0.8)
cf(5/6) = 1,5 = cf(0.833333333…)
cf(2/7) = 3,2 = cf(0.285714285…)
cf(3/7) = 2,3 = cf(0.428571428…)
cf(4/7) = 1,1,3 = cf(0.571428571…)
cf(5/7) = 1,2,2 = cf(0.714285714…)
cf(6/7) = 1,6 = cf(0.857142857…)
cf(3/8) = 2,1,2 = cf(0.375)
cf(5/8) = 1,1,1,2 = cf(0.625)
cf(7/8) = 1,7 = cf(0.875)
cf(2/9) = 4,2 = cf(0.222222222…)
cf(4/9) = 2,4 = cf(0.444444444…)
cf(5/9) = 1,1,4 = cf(0.555555555…)
cf(7/9) = 1,3,2 = cf(0.777777777…)
cf(8/9) = 1,8 = cf(0.888888888…)
cf(3/10) = 3,3 = cf(0.3)
cf(7/10) = 1,2,3 = cf(0.7)
cf(9/10) = 1,9 = cf(0.9)
cf(2/11) = 5,2 = cf(0.181818181…)
cf(3/11) = 3,1,2 = cf(0.272727272…)
cf(4/11) = 2,1,3 = cf(0.363636363…)
cf(5/11) = 2,5 = cf(0.454545454…)
cf(6/11) = 1,1,5 = cf(0.545454545…)
cf(7/11) = 1,1,1,3 = cf(0.636363636…)
cf(8/11) = 1,2,1,2 = cf(0.727272727…)
cf(9/11) = 1,4,2 = cf(0.818181818…)
cf(10/11) = 1,10 = cf(0.909090909…)
cf(5/12) = 2,2,2 = cf(0.416666666…)
cf(7/12) = 1,1,2,2 = cf(0.583333333…)
cf(11/12) = 1,11 = cf(0.916666666…)
cf(2/13) = 6,2 = cf(0.153846153…)
cf(3/13) = 4,3 = cf(0.230769230…)
cf(4/13) = 3,4 = cf(0.307692307…)
cf(5/13) = 2,1,1,2 = cf(0.384615384…)
cf(6/13) = 2,6 = cf(0.461538461…)
cf(7/13) = 1,1,6 = cf(0.538461538…)
cf(8/13) = 1,1,1,1,2 = cf(0.615384615…)
cf(9/13) = 1,2,4 = cf(0.692307692…)
cf(10/13) = 1,3,3 = cf(0.769230769…)
cf(11/13) = 1,5,2 = cf(0.846153846…)
cf(12/13) = 1,12 = cf(0.923076923…)
cf(3/14) = 4,1,2 = cf(0.214285714…)
cf(5/14) = 2,1,4 = cf(0.357142857…)
cf(9/14) = 1,1,1,4 = cf(0.642857142…)
cf(11/14) = 1,3,1,2 = cf(0.785714285…)
cf(13/14) = 1,13 = cf(0.928571428…)
cf(2/15) = 7,2 = cf(0.133333333…)
cf(4/15) = 3,1,3 = cf(0.266666666…)
cf(7/15) = 2,7 = cf(0.466666666…)
cf(8/15) = 1,1,7 = cf(0.533333333…)
cf(11/15) = 1,2,1,3 = cf(0.733333333…)
cf(13/15) = 1,6,2 = cf(0.866666666…)
cf(14/15) = 1,14 = cf(0.933333333…)
cf(3/16) = 5,3 = cf(0.1875)
cf(5/16) = 3,5 = cf(0.3125)
cf(7/16) = 2,3,2 = cf(0.4375)

After investigating some of those patterns, I wondered what happened when you reversed the continued fraction cf(a/b) and used those reversed numbers backward (that is, used the numbers of cf(a/b) forward) to generate another and different a/b. And a/b will always be different unless cf(a/b) is a palindrome, like cf(5/12) = 2,2,2 or cf(5/13) = 2,1,1,2 or cf(4/15) = 3,1,3. Note that a continued fraction never ends in 1, so that when reversing, say, cf(5/8) = (1, 1, 1, 2), you need an adjustment from (2, 1, 1, 1) to (2, 1, 1+1) = (2, 1, 2). Here’s a little of what happens when you reverse cf(a1/b1) to generate a2/b2:

cf(1/2) = 2 → 2 = cf(1/2)
1/2 = 0.5 : 0.5 = 1/2
cf(1/3) = 3 → 3 = cf(1/3)
1/3 = 0.333333333 : 0.333333333 = 1/3
cf(2/3) = 1, 2 → 2, 1 → 3 = cf(1/3)
2/3 = 0.666666666 : 0.333333333 = 1/3
cf(3/4) = 1, 3 → 3, 1 → 4 = cf(1/4)
3/4 = 0.75 : 0.25 = 1/4
cf(2/5) = 2, 2 → 2, 2 = cf(2/5)
2/5 = 0.4 : 0.4 = 2/5
cf(3/5) = 1, 1, 2 → 2, 1, 1 → 2, 2 = cf(2/5)
3/5 = 0.6 : 0.4 = 2/5
cf(4/5) = 1, 4 → 4, 1 → 5 = cf(1/5)
4/5 = 0.8 : 0.2 = 1/5
cf(5/6) = 1, 5 → 5, 1 → 6 = cf(1/6)
5/6 = 0.833333333 : 0.166666666 = 1/6
cf(2/7) = 3, 2 → 2, 3 = cf(3/7)
2/7 = 0.285714286 : 0.428571428 = 3/7
cf(3/7) = 2, 3 → 3, 2 = cf(2/7)
3/7 = 0.428571429 : 0.285714286 = 2/7
cf(4/7) = 1, 1, 3 → 3, 1, 1 → 3, 2 = cf(2/7)
4/7 = 0.571428571 : 0.285714286 = 2/7
cf(5/7) = 1, 2, 2 → 2, 2, 1 → 2, 3 = cf(3/7)
5/7 = 0.714285714 : 0.428571429 = 3/7
cf(6/7) = 1, 6 → 6, 1 → 7 = cf(1/7)
6/7 = 0.857142857 : 0.142857143 = 1/7
cf(3/8) = 2, 1, 2 → 2, 1, 2 = cf(3/8)
0.375 : 0.375
cf(5/8) = 1, 1, 1, 2 → 2, 1, 1, 1 → 2, 1, 2 = cf(3/8)
0.625 : 0.375
cf(7/8) = 1, 7 → 7, 1 → 8 = cf(1/8)
0.875 : 0.125
cf(2/9) = 4, 2 → 2, 4 = cf(4/9)
0.222222222 : 0.444444444
cf(4/9) = 2, 4 → 4, 2 = cf(2/9)
0.444444444 : 0.222222222

And if you plot x = a1/b1 and y = (a2/b2 * 2) on a fract-L, that is, a graph whose horizontal and vertical arms represent 0 to 1, you get the fractal right at the beginning:

Fract-L for x = a1/b1 and y = (a2/b2 * 2), where a2/b2 is generated from reversed(cf(a1/b1))


You need to use (a2/b2 * 2) because a2/b2 from reversed(cf(a1/b1)) is always <= 0.5, so using raw a2/b2 generates this graph:

Fract-L for x = a1/b1 and y = a2/b2 (i.e. a2/b2 is unadjusted)


Why is it always true that a2/b2 <= 0.5? For two reasons. First, a/b > 0.5 always generate continued fractions that start with 1, like cf(2/3) = 1, 2 or cf(3/4) = 1, 3 or cf(3/5) = 1, 1, 2. Second, as previously mentioned, no continued fraction ends with 1. Therefore a reversed cf(a1/b1), where the final number, n > 1, moves to the beginning, will never begin with 1 and the a2/b2 generated from reversed(cf(a1/b1)) will always be less than 0.5 (or equal to it in the solitary case of cf(1/2) = 2).

Now let's look at the development of the fractal as a1/b1 uses larger and larger denominators:

Fract-L for x = a1/b1 and y = (a2/b2 * 2) for a1/b1 <= 6/7


Fract-L for for a1/b1 <= 14/15


Fract-L for a1/b1 <= 30/31


Fract-L for a1/b1 <= 62/63


Fract-L for a1/b1 <= 126/127


Fract-L for a1/b1 <= 254/255


Fract-L for a1/b1 <= 357/358


Fract-L for a1/b1 <= 467/468


Animated fract-L for x = a1/b1 and y = (a2/b2 * 2) (animated at ezGif)


The fractal changes subtly when you restrict the b1 of a1/b1 in some way, say using multiples of 2, 3, 4, 5…:

Fract-L for x = a1/b1 and y = (a2/b2 * 2) for b1 = n = 2, 3, 4, 5, 6, 7, 8…


Fract-L for b1 = 2n = 2, 4, 6, 8, 10…


Fract-L for b1 = 3n = 3, 6, 9, 12, 15…


Fract-L for b1 = 4n


Fract-L for b1 = 5n


Fract-L for b1 = 6n


Animated fract-L for b1 = 1n..12n (animated at ezGif)


Finally, here are fract-Ls when b1 is a triangular, square, hexagonal or octagonal number:

Fract-L for x = a1/b1 and y = (a2/b2 * 2) for triangular(b1) = 3, 6, 10, 15, 21, 28,…


Fract-L for square(b1) = 4, 9, 16, 25, 36, 49,…


Fract-L for hexagonal(b1) = 6, 15, 28, 45, 66, 91,…


Fract-L for octagonal(b1) = 8, 21, 40, 65, 96, 133,…


Elsewhere Other-Accessible…

Back to Drac’ — a parallel pun for a pre-previous fractal
I Like Gryke — a first look at the limestone fractal
Lime Time — more on the limestone fractal

Fractional Fractal Fract-Ls

This is the surpassingly special Stern-Brocot sequence:

0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19, … (A002487 at the Online Encyclopedia of Integer Sequences)


And why is the sequence special? Because if you take successive pairs of the apparently arbitrarily varying numbers, you get every rational fraction in its simplest form exactly once. So 1/2, 2/3, 6/11 and 502/787 appear once and then never again. And so do 2/1, 3/2, 11/6 and 787/502. Et cetera, ad infinitum. If you map the Stern-Brocot sequence against the related Calkin-Wilk sequence, which has the same “all-simplest-fractions-exactly-once” properties, you can create this fractal, which I call a limestone fractal or gryke fractal:

Gryke fractal by mapping Stern-Brocot sequence against Calkin-Wilf sequence


The graph is what I call a Fract-L, because the lines for the x,y coordinates create an L. Each coordinate runs from 0 to 1, with the x set by the fraction from the Stern-Brocot sequence and the y set by the fraction from the Calkin-Wilf sequence (if a > b in a/b, use the conversion 1/(a/b) = b/a). But you can also find interesting patterns by mapping the Stern-Brocot sequence against itself. That is, you use two Stern-Brocot sequences that start in different places. Now, there are complicated ways to create the Stern-Brocot sequence using mathematical trees and sequential algorithms and so on. But there’s also an astonishingly simple way, a formula created by the Israeli mathematician Moshe Newman. If (a,b) is one pair of successive numbers in the sequence, the next pair (a,b) is found like this:

c = b
b = (2 * int(a/b) + 1) * b – a
a = c

This means that you can seed a Stern-Brocot sequence with any (correctly simplified) a/b and it will continue in the right way. If the two SB-sequences for x and y are both seeded with (0,1), you get this 45° line, because each successive a/b for (x,y) is identical:

Stern-Brocot pairs seeded with x ← (0,1) and y ← (0,1)


The further you extend the sequences, the less broken the 45° line will appear, because the points determined by a/b for x and y will get closer and closer together (but the line will never be solid, because any two rationals are separated by an infinity of irrationals). Now try offsetting the SB-sequences for x,y by using different seeds. Different fractal patterns appear, which all appear to be subsets (or fractions) of the limestone fractal above (see animated gif below):

Stern-Brocot pairs seeded with x ← (0,1) and y ← (1,1)


x ← (0,1) and y ← (1,2)


x ← (0,1) and y ← (1,3)


x ← (0,1) and y ← (2,3)


x ← (0,1) and y ← (3,4)


x ← (0,1) and y ← (6,7)


x ← (1,2) and y ← (1,9)


x ← (1,4) and y ← (1,6)


x ← (1,7) and y ← (1,8)


x ← (2,3) and y ← (4,5) — apparently identical to x ← (1,4) and y ← (1,6) above


x ← (26,25) and y ← (1,10)


Gryke fractal compared with Stern-Brocot-pair patterns (animated at ezGif)


And here’s what happens when the seed-fractions for x run from 1/3 to 12/13, while the seed-fraction for y is held constant at 1/23:

x ← (1,13) and y ← (1,23)


x ← (2,13) and y ← (1,23)


x ← (3,13) and y ← (1,23)


x ← (4,13) and y ← (1,23)


x ← (5,13) and y ← (1,23)


x ← (6,13) and y ← (1,23)


x ← (7,13) and y ← (1,23)


x ← (8,13) and y ← (1,23)


x ← (9,13) and y ← (1,23)


x ← (10,13) and y ← (1,23)


x ← (11,13) and y ← (1,23)


x ← (12,13) and y ← (1,23)


Animated gif for x ← (n,13) and y ← (1,23) (animated at ezGif)


Previously Pre-Posted

I Like Gryke — a first look at the limestone fractal
Lime Time — more on the fractal

Fractional Fractal

Serendipity in some simplification statistics. That’s what I encountered the other day. I was looking at the ways to simplify this set of fractions:

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

The underlined fractions are not in their simplest possible form. For example, 2/4 simplifies to 1/2, 2/6 to 1/3, 3/6 to 1/2, and so on:

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

I counted the number of times the simplest possible fractions occurred when simplifying all fractions a/b for (b = 2..n, a = 1..b-1), then displayed the stats as a graph running from 0/1 to 1/1. And there was serendipity in these simplification statistics, because a fractal had appeared:

Graph for count of simplest possible fractions from a/b for (b = 2..n, a = 1..b-1)


It’s interesting to work out what fractions appear where. For example, the peak in the middle is 1/2, but what are the next-highest peaks on either side? The answers are more obvious in the colored version of the graph:

Colored graph for count of simplest possible fractions
Key: n/2, n/3, n/4, n/5, n/6, n/7


The line for 1/2 is red, the lines for 1/3 and 2/3 in light green, the lines for 1/4 and 3/4 in yellow, and so on. But those graphs appear in an equilateral triangle, as it were. The fractals get easier to see in the full-sized versions of these widened graphs:

Widened graph for count of simplest possible fractions from a/b for (b = 2..n, a = 1..b-1)

(click for full size)


Widened and colored graph for count of simplest possible fractions

(click for full size)


Powers of Persistence

“The persistence of a number is the number of times you need to multiply the digits together before reaching a single digit.” — OEIS

Base 5

23 → 11 → 1 in b5 (c=3) (n=13 in b10)
233 → 33 → 14 → 4 in b5 (c=4) (n=68 in b10)
33334 → 2244 → 224 → 31 → 3 in b5 (c=5) (n=2344 in b10)
444444444444 → 13243332331 → 333124 → 1331 → 14 → 4 in b5 (c=6) (n=244140624 in b10)
3344444444444444444444 → 2244112144242244414 → 13243332331 → 333124 → 1331 → 14 → 4 in b5 (c=7) (n=1811981201171874 in b10)


Base 6

23 → 10 → 0 in b6 (c=3) (n=15 in b10)
35 → 23 → 10 → 0 in b6 (c=4) (n=23 in b10)
444 → 144 → 24 → 12 → 2 in b6 (c=5) (n=172 in b10)
24445 → 2544 → 424 → 52 → 14 → 4 in b6 (c=6) (n=3629 in b10)


Base 7

24 → 11 → 1 in b7 (c=3) (n=18 in b10)
36 → 24 → 11 → 1 in b7 (c=4) (n=27 in b10)
245 → 55 → 34 → 15 → 5 in b7 (c=5) (n=131 in b10)
4445 → 635 → 156 → 42 → 11 → 1 in b7 (c=6) (n=1601 in b10)
44556 → 6666 → 3531 → 63 → 24 → 11 → 1 in b7 (c=7) (n=11262 in b10)
5555555 → 443525 → 6666 → 3531 → 63 → 24 → 11 → 1 in b7 (c=8) (n=686285 in b10)
444555555555555666 → 465556434443526 → 115443241155 → 256641 → 4125 → 55 → 34 → 15 → 5 in b7 (c=9) (n=1086400325525346 in b10)


Base 8

24 → 10 → 0 in b8 (c=3) (n=20 in b10)
37 → 25 → 12 → 2 in b8 (c=4) (n=31 in b10)
256 → 74 → 34 → 14 → 4 in b8 (c=5) (n=174 in b10)
2777 → 1256 → 74 → 34 → 14 → 4 in b8 (c=6) (n=1535 in b10)
333555577 → 3116773 → 5126 → 74 → 34 → 14 → 4 in b8 (c=7) (n=57596799 in b10)


Base 9

25 → 11 → 1 in b9 (c=3) (n=23 in b10)
38 → 26 → 13 → 3 in b9 (c=4) (n=35 in b10)
57 → 38 → 26 → 13 → 3 in b9 (c=5) (n=52 in b10)
477 → 237 → 46 → 26 → 13 → 3 in b9 (c=6) (n=394 in b10)
45788 → 13255 → 176 → 46 → 26 → 13 → 3 in b9 (c=7) (n=30536 in b10)
2577777 → 275484 → 13255 → 176 → 46 → 26 → 13 → 3 in b9 (c=8) (n=1409794 in b10)


Base 10

25 → 10 → 0 (c=3)
39 → 27 → 14 → 4 (c=4)
77 → 49 → 36 → 18 → 8 (c=5)
679 → 378 → 168 → 48 → 32 → 6 (c=6)
6788 → 2688 → 768 → 336 → 54 → 20 → 0 (c=7)
68889 → 27648 → 2688 → 768 → 336 → 54 → 20 → 0 (c=8)
2677889 → 338688 → 27648 → 2688 → 768 → 336 → 54 → 20 → 0 (c=9)
26888999 → 4478976 → 338688 → 27648 → 2688 → 768 → 336 → 54 → 20 → 0 (c=10)
3778888999 → 438939648 → 4478976 → 338688 → 27648 → 2688 → 768 → 336 → 54 → 20 → 0 (c=11)
277777788888899 → 4996238671872 → 438939648 → 4478976 → 338688 → 27648 → 2688 → 768 → 336 → 54 → 20 → 0 (c=12)


Base 11

26 → 11 → 1 in b11 (c=3) (n=28 in b10)
3A → 28 → 15 → 5 in b11 (c=4) (n=43 in b10)
69 → 4A → 37 → 1A → A in b11 (c=5) (n=75 in b10)
269 → 99 → 74 → 26 → 11 → 1 in b11 (c=6) (n=317 in b10)
3579 → 78A → 46A → 1A9 → 82 → 15 → 5 in b11 (c=7) (n=4684 in b10)
26778 → 3597 → 78A → 46A → 1A9 → 82 → 15 → 5 in b11 (c=8) (n=38200 in b10)
47788A → 86277 → 3597 → 78A → 46A → 1A9 → 82 → 15 → 5 in b11 (c=9) (n=757074 in b10)
67899AAA → 143A9869 → 299596 → 2A954 → 2783 → 286 → 88 → 59 → 41 → 4 in b11 (c=10) (n=130757439 in b10)
77777889999 → 2AA174996A → 143A9869 → 299596 → 2A954 → 2783 → 286 → 88 → 59 → 41 → 4 in b11 (c=11) (n=199718348047 in b10)


Base 12

26 → 10 → 0 in b12 (c=3) (n=30 in b10)
3A → 26 → 10 → 0 in b12 (c=4) (n=46 in b10)
6B → 56 → 26 → 10 → 0 in b12 (c=5) (n=83 in b10)
777 → 247 → 48 → 28 → 14 → 4 in b12 (c=6) (n=1099 in b10)
AAB → 778 → 288 → A8 → 68 → 40 → 0 in b12 (c=7) (n=1571 in b10)
3577777799 → 3BA55B53 → 557916 → 5576 → 736 → A6 → 50 → 0 in b12 (c=8) (n=17902874277 in b10)


Base 13

27 → 11 → 1 in b13 (c=3) (n=33 in b10)
3B → 27 → 11 → 1 in b13 (c=4) (n=50 in b10)
5A → 3B → 27 → 11 → 1 in b13 (c=5) (n=75 in b10)
9A → 6C → 57 → 29 → 15 → 5 in b13 (c=6) (n=127 in b10)
27A → AA → 79 → 4B → 35 → 12 → 2 in b13 (c=7) (n=439 in b10)
8AC → 58B → 27B → BB → 94 → 2A → 17 → 7 in b13 (c=8) (n=1494 in b10)
35AB → 99C → 59A → 288 → 9B → 78 → 44 → 13 → 3 in b13 (c=9) (n=7577 in b10)
9BBB → 55B6 → 99C → 59A → 288 → 9B → 78 → 44 → 13 → 3 in b13 (c=10) (n=21786 in b10)
2999BBC → 591795 → 65B5 → 99C → 59A → 288 → 9B → 78 → 44 → 13 → 3 in b13 (c=11) (n=13274091 in b10)
28CCCCCC → 9B89B93 → 591795 → 65B5 → 99C → 59A → 288 → 9B → 78 → 44 → 13 → 3 in b13 (c=12) (n=168938314 in b10)
377AAAABCCC → 2833B38BCB → B588A8A → 777995 → 4B2CA → 4A64 → 58B → 27B → BB → 94 → 2A → 17 → 7 in b13 (c=13) (n=494196864368 in b10)


Base 14

27 → 10 → 0 in b14 (c=3) (n=35 in b10)
3C → 28 → 12 → 2 in b14 (c=4) (n=54 in b10)
5B → 3D → 2B → 18 → 8 in b14 (c=5) (n=81 in b10)
99 → 5B → 3D → 2B → 18 → 8 in b14 (c=6) (n=135 in b10)
359 → 99 → 5B → 3D → 2B → 18 → 8 in b14 (c=7) (n=667 in b10)
CCC → 8B6 → 29A → CC → A4 → 2C → 1A → A in b14 (c=8) (n=2532 in b10)
359AB → 55AA → CA8 → 4C8 → 1D6 → 58 → 2C → 1A → A in b14 (c=9) (n=130883 in b10)
CDDDD → 8CC8C → 2C436 → 8B6 → 29A → CC → A4 → 2C → 1A → A in b14 (c=10) (n=499407 in b10)
3ABBDDDD → DAAAD54 → 63DAC8 → 5BC1A → 2596 → 2A8 → B6 → 4A → 2C → 1A → A in b14 (c=11) (n=397912927 in b10)
488AABCCCDDD → 39A59889584 → A89DBD84 → 598D14C → 5BC1A → 2596 → 2A8 → B6 → 4A → 2C → 1A → A in b14 (c=12) (n=18693488093783 in b10)


Base 15

28 → 11 → 1 in b15 (c=3) (n=38 in b10)
3D → 29 → 13 → 3 in b15 (c=4) (n=58 in b10)
5E → 4A → 2A → 15 → 5 in b15 (c=5) (n=89 in b10)
28C → CC → 99 → 56 → 20 → 0 in b15 (c=6) (n=582 in b10)
8AE → 4EA → 275 → 4A → 2A → 15 → 5 in b15 (c=7) (n=1964 in b10)
5BBB → 1E8A → 4EA → 275 → 4A → 2A → 15 → 5 in b15 (c=8) (n=19526 in b10)
BBBCC → 3BBC9 → B939 → BD3 → 1D9 → 7C → 59 → 30 → 0 in b15 (c=9) (n=596667 in b10)
2999BDE → 3C9CE6 → 66B7C → 9CC9 → 36C9 → 899 → 2D3 → 53 → 10 → 0 in b15 (c=10) (n=30104309 in b10)
39BBCCCCCD → 41CBD6D4C → 23C96E6 → 66B7C → 9CC9 → 36C9 → 899 → 2D3 → 53 → 10 → 0 in b15 (c=11) (n=140410607143 in b10)


Base 16

28 → 10 → 0 in b16 (c=3) (n=40 in b10)
3E → 2A → 14 → 4 in b16 (c=4) (n=62 in b10)
5F → 4B → 2C → 18 → 8 in b16 (c=5) (n=95 in b10)
BB → 79 → 3F → 2D → 1A → A in b16 (c=6) (n=187 in b10)
2AB → DC → 9C → 6C → 48 → 20 → 0 in b16 (c=7) (n=683 in b10)
3DDE → 1BBA → 4BA → 1B8 → 58 → 28 → 10 → 0 in b16 (c=8) (n=15838 in b10)
379BDD → 55C77 → 396C → 798 → 1F8 → 78 → 38 → 18 → 8 in b16 (c=9) (n=3644381 in b10)


Base 17

29 → 11 → 1 in b17 (c=3) (n=43 in b10)
3F → 2B → 15 → 5 in b17 (c=4) (n=66 in b10)
5G → 4C → 2E → 1B → B in b17 (c=5) (n=101 in b10)
9F → 7G → 6A → 39 → 1A → A in b17 (c=6) (n=168 in b10)
CE → 9F → 7G → 6A → 39 → 1A → A in b17 (c=7) (n=218 in b10)
3DD → 1CE → 9F → 7G → 6A → 39 → 1A → A in b17 (c=8) (n=1101 in b10)
9CF → 5A5 → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=9) (n=2820 in b10)
2AFF → F9C → 5A5 → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=10) (n=12986 in b10)
55DDF → CF4G → 25EB → 55A → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=11) (n=446163 in b10)
39DDGG → DGCG7 → 35F54 → F9C → 5A5 → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=12) (n=5079174 in b10)
DEGGGG → 86DCDC → DGCG7 → 35F54 → F9C → 5A5 → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=13) (n=19710955 in b10)
6BBBBBEEF → 6FBEB7G8 → 5B39ACE → 1CED8G → 35F54 → F9C → 5A5 → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=14) (n=46650378808 in b10)
2BDDDDDEEEEEF → 1FBBBB76B714 → 6FBEB7G8 → 5B39ACE → 1CED8G → 35F54 → F9C → 5A5 → EC → 9F → 7G → 6A → 39 → 1A → A in b17 (c=15) (n=1570081251102035 in b10)


Base 18

29 → 10 → 0 in b18 (c=3) (n=45 in b10)
3F → 29 → 10 → 0 in b18 (c=4) (n=69 in b10)
5E → 3G → 2C → 16 → 6 in b18 (c=5) (n=104 in b10)
8D → 5E → 3G → 2C → 16 → 6 in b18 (c=6) (n=157 in b10)
2BB → D8 → 5E → 3G → 2C → 16 → 6 in b18 (c=7) (n=857 in b10)
2CEG → GAC → 5GC → 2H6 → B6 → 3C → 20 → 0 in b18 (c=8) (n=15820 in b10)
AABF → 2EGC → GAC → 5GC → 2H6 → B6 → 3C → 20 → 0 in b18 (c=9) (n=61773 in b10)
8GGHH → 5B8DE → DD2G → GC8 → 4D6 → H6 → 5C → 36 → 10 → 0 in b18 (c=10) (n=938627 in b10)
AAAAAAH → 8HGH28 → 5B8DE → DD2G → GC8 → 4D6 → H6 → 5C → 36 → 10 → 0 in b18 (c=11) (n=360129437 in b10)


Base 19

2A → 11 → 1 in b19 (c=3) (n=48 in b10)
3G → 2A → 11 → 1 in b19 (c=4) (n=73 in b10)
5F → 3I → 2G → 1D → D in b19 (c=5) (n=110 in b10)
AB → 5F → 3I → 2G → 1D → D in b19 (c=6) (n=201 in b10)
DH → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=7) (n=264 in b10)
2BC → DH → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=8) (n=943 in b10)
7BG → 37G → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=9) (n=2752 in b10)
DII → BCD → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=10) (n=5053 in b10)
4AAH → IFH → CDB → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=11) (n=31253 in b10)
3BGII → 15HGF → 2I9D → BCD → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=12) (n=472548 in b10)
EEFHH → 69GBI → 15HGF → 2I9D → BCD → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=13) (n=1926275 in b10)
ADEFFH → 2F7HHE → 69GBI → 15HGF → 2I9D → BCD → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=14) (n=26556906 in b10)
4ADDDDEEF → 3E7919IH → 2HH7FE → 69GBI → 15HGF → 2I9D → BCD → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=15) (n=77518543969 in b10)
9999999BBFHHHI → 6B41DG4CB3BG → H27A5F3D → 2F7HHE → 69GBI → 15HGF → 2I9D → BCD → 4E6 → HD → BC → 6I → 5D → 38 → 15 → 5 in b19 (c=16) (n=399503342991325867 in b10)


Base 20

2A → 10 → 0 in b20 (c=3) (n=50 in b10)
3H → 2B → 12 → 2 in b20 (c=4) (n=77 in b10)
6D → 3I → 2E → 18 → 8 in b20 (c=5) (n=133 in b10)
7J → 6D → 3I → 2E → 18 → 8 in b20 (c=6) (n=159 in b10)
DI → BE → 7E → 4I → 3C → 1G → G in b20 (c=7) (n=278 in b10)
6DE → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=8) (n=2674 in b10)
CGG → 7DC → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=9) (n=5136 in b10)
2BHI → GGC → 7DC → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=10) (n=20758 in b10)
CDGG → 4JGG → 28CG → 7DC → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=11) (n=101536 in b10)
2DEGJ → DGCG → 4JGG → 28CG → 7DC → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=12) (n=429939 in b10)
77BBHJ → BJ7D7 → GCGD → 4JGG → 28CG → 7DC → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=13) (n=23612759 in b10)
BBBCEEHHHHH → 8DCB4G21J4 → 21ED4J4 → DGCG → 4JGG → 28CG → 7DC → 2EC → GG → CG → 9C → 58 → 20 → 0 in b20 (c=14) (n=118569903663157 in b10)


Base 21

2B → 11 → 1 in b21 (c=3) (n=53 in b10)
3I → 2C → 13 → 3 in b21 (c=4) (n=81 in b10)
6H → 4I → 39 → 16 → 6 in b21 (c=5) (n=143 in b10)
AK → 9B → 4F → 2I → 1F → F in b21 (c=6) (n=230 in b10)
GH → CK → B9 → 4F → 2I → 1F → F in b21 (c=7) (n=353 in b10)
4GI → 2CI → KC → B9 → 4F → 2I → 1F → F in b21 (c=8) (n=2118 in b10)
GII → BFI → 6F9 → 1HC → 9F → 69 → 2C → 13 → 3 in b21 (c=9) (n=7452 in b10)
5FHJ → 2CJC → C8C → 2CI → KC → B9 → 4F → 2I → 1F → F in b21 (c=10) (n=53296 in b10)
2BGIJ → CKKC → 64CI → BFI → 6F9 → 1HC → 9F → 69 → 2C → 13 → 3 in b21 (c=11) (n=498286 in b10)
FHKKK → AA5HI → GAJF → 4J89 → C8C → 2CI → KC → B9 → 4F → 2I → 1F → F in b21 (c=12) (n=3083912 in b10)
3BDGHJK → AHKKA3 → AA5HI → GAJF → 4J89 → C8C → 2CI → KC → B9 → 4F → 2I → 1F → F in b21 (c=13) (n=304907819 in b10)
6BBHIJJJJ → G1BHJ4DF → AHKKA3 → AA5HI → GAJF → 4J89 → C8C → 2CI → KC → B9 → 4F → 2I → 1F → F in b21 (c=14) (n=247765672579 in b10)
3DDGGGGGGGIIJ → 284GJDKAD63I → 5D65FHGK3 → 5BIB3KC → 1J6DC9 → H5JF → 2CJC → C8C → 2CI → KC → B9 → 4F → 2I → 1F → F in b21 (c=15) (n=26851272398708896 in b10)

Mathemorchids

Flowers are modified leaves. That’s a scientific fact. And it must depend on the way the genetic program of a plant allows for change in variables of growth — in the relative dimensions, directions and forms of various collections of cells.

But I wasn’t thinking of flowers or leaves or botany when I wrote a program to trace the path taken by a point moving in various ways between the center and perimeter of a circle. After I’d run the program, I was definitely thinking of flowers and leaves. How could I not be, when they appeared on the screen in front of my eyes? By adjusting variables in the program, I could produce either flowers or leaves or something between the two:

Flower without color


Flower with color






Some of the flower-shapes reminded me of orchids, so I called them mathemorchids. The variables I used governed this procedure:

defprocmathemorchid
rd = 0
jump = jmin
jinc = +1
repeat
xr = xc + int(sin(rd) * rdius + sin(rd * xmult) * xminl)
yr = yc + int(cos(rd) * rdius + cos(rd * ymult) * yminl)
jump = jump + jinc
if(jump = jmin) or (jump >= jmax) then jinc = -jinc
procDrawLine(xr,yr,xc,yc,jump)
rd = rd + rdinc
until rd > maxrd
endproc

Here are explanations of the variables:

rd — short for radian and setting the angle of the point, 0 to maxrd = pi * 2, as it moves between the center and perimeter of the circle
rdinc — the amount by which rd is incremented
xc, yc — the center of the circle
rdius — the radius of the circle
xr, yr — the adjustable radiuses used in trigonometric calculations for the x and y dimensions
xmult, ymult — used to multiply rd for further trig-calcs using…
xminl, yminl — the lengths by which xr and yr are adjusted
jmin, jmax — these are the lower and upper bounds for a rising and falling variable called jump, which determines how far the point moves before it’s marked on the screen

If you look at the use of the sine and cosine functions, you’ll see that the point can swing back on its path or swing ahead of itself, as it were. That’s how the path of the point can simulate three-dimensionality as it lays down thicker or thinner patches of pixels.

Here are the mathemorchids, leaves, scallops and other shapes created by adjusting the variables described above (with more of the generating program as an appendix):

Mathemorchid for jmin = 6, jmax = 69, xmult = 7, ymult = 7, xminl = 40, yminl = 88 (see file-name)





























 

















And here are a few more examples of the mathemorchids and other shapes look like without color:





 



Code for creating the Mathemorchids

defprocmathemorchid
rd = 0
rd = 0
jump = jmin
jinc = +1
repeat
xr = xc + int(sin(rd) * rdius + sin(rd * xmult) * xminl)
yr = yc + int(cos(rd) * rdius + cos(rd * ymult) * yminl)
jump = jump + jinc
if(jump = jmin) or (jump >= jmax) then jinc = -jinc
procDrawLine(xr,yr,xc,yc,jump)
rd = rd + rdinc
k=inkey(0)
until rd > maxrd or k > -1
endproc

defprocDrawLine(x1,y1,x2,y2,puttest)
xdiff = x1 – x2
ydiff = y1 – y2
if abs(xdiff) > abs(ydiff) then
yinc = -ydiff / abs(xdiff)
if xdiff < 0 then xinc = +1 else xinc = -1
else
xinc = -xdiff / abs(ydiff)
if ydiff colrmx then col = 1
put = 0
endif
if int(x) x2 then x = x + xinc
if int(y) y2 then y = y + yinc
iffunc=2then
ifx<x_lo x_lo=x
ifyx_hi x_hi=x
ify>y_hi y_hi=y
endif
until fnreached
endproc

deffnreached
if xinc > 0 then
xreached = int(x) >= x2
else
xreached = int(x) 0 then
yreached = int(y) >= y2
else
yreached = int(y) <= y2
endif
= xreached and yreached
end

The Wyrm Ferns

A fern is a fractal, a shape that contains copies of itself at smaller and smaller scales. That is, part of a fern looks like the fern as a whole:

Fern as fractal (source)


Millions of years after Mother Nature, man got in on the fract, as it were:

The Sierpiński triangle, a 2d fractal


The Sierpiński triangle is a fractal created in two dimensions by a point jumping halfway towards one or another of the three vertices of a triangle. And here is a fractal created in one dimension by a point jumping halfway towards one or another of the two ends of a line:

A 1d fractal


In one dimension, the fractality of the fractal isn’t obvious. But you can try draggin’ out (or dragon out) the fractality of the fractal by ferning the wyrm, as it were. Suppose that after the point jumps halfway towards one or another of the two points, it’s rotated by some angle around the midpoint of the two original points. When you do that, the fractal becomes more and more obvious. In fact, it becomes what’s called a dragon curve (in Old English, “dragon” was wyrm or worm):

Fractal with angle = 5°


Fractal 10°


Fractal 15°


Fractal 20°


Fractal 25°


Fractal 30°


Fractal 35°


Fractal 40°


Fractal 45°


Fractal 50°


Fractal 55°


Fractal 60°


Fractal 0° to 60° (animated at ezGif)


But as the angle gets bigger, an interesting aesthetic question arises. When is the ferned wyrm, the dragon curve, at its most attractive? I’d say it’s when angle ≈ 55°:

Fractal 50°


Fractal 51°


Fractal 52°


Fractal 53°


Fractal 54°


Fractal 55°


Fractal 56°


Fractal 57°


Fractal 58°


Fractal 59°


Fractal 60°


Fractal 50° to 60° (animated)


At angle >= 57°, I think the dragon curve starts to look like some species of bristleworm, which are interesting but unattractive marine worms:

A bristleworm, Nereis virens (see polychaete at Wikipedia)


Finally, here’s what the ferned wyrm looks like in black-and-white and when it’s rotating:

Fractal 0° to 60° (b&w, animated)


Fractal 56° (rotating)


Fractal 56° (b&w, rotating)


Double fractal 56° (b&w, rotating)


Previously Pre-Posted (Please Peruse)…

Curvous Energy — a first look at dragon curves
Back to Drac’ — another look at dragon curves

Graph durch Euler

This is the famous Ulam spiral, in which prime numbers are represented on filled squares on a square spiral:

The Ulam spiral


I like the way the spiral sits between chaos and calm. It’s not wholly random and it’s not wholly regular — it’s betwixt and between. You get a similar chaos-and-calm vibe from a graph for a function called Euler phi. And primes are at work there too. Here’s the graph from Wikipedia:

Graph of eulerphi(n) = φ(n) (see Euler’s totient function)


But what is the Euler phi function? For any integer n, eulerphi(n) gives you the count of numbers < n that are relatively prime to n. That is, the count of numbers < n that have no common factors with n other than one. You can see how eulerphi(n) works by considering whether you can simplify the fraction a/b, where a = 1..n-1 and b = n:

φ(6) = 2
1/6 (1)
2/6 → 1/3
3/6 → 1/2
4/6 → 2/3
5/6, ∴ φ(6) = 2


φ(7) = 6
1/7 (1)
2/7 (2)
3/7 (3)
4/7 (4)
5/7 (5)
6/7, ∴ φ(7) = 6


φ(12) = 4
1/12 (1)
2/12 → 1/6
3/12 → 1/4
4/12 → 1/3
5/12 (2)
6/12 → 1/2
7/12 (3)
8/12 → 2/3
9/12 → 3/4
10/12 → 5/6
11/12, ∴ φ(12) = 4


φ(13) = 12
1/13 (1)
2/13 (2)
3/13 (3)
4/13 (4)
5/13 (5)
6/13 (6)
7/13 (7)
8/13 (8)
9/13 (9)
10/13 (10)
11/13 (11)
12/13, ∴ φ(13) = 12


As you can see, eulerphi(n) = n-1 for primes. Now you know what the top line of the Eulerphi graph is. It’s the primes. Here’s a bigger version of the graph:

Graph of eulerphi(n) = φ(n)


Unlike the Ulam spiral, however, the Eulerphi graph is cramped. But it’s easy to stretch it. You can represent φ(n) as a fraction between 0 and 1 like this: phifrac(n) = φ(n) / (n-1). Using phifrac(n), you can create Eulerphi bands, like this:

Eulerphi band, n <= 1781


Eulerphi band, n <= 3561


Eulerphi band, n <= 7121


Eulerphi band, n <= 14241


Or you can create Eulerphi discs, like this:

Eulerphi disc, n <= 1601


Eulerphi disc, n <= 3201


Eulerphi disc, n <= 6401


Eulerphi disc, n <= 12802


Eulerphi disc, n <= 25602


But what is the bottom line of the Eulerphi bands and inner ring of the Eulerphi discs, where φ(n) is smallest relative to n? Well, the top line or outer ring is the primes and the bottom line or inner ring is the primorials (and their multiples). The function primorial(n) is the multiple of the first n primes:

primorial(1) = 2
primorial(2) = 2*3 = 6
primorial(3) = 2*3*5 = 30
primorial(4) = 2*3*5*7 = 210
primorial(5) = 2*3*5*7*11 = 2310
primorial(6) = 2*3*5*7*11*13 = 30030
primorial(7) = 2*3*5*7*11*13*17 = 510510
primorial(8) = 2*3*5*7*11*13*17*19 = 9699690
primorial(9) = 2*3*5*7*11*13*17*19*23 = 223092870
primorial(10) = 2*3*5*7*11*13*17*19*23*29 = 6469693230


Here are the numbers returning record lows for φfrac(n) = φ(n) / (n-1):

φ(4) = 2 (2/3 = 0.666…)
4 = 2^2
φ(6) = 2 (2/5 = 0.4)
6 = 2.3
φ(12) = 4 (4/11 = 0.363636…)
12 = 2^2.3
[…]
φ(30) = 8 (8/29 = 0.275862…)
30 = 2.3.5
φ(60) = 16 (16/59 = 0.27118…)
60 = 2^2.3.5
[…]
φ(210) = 48 (48/209 = 0.229665…)
210 = 2.3.5.7
φ(420) = 96 (96/419 = 0.2291169…)
420 = 2^2.3.5.7
φ(630) = 144 (144/629 = 0.228934…)
630 = 2.3^2.5.7
[…]
φ(2310) = 480 (480/2309 = 0.2078822…)
2310 = 2.3.5.7.11
φ(4620) = 960 (960/4619 = 0.20783719…)
4620 = 2^2.3.5.7.11
[…]
30030 = 2.3.5.7.11.13
φ(60060) = 11520 (11520/60059 = 0.191811385…)
60060 = 2^2.3.5.7.11.13
φ(90090) = 17280 (17280/90089 = 0.1918103209…)
90090 = 2.3^2.5.7.11.13
[…]
φ(510510) = 92160 (92160/510509 = 0.18052571061…)
510510 = 2.3.5.7.11.13.17
φ(1021020) = 184320 (184320/1021019 = 0.18052553…)
1021020 = 2^2.3.5.7.11.13.17
φ(1531530) = 276480 (276480/1531529 = 0.180525474868579…)
1531530 = 2.3^2.5.7.11.13.17
φ(2042040) = 368640 (368640/2042039 = 0.18052544540040616…)
2042040 = 2^3.3.5.7.11.13.17

Primal Polynomial

n² + n + 17 is one of the best-known polynomial formulas for primes. Its values for n = 0 to 15 are all prime, starting with 17 and ending with 257. — David Wells in The Penguin Dictionary of Curious and Interesting Numbers (1986), entry for “17”

• 17, 19, 23, 29, 37, 47, 59, 73, 89, 107, 127, 149, 173, 199, 227, 257

Squaring the Triangle

It’s an interesting little exercise in elementary trigonometry to turn the Sierpiński triangle…

A Sierpiński triangle


…into its circular equivalent:

A Sierpiński trisc


You could call that a trisc, because it’s a triangle turned into a disc. And here’s triangle-and-trisc in one image:

Sierpiński triangle + Sierpiński trisc


But what’s the square equivalent of a Sierpiński triangle? This is:

Square from Sierpiński triangle


You can do that directly, as it were:

Sierpiński triangle → square


Or you can convert the triangle into a disc, then the disc into a square, like this:

Sierpiński triangle → trisc → square


Now try converting the triangle into a pentagon:

Pentagon from Sierpiński triangle


Sierpiński triangle → pentagon


Sierpiński triangle → trisc → pentagon


And a hexagon:

Hexagon from Sierpiński triangle


Sierpiński triangle → hexagon


Sierpiński triangle → trisc → hexagon


But you can also convert the Sierpiński trisc back into a Sierpiński triangle, then into a Sierpiński trisc again:

Sierpiński triangle → trisc → triangle → trisc


Sierpiński triangle → trisc → triangle → trisc (animated at Ezgif)


Sierpiński triangle → trisc → triangle → trisc (b&w)


Sierpiński triangle → trisc → triangle → trisc (b&w) (animated at Ezgif)


After triangles come squares. Here’s a shape called a T-square fractal:

T-square fractal


And here’s the circular equivalent of a T-square fractal:

T-square fractal → T-squisc


T-square fractal + T-squisc


If a disc from a triangle is a trisc, then a disc from a square is a squisc (it would be pentisc, hexisc, heptisc for pentagonal, hexagonal and heptagonal fractals). Here’s the octagonal equivalent of a T-square fractal:

Octagon from T-square fractal


As with the Sierpiński trisc, you can use the T-squisc to create the T-octagon:

T-square fractal → T-squisc → T-octagon (color)


Or you can convert the T-square directly into the T-octagon:

T-square fractal to T-octagon fractal

But using the squisc makes for interesting multiple images:


T-square fractal → T-squisc → T-octagon (b&w)


T-square fractal → T-squisc → T-octagon → T-squisc


T-square fractal → T-squisc → T-octagon → T-squisc (animated at Ezgif)


The conversions from polygon to polygon look best when the number of sides in the higher polygon are a multiple of the number of sides in the lower, like this:

Sierpiński triangle → Sierpiński hexagon → Sierpiński nonagon