The Fractal That Hung on My Wall for 12 Years
A middle-school doodle of repeating squares on graph paper turns out to encode deep mathematics — from L-systems and base-5 numbering to matrix number systems, determinant geometry, and extensions into 3D and 4D space.
When I was in middle school, instead of doing what I was supposed to, I often doodled all sorts of things.
It was then that I managed to elegantly fill a drafting sheet by combining and repeating many squares — something between a "Cool S" and Penrose triangles.

I felt there was something deeper hidden in this drawing, but at the time I didn't have enough knowledge to fully comprehend its principles.
In the end, deciding to delegate this task to my future self — who would know mathematics much better — I hung my creation on the wall behind my desk, where it remained throughout my years in high school and college, and hangs to this day.
However, time passed, and today I've become that future version of myself who understands math a bit better. And since my fractal resembles a blooming flower and has hung on my wall for so many years, I'll affectionately call it "wallflower" — though below you'll see it bears a strong resemblance to some other well-known fractals.
The Construction Algorithm
Before diving into the study of this pattern, it's worth walking through the steps we followed in school when drawing it.
Start with one square.
Add four copies of this square to the left, right, above, and below it.

Add four copies of the current state, each rotated approximately 27 degrees clockwise around the original square.
Alternate steps 2 and 3 until the space is filled.
These two steps — adding copies along axes and adding rotated copies — create the fractal's distinctive pattern. Each iteration scales the figure by a factor related to the square root of 5.
L-System Generation
An alternative way to construct the fractal uses L-system substitution rules with rotations (R for right turn, L for left turn):
- Start: RRRR
- Substitution rules: R → RLR; L → RLL

Interestingly, I discovered that these two construction methods produce different results at higher iterations — the first method places copies along axes, while the L-system positions them diagonally. This divergence reveals something fundamental about how the same visual pattern can arise from different mathematical rules.
The Numbering System
To understand the fractal more deeply, I developed a numbering scheme based on its recursive structure, using base-5 notation since each iteration scales the figure by a factor of 5.

A key observation: numbers divisible by 5 form rotated grids at approximately 27 degrees. Numbers of the form 5n+1 show similar patterns with offsets. This isn't coincidence — it reflects the underlying matrix structure of the fractal.
Matrix-Based Representation
Using vector notation vec(n), I discovered that fractal positions follow matrix transformations. The core matrix M has determinant det(M) = -5.

The system uses M as a numerical base with vectors as "digits," creating a matrix-based number system rather than a scalar-based one. This is the mathematical heart of the fractal — positions aren't described by ordinary numbers but by vectors acted upon by matrix powers.
The representation works as follows: any position in the fractal can be written as a sum of vectors, each multiplied by a power of the matrix M. The "digits" are the five displacement vectors (center, left, right, up, down), and the "base" is the matrix itself.
Determinants and Variations
Two matrix variants exist with fascinating geometric consequences:
- M with det = -5: Creates the version hanging on my wall, where space "flips" at each iteration due to the negative determinant
- M' with positive determinant: Produces the more commonly documented quadratic von Koch island variant
The mysterious ~27 degree angle that appears throughout the construction emerges naturally from the vector (1, 2) with magnitude sqrt(5), where arctan(2/1) ≈ 63.43 degrees from the y-axis, giving about 26.57 degrees from the x-axis.

This angle isn't arbitrary — it's baked into the geometry of the integer lattice. The vector (1, 2) is the shortest integer vector whose squared magnitude equals 5, and 5 is the smallest number expressible as a sum of two non-zero squares. This is why the fractal fundamentally lives in base 5.
Extension to 3D
Naturally, I wondered: can this fractal be extended to three dimensions? Using cubes instead of squares, with a "3D plus" formation (6 copies: left, right, up, down, front, back), we need:
- Integer matrix entries
- Hamming distance of 3 between vector columns
- Determinant of ±7 for proper scaling

The 3D version works — but exhibits "slipping" artifacts in later iterations due to asymmetric placement. The six direction vectors in 3D cannot be arranged with the same symmetry as the four direction vectors in 2D. The result is a fractal that fills space but does so unevenly, with visible seams between iterations.
The 4D Solution
The slipping problem in 3D led me to explore four dimensions. In 4D space with orthogonal unit vectors, proper symmetric expansion becomes possible.

The 4D version uses 8 direction vectors (±1 along each of 4 axes) plus the center, for a total of 9 digits — but we actually need only 7 (the center plus 6 neighbors in a carefully chosen subspace). I visualized this using nested 7×7 grids representing 2D slices of 4D space.
The 4D fractal encodes quaternions in what can be described as a "balanced base quaternion" system with base i+j+k. The matrix in this case has determinant 7, and the construction achieves the perfect symmetry that was impossible in 3D.
Which Dimensions Work?
A remarkable conclusion emerges: only dimensions 1, 2, and 4 permit fractal extensions satisfying all geometric constraints simultaneously — integer coordinates, proper scaling, symmetric neighbor placement, and space-filling behavior.
In dimension 1, we get a simple interval-filling fractal in base 3. In dimension 2, we get my wallflower in base sqrt(5). In dimension 4, we get the quaternionic version in base 7. Dimension 3 comes close but can never achieve full symmetry.
This is not a coincidence. The dimensions 1, 2, and 4 correspond to the real numbers, complex numbers, and quaternions — the three associative normed division algebras. The fractal construction secretly depends on having a division algebra structure, which is why it works perfectly only in these dimensions.
What began as idle doodling in middle school turned out to connect to some of the deepest structures in mathematics — from number theory and L-systems to matrix representations and division algebras. Sometimes the most interesting mathematics is hiding in plain sight, hanging on your wall for twelve years, waiting for you to be ready to understand it.