Fawn Nguyen recently updated her terrific Visual Patterns website and mentioned how she used AI to help her rebuild the site. She also updated the patterns on the website to all use squares instead of some of the random shapes previously used in patterns.
This got me wondering: how well can AI make sense of the patterns themselves? I decided to do some investigation.
I uploaded this pattern to Gemini.

And this is Gemini’s response when asked to analyze the pattern and determine a rule matching the pattern, and then annotate the image to make it apparent how the rule matches.

I decided that this response was a bit too detailed, and asked it to simplify the image and focus on the annotation instead of including all of the explanation on the image itself. For a simple linear pattern, Gemini’s output is more than adequate (although, it does have an error in the figure n element of the image).

Next, I tried this same task with Claude.

Interestingly enough, Gemini and Claude have different ways of decomposing the visuals to represent the linear pattern. The simple task that a 6th grade student can do was completed by both AI tools I tried.
Next, I moved onto a more complicated pattern. I fed this quadratic pattern into both tools to see what the AI models could do with it.

This is where the AI models struggled. Initially, Gemini treated the visual as a growing linear pattern, and tried to get their annotation and formulas to match linearly. Claude simply did not attempt the annotation at all, although it seemed more aware this pattern is quadratic in nature.
Here’s Gemini’s output. There are obvious errors in the output, including Gemini completing missing a column of the right part of the 3rd figure.

Here’s Claude’s initial attempt. Notice how the AI model does not follow my instructions on visually annotating the pattern and instead just counts the squares and comes up with a formula. This formula also isn’t displayed correctly.

I asked Claude next to make explicit and direct connections between the visuals and the formula. I even told Claude another form of the formula is Total squares = 2n(n+1) + 3. Here’s what it came up with.

Notice how it tries to fit the +3 to the three squares at the bottom of the image, even though these three squares are not what most people who see this image think of as the constant part of the image. On the other hand, at least Claude is able to correctly match the value of n to the formula and has shaded the right number of squares. It doesn’t make use of the structure of the shape at all.
Here are a couple of the ways my students have seen the structure of one of the terms pattern over the years. Notice that the structure is very clear, especially the symmetry inherent in each figure of the pattern. While these images do not explicitly show students making connections between a formula and the figures, my 8th grade students this past semester could nearly all visualize this relationship and come up with it on their own.

The human mind makes use of visual structure in a way that the models I tested did not. The AI models I tested, which are the general free models available to consumers, are not yet as “smart” as middle school students in seeing and making use of mathematical structure.
This amazes me in a way, since I recently read that some of these models have made headway on incredibly complex mathematics and even outputted proofs or counter-examples to theorems not yet proven by mathematicians.
