$(k,\lambda)$-Anti-Powers and Other Patterns in Words

Given a word, we are interested in the structure of its contiguous subwords split into $k$ blocks of equal length, especially in the homogeneous and anti-homogeneous cases. We introduce the notion of $(\mu_1,\dots,\mu_k)$-block-patterns, words of the form $w = w_1\cdots w_k$ where, when $\{w_1,\dots,w_k\}$ is partitioned via equality, there are $\mu_s$ sets of size $s$ for each $s \in \{1,\dots,k\}$. This is a generalization of the well-studied $k$-powers and the $k$-anti-powers recently introduced by Fici, Restivo, Silva, and Zamboni, as well as a refinement of the $(k,\lambda)$-anti-powers introduced by Defant. We generalize the anti-Ramsey-type results of Fici et al. to $(\mu_1,\dots,\mu_k)$-block-patterns and improve their bounds on $N_\alpha(k,k)$, the minimum length such that every word of length $N_\alpha(k,k)$ on an alphabet of size $\alpha$ contains a $k$-power or $k$-anti-power. We also generalize their results on infinite words avoiding $k$-anti-powers to the case of $(k,\lambda)$-anti-powers. We provide a few results on the relation between $\alpha$ and $N_\alpha(k,k)$ and find the expected number of $(\mu_1,\dots,\mu_k)$-block-patterns in a word of length $n$.


Introduction
In 1975 Erdős, Simonivits, and Sós [4] introduced anti-Ramsey theory, the idea that sufficiently large partitioned structures cannot avoid anti-homogeneous substructures. Their investigation was initially graph-theoretic, but with time anti-Ramsey-type results have permeated many areas of combinatorics, including the studies of Sidon sets, canonical Ramsey theory, and the spectra of colorings [1,10,12]. The study of homogeneous and anti-homogeneous substructures can also be extended to words, finite or infinite (to the right) sequences of letters from a fixed alphabet. The substructures of interest are contiguous subwords, known as factors. A well-studied type of regularity in words concerns k-powers, that is, words of the form u k = uu · · · u (concatenated k times) for some nonempty word u (see, for example, [7]). Recently Fici et al. [6] introduced a notion of anti-regularity in words through their definition of k-anti-powers. Definition 1.1. Let |u| denote the length of a word u. A k-anti-power is a word w of the form w = w 1 w 2 · · · w k such that |w 1 | = · · · = |w k | and w 1 , . . . , w k are distinct.
E-mail address: burcroff@umich.edu Fici et al. [6] were able to show several properties of anti-powers in words, including anti-Ramsey results concerning the existence of -powers or k-anti-powers. Defant [3] and Narayanan [9] showed that ap(t, k), the minimum m > 0 for which the factor of length km beginning at the first index of the famous Thue-Morse word t is a k-anti-power, grows linearly in k. Defant also introduced the notion of (k, λ)-anti-powers, which is a generalization of k-anti-powers. Definition 1.2. A (k, λ)-anti-power is a word w of the form w = w 1 w 2 · · · w k such that |w 1 | = · · · = |w k | and |{i : w i = w j }| ≤ λ for each fixed j ∈ {1, . . . , k}.
Note that when λ = 1, this is precisely the definition of a k-anti-power. Whenever such a generalization is nontrivial, we prove that the results of Fici et al. in [6] concerning k-anti-powers generalize to the case of (k, λ)-anti-powers. In fact, many of these results can be strengthened by enforcing a particular structure on the partition of the blocks by equality. We generalize the notions of k-powers and k-anti-powers while refining the (k, λ)-anti-powers through the introduction of (µ 1 , . . . , µ k )-block-patterns. Definition 1.3. Let µ 1 , . . . , µ k be nonnegative integers satisfying k s=1 sµ s = k. A (µ 1 , · · · , µ k )block-pattern is a word of the form w = w 1 · · · w k where, if the set {1, . . . , k} is partitioned via the rule i ∼ j ⇐⇒ w i = w j , there are µ s parts of size s for all 1 ≤ s ≤ k.
The generalizations of the anti-Ramsey results of Fici et al. in [6] to the case of (µ 1 , . . . , µ k )block-patterns are the focus of Section 3. In particular, we obtain bounds on the sizes of words avoiding powers or block-patterns with at most σ pairs of equal blocks. In Section 4, we generalize the results of [6] on avoiding k-anti-powers in infinite words to (k, λ)-anti-powers. We also observe that Sturmian words have anti-powers of every order starting at each index.
A slight strengthening of the arguments of Fici et al. in [6] also provide better bounds for N α (k, k), the smallest positive integer such that every word of length N α (k, k) over an alphabet of size α contains a k-power or k-anti-power. Namely, it is shown in [6] that for k > 2, In Section 5, we improve both the lower and upper bounds according to the following theorem.
Theorem 5.1. For any k > 3, In Section 5 we also investigate how the size of the alphabet affects N α (k, k). In Section 6, we return to the more general setting and compute the expected number of (µ 1 , . . . , µ k )-blockpatterns in a word of length n.

