Of interest in DNA analysis is the length $L(x^n_1)$ of the longest sequence that appears twice in a sequence $x^n_1$ of length $n$. Karlin and Ghandour and Arratia and Waterman have shown that if the sequence is a sample path from an i.i.d. or Markov process, then $L(x^n_1) = O(\log n)$. In this paper, examples of ergodic processes are constructed for which the asymptotic growth rate is infinitely often as large as $\lambda(n)$, where $\lambda(n)$ is subject only to the condition that it be $o(n)$.
"String Matching: The Ergodic Case." Ann. Probab. 20 (3) 1199 - 1203, July, 1992. https://doi.org/10.1214/aop/1176989686