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.
%I A277731 #17 Mar 20 2023 06:22:36 %S A277731 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, %T A277731 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, %U A277731 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 %N A277731 Fixed point of the morphism 0 -> 01, 1 -> 012, 2 -> 0; starting with a(1) = 0. %C A277731 After k = 0,1,2,3,... applications of the morphism we have 0, 01, 01012, 01012010120, ... which have lengths 1, 2, 5, 11, 24, 53, 117, ..., satisfying b(n) = 2*b(n-1) + b(n-3) (cf. A052980). %H A277731 N. J. A. Sloane, <a href="/A277731/b277731.txt">Table of n, a(n) for n = 1..20000</a> %p A277731 with(ListTools); %p A277731 T:=proc(S) Flatten(subs( {0=[0,1], 1=[0,1,2], 2=[0]}, S)); end; %p A277731 S:=[0]; %p A277731 for n from 1 to 10 do S:=T(S); od: %p A277731 S; %t A277731 m = 100; (* number of terms required *) %t A277731 S[1] = {0}; %t A277731 S[n_] := S[n] = SubstitutionSystem[{0 -> {0, 1}, 1 -> {0, 1, 2}, 2 -> {0}}, S[n-1]]; %t A277731 For[n = 2, True, n++, If[PadRight[S[n], m] == PadRight[S[n-1], m], Print["n = ", n]; Break[]]]; %t A277731 Take[S[n], m] (* _Jean-François Alcover_, Mar 20 2023 *) %Y A277731 Cf. A052980, A277732, A277733, A277734. %K A277731 nonn %O A277731 1,5 %A A277731 _N. J. A. Sloane_, Nov 07 2016