A277731 Fixed point of the morphism 0 -> 01, 1 -> 012, 2 -> 0; starting with a(1) = 0.
0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 1, 2
Offset: 1
Keywords
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..20000
Programs
-
Maple
with(ListTools); T:=proc(S) Flatten(subs( {0=[0,1], 1=[0,1,2], 2=[0]}, S)); end; S:=[0]; for n from 1 to 10 do S:=T(S); od: S;
-
Mathematica
m = 100; (* number of terms required *) S[1] = {0}; S[n_] := S[n] = SubstitutionSystem[{0 -> {0, 1}, 1 -> {0, 1, 2}, 2 -> {0}}, S[n-1]]; For[n = 2, True, n++, If[PadRight[S[n], m] == PadRight[S[n-1], m], Print["n = ", n]; Break[]]]; Take[S[n], m] (* Jean-François Alcover, Mar 20 2023 *)
Comments