Boole(b)an

Suppose you allow a point to jump at random half-way towards one of the four vertices of a square. But not entirely at random — you ban the point from jumping towards the same vertex twice (or more) in a row. You get this pattern:

ban on v(i) + 0


It’s a fractal, that is, a shape that contains smaller and smaller copies of itself. Next you ban the point from jumping towards the vertex one place clockwise of the vertex it last jumped towards (i.e., it can jump towards, say, vertex 2 as many times as it likes, but it can’t jump towards vertex 2+1 = 3, and so on). You get this fractal:

ban on v(i) + 1


Now ban it from jumping towards the vertex two places clockwise of the vertex it last jumped towards (i.e., it can’t jump towards the diagonally opposite vertex). You get this fractal:

ban on v(i) + 2


And if you ban the point from jumping towards the vertex three places clockwise of the last vertex, you get a mirror-image of the v(i)+1 fractal (see above):

ban on v(i) + 3


The fractals above have a memory one vertex into the past: the previous vertex. Let’s try some fractals with a memory two vertices into the past: the previous vertex and the pre-previous vertex (and even the pre-pre-previous vertex).

But this time, let’s suppose that sometimes the point can’t jump if the previous or pre-previous isn’t equal to v(i) + n. So sometimes the jump is banned when the test is true, sometimes when the test is false — you might call it a boolean ban or boole(b)an. Using boole(b)ans, you can get this set of fractals:
















With these fractals, the boolean test sends the point back to the center of the square:










Trifylfots

Here’s a simple fractal created by dividing an equilateral triangle into smaller equilateral triangles, then discarding (and rotating) some of those sub-triangles, then doing the same to the sub-triangles:

Fractangle (triangle-fractal) (stage 1)


Fractangle #2


Fractangle #3


Fractangle #4


Fractangle #5


Fractangle #6


Fractangle #7


Fractangle #8


Fractangle #9


Fractangle (animated)


I’ve used the same fractangle to create this shape, which is variously known as a swastika (from Sanskrit svasti, “good luck, well-being”), a gammadion (four Greek Γs arranged in a circle) or a fylfot (from the shape being used to “fill the foot” of a stained glass window in Christian churches):

Trifylfot


Because it’s a fylfot created ultimately from a triangle, I’m calling it a trifylfot (TRIFF-ill-fot). Here’s how you make it:

Trifylfot (stage 1)


Trifylfot #2


Trifylfot #3


Trifylfot #4


Trifylfot #5


Trifylfot #6


Trifylfot #7


Trifylfot #8


Trifylfot #9


Trifylfot (animated)


And here are more trifylfots created from various forms of fractangle:













































Elsewhere other-accessible

Fractangular Frolics — more on fractals from triangles

Digital Dissection

As I never tire of pointing out, the three most powerful drugs in the universe are water, maths and language. And I never tire of snorting the fact that numbers can come in many different guises. You can take a trivial, everyday number like a hundred and see it transform like this:


100 = 1100100 in base 2; 10201 in base 3; 1210 in base 4; 400 in base 5; 244 in base 6; 202 in base 7; 144 in base 8; 121 in base 9; 100 in b10; 91 in b11; 84 in b12; 79 in b13; 72 in b14; 6A in b15; 64 in b16; 5F in b17; 5A in b18; 55 in b19; 50 in b20; 4G in b21; 4C in b22; 48 in b23; 44 in b24; 40 in b25; 3M in b26; 3J in b27; 3G in b28; 3D in b29; 3A in b30; 37 in b31; 34 in b32; 31 in b33; 2W in b34; 2U in b35; 2S in b36; 2Q in b37; 2O in b38; 2M in b39; 2K in b40; 2I in b41; 2G in b42; 2E in b43; 2C in b44; 2A in b45; 28 in b46; 26 in b47; 24 in b48; 22 in b49; 20 in b50; 1[49] in b51; 1[48] in b52; 1[47] in b53; 1[46] in b54; 1[45] in b55; 1[44] in b56; 1[43] in b57; 1[42] in b58; 1[41] in b59; 1[40] in b60; 1[39] in b61; 1[38] in b62; 1[37] in b63; 1[36] in b64; 1Z in b65; 1Y in b66; 1X in b67; 1W in b68; 1V in b69; 1U in b70; 1T in b71; 1S in b72; 1R in b73; 1Q in b74; 1P in b75; 1O in b76; 1N in b77; 1M in b78; 1L in b79; 1K in b80; 1J in b81; 1I in b82; 1H in b83; 1G in b84; 1F in b85; 1E in b86; 1D in b87; 1C in b88; 1B in b89; 1A in b90; 19 in b91; 18 in b92; 17 in b93; 16 in b94; 15 in b95; 14 in b96; 13 in b97; 12 in b98; 11 in b99

