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.

A245188 Trajectory of 1 under repeated applications of the morphism 0->12, 1->13, 2->20, 3->21.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 21 2014

Keywords

Comments

This is the 2-block coding of the Thue-Morse word A010060.
Essentially equal to A005681. - Michel Dekking, Feb 18 2021

Crossrefs

Programs

  • Maple
    mor := proc(L)
        local Lout,w ;
        if nops(L) = 0 then
            [1,2] ;
        else
            Lout := [] ;
            for w in L do
                if w = 0 then
                    Lout := [op(Lout),1,2] ;
                elif w =1 then
                    Lout := [op(Lout),1,3] ;
                elif w =2 then
                    Lout := [op(Lout),2,0] ;
                else
                    Lout := [op(Lout),2,1] ;
                end if;
            end do:
            Lout ;
        end if;
    end proc:
    L := [1] ;
    for r from 0 to 10 do
        Lold := L ;
        L := mor(Lold) ;
        for n from 1 to nops(Lold) do
            if op(n,L) = op(n,Lold) then
                printf("%d,",op(n,L)) ;
            else
                break;
            end if;
        end do:
        print() ;
    end do: # R. J. Mathar, Oct 25 2014
  • Mathematica
    (* This gives the first 128 terms. *)
    SubstitutionSystem[{0 -> {1, 2}, 1 -> {1, 3}, 2 -> {2, 0}, 3 -> {2, 1}}, {1}, {{7}}] (* Eric Rowland, Oct 02 2016 *)