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.

A219762 Start with 0; repeatedly apply the map {0->012, 1->120, 2->201} to the odd-numbered terms and {0->210, 1->021, 2->102} to the even-numbered terms.

Original entry on oeis.org

0, 1, 2, 0, 2, 1, 2, 0, 1, 2, 1, 0, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 2, 0, 1, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 1, 2, 1, 0, 2, 1, 2, 0, 1, 0, 2, 0, 1, 2, 1, 0, 2, 1, 2, 0
Offset: 1

Views

Author

N. J. A. Sloane, Dec 05 2012

Keywords

Comments

An infinite squarefree sequence over {0,1,2} that is not generated by a CDOL system.

Examples

			0 -> 012 -> 012021201 -> ...
		

References

  • A. Salomaa, Jewels of Formal Language Theory. Computer Science Press, Rockville, MD, 1981, p. 16, Problem 13.

Programs

  • Haskell
    a219762 = subtract 1 . a099054 . subtract 1
    -- Reinhard Zumkeller, Aug 08 2014
  • Mathematica
    f[lst_] := Replace[MapIndexed[{#1, #2[[1]]}&, lst], {{0, n_} :> If[OddQ[n], {0, 1, 2}, {2, 1, 0}], {1, n_} :> If[OddQ[n], {1, 2, 0}, {0, 2, 1}], {2, n_} :> If[OddQ[n], {2, 0, 1}, {1, 0, 2}]}, 1] // Flatten; Nest[f, {0}, 5] (* Jean-François Alcover, Mar 07 2014 *)

Formula

a(n) = A099054(n-1) - 1. - Reinhard Zumkeller, Aug 08 2014