I like the shifts from 1100100 to 10201 to 1210 to 400 to 244 to 202 to 144 to 121. How can 1100100 and 244 be the same number? Well, they are — or they’re not, as you please. In base 2, 1100100 = 244 in base 6 = 100 in base 10. But if all those numbers are in the same base, they’re completely different and 1100100 dwarfs the other two.

But some things you can’t please yourself about. Suppose you take the different representations of 6561 in bases 2..6560 and add up the 1s, the 2s, the 3s and so on, like this:


n=6561

digsum(1,6561,b=2..6560) = 3343 (50.95% of 6561)
digsum(2,6561,b=2..6560) = 2246 (34.23% of 6561)
digsum(3,6561,b=2..6560) = 1680 (25.61% of 6561)
digsum(4,6561,b=2..6560) = 1368 (20.85% of 6561)
digsum(5,6561,b=2..6560) = 1185 (18.06% of 6561)
digsum(6,6561,b=2..6560) = 1074 (16.37% of 6561)
digsum(7,6561,b=2..6560) = 875 (13.34% of 6561)
digsum(8,6561,b=2..6560) = 768 (11.71% of 6561)
digsum(9,6561,b=2..6560) = 1080 (16.46% of 6561)
[...]
digcount(0,6561,b=2..6560) = 31

Is there a pattern in the percentages? Let’s apply the same process to some bigger numbers (and note that 0 does not behave like the other digits):


n=59049

digsum(1,59049) = 29648 (50.21%)
digsum(2,59049) = 19790 (33.51%)
digsum(3,59049) = 14901 (25.23%)
digsum(4,59049) = 11956 (20.25%)
digsum(5,59049) = 9970 (16.88%)
digsum(6,59049) = 8550 (14.48%)
digsum(7,59049) = 7539 (12.77%)
digsum(8,59049) = 6672 (11.30%)
digsum(9,59049) = 6579 (11.14%)
digcount(0,59049) = 41


n=531441

digsum(1,531441) = 266065 (50.06%)
digsum(2,531441) = 177394 (33.38%)
digsum(3,531441) = 133128 (25.05%)
digsum(4,531441) = 106532 (20.05%)
digsum(5,531441) = 88815 (16.71%)
digsum(6,531441) = 76224 (14.34%)
digsum(7,531441) = 66661 (12.54%)
digsum(8,531441) = 59320 (11.16%)
digsum(9,531441) = 53928 (10.15%)
digcount(0,531441) = 62


n=4782969

digsum(1,4782969) = 2392219 (50.02%)
digsum(2,4782969) = 1595000 (33.35%)
digsum(3,4782969) = 1196370 (25.01%)
digsum(4,4782969) = 957300 (20.01%)
digsum(5,4782969) = 797700 (16.68%)
digsum(6,4782969) = 683850 (14.30%)
digsum(7,4782969) = 598444 (12.51%)
digsum(8,4782969) = 531944 (11.12%)
digsum(9,4782969) = 480870 (10.05%)
digcount(0,4782969) = 66

Yes, the pattern’s getting stronger. Let’s try even bigger numbers:


n=43046721

digsum(1,43046721) = 21525521 (50.01%)
digsum(2,43046721) = 14350754 (33.34%)
digsum(3,43046721) = 10763496 (25.00%)
digsum(4,43046721) = 8610980 (20.00%)
digsum(5,43046721) = 7175955 (16.67%)
digsum(6,43046721) = 6150924 (14.29%)
digsum(7,43046721) = 5382167 (12.50%)
digsum(8,43046721) = 4784232 (11.11%)
digsum(9,43046721) = 4306257 (10.00%)
digcount(0,43046721) = 86


