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 A291072 #8 Dec 12 2023 13:39:57 %S A291072 -1,22,1,1,122,122,11,11,11,11,2122,2122,2122,2122,111,211,111,211, %T A291072 111,211,111,211,12122,22122,12122,22122,12122,22122,12122,22122,1111, %U A291072 1211,2111,2211,1111,1211,2111,2211,1111,1211,2111,2211,1111,1211,2111,2211,112122,122122,212122,222122 %N A291072 Take n-th string over {1,2} in lexicographic order and apply the Watanabe tag system {00, 1011} described in A291067 (but adapted to the alphabet {1,2}) just once. %p A291072 # First define the mapping by defining the strings T1 and T2: %p A291072 # Work over the alphabet {1,2} %p A291072 # 11 / 2212 A284116 This is the "Post Tag System" %p A291072 T1:="11"; T2:="2212"; %p A291072 # 11 / 2122 A291067 These three are from the Watanabe paper %p A291072 T1:="11"; T2:="2122"; %p A291072 # 11 / 2221 A291068 %p A291072 T1:="11"; T2:="2221"; %p A291072 # 11 / 1222 A291069 %p A291072 T1:="11"; T2:="1222"; %p A291072 with(StringTools): %p A291072 # the mapping: %p A291072 f1:=proc(w) local L, ws, w2; global T1,T2; %p A291072 ws:=convert(w, string); %p A291072 if ws="-1" then return("-1"); fi; %p A291072 if ws[1]="1" then w2:=Join([ws, T1], ""); else w2:=Join([ws, T2], ""); fi; %p A291072 L:=length(w2); if L <= 3 then return("-1"); fi; %p A291072 w2[4..L]; end; %p A291072 # Construct list of words over {1,2} (A007931) %p A291072 a:= proc(n) local m, r, d; m, r:= n, 0; %p A291072 while m>0 do d:= irem(m, 2, 'm'); %p A291072 if d=0 then d:=2; m:= m-1 fi; %p A291072 r:= d, r %p A291072 od; parse(cat(r))/10 %p A291072 end: %p A291072 WLIST := [seq(a(n), n=1..100)]; %p A291072 # apply the map once: %p A291072 # this produces A289673, A291072, A291073, A291074 %p A291072 W2:=map(f1,WLIST); %Y A291072 Cf. A007931, A284116, A291067, A291068, A291069. %Y A291072 Cf. also A289673, A291073, A291074. %K A291072 sign %O A291072 1,2 %A A291072 _N. J. A. Sloane_, Aug 18 2017