Dim As String tm = "0" Function Thue_Morse(s As String) As String Dim As String k = "" For i As Integer = 1 To Len(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 As Integer = 1 To 7 tm = Thue_Morse(tm) Print tm Next j End