The following problem has come up in the context of unitary equivalence of sets of matrices. However, here I will omit the context and state it as a standalone combinatorial problem.
Consider bitstrings, i.e., words made of 0's and 1's. The rule is: No sub-pattern can repeat more than $d$ times and the boundary conditions are periodic. Some examples of invalid bitstrings for $d=2$:
000 (repetition),
0100 (repetition across boundary),
0101101101 (repetition of sub-pattern 101)
Here are examples of valid string: 101, 010011011
Update: To clarify: a repetition only counts if the repetitions are adjacent to each other. For example, 010011011 is valid even though 01 appears multiple times, but never three times in a row.
The questions are:
Are there infinitely many valid strings or not?
If not, can one give an upper bound to the number of valid strings?
Our first impression is that one can get very long bit strings. However, we have neither been able to show that one can generate infinitely many, nor that there are only finitely many.
The concept you're looking for is a 'power-free words'. Let $q$ be the power you're interested in. A (finite or infinite) word $v$ is $q$-power-free if there exists no non-empty word $u$ such that the word $$u^q = \overbrace{u\cdots u}^{q\text{-times}}$$ is a subword of $v$.
Every sufficiently long binary word contains squares because the only way to avoid the squares $00$ or $11$ is for your word to be $01010101\cdots$, in which case the square $0101$ is a subword.
The most famous example of a cube-free word is the infinite Thue-morse word $$v = 0110100110010110 \cdots$$ defined to be the limit of the substituton $$\theta \colon \begin{cases}0 &\mapsto 01\\ 1 &\mapsto 10\end{cases}.$$ So we have $$0 \mapsto 01 \mapsto 0110 \mapsto 01101001 \cdots.$$