OFFSET
1,1
MATHEMATICA
f[n_List] := Block[{a = {}, l = Length[n], k = 1}, While[k < l + 1, If[ EvenQ[k], Switch[ n[[k]], 1, AppendTo[a, 321], 2, AppendTo[a, 132], 3, AppendTo[a, 213]], Switch[ n[[k]], 1, AppendTo[a, 123], 2, AppendTo[a, 231], 3, AppendTo[a, 312]]]; k++ ]; Flatten[ IntegerDigits /@ a]]; Take[ Nest[f, {2}, 5], 105]
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Nov 17 2004
STATUS
approved