n=387420489

digsum(1,387420489) = 193716365 (50.00%)
digsum(2,387420489) = 129145522 (33.33%)
digsum(3,387420489) = 96859980 (25.00%)
digsum(4,387420489) = 77488588 (20.00%)
digsum(5,387420489) = 64574220 (16.67%)
digsum(6,387420489) = 55349742 (14.29%)
digsum(7,387420489) = 48431250 (12.50%)
digsum(8,387420489) = 43050264 (11.11%)
digsum(9,387420489) = 38748357 (10.00%)
digcount(0,387420489) = 95

To the given precision, the sum of 1s is 1/2 of n; the sum of 2s is 1/3; the sum of 3 is 1/4; and the sum of 4s is 1/5. It looks as though the sum of a given digit d → 1/(d+1) of n as n → ∞. But why? My mathematical intuition is bad, so it took me a while to see what some people will see in a flash. To see what’s going on, let’s go back to the all-base representations of 100:


100 = 1100100 in base 2; 10201 in base 3; 1210 in base 4; 400 in base 5; 244 in base 6; 202 in base 7; 144 in base 8; 121 in base 9; 100 in b10; 91 in b11; 84 in b12; 79 in b13; 72 in b14; 6A in b15; 64 in b16; 5F in b17; 5A in b18; 55 in b19; 50 in b20; 4G in b21; 4C in b22; 48 in b23; 44 in b24; 40 in b25; 3M in b26; 3J in b27; 3G in b28; 3D in b29; 3A in b30; 37 in b31; 34 in b32; 31 in b33; 2W in b34; 2U in b35; 2S in b36; 2Q in b37; 2O in b38; 2M in b39; 2K in b40; 2I in b41;
2G in b42; 2E in b43; 2C in b44; 2A in b45; 28 in b46; 26 in b47; 24 in b48; 22 in b49; 20 in b50; 1[49] in b51; 1[48] in b52; 1[47] in b53; 1[46] in b54; 1[45] in b55; 1[44] in b56; 1[43] in b57; 1[42] in b58; 1[41] in b59; 1[40] in b60; 1[39] in b61; 1[38] in b62; 1[37] in b63; 1[36] in b64; 1Z in b65; 1Y in b66; 1X in b67; 1W in b68; 1V in b69; 1U in b70; 1T in b71; 1S in b72; 1R in b73; 1Q in b74; 1P in b75; 1O in b76; 1N in b77; 1M in b78; 1L in b79; 1K in b80; 1J in b81
; 1I in b82; 1H in b83; 1G in b84; 1F in b85; 1E in b86; 1D in b87; 1C in b88; 1B in b89; 1A in b90; 19 in b91; 18 in b92; 17 in b93; 16 in b94; 15 in b95; 14 in b96; 13 in b97; 12 in b98; 11 in b99

When the base b is higher than half of 100, the representations of 100 consist of a digit 1 followed by another digit. Half of a hundred = 50, therefore 100 in base 10 = 1[49] in b51, 1[48] in b52, 1[47] in b53, 1[46] in b54, 1[45] in b55, 1[44] in b56, 1[43] in b57, 1[42] in b58, 1[41] in b59… If you take binary and so on into account, 1 is the first digit of slightly over half the representations of 100. And 1 also occurs in other positions. Therefore digsum(1,100,b=2..99) > 50. As the number n gets larger and larger, the contribution of leading 1s in bases b > n/2 begins to swamp the contributions of 1s in other positions, therefore digsum(1,n) → 1/2 of n as n → ∞.

