######################################################################### # # Simnple Maple code for sequences mentioned in the following remark. # # # Asveld's Table 1 gives data about the behavior of Post's 3-shift tag system {00/1101} applied to the word (100)^n. The first column gives n, the nonzero values in column 2 give A291792, and columns 3 through 7 give A284119, 291793 (or A284121), A291794, A291795, A291796. For the corresponding data for Watanabe's 3-shift tag system {00/1011} applied to (100)^n see A292089, A292090, A292091, A292092, A292093, A292094. # ######################################################################### ######################################################################### # First define the mapping by defining the strings T1 and T2: # Work over the alphabet {0,1} with(StringTools); # 00 / 1101 A284116 This is the "Post Tag System" T1:="00"; T2:="1101"; # 00 / 1011 A291067 This is from the Watanabe paper T1:="00"; T2:="1011"; # the mapping: f1:=proc(w) local L, ws, w2; global T1,T2; ws:=convert(w, string); if ws="-1" then return("-1"); fi; if ws[1]="0" then w2:=Join([ws, T1], ""); else w2:=Join([ws, T2], ""); fi; L:=length(w2); if L <= 3 then return("-1"); fi; w2[4..L]; end; # Compute the trajectory of word s1 and analyze it tr:=proc(s1) local MMM,MMMat,i,A291794,mytau,clength,p,lis,ss,n,M,traj; global f1,T1,T2; ss:=convert(s1,string); M:=100000; traj:={ss}; lis:=[ss]; MMMat:=1; MMM:=length(ss); for n from 2 to M do ss:=f1(ss); if length(ss)>MMM then MMM:=length(ss); MMMat:=n; fi; traj := traj union {ss}; if nops(traj) < n then if ss="-1" then #lprint("died at step",n-1); clength:=0; mytau:=n-2; A291794:=0; # find length of cycle else member(ss,lis,'p'); clength:=n-p; mytau:=p-1; A291794:=length(lis[p]); fi; break; else lis:=[op(lis),ss]; fi; od: if n=M+1 then lprint("Did not terminate"); fi; MMMat:=MMMat-1; [mytau,clength,A291794,MMM,MMMat]; end: # The main run: A:="100"; W:=""; for c from 1 to 21 do W:=Join([W,A],""); lprint(tr(W)); od: