OFFSET
1,2
COMMENTS
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..20000
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 14 do S:=T(S); od:
S; # A277731
p0:=[]: p1:=[]: p2:=[]:
for i from 1 to nops(S) do
j:=S[i];
if j=0 then p0:=[op(p0), i];
elif j=1 then p1:=[op(p1), i];
else p2:=[op(p2), i]; fi: od:
p0; # A277732
p1; # A277733
p2; # A277734
MATHEMATICA
m = 1000; (* number of terms of A277731 *)
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[]]];
A277731 = Take[S[n], m];
Position[A277731, 0] // Flatten (* Jean-François Alcover, Mar 20 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 07 2016
STATUS
approved