Preliminaries
, and for i < j the contiguous substring beginning at the i th letter and ending with the j th is denoted x[i..j]. A word v is a factor of x if x = uvw for words u and w. In the case that u is empty, v is a prefix of x, and if w is empty, then v is a suffix of x. The suffix of x beginning at the j th index of x is denoted x (j) . If w is both a prefix and suffix of x, then w is a border of x.
A word is called recurrent if every finite factor appears infinitely many times in the word. A word x is called eventually periodic if there exists an index j ≥ 0 and a finite word u such that x (j) = u ω ; otherwise x is called aperiodic. A word is called ω-power-free if for every finite factor u, there exists an ∈ N such that u is not a factor. Note that a word that avoids k-powers for some k ∈ N is ω-power-free, but the converse is not necessarily true. 3. Generalization of an Anti-Ramsey result to (µ 1 , . . . , µ k )-block-patterns A main result of Fici et al. [6] is that every infinite word contains either powers of all orders or anti-powers of all orders. Since powers are homogeneous substructures whereas the anti-powers are anti-homogeneous, one may wonder if similar results can be demonstrated for substructures between these extremes. We will generalize their result to the case of (µ 1 , . . . , µ k )-block-patterns in infinite words. The density bounds rely on the number of pairs of equal blocks that are forced in the prefixes of length km, . . . , k(m + β) for some m, β. The following definition is created to account for these pairs. Definition 3.1. Let D(x, k, σ) be the set of m ∈ N such that the prefix of the word x of length km is a (µ 1 , . . . , µ k )-block-pattern satisfying k s=1 µ s s 2 ≤ σ.
Note that D(x, k, σ) is closed downward with respect to the dominance order. That is, if m ∈ D(x, k, σ) and m ∈ N are such that x[1.
For the proof of Theorem 3.3, we make use of the following lemma of Fici, Restivo, Silva, and Zamboni. Let v be a border of a word w and let u be the word such that w = uv. If is an integer such that |w| ≥ |u|, then u is a prefix of w. such that u is a factor of x.
so v is a border of w. Writing w = uv, we have Hence, |w| = |u| + |v| ≥ |u|. By Lemma 3.2, u is a factor of x.
Theorem 3.3 can be applied to the special case of (k, λ)-anti-powers. The definition of (k, λ)anti-powers suggests the following generalization of AP(x, k), the set of integers m such that the prefix of x of length km is a k-anti-power.
Definition 3.4. Let AP(x, k, λ) be the set of m ∈ N such that the prefix of the word x of length km is a (k, λ)-anti-power.
for some k, λ ∈ N. For every , there is a word u with |u| ≤ (k − 1) k 2 −k λ 2 +λ such that u is a factor of x.
Proof. Fix k and λ as above. Note that N\ AP(x, k, λ) ⊆ D x, k, λ+1 2 . Hence, This shows that x satisfies the conditions of Theorem 3.3 for the same k and σ = λ+1 2 .
In the case that our alphabet is finite, there are finitely many factors of length at most (k − 1) k 2 −k λ 2 +λ . Thus, the Pigeonhole Principle allows us to choose a word u that works for every in Theorem 3.5.
Corollary 3.6. Let x be an infinite word on a finite alphabet such that There is a λ = 1 analogue to Corollary 3.5 in [6] (their Theorem 4), which claims under the same density condition that x is not ω-power-free. Though the condition that the alphabet is finite is not explicitly stated, their result is false for infinite alphabets. In fact, there exist ωpower-free words which avoid k-anti-power prefixes for some fixed k ∈ N. These words also show that Theorem 6 of [6], which states that ω-power-free words have anti-powers of every order beginning at each index, is false when infinite alphabets are allowed. Theorem 3.7 provides a counterexample to Theorems 4 and 6 in [6] when infinite alphabets are permitted.
Theorem 3.7. There exists an ω-power-free word x on an infinite alphabet such that AP(x, k) is empty for some k ∈ N.
Since there are finitely many appearances of each letter a i , y is clearly ω-power-free. Note that if 2 i+1 − 2 i = 2 i ≥ 4m for some block length m and some i satisfying 2 i+1 < km, then two blocks of the prefix of length km must equal a m i . Hence, m ∈ AP(x, k). For k ≥ 17, such an i always exists. AP(x, k) is empty for k ≥ 17, despite x being ω-power-free.
We return to a modified version of the proof of Theorem 3.3 in order to find bounds on the length of words avoiding k-powers and k-anti-powers.
Proof. As in [6], the upper bound follows from the proof of the infinite case in Theorem 3.3. Let β = 1 σ k 2 . Let x be any word of length β(k 3 − k 2 + k). For each r ∈ {(k 2 − k)β, . . . , (k 2 − k + 1)β}, consider the first k consecutive blocks of length r in x, denoted by U 0,r , U 1,r , . . . , U k−1,r . If x does not contain any element of D(x, k, σ), then there exist i, j, r, s such that 0 x contains a k-power. The length of x is chosen to accommodate k blocks of size at most (k 2 − k + 1)β.
The lower bound is proven via a construction; we will show that the word If u k were a factor of x, either u would contain the letter 1, contradicting the fact that that x has at most k − 1 copies of the letter 1, or u = 0 m for some m ≥ 1, contradicting the fact that x has no factor equal to 0 k . Hence, x avoids k-powers. We can see that for every factor v of length km, at least 1 2 ( We can specialize Theorem 3.8 to the case of (k, λ)-anti-powers.
Proof. Suppose a word avoids (k, λ)-anti-powers. Then it avoids ( yields the corresponding bounds. In particular, this improves upon the upper bound for N α (k, k) (in their notation, N (k, k)) in [6].

Avoiding Anti-Powers
This section is devoted to generalizing the results of Fici et al. [6] on infinite words avoiding k-anti-powers to the case of (k, λ)-anti-powers. Many of these generalizations can be achieved using proofs similar to those in [6]. We also provide a condensed proof of the fact that the Sturmian words contain anti-powers of every order beginning at every index.
We begin with a straightforward lemma.
Proof. It is enough to show that if a word avoids (k, λ)-anti-powers, then it avoids (k − 1, λ − 1)anti-powers. Suppose that a word x contains a (k − 1, λ − 1)-anti-power w of length km. If we extend to the right by m letters, we obtain a (k, λ)-anti-power, since we increase the number of equal blocks, |{i : w i = w j }| for any j, by at most 1. In order to classify the words avoiding (k, k − 2)-anti-powers, we will use two results of Fici, Restivo, Silva, and Zamboni.   (1) For k > 1, the infinite words avoiding (k, k − 1)-anti-powers are precisely the constant words.
(2) For k > 2, infinite words avoiding (k, k − 2)-anti-powers are the words that differ from a constant word in at most one position.
Proof. The first claim is trivial; merely note that the avoidance of (k, k − 1)-anti-powers implies that every factor whose length is a multiple of k is a k-power.
For the second claim, let x be a word avoiding (k, k −2)-anti-powers. By Lemma 4.1, x avoids 3-anti-powers. By Lemma 4.3, x is a binary word. Suppose, seeking a contradiction, that x has at least 2 instances of 1 and at least 2 instances of 0, i.e., x differs from a constant word in more than one position. Then x has a factor of the form 10 a 1 b 0 or 01 a 0 b 1 for some a ≥ 1, b ≥ 1; without loss of generality assume it is the first. By Proposition 4.4, a = b = 1. However, under these conditions, x has a factor of the form 1010, which is itself a (4, 2)-anti-power.
For the third claim, we exhibit a family of infinite aperiodic words avoiding (k, k − 3)-antipowers. Let {γ i } n i=1 be an increasing sequence such that γ i+1 ≥ (k + 1)γ i for all i ∈ N. Define a word x as follows: We will show that x avoids (k, k − 3)-anti-powers. Note that if x[ + 1.. + n] has at least two nonzero entries, then for some i we have This implies that n > kγ i ≥ k( + 1), so + 1 ≤ n k . Suppose, seeking a contradiction, that the k consecutive blocks x[j + 1..j + m], . . . , x[j + (k − 1)m + 1..j + km] form a (k, k − 3)-anti-power. At most k − 3 of these blocks can be 0 m , so the word x[j + m + 1..j + km] has at least two nonzero entries. Thus, j + m + 1 ≤ (k−1)m k . It follows that j + 1 < 0, a contradiction. Proof. Let w be the limit of the sequence w 0 = 0, w n+1 = w n 1 (k−3)|wn| w n . Note that each occurrence of w n except the first is preceded and followed by 1 (k−3)|wn| . Let v = v 1 v 2 · · · v k be a factor of w, where |v i | = > 0 for all i ∈ {1, . . . , k}. Let n be the largest integer such that Since w is recurrent, we can assume v appears after the first appearance of w n .
We claim that at most four blocks of v can intersect an occurrence of w n . Each occurrence of w n intersects at most two blocks of v by the condition 2 > |w n |. Moreover, any three occurrences of w n are separated by factors of 1 (k−3)|wn| and 1 (k−3)|w n+1 | ,. As v can intersect at most 2 occurrences of w n . We can conclude that at most four blocks of v are not equal to 1 .
We now restrict ourselves to the setting of k-anti-powers. In [6], Fici et al. question under what conditions aperiodic recurrent words can avoid k-anti-powers. It is known this is possible for k ≥ 6 and impossible for k ≤ 3, but nothing has been shown for k = 4 or 5. One class of aperiodic recurrent words that we can exclude from this search are the Sturmian words.
Definition 4.7. A Sturmian word is an infinite word x such that for all n ∈ N, x has exactly n + 1 distinct factors of length n.
Note that Sturmian words are necessarily binary. An alternate characterization of the Sturmian words in terms of irrationally mechanical words was given by Morse and Hedlund [8] in 1938.
Definition 4.8. The upper mechanical word s θ,x and the lower mechanical word s θ,x with angle θ and initial position x are defined, respectively, by for some θ, x ∈ R. A word w is called irrationally mechanical if w = s θ,x or w = s θ,x for some x ∈ R and irrational θ ∈ R. Irrationally mechanical words can be interpreted through the lens of mathematical billiards. Consider the unit circle centered at the origin, parameterized by g(t) = (cos(2πt), sin(2πt)) for t ∈ R. Place an (infinitesimal) ball at point g(x) on the circle and shoot it in a straight trajectory toward g(x + π). At each moment the ball "bounces off" the circle, it generates a 0 if it hits the point g(x) for x ∈ [0, 1 − θ) and a 1 otherwise. The sequence generated by the trajectory of such a ball is precisely the word s θ,x . For example, a trajectory generating the famous Fibonacci word is shown below. Figure 1. The trajectory associated with the Fibonacci word s φ,φ = 01001010..., where φ is the golden ratio 1.6180339.... A white point indicates that the letter 0 is generated, and a black point indicates that the letter 1 is generated. The Fibonacci word can also be generated as the limit of the sequence {S n } ∞ n=1 , where S 1 = 0, S 2 = 01, and S n = S n−1 S n−2 for n ≥ 3.
The Sturmian words comprise a well-studied class of aperiodic recurrent words. We will show that for any Sturmian word x, j ≥ 0, and k ≥ 1, x contains a k-anti-power beginning at x[j]. Hence, the Sturmian words cannot avoid k-anti-powers for any k ≥ 1. It is enough to show that the Sturmian words are ω-power-free by the following theorem from [6]. In fact, for every Sturmian word x there exists an M ∈ N such that x avoids M powers. This follows from the work of Fici, Langiu, Lecroq, Lefebvre, Mignosi, Peltomäki, and Prieur-Gaston in [5]. They prove a stronger but somewhat lengthy result about a generalized notion of powers known as abelian powers. We provide a condensed proof of our weaker claim. Proof. Suppose w is an upper mechanical word; the case for lower mechanical words follows analogously. Let w = s θ,x for x ∈ R. Suppose, seeking a contradiction, that there exists a factor u of length m such that u M is also a factor. Let {z} denote the fractional part of z ∈ R. There is some nonnegative integer r such that In the first case, we divide [0, 1) up into θ −1 intervals of uniform size, starting at 0. By the Pigeonhole Principal, at least two of the M points lie in the same interval. In other words, there exist 0 ≤ q, i, j ≤ θ −1 such that In the second case, we divide [0, 1) up into (1 − θ) −1 intervals of uniform size, starting at 0. By the Pigeonhole Principal, at least two of the M points lie in the same interval. In other words, there exist 0 ≤ q, i, j ≤ (1 − θ) −1 such that Definition 4.13. Given a sequence {v n } ∞ n=1 of finite words, define words w n by w 1 = v 1 and w n+1 = w n v n w n . The limit of the sequence of words {w n } ∞ n=1 is called the sesquipower induced by the sequence {v n } ∞ n=1 .
It is well-known that an infinite word is recurrent if and only if it is a sesquipower (see, for example, [7]). We will show that if an aperiodic recurrent word avoids k-anti-powers, then we can deduce some properties about the sequence {v n } ∞ n=1 . Theorem 4.14. Let x be the aperiodic sesquipower on a finite alphabet induced by {v n } ∞ n=1 , and suppose x avoids k-anti-powers for some k ≥ 2. There exists a word u of length at most k − 1 such that for all > 0, there is some n > 0 such that u is a factor of v n .
Proof. Since x avoids k-anti-powers, Corollary 3.6 implies x is not ω-power-free. Thus, there is some factor u of x such that u is a factor for every > 0. We can assume u is not an m-power for any m ≥ 2; otherwise, let u = u (|u|/m) . Suppose, seeking a contradiction, that |u| ≥ k. Note that the prefix of length k(|u| + 1) of u k+1 is a k-anti-power, contradicting the fact that u k+1 is a factor of x that avoids k-anti-powers. Thus, |u| ≤ k − 1.
We now know arbitrarily long powers of u occur in x, but, in fact, we can show that arbitrarily long powers of u occur in {v n } ∞ n=1 . Since x is not periodic, there exists a k such that v k is not a factor of u ω . Let 0 be the largest power of u that is a factor of x k . For sufficiently large , there is some m ≥ k such that u is a factor of w m+1 but not of w m . We can conclude u −2 0 −2 is a factor of v m+1 , as w k is a border of w m . As 0 is fixed, this implies that for all > 0, u is a factor of some v m .
To summarize, if x is an aperiodic recurrent word avoiding k-powers for some k ≥ 2, then x is non-Sturmian and is the sesquipower induced by a sequence {v n } ∞ n=1 where the v n contain arbitrarily long powers of some word u.

Avoiding Powers and Anti-Powers
In [6], Fici et al. show that for every , k > 1, there exists N α ( , k) such that every word of length N α ( , k) on an alphabet of size α contains either an -power or a k-anti-power. They prove that for k > 2, one has k 2 − 1 ≤ N α (k, k) ≤ k 3 k 2 . We improve both these lower and upper bounds.
Theorem 5.1. For any k > 3, Proof. The upper bound is precisely the statement of Corollary 3.10.
For the lower bound, consider the word We begin by showing that the border 1(0 k−1 1) k−2 0 k−2 10 k−2 of length k 2 − 2 avoids k-powers and k-anti-powers. In their proof that k 2 − 1 ≤ N α (k, k), Fici et al. [6] show that the word (0 k−1 1) k−2 0 k−2 10 k−1 avoids k-powers and k-anti-powers, so we need only check this border for k-power or k-anti-power prefixes. We can see immediately that there are no k-power prefixes: as 1 ≤ m ≤ k − 1, the first block of length m of the prefix of length km begins with 1 while the second begins with 0. Suppose, seeking a contradiction, that the prefix of length km is a k-anti-power for some m. Since the prefix of length km would need to contain at least k − 1 instances of the letter 1 to distinguish the blocks, we require km ≥ 1 + k(k − 2). Hence, m ≥ k − 1. We know the block length m is at most k − 1 since 1(0 k−1 1) k−2 0 k−2 10 k−2 has length k 2 − 2. However, as k(k − 2) + 1 = (k − 1) 2 , the last two blocks must be 0 k−2 1. The equality of these blocks contradicts the assumption that the prefix of length km is a k-anti-power. 1(0 k−1 1) k−2 0 k−2 10 k−2 avoids both k-powers and k-anti-powers.
Thus, we need to consider only those factors of x intersecting nontrivially with the prefix and suffix of length k 2 − 2. Fix such a factor y of length km starting at position j.
Suppose, seeking a contradiction, that y is a k-power. Let y = x[j + m..j + ( + 1)m − 1] be the th block of length m in y. Choose b such that the central letter 1 of x is contained in y b . That is, j + bm ≤ k(k − 1) ≤ j + (b + 1)m − 1. Since k ≥ 4 and there are exactly two occurrences of the factor 10 k−2 1 in x, the block y b cannot contain 10 k−2 1 as a factor. Note y = 0 m for any nonnegative integers and m. As k ≥ 4, one of b − 2, b + 2 ∈ {0, . . . , k − 1}; without loss of generality assume it is b + 2. Thus, the two factors y b−1 y b and y b+1 y b+2 of x each contain an occurrence of the factor 10 k−2 1. However, the only two occurrences of 10 k−2 1 in x intersect while y b−1 y b and y b+1 y b+2 are disjoint, so we've reached a contradiction. Therefore, x avoid k-powers. Now we show that such a factor y is not a k-anti-power. Suppose it were. Since y contains at least k − 1 occurrences of the letter 1, it follows that m ≥ k − 2. In the case m = k − 2, each block contains at most one occurrence of the letter 1, but there are only k − 1 distinct such blocks. One can check m = k − 1, k by examining the period of the prefix/suffix of length k(k − 2) + 1 or the middle section of length 2k − 1. Thus, taking into consideration the length of x, we have k + 1 ≤ m ≤ 2k − 3. Consider all blocks except y b (the block containing the central 1). Note that the letters of each block are determined by the number of leading 0's, which is at most k − 1. If there are blocks preceding y b , and y b−1 has z leading zeros, then the numbers of leading zeros for all blocks except y b are given by the multiset The left-hand side has size k − − 1 while the right-hand side has size at most k − , and both are arithmetic progressions with difference m. Thus, either m − 2 ≡ m mod k or m − 2 ≡ ( + 1)m mod k. In the former case, 2 ≡ 0 mod k, but this would imply k = 2, contradicting the fact that k ≥ 4. In the latter case, m ≡ −2 mod k, but this also leads to a contradiction as k + 1 ≤ m ≤ 2k − 3. Therefore, x avoids k-powers and k-anti-powers.
Note that the above bounds are independent of the alphabet size. This leads to two questions: does N α (k, k) depend on the size of the alphabet, and if so, in what way? Note that N α (k, k) is nondecreasing as α increases. The following values of N 2 (k, k) were computed by Shallit [11].
Another scenario to investigate is under what conditions a word can be extended (in a potentially larger alphabet) and still avoid k-powers and k-anti-powers. We aim to show that for large enough α, no word of length N α (k, k) − 1 can be extended (in a larger alphabet) and avoid k-powers and k-anti-powers. To do so, we require the following lemma.
Since we assumed i < j, we've reached a contradiction.
An investigation of the failure of the first case leads to the following corollary.
If a word w has a factor u = w of length N α (k, k) − 1 that uses only α letters, w contains a k-power or k-anti-power.
Proof. Suppose, seeking a contradiction, that w is as above but contains no k-power or k-antipower. For all 1 ≤ i < j ≤ α, we have by Lemma 5.2 that Thus, |u j | ≥ k − 2 for all j ≥ 2. Since the |u j |'s are strictly increasing, this implies |u α | ≥ Since w is a word on [α] avoiding k-powers and k-anti-powers, kα + k 2 − 3k − 1 ≤ N α (k, k). If this inequality is not satisfied, then we can conclude w is as above but contains a k-power or k-anti-power.

Block Patterns and Their Expectation
In this section, we return to the general setting of block-patterns to calculate the expected number of (µ 1 , . . . , µ n )-block-patterns in a word of length n on an alphabet of size α. The special case of this expectation for k-powers was calculated by Christodoulakis, Christou, Crochemore, and Iliopoulos in [2]. Theorem 6.1. ( [2], Theorem 4.1) On average, a word of length n has Θ(n) k-powers. More precisely, this number is Theorem 6.2. On average, a word of length n has O(n 2 ) and Ω(n) (µ 1 , . . . , µ k )-block-patterns.
Let us count the number of (µ 1 , . . . , µ k )-block-patterns of length α j+1−i on [α]. Partition [k] into unlabeled parts with µ s parts of size s, and choose µ 1 + · · · + µ k distinct ordered elements from α (j+1−i)/k . We can assign elements to parts by order of appearance of the parts, which will yield a (µ 1 , . . . , µ k )-block-pattern. Moreover, the block-pattern is uniquely determined by the choice of an unlabeled partition and ordered m-tuple. Let [A] denote the indicator function of the event A. We have Since there are only n 2 + n nonempty factors of x, we have E [N ] = O(n 2 ). Note that the expectation is minimized for k-powers, where µ k = 1 and µ s = 0 for all s < k. Thus, from Theorem 6.1, we have E [N ] = Ω(n). Corollary 6.3. On average, a word of length n has Θ(n 2 ) k-anti-powers. More precisely, the expected number of k-anti-powers is n k m=1 (n + 1 − km) Proof. The formula follows Theorem 6.2 in the case µ 1 = k and µ s = 0 for s > 1. Restricting the sum (of nonnegative terms) to the range n 4k ≤ m ≤ 3n 4k , we see = Ω(n 2 ).

Further Directions
Recall that Theorem 3.3 shows that having a small enough density of (µ 1 , . . . , µ k )-blockpattern prefixes with few equal blocks implies the existence of arbitrarily long power prefixes. We believe that a strengthening of this argument could yield a lower bound on the density of P (x, k), the set of m ∈ N such that the prefix of x of length km is a k-power. In Section 3, we also remark that Theorem 6 of [6], stating that if x is an ω-power-free word then AP (x (j) , k) is nonempty for every j and k, is false if we allow infinite alphabets. Perhaps there is a finer characterization of which ω-power-free words fail this condition.
As in the bounds found by Fici et al. [6], our upper and lower bounds for N α (k, k) are polynomials in k whose degrees differ by 3. If it is the case that N α (k, k) depends on α, such a dependence could be used to strengthen the bounds for N α (k, k). Given the few known values of N α (k, k), it seems plausible that k always divides N α (k, k). On the other hand, if N α (k, k) is independent of α, this alone would be an interesting structural property of the set of words avoiding k-powers and k-anti-powers achieving the length N α (k, k) for arbitrary α. We believe the second case holds.
Conjecture 7.1. The quantity N α (k, k) is independent of α.
Whether there exist aperiodic recurrent words avoiding 4 or 5 powers remains an open question. One may wish to investigate other large classes of words, such as the morphic words, and their potential to avoid k-anti-powers. A natural generalization is to find the structure of infinite words avoiding (µ 1 , . . . , µ k )-block-patterns other than (k, λ)-anti-powers.
Lastly, let A = {a 1 , . . . , a α } be a finite alphabet. The Parikh vector P(w) = (e 1 , . . . , e α ) of a finite word w on A has entry e i equal to the number of instances of a i in w. Define an abelian (µ 1 , . . . , µ k )-block-pattern to be a word of the form w = w 1 · · · w k where, if the set {1, . . . , k} is partitioned via the rule i ∼ j ⇐⇒ P(w i ) = P(w j ), there are µ s parts of size s for all 1 ≤ s ≤ k. Ones may ask questions similar to those addressed in this paper for abelian (µ 1 , . . . , µ k )-block-patterns.

Acknowledgements
The author would like to thank Joe Gallian for his tireless efforts to foster a productive and engaging mathematical community. She also extends her gratitude to Colin Defant and Samuel Judge for carefully reading through this article and providing helpful feedback. This research was conducted at the University of Minnesota, Duluth REU and was supported by NSF/DMS grant 1650947 and NSA grant H98230-18-1-0010.