Class of fractal curves derived from recursion on the base-2 representation of the integers

92 Views Asked by At

Consider the recurrence

$\displaystyle T(n) = \begin{cases} 1 &\text{if } n = 0 \\ 0 &\text{if } n = 1 \\ T(\lfloor n/2\rfloor) + T(n \bmod 2) &\text{otherwise} \end{cases} $

If you plot the value of this recurrence at the nonnegative integers, you get a fractal curve:

enter image description here

(The red line is $\lfloor\log_2 n\rfloor$; if you set $T(1)=1$ instead of $T(1)=0$, the recurrence degenerates to that function.)

Does this fractal have a name? Is it a member of a more general class of curves?

1

There are 1 best solutions below

2
On

I'm not sure that "fractal" is the correct term for this curve, in spite of the seeming self-similarity. If we plot your curve over the interval $[0,2^m]$ for several choices of $m$, we find that the lengths are $2^{m+1}-2$:

enter image description here

As the curves roughly double in length with each step, we'd expect a dimension of 1.

In the context of fractal geometry, it might make more sense to scale these curves so that each lies over the unit interval. If we plot them in correct aspect ratio, we see a picture that looks like so:

enter image description here

Note that the limiting object is just the unit interval; the dimension is again 1.