And what about 2s and 3s? Similar reasoning applies. One hundred has a leading digit of 2 in bases b where b > 1/3 of 100 and b <= 1/2 of 100. So 100 = 2W in b34, 2U in b35, 2S in b36, 2Q in b37, 2O in b38… In other words, roughly 1/2 – 1/3 of the representations of 100 have a leading 2. Now, 1/2 – 1/3 = 3/6 – 2/6 = 1/6 and 1/6 * 2 = 1/3 (i.e., 1/6 of the representations contribute a leading 2 to the sum of 2s). Therefore the all-base digsum(2,n) → 1/3 of n as n → ∞. Next, one hundred has a leading digit of 3 in bases b where b > 1/4 of 100 and b <= 1/3. So 100 = 3M in b26, 3J in b27, 3G in b28, 3D in b29, 3A in b30… Now, 1/3 – 1/4 = 4/12 – 3/12 = 1/12 and 1/12 * 3 = 1/4. Therefore the all-base digsum(3,n) → 1/4 of n as n → ∞.

And so on.

Hour Re-Re-Re-Re-Powered

In “Dissing the Diamond” I looked at some of the fractals I found by selecting lines from a dissected diamond. Here’s another of those fractals:

Fractal from dissected diamond


It’s a distorted and incomplete version of the hourglass fractal:

Hourglass fractal


Here’s how to create the distorted form of the hourglass fractal:

Distorted hourglass from dissected diamond (stage 1)


Distorted hourglass #2


Distorted hourglass #3


Distorted hourglass #4


Distorted hourglass #5


Distorted hourglass #6


Distorted hourglass #7


Distorted hourglass #8


Distorted hourglass #9


Distorted hourglass #10


Distorted hourglass (animated)


When I de-distorted and doubled the dissected-diamond method, I got this:

Hourglass fractal #1


Hourglass fractal #2


Hourglass fractal #3


Hourglass fractal #4


Hourglass fractal #5


Hourglass fractal #6


Hourglass fractal #7


Hourglass fractal #8


Hourglass fractal #9


Hourglass fractal #10


Hourglass fractal (animated)


Elsewhere other-engageable:

 

Hour Power
Hour Re-Powered
Hour Re-Re-Powered
Hour Re-Re-Re-Powered

Dissing the Diamond

In “Fractangular Frolics” I looked at how you could create fractals by choosing lines from a dissected equilateral or isosceles right triangle. Now I want to look at fractals created from the lines of a dissected diamond, as here:

Lines in a dissected diamond


Let’s start by creating one of the most famous fractals of all, the Sierpiński triangle:

Sierpiński triangle stage 1


Sierpiński triangle #2


Sierpiński triangle #3


Sierpiński triangle #4


Sierpiński triangle #5


Sierpiński triangle #6


Sierpiński triangle #7


Sierpiński triangle #8


Sierpiński triangle #9


Sierpiński triangle #10


Sierpiński triangle (animated)


However, you can get an infinite number of Sierpiński triangles with three lines from the diamond:

Sierpińfinity #1


Sierpińfinity #2


Sierpińfinity #3


Sierpińfinity #4


Sierpińfinity #5


Sierpińfinity #6


Sierpińfinity #7


Sierpińfinity #8


Sierpińfinity #9


Sierpińfinity #10


Sierpińfinity (animated)


Here are some more fractals created from three lines of the dissected diamond (sometimes the fractals are rotated to looked better):



















And in these fractals one or more of the lines are flipped to create the next stage of the fractal:




Previously pre-posted:

Fractangular Frolics — fractals created in a similar way

Dissecting the Diamond — fractals from another kind of diamond

Circus Trix

Here’s a trix, or triangle divided into six smaller triangles:

Trix, or triangle divided into six smaller triangles


Now each sub-triangle becomes a trix in its turn:

Trix stage #2


And again:

Trix #3


Trix #4


Trix #5


Trix divisions (animated)


Now try dividing the trix and discarding sub-triangles, then repeating the process. A fractal appears:

Trix fractal #1


Trix fractal #2


Trix fractal #3


Trix fractal #4


Trix fractal #5


Trix fractal #6


Trix fractal #7


Trix fractal (animated)


But what happens if you delay the discarding, first dividing the trix completely into sub-triangles, then dividing completely again? You get a more attractive and symmetrical fractal, like this:

Trix fractal (delayed discard)


And it’s easy to convert the triangle into a circle, creating a fractal like this:

