%I #24 Mar 18 2021 19:12:02
%S 1,1,1,1,1,2,1,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%T 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
%U 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2
%N a(n) = k where Z_k is the largest Zimin word that n (read as a binary word) does not avoid.
%C Zimin words are defined recursively: Z_1 = A, Z_2 = ABA, Z_3 = ABACABA, and Z_{i+1} = Z_i a_{i+1} Z_i.
%C Every Zimin word Z_i is an "unavoidable" word, meaning that every sufficiently long string over a finite alphabet contains a substring that is an instance of Z_i. A word w is instance of a Zimin word Z_i if there's a nonerasing monoid homomorphism from Z_i to w.
%C a(n) >= 2 for all n >= 2^4.
%C a(n) >= 3 for all n >= 2^28.
%C For any fixed k, a(n) >= k for sufficiently large n, however there exists a value of a(n) = 3 with n >= 2^10482.
%C The first occurrence of k is when n = A001045(2^k), that is, the binary expansion of n is "1010101...01" with 2^k - 1 bits.
%H Peter Kagey, <a href="/A342510/b342510.txt">Table of n, a(n) for n = 0..8191</a>
%H Peter Kagey, <a href="https://codegolf.stackexchange.com/q/220679/53884">Matching ABACABA-type patterns</a>, Code Golf Stack Exchange.
%H Danny Rorabaugh, <a href="http://arxiv.org/abs/1509.04372">Toward the Combinatorial Limit Theory of Free Words</a>, arXiv preprint arXiv:1509.04372 [math.CO], 2015.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Sesquipower">Sesquipower</a>.
%e For n = 10101939, the binary representation is "100110100010010010110011", and the substring "0010010010" is an instance of the Zimin word Z_3 = ABACABA with A = "0", B = "01", and C = "01".
%e No substring is an instance of the Zimin word Z_4 = ABACABADABACABA, so a(10101939)= 3.
%o (Python)
%o def sd(w): # sesquipower degree
%o return 1 + max([0]+[sd(w[:i]) for i in range(1, (len(w)+1)//2) if w[:i] == w[-i:]])
%o def a(n):
%o w = bin(n)[2:]
%o return max(sd(w[i:j]) for i in range(len(w)) for j in range(i+1, len(w)+1))
%o print([a(n) for n in range(87)]) # _Michael S. Branicky_, Mar 15 2021
%Y Cf. A001045.
%Y Cf. A342511, A342512.
%K nonn,base
%O 0,6
%A _Peter Kagey_, Mar 14 2021
|