Matching ABACABA-type patterns (This challenge is related to the challenge &quot;Generate the Abacaba sequence.&quot;)
Zimin words (also called &quot;sesquipowers&quot;) are an important idea in the subject of &quot;combinatorics on words&quot;. This is because every Zimin word is &quot;unavoidable&quot;, meaning that every sufficiently long word over a finite alphabet has a substring that is an &quot;instance&quot; (defined below) of the Zimin word. Remarkably, every binary word of length 29 has a substring that is an instance of the pattern \$ABACABA\$.
Definitions
Zimin words are recursively defined:

\$Z_1 = A\$
\$Z_2 = ABA\$
\$Z_3 = ABACABA\$
\$Z_4 = ABACABADABACABA\$
\$\vdots\$
\$Z_{n+1} = Z_n X Z_n\$

It's a little tricky to formally define what it means to be an &quot;instance&quot; for a word without talking about free monoids and homomorphisms, but it's easy enough to see from some examples.
At a hand-wave-y level, a word \$w\$ is said to be an &quot;instance&quot; of a pattern if there's a way to assign a (non-empty) string to each letter of the pattern and recover \$w\$.
Examples
Consider the word &quot;11211212211221&quot; on two letters.

It has \$105\$ substrings that are instances of the Zimin word \$Z_1 = A\$ because every substring is an instance of \$A\$.
It has \$54\$ substrings that are instances of the Zimin word \$Z_2 = ABA\$—for example, the substring &quot;212211221&quot;: $$
  11211\underbrace{21}_A\underbrace{22112}_B\underbrace{21}_A.
$$
It has \$1\$ substring that is an instance of the Zimin word \$Z_3 = ABACABA\$: $$
11 \underbrace{2}_A \underbrace{11}_B \underbrace{2}_A \underbrace{12}_C \underbrace{2}_A \underbrace{11}_B \underbrace{2}_A 21.
$$
It has \$0\$ substrings that are instances of the Zimin word \$Z_4 = ABACABADABACABA\$.

Thus if you are given &quot;11211212211221&quot;, you should return [105, 54, 1].
Challenge
This code-golf challenge will give you a word as an an input, and asks you to output a list of the number of substrings that are instances \$Z_1, Z_2, \cdots, Z_n\$ until there are not any substrings that are instances. That is, your program should never output 0.
You can take the word in any reasonable way: as a string, as a list of strings, as a list of appropriately coded integers, as a pair of integers \$(b,i)\$ where \$i\$ is base-\$b\$ encoded integer, etc.
Test Data
word                           | zimin_counts(word)
-------------------------------+-------------------
&quot;&quot;                             | []
&quot;P&quot;                            | [1]
&quot;MOM&quot;                          | [6,1]
&quot;alfalfa&quot;                      | [28, 8]
&quot;aha aha!&quot;                     | [36, 9, 1]
&quot;xxOOOxxxxxOOOxxx&quot;             | [136, 64, 9]
&quot;3123213332331112232&quot;          | [190, 55, 1]
&quot;2122222111111121221&quot;          | [190, 80, 3]
&quot;13121311213121311212&quot;         | [210, 114, 25, 2]
&quot;344112222321431121114&quot;        | [231, 48]
&quot;141324331112324224341&quot;        | [231, 49]
&quot;344342224124222122433&quot;        | [231, 61, 1]
&quot;331123321122132312321&quot;        | [231, 74]
&quot;11221112211212122222122&quot;      | [276, 149, 4]
&quot;2222222112211121112212121&quot;    | [325, 166, 6]
&quot;AAAaaAAAAAAAaAaAAaAaAAAAA&quot;    | [325, 198, 30]
&quot;1100000010010011011011111100&quot; | [406, 204]
&quot;1111221211122111111221211121&quot; | [406, 261, 56, 2]
J, 63 58 53 52 51 47 bytes
_1}.1#.a:~:[:([#~[e.&amp;,(],,)&amp;.&gt;/)^:a:~@;&lt;@(&lt;\)\.

Try it online!
-2 bytes thanks to Bubbler
-3 bytes thanks to FrownyFrog for golfier way to create all substrings of a string.
how
We'll use MOM as our example:

[:...;&lt;@(&lt;\)\. All substrings of the input, boxed.
┌─┬─┬─┬──┬──┬───┐
│M│O│M│MO│OM│MOM│
└─┴─┴─┴──┴──┴───┘


(...)^:a:~ Using the substrings as both the left and right args ~,
apply the verb in parens until a fixed point, keeping track of each iteration's
results ^:a:.

(...(],,)&amp;.&gt;/) To create the next &quot;level&quot; of candidates, create all possible
combinations that look like &lt;level_n&gt;&lt;orig substring&gt;&lt;level_n&gt; where
level_n is any element from the current level, and &lt;orig substring&gt; is
one of the original input substrings (level 0).  Then the 1st level looks like:
┌─────┬─────┬─────┬───────┬───────┬─────────┐
│MMM  │OMO  │MMM  │MOMMO  │OMMOM  │MOMMMOM  │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MOM  │OOO  │MOM  │MOOMO  │OMOOM  │MOMOMOM  │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MMM  │OMO  │MMM  │MOMMO  │OMMOM  │MOMMMOM  │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MMOM │OMOO │MMOM │MOMOMO │OMMOOM │MOMMOMOM │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MOMM │OOMO │MOMM │MOOMMO │OMOMOM │MOMOMMOM │
├─────┼─────┼─────┼───────┼───────┼─────────┤
│MMOMM│OMOMO│MMOMM│MOMOMMO│OMMOMOM│MOMMOMMOM│
└─────┴─────┴─────┴───────┴───────┴─────────┘


[#~[e.&amp;,... Check if each original substring is an element of this candidate
list [e.&amp;,, and use that to filter the original substrings [#~.  In the above
example, only MOM passes.

After the above process iterates to its fixed point (no more matches), the result
is:
┌───┬─┬─┬──┬──┬───┐
│M  │O│M│MO│OM│MOM│
├───┼─┼─┼──┼──┼───┤
│MOM│ │ │  │  │   │
├───┼─┼─┼──┼──┼───┤
│   │ │ │  │  │   │
└───┴─┴─┴──┴──┴───┘


a:~: Since we don't want to count empty boxes, we perform an elementwise
test for &quot;not equal to the empty box a:&quot;, giving us a 0-1 matrix:
1 1 1 1 1 1
1 0 0 0 0 0
0 0 0 0 0 0


1#. Sum rows:
6 1 0


_1}. And kill the last element:
6 1