OFFSET
1,2
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10010
Wai-Fong Chuan and Hui-Ling Ho, Locating factors of the infinite Fibonacci word, Theoret. Comput. Sci. 349 (2005), no. 3, 429--442. MR2183167 (2007c:68115)
James D. Currie and Kalle Saari, Least Periods of Factors of Infinite Words, RAIRO - Theoretical Informatics and Applications, January 2009, 43, pp. 165-178.
M. Lothaire, Algebraic Combinatorics on Words, Cambridge, 2002; see Chap. 2.
F. Mignosi, A. Restivo, M. Sciortino, Words and forbidden factors, WORDS (Rouen, 1999). Theoret. Comput. Sci. 273 (2002), no. 1-2, 99--117. MR1872445 (2002m:68096).
Kalle Saari, Periods of factors of the Fibonacci word, Department of Mathematics and Turku Centre for Computer Science, University of Turku, 2001 4 Turku, Finland.
Kalle Saari, Periods of factors of the Fibonacci word, in Proceedings of the Sixth International Conference on Words (WORDS’07). Institut de Mathématiques de Luminy (2007) 273-279.
Zhi-Xiong Wen and Zhi-Ying Wen, Some properties of the singular words of the Fibonacci word, European J. Combin. 15 (1994), 587-598.
FORMULA
The list S(n), say, of words of length n in this sequence can be constructed recursively as follows.
There are two words of length 1, namely S(1)={1,2}.
The n+2 words in S(n+1) are obtained from the n+1 words in S(n) thus:
if u in S(n) is the reverse of a prefix of the Fibonacci word A003842 then both u0 and u1 are in S(n+1), otherwise u in S(n) has a unique extension ux in S(n+1), where x is determined by the requirement that no right factor of ux is one of the forbidden words listed in A214216.
For example, A214216 contains both 22 and 111. So if u ends with 2 then (since 22 is forbidden), x=1 and u1 is in S(n+1), while if u ends with 11 then (since 111 is forbidden) x=2 and u2 is in S(n+1).
On the other hand, consider for example u=21121 in S(5), which is the reverse of the first 5 digits of A003842. Now both u1 and u2 are in S(6).
EXAMPLE
A003842 begins 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, ... and we can see factors 1, 2, 11, 12, 21, but not 22.
MAPLE
S:= proc(n) option remember;
`if`(n<2, [2-n], [S(n-1)[], S(n-2)[]])
end:
T:= proc(n) local k, l, m, s;
for k while nops(S(k))<n do od;
do l:= S(k); m:= nops(l);
s:= {seq(parse(cat(l[i..i+n-1][])), i=1..m-n+1)};
if nops(s) = n+1 then break else k:= k+1 fi
od; sort([s[]])[]
end:
seq(T(n), n=1..10); # Alois P. Heinz, Jul 04 2012
MATHEMATICA
nmax = 10;
seq[steps_] := seq[steps] = (S = SubstitutionSystem[{1 -> {1, 2}, 2 -> {1}}, {1}, steps] // Last; T[n_] := FromDigits /@ Union[Partition[S, n, 1]]; Table[T[n], {n, 1, nmax}] // Flatten);
seq[s = 1];
While[seq[s] != seq[s-1], s++];
seq[s] (* Jean-François Alcover, Apr 28 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jul 03 2012, Jul 10 2012
STATUS
approved