The Fractal That Hung on My Wall for 12 Years

A pattern doodled in a school notebook became a wall decoration, then a 12-year mystery, then a journey through L-systems, matrix number bases, and the strange mathematics of why the construction only works in dimensions 1, 2, and 4.

In middle school I drew a pattern by combining and repeating squares. The result looked like something between a Cool S and a Penrose triangle — vaguely floral, pleasantly self-similar. I liked it enough to hang it on my wall, where it stayed for twelve years without my ever really understanding what it was.

Eventually I decided to find out. This is what I found.

The wallflower fractal

How to Build It

The construction is iterative. Start with a single square. Then:

  1. Add four copies of the current figure, placed above, below, left, and right of it.
  2. Add four more copies, but rotated by approximately 27 degrees.
  3. Repeat, alternating between orthogonal and rotated placements, until the plane fills.
Fractal construction animation

The angle of roughly 27 degrees is not arbitrary. It comes from the vector ⟨1, 2⟩, which makes an angle of arctan(2/1) ≈ 63.43° with the horizontal — and the rotation between successive levels is the complement of that. Everything flows from choosing that particular vector.

The L-System Connection

I discovered that the pattern can be generated by a Lindenmayer system (L-system) — a formal substitution grammar used to model plant growth and generate fractals. The rules are:

  • R → RLR
  • L → RLL

Starting from the seed RRRR and applying substitutions repeatedly produces the growth sequence of the fractal.

L-system substitution tree

But here is where it gets interesting: the L-system method and my original "dragging" method diverge at higher iterations. The L-system places new copies diagonally; the wall version places them orthogonally. They produce two related but distinct fractals. My wall fractal was not quite the textbook version.

Two fractal variants

A Numbering System for the Fractal

Treating the fractal as a space-filling curve suggests a natural way to number every cell. Each iteration multiplies the number of cells by 5 — the figure grows by a factor of 5 at each level. This makes base-5 representation feel natural.

Base-5 numbering overlay

But the positions are two-dimensional, and standard base-5 is one-dimensional. The right framework turns out to be a matrix-based number system. Instead of a scalar base like 5, use a 2×2 matrix M as the base. Instead of scalar digits 0–4, use a set of five vectors as the "digits." A position in the fractal is then expressed as:

position = M² * d₂ + M¹ * d₁ + M⁰ * d₀

where each dᵢ is one of the five digit vectors. The matrix M must satisfy |det(M)| = 5, which matches the 5× growth factor per iteration. The specific matrix that generates this fractal has determinant ±5, and its eigenvectors correspond to the rotation angle of 27 degrees.

Matrix number system diagram

Connections to Other Number Systems

This construction is not as exotic as it sounds. It is closely related to several known systems:

  • Balanced ternary: A base-3 system using digits {-1, 0, 1} instead of {0, 1, 2}, which gives symmetric representations and some computational advantages.
  • Quater-imaginary base: A complex number system with base 2i, where every Gaussian integer has a unique finite representation using only digits {0, 1, 2, 3}.
  • Base (2+i): Another complex number system encoding Gaussian integers in base 2+i, with |2+i|² = 5 — the same factor of 5 that appears in our fractal.

The fractal is, in a precise sense, a geometric realization of the number system with base (2+i).

Complex number base visualization

Extending to Higher Dimensions

The natural question: can you build the same structure in 3D? I tried. The answer is: not cleanly. In 3D, the construction "slips" — the copies don't tile correctly because of an asymmetry in how the rotation group works in odd dimensions.

3D extension attempt

But in 4D, it works perfectly. The 4D version uses a 4×4 matrix M with determinant ±7. The digit vectors must satisfy three constraints:

  • All columns of the digit matrix have Hamming distance exactly 3 from each other
  • The columns are mutually orthogonal
  • All entries are integers (to preserve the lattice structure)

When these conditions are met, the 4D fractal tiles perfectly and has all the same self-similar properties as the 2D version. I call it the orthofloreolus.

4D fractal slice animation

Why Only Dimensions 1, 2, and 4?

This turns out to be the most interesting constraint. The construction requires a number of digit vectors equal to the determinant of the base matrix, and the vectors must be mutually orthogonal. The number of mutually orthogonal integer vectors of a given length in n-dimensional space is severely constrained by the theory of quadratic forms.

The specific combination of requirements — integer entries, mutual orthogonality, and the right determinant — is satisfiable in dimensions 1, 2, and 4. In dimension 3 and all dimensions above 4, no valid construction exists. This connects to the same reason why the only normed division algebras are the reals (dim 1), complex numbers (dim 2), quaternions (dim 4), and octonions (dim 8) — with the octonions being non-associative and thus excluded from our stricter requirements.

The 4D version encodes quaternions: it is, precisely, a balanced nonary quaternionic representation.

Dimension constraints diagram

A Final Reflection

I spent twelve years not thinking about that pattern on my wall. When I finally did think about it, it led through L-systems, matrix number bases, complex number arithmetic, and the deep structure of why certain constructions are possible only in specific dimensions. All from a doodle in a school notebook.

Procrastination, it turns out, is sometimes just deferred depth.

Full fractal tiling