fractal time and time again

In the Mandelbrot set — that is, the complex numbers $c$ for which the recurrence

$$\begin{aligned} z_{n+1} = z_n^2 + c \end{aligned}$$

remains finite — there are different regions of recurrence. Here's the classic picture. Let's play a bit.

The Mandelbrot set fractal

The classic illustration above is the number of iterations it takes for a recurrence starting at $c$ to escape to infinity.1 For example, the point at $1+i$ goes

$$\begin{aligned} 0^2 + (1+i) &\to 1+i \\ (1+i)^2 + (1+i) &\to 1 + 3i \\ (1+3i)^2 + (1+i) &\to -7 + 7i \\ (-7+7i)^2 + (1+i) &\to 1 - 97i \\ \end{aligned}$$

That's not in the set, so it's dark. The yellow points are those which haven't escaped after 100 iterations or so, and are candidates to actually belong to the set. Intermediate colors have still escaped, just later.

But there's structure within the set, too. The points in the "main cardioid," which includes the origin $c=0$, all eventually stabilize in one place. For example (choosing via dartboard), the recurrence

$$\begin{aligned} (-0.341+0.238i)^2 + (0.400 + 0.400i) &\to (-0.341+0.238i) \end{aligned}$$

means that $0.4+0.4i$ is a fixed point.

The other "lobes" of points which don't escape don't converge to single fixed points, but alternate with some period. The nice circle centered on $c=-1$ has recurrence period two. The point $c=-1$ itself can be done by hand:

$$\begin{aligned} 0^2 -1 &\to -1 \\ (-1)^2 -1 &\to 0 \\ \end{aligned}$$

But the points near $c=-1$ have the same period:

$$\begin{aligned} (-1.097 + 0.084i)^2 + (-1.1 + 0.1i) &\to +0.097 - 0.084i \\ (+0.097 - 0.084i)^2 + (-1.1 + 0.1i) &\to -1.097 + 0.084i \\ \end{aligned}$$

A cute way to see this is to colorize the plane by the difference between adjacent iterations. Here, the colors are given by

$$\begin{aligned} \frac{1}{1 + \left|z_n - z_{n+p}\right|} \end{aligned}$$

for different values of the recurrence period $p$:

  • $p = 1$
    Here just the main cardioid is highlighted. (The wavy dark stuff outside of the set isn't meaningful.)
    Mandelbrot set with period-1 recurrences highlighted.
  • $p = 2$
    Now we have the period-two circle around $c=-1$. The main cardioid, with period one, also repeats with period two.
    Mandelbrot set with period-2 recurrences highlighted.
  • $p = 3$
    The period-two circle is gone, but now we have the little lobes on the top and bottom of the main cardioid. The miniature version of the set centered around $c=-1.75$ also has period three.
    Mandelbrot set with period-3 recurrences highlighted.
  • $p = 4$
    We have all the period-two stuff again, but we've picked up the next period-doubled circle on the real axis, as well as a few lobes off of the main cardioid.
    Mandelbrot set with period-4 recurrences highlighted.
  • $p = 5$
    Another prime number, so there's no overlap between these lobes and any of the previous ones (except for the period-one cardioid, of course).
    Mandelbrot set with period-5 recurrences highlighted.

To get a hint for what's happening, here's the evolution of a particular point near the transition from period-one to period-three:

A portion of the Mandelbrot set, with a spiraling triangle of points.

Here we have a period-one convergence: the fixed point is

$$\begin{aligned} (-0.223 + 0.416i)^2 + (-0.1 + 0.6i) &\to -0.223 + 0.416i \end{aligned}$$

On the other hand, starting within the period-three lobe puts us in a different sort of cycle:

A portion of the Mandelbrot set, with a non-spiraling triangle of points.

Anyway, I've seen the plots of the points spiraling inward or crashing away before. But this is the first time I've figured out how to color the lobes based on their periods. Fun.

Here's two more, and then I have to stop. First, a figure that shows only the periods, with longer periods being represented by darker colors:

A Mandelbrot set colored by the recurrence period of each lobe

And finally, one that's a little zoomier, which shows the period for points that are definitely in the Mandelbrot set, but which also shows the escape time for some points which are outside of the set. The escape time hints at the jagged little paths connecting all of the islands to each other.2

A Mandelbrot set colored by the recurrence period of each lobe,
with some information about escape time for points outside of the set.

For my own future reference, this last was generated with code like

m = Mandelbrot.from_axis()
m.imshow(np.log(1+m.divergence_count(n=1000)))
period = np.zeros_like(m.count) ; n = 0
for n in range(1,51):
    dn = 1/(1+np.abs(m.z - m.advance(n=n)))
    period[ (dn > 1-1e-3) & (period == 0) ] = n
    print(f"{n=}: {(period == n).sum()=}")
pimg = m.ax.imshow(np.log(1+period), cmap='magma_r', alpha=0.65, \
        extent=m.image.get_extent(), origin=m.image.origin)

Meanwhile, the plots which simply highlight the lobes are plots of the dn parameter above with the 'magma' colormap. Here's the Mandelbrot object.


  1. Actually the colors on the blue-and-gold escape-duration plots are proportional to $\log(1+n_\text{escape})$, which shows the rapid-escape points better if I'm looking at a region where escapes take a long time. 

  2. Apparently there aren't any "islands," because the set is simply connected; however, whether it is also locally connected seems to be an unproven conjecture.