tm = "0" Function Thue_Morse(s) k = "" For i = 1 To Length(s) If Mid(s, i, 1) = "1" Then k += "0" Else k += "1" End If Next i Thue_Morse = s + k End Function Print tm For j = 1 To 7 tm = Thue_Morse(tm) Print tm Next j End