Delayed-discard trix fractal converted into circle


Delayed-discard trix fractal to circular fractal (animated)


Now a trix fractal that looks like a hawk-god:

Trix hawk-god #1


Trix hawk-god #2


Trix hawk-god #3


Trix hawk-god #4


Trix hawk-god #5


Trix hawk-god #6


Trix hawk-god #7


Trix hawk-god (animated)


Trix hawk-god converted to circle


Trix hawk-god to circle (animated)


If you delay the discard, you get this:

Trix hawk-god circle (delayed discard)


And here are more delayed-discard trix fractals:







Various circular trix-fractals (animated)


Post-Performative Post-Scriptum

In Latin, circus means “ring, circle” — the English word “circle” is actually from the Latin diminutive circulus, meaning “little circle”.

Fractangular Frolics

Here’s an interesting shape that looks like a distorted and dissected capital S:

A distorted and dissected capital S


If you look at it more closely, you can see that it’s a fractal, a shape that contains itself over and over on smaller and smaller scales. First of all, it can be divided completely into three copies of itself (each corresponding to a line of the fractangle seed, as shown below):

The shape contains three smaller versions of itself


The blue sub-fractal is slightly larger than the other two (1.154700538379251…x larger, to be more exact, or √(4/3)x to be exactly exact). And because each sub-fractal can be divided into three sub-sub-fractals, the shape contains smaller and smaller copies of itself:

Five more sub-fractals


But how do you create the shape? You start by selecting three lines from this divided equilateral triangle:

A divided equilateral triangle


These are the three lines you need to create the shape:

Fractangle seed (the three lines correspond to the three sub-fractals seen above)


Now replace each line with a half-sized set of the same three lines:

Fractangle stage #2


And do that again:

Fractangle stage #3


And again:

Fractangle stage #4


And carry on doing it as you create what I call a fractangle, i.e. a fractal derived from a triangle:

Fractangle stage #5


Fractangle stage #6


Fractangle stage #7


Fractangle stage #8


Fractangle stage #9


Fractangle stage #10


Fractangle stage #11


Here’s an animation of the process:

Creating the fractangle (animated)


And here are more fractangles created in a similar way from three lines of the divided equilateral triangle:

Fractangle #2


Fractangle #2 (anim)

(open in new window if distorted)


Fractangle #2 (seed)


Fractangle #3


Fractangle #3 (anim)


Fractangle #3 (seed)


Fractangle #4


Fractangle #4 (anim)


Fractangle #4 (seed)


You can also use a right triangle to create fractangles:

Divided right triangle for fractangles


Here are some fractangles created from three lines chosen of the divided right triangle:

Fractangle #5


Fractangle #5 (anim)


Fractangle #5 (seed)


Fractangle #6


Fractangle #6 (anim)


Fractangle #6 (seed)


Fractangle #7


Fractangle #7 (anim)


Fractangle #7 (seed)


Fractangle #8


Fractangle #8 (anim)


Fractangle #8 (seed)


Hour Re-Re-Re-Powered

Here’s a set of three lines:

Three lines


Now try replacing each line with a half-sized copy of the original three lines:

Three half-sized copies of the original three lines


What shape results if you keep on doing that — replacing each line with three half-sized new lines — over and over again? I’m not sure that any human is yet capable of visualizing it, but you can see the shape being created below:

Morphogenesis #3


Morphogenesis #4


Morphogenesis #5


Morphogenesis #6


Morphogenesis #7


Morphogenesis #8


Morphogenesis #9


Morphogenesis #10


Morphogenesis #11 — the Hourglass Fractal


Morphogenesis of the Hourglass Fractal (animated)


The shape that results is what I call the hourglass fractal. Here’s a second and similar method of creating it:

Hourglass fractal, method #2 stage #1


Hourglass fractal #2


Hourglass fractal #3


Hourglass fractal #4


Hourglass fractal #5


Hourglass fractal #6


Hourglass fractal #7


Hourglass fractal #8


Hourglass fractal #9


Hourglass fractal #10


Hourglass fractal #11


Hourglass fractal (animated)


