Some of the most fun mathematical rabbit trails I’ve been drawn to explore started with doodling. Most of my notebooks and papers have always had scribbles1 exploring some tiling pattern or fractal while I was a student. Magic squares, Sierpiński triangles, and convoluted Apollonian gaskets were common repeats, although I didn’t know their names at first. I learned their names from graphic novels, or doing research for a different doodle, or (somewhat more rarely) in a math class.
Here is a doodle probably best described visually2 rather than textually, but I’ll take a swing at both.
This is a composition of “strips”3 of unit squares that wrap around the center of the figure. Starting at a single square, subsequent strips add one unit square to their length. You could keep counting and wrapping forever, but it only takes until strip number three to discover a tidily packed 2x3 rectangle (if you skip over the trivial starting square).
The Icon

There is no accounting for taste, but this little pattern shattered my doodle pantheon irreparably. It can be made neatly in margins, or (more naturally) the center of a piece of graph paper. It holds symmetry, asymmetry, and fundamental mathematical meaning. It amounts to a visual proof that
The incumbents (a toothpick sequence, platonic nets, the Golden Rectangle and curve) were blindsided and caught flat-footed. The next instance of this perfect rectangular curl, though, is what took this from a rookie-of-the-year scribble to a full-blown sun-darkening pattern obsession.4 It happens on the eighth strip.
The Graphic Design
The implied geometric proof that emerges from the strip-eight rectangle rhymes with our strip-three rectangle but is different in an important detail:
This rectangle is a square. It’s satisfying to have one example of each type, and a way to constrain the problem is starting to reveal itself. Lots of questions emerge, about the area pattern (1, 6, 36,…), the last strip pattern (1, 3, 8,…) that aren’t clear until we graduate from hand-drawing the thing. But the main question is: how do I predict the next one?
We have so far on the right hand side the running total number of units in the figure. It’s a well-known sum with some rare mathematical folklore attached. It simplifies like this (where n is the number of strips in the figure):
The first 8 terms of this sequence are 1, 3, 6, 10, 15, 21, 28, 36… squares and near-squares bolded.
On the left hand side of the equation a simple area calculation for rectangles based on height and width. You could think of it as the area of the bounding box of the figure, since we know that when these just-perfect rectangles form, they fill their bounding boxes. Even as the figure continues to add strips, the difference between its bounding height and bounding width is never more than one unit. It goes from a 1x1 to a 1x2, then 2x2, 2x3, 3x3, and so on. In other words, the only possible rectangles that can be formed are squares or near-squares (basically n by n or n by n+1). This sequence models quite directly the growth of the bounding box of the figure, adding to previous terms with a processional stutter-step. The nth number in this sequence can be described as5
The first few terms might seem to start weird, but the pattern of adding a row and then column to a rectangle falls out quickly. The first say… thirteen terms are 0, 0, 1, 2, 4, 6, 9, 12, 16, 20, 25, 30, 36.
So we have a kind of sieve for finding rectacurl6 numbers by counting up the area amassed by each added strip and checking whether it is a square or near-square. I do some quick scripting, validate by drawing, and find the next one is probably the last one I’ll draw by hand.
The QR Code
After adding strip number twenty, this eye-straining optical non-illusion is left. There are 210 unit squares7 packed into the 14x15 grid. I have reached the end of pen-and-paper exploration and at this point am just trying to get enough of a sequence to trigger the right search results in the OEIS.8 I’ve been using it this whole time to better understand the triangular numbers (A000217) and the so-called quarter-squares (A002620) but now I’m fishing for their intersection with the first few terms.
4 8 15 16 23 42
“1, 6, 36, 210, …” returns a handful of sequences, but only one sequence survives the addition of 1,225 and 7,140. A096979 is described as the “sum of the areas of the first n+1 Pell triangles”, a term as new to me when I read it as it probably is to you now. It’s here that I notice a related formula with a few purple links.910
Stay with me while I break out the red yarn and thumbtacks.
A096979 is the sequence we care about. The areas of these rectangles made out of twisting incrementally longer strips around a center. A002620 are the quarter-squares. A000129 are the Pell numbers. A000217 are the triangular numbers. A048739 is new to us, but can apparently be described as a sequence of partial sums of Pell numbers.11 In fact, it looks a lot like the sequence of terminal strips12 (1, 3, 8, 20,…). So let’s put it all together in words.
“The sum of the areas of the first n+1 Pell triangles”
is
“the (n+1th Pell number)th quarter-square“
is
“the (n-1th partial Pell sum)th triangular number“
Clear as mud. What this means on a more macroscopic level is that these rectangles that fall out of our figure, call them I don’t know… Pell Tiles are the intersection of triangular numbers and quarter squares and this is how to get that intersection. And I can just… generate the numbers without any drawing or scripting:13
So if we only found the first few members (1, 6, 36, 210…) we could fill out the rest. It’s continuously growing a little bit slower than 6x per term, so it blows up fast.
1,225 is the square of 35, and the sum of numbers 1 to 49. That is not obvious or trivial! But we are sure of its properties without making a drawing or adding up 49 integers. Math has a wonderful way of taking a simple grain of a question through a thresher of rigor and complexity and notation to a plain, undeniable kernel of truth at the end, one that you wouldn’t be confident about if it weren’t for the thresher.
Or entire pages
This word is mine, not math’s.
I’m not even really kidding here. While my own experience of artistic inspiration is limited, I feel like I get a small taste of that compulsion when a geometric puzzle or number pattern captures my attention. It is involuntary and complete, for better or worse in both cases.
Keeping in mind ⌊x⌋ (read “the floor of x”) is essentially x rounded down. ⌊7.3⌋ = 7, ⌊9.9⌋ = 9, ⌊4⌋ = 4.
If you have a better name please tell me.
Not 216, interestingly! Or maybe unsurprisingly, since that number isn’t a square or near-square.
The On-Line Encyclopedia of Integer Sequences is a huge resource in nearly every rabbit trail I travel. This free and extremely usable site is a window into an internet without bloat, advertisement, or agenda. Pure horizontal knowledge sharing.
Read A(n) as “the nth term in the A sequence“ or “A’s nth term“.
Shout out to the contributor who added it here. I don’t know what you were doing that took you to this destination. Either we found the same doodle and followed the same questions or these sequences are connected in other, more important ways from other parts of math. I suspect the latter.
A classic triple-coincidence.
Because it is.
There is a very ugly closed form without recursion that I will not afflict anyone else with.