cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A006346 The Sally sequence: the length of repetition avoided in A006345.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 1, 3, 2, 1, 6, 3, 2, 1, 3, 1, 1, 6, 3, 2, 4, 1, 1, 3, 2, 1, 3, 1, 6, 4, 2, 1, 2, 4, 3, 1, 8, 3, 2, 1, 6, 3, 2, 1, 3, 1, 1, 6, 3, 2, 4, 1, 1, 3, 2, 1, 3, 1, 30, 6, 3, 2, 4, 1, 1, 3, 2, 1, 3, 1, 6, 4, 2, 1, 2, 4, 3, 1, 8, 3, 2, 1, 6, 3, 2, 1, 3, 1, 1, 6, 3, 2, 4, 1, 1, 3, 2, 1, 3, 1, 6, 4, 2
Offset: 1

Views

Author

Keywords

Comments

In the first 1000 terms, only patterns of lengths 0, 1, 2, 3, 4, 6, 8, 24, 30 and 108 are avoided. - T. D. Noe, Oct 14 2006
In the first 20000 terms, patterns of lengths 0, 1, 2, 3, 4, 5, 6, 7, 8, 16, 18, 24, 30, 108, 528, 552, 1298, 2752, 5876 are avoided. - Robert Israel, Jun 22 2015
In the first 10^6 terms, patterns of lengths 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 24, 30, 36, 60, 72, 108, 318, 372, 414, 420, 444, 522, 528, 546, 552, 1280, 1292, 1298, 1632, 2620, 2752, 5876, 6203, 6218, 13912, 14312, 17220, 17580, 31532, 87650 are avoided. - Ray Chandler, Jun 24 2015

References

  • N. S. Hellerstein, personal communication to N. J. A. Sloane.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A006345.

Programs

  • Maple
    LDS:= proc(L)
      local Cands, r, m;
      Cands:= {$1..floor(nops(L)/2)};
      r:= 0;
      for m from 1 while nops(Cands) > 0 do
         Cands:= select(c -> L[-m] = L[-c-m], Cands);
         if min(Cands) = m then
            r:= m;
            Cands:= subs(m=NULL,Cands);
         fi
       od;
       r
    end proc:
    A:= 1: B:= 0;
    for n from 2 to 1000 do
      a1:= LDS([A,1]);
      a2:= LDS([A,2]);
      if a1 < a2 then A:= A,1; B:= B, a2 else A:= A,2; B:= B, a1 fi;
    od:
    seq(B[i],i=1..1000); # Robert Israel, Jun 22 2015
  • Mathematica
    max = 120;
    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}; B = {0};
    For[n = 2, n <= max, n++,
      a1 = LDS[Append[A, 1]];
      a2 = LDS[Append[A, 2]];
      If[a1 < a2,
        AppendTo[A, 1]; AppendTo[B, a2],
        AppendTo[A, 2]; AppendTo[B, a1]
      ]
    ];
    Table[B[[i]], {i, 1, max}] (* Jean-François Alcover, Jun 08 2018, after Robert Israel's Maple program *)

Extensions

More terms from Naohiro Nomoto, May 21 2001