And below are both methods in one animated gif, where you can see how method #1 produces an hourglass fractal twice as large as the hourglass fractal produced by method #2:

Two routes to the hourglass fractal (animated)


Elsewhere other-engageable:

Hour Power
Hour Re-Powered
Hour Re-Re-Powered

Tri Again (Again (Again))

Like the moon, mathematics is a harsh mistress. In mathematics, as on the moon, the slightest misstep can lead to disaster — as I’ve discovered again and again. My latest discovery came when I was looking at a shape called the L-tromino, created from three squares set in an L-shape. It’s a rep-tile, because it can be tiled with four smaller copies of itself, like this:

Rep-4 L-tromino


And if it can be tiled with four copies of itself, it can also be tiled with sixteen copies of itself, like this:

Rep-16 L-tromino


My misstep came when I was trying to do to a rep-16 L-tromino what I’d already done to a rep-4 L-tromino. And what had I already done? I’d created a beautiful shape called the hourglass fractal by dividing-and-discarding sub-copies of a rep-4 L-tromino. That is, I divided the L-tromino into four sub-copies, discarded one of the sub-copies, then repeated the process with the sub-sub-copies of the sub-copies, then the sub-sub-sub-copies of the sub-sub-copies, and so on:

Creating an hourglass fractal #1


Creating an hourglass fractal #2


Creating an hourglass fractal #3


Creating an hourglass fractal #4


Creating an hourglass fractal #5


Creating an hourglass fractal #6


Creating an hourglass fractal #7


Creating an hourglass fractal #8


Creating an hourglass fractal #9


Creating an hourglass fractal #10


Creating an hourglass fractal (animated)


The hourglass fractal


Next I wanted to create an hourglass fractal from a rep-16 L-tromino, so I reasoned like this:

• If one sub-copy of four is discarded from a rep-4 L-tromino to create the hourglass fractal, that means you need 3/4 of the rep-4 L-tromino. Therefore you’ll need 3/4 * 16 = 12/16 of a rep-16 L-tromino to create an hourglass fractal.

So I set up the rep-16 L-tromino with twelve sub-copies in the right pattern and began dividing-and-discarding:

A failed attempt at an hourglass fractal #1


A failed attempt at an hourglass fractal #2


A failed attempt at an hourglass fractal #3


A failed attempt at an hourglass fractal #4


A failed attempt at an hourglass fractal #5


A failed attempt at an hourglass fractal (animated)


Whoops! What I’d failed to take into account is that the rep-16 L-tromino is actually the second stage of the rep-4 triomino, i.e. that 4 * 4 = 16. It follows, therefore, that 3/4 of the rep-4 L-tromino will actually be 9/16 = 3/4 * 3/4 of the rep-16 L-tromino. So I tried again, setting up a rep-16 L-tromino with nine sub-copies, then dividing-and-discarding:

A third attempt at an hourglass fractal #1


A third attempt at an hourglass fractal #2


A third attempt at an hourglass fractal #3


A third attempt at an hourglass fractal #4


A third attempt at an hourglass fractal #5


A third attempt at an hourglass fractal #6


A third attempt at an hourglass fractal (animated)



Previously (and passionately) pre-posted:

Tri Again
Tri Again (Again)

Count Amounts

One of my favourite integer sequences is what I call the digit-line. You create it by taking this very familiar integer sequence:

• 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20…

And turning it into this one:

• 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 2, 0… (A033307 in the Online Encyclopedia of Integer Sequences)

You simply chop all numbers into single digits. What could be simpler? Well, creating the digit-line couldn’t be simpler, but it is in fact a very complex object. There are hidden depths in its patterns, as even a brief look will uncover. For example, you can try counting the digits as they appear one-by-one in the line and seeing whether the digit-counts compare. Do the 1s of the digit-line always outnumber the 0s, as you might expect? Yes, they do (unless you start the digit-line 0, 1, 2, 3…). But do the 2s always outnumber the 0s? No: at position 2, there’s a 2, and at position 11 there’s a 0. So that’s one 2 and one 0. Does it happen again? Yes, it happens again at the 222nd digit of the digit-line, as below:

