Eric Weisstein's World of Mathematics, <a href="httphttps://mathworld.wolfram.com/LinusSequence.html">Linus Sequence.</a>
Eric Weisstein's World of Mathematics, <a href="httphttps://mathworld.wolfram.com/LinusSequence.html">Linus Sequence.</a>
reviewed
approved
proposed
reviewed
editing
proposed
T. D. Noe, Robert Israel , and Hugo van der Sanden, <a href="/A006345/b006345.txt">Table of n, a(n) for n = 1..50000</a> (1..1000 from T. D. Noe, 1001..20000 from Robert Israel)
P. Balister, S. Kalikow, and A. Sarkar, <a href="http://www2.ims.nus.edu.sg/preprints/2007-19.pdf">The Linus sequence</a>, Preprint May 2007; Combinatorics, Probability and Computing, Volume 19, Issue 1 January 2010 , pp. 21-46..
N. Hellerstein, M. Gardner, & and S. Kim, <a href="/A006345/a006345_1.pdf">Correspondence related to the Linus and Sally sequences, 1977</a>
reviewed
editing
proposed
reviewed
editing
proposed
a[1]=1; a[2]=2; suffix[lst_] := If[MatchQ[lst, {___, b__, b__}], lst /. {___, b__, b__} :> {b}, {}]; a[n_] := a[n] = Module[{aa, lg1, lg2}, aa = Array[a, n-1]; lg1 = suffix[Append[aa, 1]] // Length; lg2 = suffix[Append[aa, 2]] // Length; If[lg1 <= lg2, 1, 2]]; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Dec 11 2014 *)
LDS[L_] := Module[{Cands, r, m}, Cands = Range[Floor[Length[L]/2]]; r = 0; For[m = 1, Length[Cands] > 0, m++, Cands = Select[Cands, L[[-m]] == L[[-# - m]]&]; If[Min[Cands] == m, r = m; Cands = ReplaceAll[Cands, m -> Nothing]]]; r]; A = {1}; For[n = 2, n <= 10^3, n++, If[LDS[Append[A, 1]] < LDS[Append[A, 2]], A = Append[A, 1], A = Append[A, 2]]];
Table[A[[i]], {i, 1, 105}] (* Jean-François Alcover, Jul 17 2024, after Robert Israel *)
approved
editing
proposed
approved
editing
proposed