\documentclass[11pt,reqno]{amsart} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern,amssymb,graphicx,xurl} \usepackage[textwidth=370pt,textheight=620pt,centering]{geometry} \usepackage[hidelinks]{hyperref} \raggedbottom \setlength{\emergencystretch}{3em} \hypersetup{pdftitle={The minimum number of distinct abelian squares in a binary circular word},pdfauthor={Deep Bhattacharjee}} \newcommand{\releaseURL}{https://github.com/creelie/literate-octo-lamp/releases/tag/v2.3.0} \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{remark}[theorem]{Remark} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem*{conjecture*}{Conjecture 0.6 of \cite{Sim18}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\lb}{\bar\ell} \newcommand{\fl}[1]{\lfloor #1\rfloor} \title[Abelian squares in binary circular words]{The minimum number of distinct abelian squares in a binary circular word} \author{Deep Bhattacharjee} \address{Formerly, Electro-Gravitational Space Propulsion Laboratory (EGSPL), Bhubaneswar, Odisha 751030, India} \address{Formerly, University of Calcutta, Senate House, 87/1 College Street, Kolkata 700073, West Bengal, India} \email{d.bhattacharjee@erl-forschung.de} \email{itsdeep@live.com} \email{egspl@proton.me} \thanks{\sloppy Corresponding author: Deep Bhattacharjee. Email: \href{mailto:d.bhattacharjee@erl-forschung.de}{d.bhattacharjee@erl-forschung.de}, \href{mailto:itsdeep@live.com}{itsdeep@live.com}, \href{mailto:egspl@proton.me}{egspl@proton.me}; ORCID \href{https://orcid.org/0000-0003-0466-750X}{0000-0003-0466-750X}} \subjclass[2020]{Primary 68R15; Secondary 05A05, 68V15} \keywords{Abelian square, circular word, Parikh vector, combinatorics on words} \date{27 October 2026} \begin{document} \begin{abstract} We prove that every binary circular word of length $n$ contains at least $\fl{(n-1)/2}$ distinct abelian squares, and we determine all words attaining this bound. This settles a conjecture of Simpson: its odd case holds, and in its even case the list of extremal words misses $(ab)^{n/2}$ for $n\equiv 2\pmod 4$, $n\ge 6$. We then review the other problems of the survey: we conjecture, and verify to length $27$, that for odd $n$ the least number of non-equivalent abelian squares in a circular word is also $(n-1)/2$, and we show that the least number of occurrences of abelian squares in a binary word of length $n$ is asymptotically proportional to $n$ or grows faster, and is below $n^{3/2}$. \end{abstract} \maketitle \begin{quote} \small\sloppy \noindent\textbf{Note.} An earlier version of this paper appeared on Hexagon, where it is the preprint \texttt{hexagon:2610.00473}, available at \url{https://hexagonmath.org/2610.00473v1}. That version proved Theorem~\ref{thm:main} and stopped there. This version adds Sections~\ref{sec:types} and~\ref{sec:others}, which treat the other problems of Simpson's survey: the balance identities, the jump and descent lemmas, the two-run formula and Conjecture~\ref{conj:odd} on non-equivalent abelian squares in circular words of odd length, verified to length $27$; the status of the linear-word minimum $\fl{n/4}$ and of the problems of Fici and Mignosi, of Kucherov, Ochem and Rao and of M\"akel\"a; and Theorem~\ref{thm:occ} on the least number of occurrences of abelian squares. The earlier versions are archived on Zenodo under the concept DOI \href{https://doi.org/10.5281/zenodo.23313258}{10.5281/zenodo.23313258} (versions \href{https://doi.org/10.5281/zenodo.23313259}{10.5281/zenodo.23313259}, \href{https://doi.org/10.5281/zenodo.23313541}{10.5281/zenodo.23313541}, \href{https://doi.org/10.5281/zenodo.23384530}{10.5281/zenodo.23384530}, \href{https://doi.org/10.5281/zenodo.23553002}{10.5281/zenodo.23553002} and \href{https://doi.org/10.5281/zenodo.23672660}{10.5281/zenodo.23672660}). The source of this revision, the Lean formalization and the programs are in the repository \url{https://github.com/creelie/literate-octo-lamp}, release \texttt{v2.3.0}, archived on Zenodo as \href{https://doi.org/10.5281/zenodo.23692500}{10.5281/zenodo.23692500}. \end{quote} \section{Introduction}\label{sec:intro} Words are over the alphabet $\{a,b\}$. For a letter $\ell$ we write $\lb$ for the other letter and $|u|_\ell$ for the number of occurrences of $\ell$ in a word $u$. An \emph{abelian square} is a word $uv$ with $u$ nonempty and $|u|_a=|v|_a$, $|u|_b=|v|_b$; then $|u|=|v|$. A circular word of length $n$ is a word $w=w_0\cdots w_{n-1}$ read cyclically; its \emph{factors} are the words $w_iw_{i+1}\cdots w_{i+L-1}$, indices modulo $n$, with $0\le ij_0$, and $\sum_{j=j_0+1}^{j_0+t_\ell}e_j<0$. So there is $j$ with $e_j\le 0\le e_{j+1}$, that is $d_{j+k}\le d_j$ and $d_{j+1}\le d_{j+k+1}$. We show $I_j(k)\neq\emptyset$ by comparing each lower bound in \eqref{eq:interval} with each upper bound. First, $p_{j+k}-p_{j+1}+1\le p_{j+k}-p_j$ and $p_{j+2k}-p_{j+k}\le p_{j+2k+1}-p_{j+k}-1$. Second, $p_{j+2k}-p_{j+k}=d_{j+k}\le d_j=p_{j+k}-p_j$. Third, with $g=p_{j+k+1}-p_{j+k}\ge 1$, \begin{align*} p_{j+k}-p_{j+1}+1&=d_{j+1}-g+1\le d_{j+1}\le d_{j+k+1}\\ &\le d_{j+k+1}+g-1=p_{j+2k+1}-p_{j+k}-1. \end{align*} By Lemma~\ref{lem:interval}, $C_\ell(k)\supseteq I_j(k)\ne\emptyset$. \end{proof} \begin{theorem}\label{thm:lower} $D(w)\ge\fl{(n-1)/2}$. \end{theorem} \begin{proof} Let $N=\sum_{m=1}^{n-1}|Q_m|$ and $F=\sum_{m=1}^{\fl{n/2}}|Q_m|$. Counting the pairs $(m,(\ell,k))$ with $(\ell,k)\in Q_m$ by columns, \begin{equation}\label{eq:N} N=\sum_{\ell}\sum_{k\ge 0}|C_\ell(k)|,\qquad \sum_{k\ge 0}|C_\ell(k)|\ge t_\ell-1\ \text{ if } t_\ell\ge 1, \end{equation} by Lemmas~\ref{lem:mirror} and~\ref{lem:column}. If both letters occur, $N\ge t_a+t_b-2=n-2$; otherwise $N\ge n-1$. By Lemma~\ref{lem:mirror}, $|Q_m|=|Q_{n-m}|$, so \begin{equation}\label{eq:NF} N+\varepsilon\,|Q_{n/2}|=2F,\qquad \varepsilon=1\text{ if $n$ is even},\ \varepsilon=0\text{ if $n$ is odd}. \end{equation} Hence $2F\ge n-2$ and $F\ge\lceil(n-2)/2\rceil=\fl{(n-1)/2}$. By Lemma~\ref{lem:QS}, $D(w)\ge F$. \end{proof} We call a letter $\ell$ with $t_\ell\ge 1$ \emph{tight} if $|C_\ell(k)|\le 1$ for every $k$. By Lemmas~\ref{lem:mirror} and~\ref{lem:column}, $\ell$ is tight if and only if $\sum_k|C_\ell(k)|=t_\ell-1$. We call $w$ \emph{rigid} if $|S_m|=|Q_m|$ for $1\le m\le n/2$: two squares $W(i,m)$, $W(i',m)$ with $2m\le n$, $x_{i+m-1}=x_{i'+m-1}=\ell$ and $c_\ell(i,m)=c_\ell(i',m)$ are equal words. \begin{proposition}\label{prop:equality} If $D(w)=\fl{(n-1)/2}$, then $w$ is rigid and $N+\varepsilon|Q_{n/2}|=2\fl{(n-1)/2}$. \end{proposition} \begin{proof} In the proof of Theorem~\ref{thm:lower}, $\fl{(n-1)/2}\le F\le D(w)$, so $F=D(w)$, and $|Q_m|\le|S_m|$ for each $m$ forces $|Q_m|=|S_m|$. Then \eqref{eq:NF} gives the second statement. \end{proof} \section{Rigid words with a tight letter}\label{sec:tight} \begin{theorem}\label{thm:classify} Let $w$ be rigid and let $\ell$ be a tight letter, $t=t_\ell$. Then $w$ is a conjugate of $\ell^t\lb^{\,n-t}$ with $t$ odd or $t=n$, or $n=2t$ and $w$ is a conjugate of $(\ell\lb)^t$. \end{theorem} Throughout this section $w$ and $\ell$ are as in Theorem~\ref{thm:classify}, $(p_j)$ enumerates the occurrences of $\ell$, and $g_j=p_{j+1}-p_j\ge 1$. Since $\ell$ is tight, Lemma~\ref{lem:interval} gives: \begin{equation}\label{eq:tight} \text{for } 1\le kg_{j+1}$, then $I_j(1)\supseteq\{g_{j+1},g_{j+1}+1\}$ since $g_{j+2}\ge 2$, contradicting \eqref{eq:tight}. So $g_j\le g_{j+1}$ for all $j$, and as $g$ is periodic, $g_j=\delta$ is constant and $n=t\delta$. If $\delta=2$, then $n=2t$ and $w$ is a conjugate of $(\ell\lb)^t$. Let $\delta\ge 3$, so $p_{j}=p_0+j\delta$. The words $W(p_1,\delta)$ and $W(p_1+2,\delta)$ have halves $\ell\lb^{\,\delta-1}$, $\ell\lb^{\,\delta-1}$ and $\lb^{\,\delta-2}\ell\lb$, $\lb^{\,\delta-2}\ell\lb$. Both are squares whose left halves end with $\lb$ and contain $\delta-1$ letters $\lb$, and $2\delta\le n$. By rigidity they are equal, but their first letters are $\ell$ and $\lb$. \emph{Case B: $g_j=1$ for some $j$.} A \emph{run} of length $L\ge 1$ consists of occurrences $p_{J+1},\dots,p_{J+L}$ with $g_J\ge 2$, $g_{J+1}=\dots=g_{J+L-1}=1$ and $g_{J+L}\ge 2$; its \emph{gaps} are $\lambda=g_J$ and $\rho=g_{J+L}$. Since $g$ has period $t$ and some $g_j\ge 2$, every run has length $L\le t$. The two occurrences $p_j,p_{j+1}$ with $g_j=1$ lie in a run of length at least $2$. (B1) \emph{Every run has odd length.} Suppose a run has length $2i$, $i\ge 1$. In \eqref{eq:interval} for $I_J(i)$ the lower bounds are $i$ and $i$, and the upper bounds are $\lambda+i-1\ge i+1$ and $i+\rho-1\ge i+1$. So $I_J(i)\supseteq\{i,i+1\}$ with $i<2i\le t$, contradicting \eqref{eq:tight}. For a run $p_{J+1},\dots,p_{J+2h+1}$ with $h\ge 1$ and gaps $\lambda,\rho$, \eqref{eq:interval} gives, with $\lambda'=g_{J-1}$ and $\rho'=g_{J+2h+2}$, \begin{align} I_{J-1}(h+1)&=[\lambda+h,\ \min(\lambda+h+\lambda'-1,\ h+\rho)],\label{eq:left}\\ I_J(h+1)&=[\rho+h,\ \min(\lambda+h,\ h+\rho+\rho'-1)],\label{eq:right} \end{align} where we used $\lambda,\rho\ge 2$. Here $h+1<2h+1\le t$. (B2) \emph{All runs of length at least $3$ have the same length.} Let a run $p_{J+1},\dots,p_{J+2h+1}$ have $h\ge 1$, and suppose another run $p_{J'+1},\dots,p_{J'+L'}$ has $L'\ge 2h+2$. In \eqref{eq:interval} for $I_{J'}(h+1)$ the lower bounds are $h+1$ and $h+1$, and the upper bounds are at least $h+1$; so $h+1\in I_{J'}(h+1)$. By \eqref{eq:left} and \eqref{eq:right}, $\lambda+h\in I_{J-1}(h+1)$ if $\lambda\le\rho$ and $\rho+h\in I_J(h+1)$ if $\rho\le\lambda$. Both numbers exceed $h+1$, contradicting \eqref{eq:tight}. By (B1) and (B2) there is $h\ge 1$ such that every run has length $1$ or $2h+1$, and some run has length $2h+1$. Consider such a run $R=(p_{J+1},\dots,p_{J+2h+1})$ with gaps $\lambda,\rho$. (B3) \emph{$\rho<\lambda$ is impossible.} Let $R'$ be the run following $R$, starting at $p_{J+2h+2}$. If $R'$ has length $1$, then $\rho'\ge 2$, and by \eqref{eq:right} $I_J(h+1)\supseteq\{\rho+h,\rho+h+1\}$. If $R'$ has length $2h+1$, let $\sigma\ge 2$ be its right gap. Then $t\neq 2h+1$: otherwise $R'$ is the translate of $R$ by $n$ and $\rho=g_{J+t}=g_J=\lambda$. In \eqref{eq:interval} for $I_J(2h+1)$ the lower bounds are $2h+1$ and $2h+\rho$, and the upper bounds are $2h+\lambda\ge 2h+\rho+1$ and $2h+\rho+\sigma-1\ge 2h+\rho+1$; so $I_J(2h+1)\supseteq\{2h+\rho,2h+\rho+1\}$ with $2h+1n$. Then $p_{J+t}=p_J+n\lambda$, then by (B4) the run $R^-$ preceding $R$ has length $2h+1$. Its right gap is $\lambda$, and its left gap is at least $\lambda$ by the choice of $R$; by (B3) the two are equal, and (B5) applies to $R^-$. In all cases $w$ is a conjugate of $\ell^{t}\lb^{\,n-t}$ with $t=2h+1$ odd. \end{proof} \section{Proof of Theorem~\ref{thm:main}}\label{sec:proof} \begin{lemma}\label{lem:upper} Let $\ell$ be a letter. \begin{enumerate} \item[(i)] Let $0\le\alpha\le n$ and $\beta=n-\alpha$, and suppose each of $\alpha$, $\beta$ is $0$, odd, or at least $n-1$. Then every abelian square factor of the circular word $\ell^\alpha\lb^{\,\beta}$ is $\ell^{2m}$ or $\lb^{\,2m}$, and $D(\ell^\alpha\lb^{\,\beta})=\fl{\alpha/2}+\fl{\beta/2}$. \item[(ii)] For even $n$, $D((\ell\lb)^{n/2})=2\fl{n/4}$. \end{enumerate} \end{lemma} \begin{proof} (i) Let $s=uv$ be an abelian square factor, $|u|=|v|=m$, $2m\le n$, containing both letters; then $1\le\alpha,\beta\le n-1$, and read cyclically the word consists of the two blocks $\ell^\alpha$ and $\lb^{\,\beta}$. If $s$ crosses exactly one block boundary, $s=c^r\bar c^{\,2m-r}$ with $c\in\{\ell,\lb\}$ and $0\max(r-m,0)=|v|_c$. Otherwise $s$ contains a whole block in its interior, say $s=\ell^r\lb^{\,\beta}\ell^{r'}$ with $r,r'\ge 1$. Then $\beta\le 2m-2\le n-2$, so $\beta$ is odd, whereas $\beta=|s|_{\lb}=2|u|_{\lb}$. The case $s=\lb^{\,r}\ell^\alpha\lb^{\,r'}$ is symmetric. The factor $\ell^{2m}$ occurs if and only if $2m\le\alpha$, and $\lb^{\,2m}$ if and only if $2m\le\beta$. (ii) Every factor of length $2m$ alternates. If $m$ is odd, its halves start with different letters $c\ne\bar c$, and $|u|_c=(m+1)/2\ne(m-1)/2=|v|_c$. If $m$ is even, both halves contain $m/2$ letters of each kind, and there are exactly two factors of length $2m\le n$. So $D=2\,|\{m: m\text{ even},\ 2\le m\le n/2\}|=2\fl{n/4}$. \end{proof} \begin{lemma}\label{lem:fat} Let $\alpha\ge 3$, $h\ge 1$, $n=\alpha+2h$ and $w=\ell^\alpha\lb^{\,2h}$. Then $C_{\lb}(h)\supseteq\{h,\,h+1,\,n-h\}$, three distinct numbers. \end{lemma} \begin{proof} $W(\alpha,h)=\lb^{\,2h}$ is a square whose left half $\lb^{\,h}$ ends with $\lb$, so $h\in C_{\lb}(h)$. $W(\alpha-1,h+1)=\ell\lb^{\,2h}\ell$ is a square with halves $\ell\lb^{\,h}$ and $\lb^{\,h}\ell$, and $2h+2\le n$; so $h+1\in C_{\lb}(h)$. By Lemma~\ref{lem:mirror} with $t_{\lb}=2h$, $n-h\in C_{\lb}(2h-h)$. Finally $n-h=\alpha+h\ge h+3$. \end{proof} \begin{proof}[Proof of Theorem~\ref{thm:main}] The lower bound is Theorem~\ref{thm:lower}. If $w$ is a conjugate of a word in the list, Lemma~\ref{lem:upper} gives $D(w)=\fl{(n-1)/2}$: for $a^n$ ($n$ odd) $\fl{n/2}=(n-1)/2$; for $a^{n-1}b$ ($n$ odd) $(n-1)/2+0$; for $a^kb^{n-k}$ ($n$ even, $k$ odd) $(k-1)/2+(n-k-1)/2=(n-2)/2$; for $(ab)^{n/2}$ ($n\equiv 2\pmod 4$) $2(n-2)/4$. Complements and conjugates have the same $D$. Conversely let $D(w)=\fl{(n-1)/2}$. By Proposition~\ref{prop:equality}, $w$ is rigid and $N+\varepsilon|Q_{n/2}|=2\fl{(n-1)/2}$. \emph{$n$ even.} Then $N+|Q_{n/2}|=n-2$. If only one letter occurs, $N\ge n-1$; so both occur, and by \eqref{eq:N} $N\ge n-2$. Hence $|Q_{n/2}|=0$ and $\sum_k|C_\ell(k)|=t_\ell-1$ for both letters, so both letters are tight. Theorem~\ref{thm:classify} for $\ell=a$ shows that $w$ is a conjugate of $a^kb^{n-k}$ with $k$ odd ($k=n$ is excluded since $b$ occurs), or $n=2t_a$ and $w$ is a conjugate of $(ab)^{n/2}$. In the second case, if $n\equiv 0\pmod 4$, both halves of $W(0,n/2)$ alternate and have even length $n/2$, so $W(0,n/2)$ is a square and $Q_{n/2}\ne\emptyset$, a contradiction. So $n\equiv 2\pmod 4$. \emph{$n$ odd.} Then $N=n-1$. If only one letter occurs, $w$ is $a^n$ or $b^n$. Otherwise \eqref{eq:N} gives $\sum_k|C_a(k)|+\sum_k|C_b(k)|=(t_a-1)+(t_b-1)+1$ with $\sum_k|C_\ell(k)|\ge t_\ell-1$ for both letters. So one letter $\ell$ is tight, and $\sum_k|C_{\lb}(k)|\le t_{\lb}$. By Theorem~\ref{thm:classify}, $w$ is a conjugate of $\ell^t\lb^{\,n-t}$ with $t=t_\ell$ odd, since $tt_{\lb}$, a contradiction. \end{proof} \section{Non-equivalent abelian squares in circular words of odd length}\label{sec:types} Two abelian squares are \emph{equivalent} \cite{FSP97,Sim18} when they have the same length and the same number of letters $a$. The \emph{type} of a square $W(i,m)$ is the pair $(m,c_a(i,m))$, and for $1\le m\le n/2$ we let $z_m(w)$ be the number of types of the squares $W(i,m)$, $i\in\Z$. Thus \[ N(w)=\sum_{m=1}^{\fl{n/2}}z_m(w) \] is the number of non-equivalent abelian squares among the factors of $w$, and $N(w)\le D(w)$ since the type of a square is determined by the factor. Fraenkel, Simpson and Paterson \cite{FSP97} proved that a circular word with at most $k$ non-equivalent abelian squares has length at most $4k+2$, the bound being attained by $(ab)^{2k+1}$ only; hence $N(w)\ge\fl{(n+1)/4}$ for every circular word of length $n$, and this is sharp when $n\equiv 2\pmod 4$. In this section $n$ is odd. Then $N(w)\le D(w)$ and Theorem~\ref{thm:main} give $N(w)\le (n-1)/2$ for the words $a^n$ and $a^{n-1}b$, so the minimum of $N$ over the words of odd length $n$ is at most $(n-1)/2$. We collect what we can prove about the lower bound and state the expected answer as a conjecture; all the computations referred to are performed by the programs \texttt{odd\_circular\_types.c} and \texttt{linear\_minima.c} of the ancillary files. For $i\in\Z$ and $1\le m\le n-1$ put $\delta_m(i)=c_a(i+m,m)-c_a(i,m)$, so that $W(i,m)$ is a square exactly when $\delta_m(i)=0$. Since $i\mapsto i+m$ permutes the residues modulo $n$, \begin{equation}\label{eq:deltasum} \sum_{i=0}^{n-1}\delta_m(i)=0, \end{equation} and writing $[x_s=a]$ for $1$ if $x_s=a$ and $0$ otherwise, \begin{equation}\label{eq:deltastep} \delta_m(i+1)-\delta_m(i)=[x_i=a]-2[x_{i+m}=a]+[x_{i+2m}=a]\in\{-2,-1,0,1,2\}. \end{equation} \begin{lemma}[jump]\label{lem:jump} Let $1\le m$ with $2m0>\delta_m(i'+1)$. At $i$ the step \eqref{eq:deltastep} is at least $2$, so it equals $2$, $\delta_m(i)=-1$, $\delta_m(i+1)=1$, $x_i=x_{i+2m}=a$ and $x_{i+m}=b$. Then $c_a(i+1,m)=c_a(i,m)-[x_i=a]+[x_{i+m}=a]=c_a(i,m)-1=c_a(i+m,m)$. The position $i'$ is treated in the same way, with the step equal to $-2$: $x_{i'}=x_{i'+2m}=b$, $x_{i'+m}=a$, $\delta_m(i')=1$ and $c_a(i'+1,m)=c_a(i',m)+1=c_a(i'+m,m)$. \end{proof} In words: an empty half-length $m$ forces the two patterns $aXbYa$ and $bX'aY'b$ in $w$, with $|X|=|Y|=|X'|=|Y'|=m-1$, $|X|_a=|Y|_a$ and $|X'|_a=|Y'|_a$. Such a pattern produces squares of smaller half-lengths. \begin{lemma}[descent]\label{lem:descent} Let $m\ge 2$ and let $i$ satisfy $x_i=x_{i+2m}=a$, $x_{i+m}=b$ and $c_a(i+1,m-1)=c_a(i+m+1,m-1)=e$. Then either $(m-1,e)$ is the type of a square, or $x_{i+1}=x_{i+2m-1}=a$ and $i+1$ satisfies the same hypotheses with $m-1$ and $e-1$ in place of $m$ and $e$. The statement with the letters $a$ and $b$ exchanged, and $e$ counting the letters $b$, holds as well. \end{lemma} \begin{proof} If $x_{i+2m-1}=b$ then $W(i+1,m-1)$ has halves $x_{i+1}\cdots x_{i+m-1}$ and $x_{i+m}\cdots x_{i+2m-2}$ with $e$ and $c_a(i+m+1,m-1)-[x_{i+2m-1}=a]=e$ letters $a$ (recall $x_{i+m}=b$), so it is a square of type $(m-1,e)$. If $x_{i+1}=b$ then $W(i+2,m-1)$ has halves $x_{i+2}\cdots x_{i+m}$ and $x_{i+m+1}\cdots x_{i+2m-1}$ with $e-[x_{i+1}=a]=e$ and $e$ letters $a$, again a square of type $(m-1,e)$. Otherwise $x_{i+1}=x_{i+2m-1}=a$; then $x_{i+1}=a$, $x_{(i+1)+(m-1)}=x_{i+m}=b$, $x_{(i+1)+2(m-1)}=x_{i+2m-1}=a$, and $c_a(i+2,m-2)=e-1=c_a(i+m+1,m-2)$ because the first window lost the letter $x_{i+1}=a$ and the second lost $x_{i+2m-1}=a$. The second statement follows by complementation. \end{proof} Starting from the pattern of Lemma~\ref{lem:jump} and applying Lemma~\ref{lem:descent} repeatedly, an empty half-length $m$ yields a square of some type $(m-1-r,e-r)$ with $0\le r\le m-2$, or else the factor $a^mba^m$, which contains the squares $a^{2j}$ for $2j\le m$; and likewise with $b$. The squares so obtained need not be new, and this is why the following two propositions cover only the smallest half-lengths and the words with two runs. Here a \emph{run} is a maximal factor of the circular word consisting of one letter. \begin{proposition}\label{prop:small} Let $n\ge 5$ be odd. Then $z_1(w)\ge 1$ and $z_1(w)+z_2(w)\ge 2$ for every circular word $w$ of length $n$. \end{proposition} \begin{proof} Since $n$ is odd, $w$ is not a conjugate of $(ab)^{n/2}$, so $x_i=x_{i+1}$ for some $i$ and $W(i,1)$ is a square: $z_1(w)\ge 1$. Suppose $z_1(w)=1$; by complementation we may assume that $bb$ is not a factor, so each run of $b$ has length $1$. If $t_b=0$ then $w=a^n$, $n\ge 5$, and $aaaa$ gives $z_2(w)\ge 1$. Let $t_b\ge 1$. A run of $a$ of length at least $4$ gives the square $aaaa$ of type $(2,2)$. A run of $a$ of length exactly $2$ lies between two letters $b$, which gives the factor $baab$, a square of type $(2,1)$. A run of $a$ of length $1$ is a factor $bab$, and since the letter after the second $b$ is $a$ (if $t_b=1$ this second $b$ is the first one and $n=2$, which is excluded), $w$ has the factor $baba$, a square of type $(2,1)$. If none of these happens, every run of $a$ has length $3$ and $n=4t_b$ is even, a contradiction. \end{proof} \begin{proposition}\label{prop:tworuns} Let $n=p+q$ be odd with $p,q\ge 1$, and let $r$ be the odd one of $p$ and $q$. Then \[ N(a^pb^q)=\frac{n-1}{2}+\frac{r-1}{2}. \] In particular $N(a^pb^q)\ge(n-1)/2$, with equality exactly for $a^{n-1}b$ and $ab^{n-1}$. \end{proposition} \begin{proof} By complementation we may assume that $p$ is even and $q$ is odd. Fix $m$ with $2m\le n-1$ and consider the factor $W(i,m)$, of length $2mq$ the halves are $a^sb^qa^{m-s-q}$ and $a^m$, with $m-q