1, 2count=1, 3, 4, 5, 6, 7, 8, 9, 1, 0count=1, 1, 1, 1, 22, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 23, 02, 24, 1, 25, 26, 27, 3, 28, 4, 29, 5, 210, 6, 211, 7, 212, 8, 213, 9, 3, 03, 3, 1, 3, 214, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 4, 04, 4, 1, 4, 215, 4, 3, 4, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 5, 05, 5, 1, 5, 216, 5, 3, 5,4, 5, 5, 5, 6, 5, 7, 5, 8, 5, 9, 6, 06, 6, 1, 6, 217, 6, 3, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8, 6, 9, 7, 07, 7, 1, 7, 218, 7, 3, 7, 4, 7, 5, 7, 6, 7, 7, 7, 8, 7, 9, 8, 08, 8, 1, 8, 219, 8, 3, 8, 4, 8, 5, 8, 6, 8, 7, 8, 8, 8, 9, 9, 09, 9, 1, 9, 220, 9, 3, 9, 4, 9, 5, 9, 6, 9, 7, 9, 8, 9, 9, 1, 010, 011, 1, 012, 1, 1, 013, 221, 1, 014, 3, 1, 015, 4, 1, 016, 5, 1, 017, 6, 1, 018, 7, 1, 019, 8, 1, 020, 9, 1, 1, 021

So count(2) = count(0) = 1 at digit 11 of the digit-line in the 0 of what was originally 10. And count(2) = count(0) = 21 @ digit 222 in the 0 of what was originally 110. Is a pattern starting to emerge? Yes, it is. Here are the first few points at which the count(2) = count(0) in the digit-line of base 10:

1 @ 11 in 10
21 @ 222 in 110
321 @ 3333 in 1110
4321 @ 44444 in 11110
54321 @ 555555 in 111110
654321 @ 6666666 in 1111110
7654321 @ 77777777 in 11111110
87654321 @ 888888888 in 111111110
987654321 @ 9999999999 in 1111111110
10987654321 @ 111111111110 in 11111111110
120987654321 @ 1222222222221 in 111111111110
[...]

The count(2) = count(0) = 321 at position 3333 in the digit-line, and 4321 at position 44444, and 54321 at position 555555, and so on. I don’t understand why these patterns occur, but you can predict the count-and-position of 2s and 0s easily until position 9999999999, after which things become more complicated. Related patterns for 2 and 0 occur in all other bases except binary (which doesn’t have a 2 digit). Here’s base 6:

1 @ 11 in 10 (1 @ 7 in 6)
21 @ 222 in 110 (13 @ 86 in 42)
321 @ 3333 in 1110 (121 @ 777 in 258)
4321 @ 44444 in 11110 (985 @ 6220 in 1554)
54321 @ 555555 in 111110 (7465 @ 46655 in 9330)
1054321 @ 11111110 in 1111110 (54121 @ 335922 in 55986)
12054321 @ 122222221 in 11111110 (380713 @ 2351461 in 335922)
132054321 @ 1333333332 in 111111110 (2620201 @ 16124312 in 2015538)
1432054321 @ 14444444443 in 1111111110 (17736745 @ 108839115 in 12093234)
15432054321 @ 155555555554 in 11111111110 (118513705 @ 725594110 in 72559410)
205432054321 @ 2111111111105 in 111111111110 (783641641 @ 4788921137 in 435356466)
2205432054321 @ 22222222222220 in 1111111111110 (5137206313 @ 31345665636 in 2612138802)

And what about comparing other pairs of digits? In fact, the count of all digits except 0 matches infinitely often. To write the numbers 1..9 takes one of each digit (except 0). To write the numbers 1 to 99 takes twenty of each digit (except 0). Here’s the proof:

