login
Lengths of runs in A090822.
2

%I #17 Aug 05 2018 12:07:08

%S 2,1,2,3,1,2,1,2,3,1,1,2,1,2,3,1,2,1,2,3,1,3,1,3,2,1,2,1,2,3,1,2,1,2,

%T 3,1,1,2,1,2,3,1,2,1,2,3,1,3,1,3,2,3,1,1,2,1,2,3,1,2,1,2,3,1,1,2,1,2,

%U 3,1,2,1,2,3,1,3,1,3,2,1,2,1,2,3,1,2,1,2,3,1,1,2,1,2,3,1,2,1,2

%N Lengths of runs in A090822.

%H F. J. van de Bult, D. C. Gijswijt, J. P. Linderman, N. J. A. Sloane and Allan Wilks, <a href="https://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>

%t Clear[g]; reversed = {g[2] = 1, g[1] = 1}; blocs[len_] := Module[{bloc1, par, pos}, bloc1 = Take[reversed, len]; par = Partition[reversed, len]; pos = Position[par, bloc_ /; bloc != bloc1, 1, 1]; If[pos == {}, Length[par], pos[[1, 1]] - 1]]; g[n_] := g[n] = Module[{g0}, g0 = Table[{blocs[len], len}, {len, 1, Quotient[n - 1, 2]}] // Sort // Last // First; PrependTo[reversed, g0]; g0]; A090822 = Table[g[n], {n, 1, 200}]; A091412 = Length /@ Split[A090822] (* _Jean-François Alcover_, Oct 07 2013 *)

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Mar 04 2004