%I #16 Jul 29 2017 00:01:47
%S 2,2,2,3,3,2,2,2,3,3,2,2,2,3,2,2,2,3,2,2,2,3,3,2,2,2,3,2,2,2,3,2,2,2,
%T 3,3,2,2,2,3,2,2,2,3,3,2,2,2,3,2,2,2,3,3,3,3,4,4,2,2,2,3,3,2,2,2,3,3,
%U 2,2,2,3,2,2,2,3,2,2,2,3,3,2,2,2,3,2,2,2,3,2,2,2,3,3,2,2,2,3,2
%N a(1) = 2. For n>1, let k = largest integer such that the word a(1)a(2)...a(n-1) is of the form xy^k for words x and y (where y has positive length), i.e., the maximal number of repeating blocks at the end of the sequence so far. If k>1, a(n) = k. If k=1, choose a(n) so that the next k (that for a(1),...,a(n)) is as large as possible and if there is more than one choice for this a(n), pick the smallest.
%C Resembles A091787, but constructed by a greedy algorithm.
%H F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL10/Sloane/sloane55.html">A Slow-Growing Sequence Defined by an Unusual Recurrence</a>, J. Integer Sequences, Vol. 10 (2007), #07.1.2.
%H F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, A Slow-Growing Sequence Defined by an Unusual Recurrence [<a href="http://neilsloane.com/doc/gijs.pdf">pdf</a>, <a href="http://neilsloane.com/doc/gijs.ps">ps</a>].
%H <a href="/index/Ge#Gijswijt">Index entries for sequences related to Gijswijt's sequence</a>
%e For n=2: we have a(1) = 1, so k=1; taking a(2) = 2 makes the next k=2.
%e For n=3, we have a(1),a(2) = 22, so k = 2 = a(3).
%e For n=4, we have a(1),...,a(3) = 222, so k = 3 = a(4).
%e For n=5, we have a(1),...,a(4) = 2223, so k = 1; taking a(5) = 3 makes the next k=2.
%e For n=6, we have a(1),...,a(5) = 22233, so k = 2 = a(6); etc.
%Y Cf. A091787, A090822.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_, Jun 03 2004
%E More terms from _John P. Linderman_, Jun 03 2004