11, 21, 31, 41, 51, 61, 71, 81, 91, 12, 01, 13, 14, 15, 22, 16, 32, 17, 42, 18, 52, 19, 62, 110, 72, 111, 82, 112, 92, 23, 02, 24, 113, 25, 26, 27, 33, 28, 43, 29, 53, 210, 63, 211, 73, 212, 83, 213, 93, 34, 03, 35, 114, 36, 214, 37, 38, 39, 44, 310, 54, 311, 64, 312, 74, 313, 84, 314, 94, 45, 04, 46, 115, 47, 215, 48, 315, 49, 410, 411, 55, 412, 65, 413, 75, 414, 85, 415, 95, 56, 05, 57, 116, 58, 216, 59, 316, 510, 416, 511, 512, 513, 66, 514, 76, 515, 86, 516, 96, 67, 06, 68, 117, 69, 217, 610, 317, 6
11
, 417, 612, 517, 613, 614, 615, 77, 616, 87, 617, 97, 78, 07, 79, 118, 710, 218, 711, 318, 712, 418, 713, 518, 714, 618, 715, 716, 717, 88, 718, 98, 89, 08, 810, 119, 811, 219, 812, 319, 813, 419, 814, 519, 815, 619, 816, 719, 817, 818, 819, 99, 910, 09, 911, 120, 912, 220, 913, 320, 914, 420, 915, 520, 916, 620, 917, 720, 918, 820, 919, 920

And what about writing 1..999, 1..9999, and so on? If you think about it, for every pair of non-zero digits, d1 and d2, all numbers containing one digit can be matched with a number containing the other. 100 → 200, 111 → 222, 314 → 324, 561189571 → 562289572, and so on. So in counting 1..999, 1..9999, 1..99999, you use the same number of non-zero digits. And once again a pattern emerges:

count(0) = 0; count(1) = 1; count(2) = 1; count(3) = 1; count(4) = 1; count(5) = 1; count(6) = 1; count(7) = 1; count(8) = 1; count(9) = 1 (writing 1..9)
count(0) = 9; count(1) = 20; count(2) = 20; count(3) = 20; count(4) = 20; count(5) = 20; count(6) = 20; count(7) = 20; count(8) = 20; count(9) = 20 (writing 1..99)
0: 189; 1: 300; 2: 300; 3: 300; 4: 300; 5: 300; 6: 300; 7: 300; 8: 300; 9: 300 (writing 1..999)
0: 2889; 1: 4000; 2: 4000; 3: 4000; 4: 4000; 5: 4000; 6: 4000; 7: 4000; 8: 4000; 9: 4000 (writing 1..9999)
0: 38889; 1: 50000; 2: 50000; 3: 50000; 4: 50000; 5: 50000; 6: 50000; 7: 50000; 8: 50000; 9: 50000 (writing 1..99999)
0: 488889; 1: 600000; 2: 600000; 3: 600000; 4: 600000; 5: 600000; 6: 600000; 7: 600000; 8: 600000; 9: 600000 (writing 1..999999)
0: 5888889; 1: 7000000; 2: 7000000; 3: 7000000; 4: 7000000; 5: 7000000; 6: 7000000; 7: 7000000; 8: 7000000; 9: 7000000 (writing 1..9999999)
[...]

And here’s base 6 again:

0: 0; 1: 1; 2: 1; 3: 1; 4: 1; 5: 1 (writing 1..5)
0: 5; 1: 20; 2: 20; 3: 20; 4: 20; 5: 20 (writing 1..55 in base 6)
0: 145; 1: 300; 2: 300; 3: 300; 4: 300; 5: 300 (writing 1..555)
0: 2445; 1: 4000; 2: 4000; 3: 4000; 4: 4000; 5: 4000 (writing 1..5555)
0: 34445; 1: 50000; 2: 50000; 3: 50000; 4: 50000; 5: 50000 (writing 1..55555)
0: 444445; 1: 1000000; 2: 1000000; 3: 1000000; 4: 1000000; 5: 1000000 (writing 1..555555)
0: 5444445; 1: 11000000; 2: 11000000; 3: 11000000; 4: 11000000; 5: 11000000 (writing 1..5555555)
0: 104444445; 1: 120000000; 2: 120000000; 3: 120000000; 4: 120000000; 5: 120000000 (writing 1..55555555)
0: 1144444445; 1: 1300000000; 2: 1300000000; 3: 1300000000; 4: 1300000000; 5: 1300000000 (writing 1..555555555)