A026600 a(n) is the n-th letter of the infinite word generated from w(1)=1 inductively by w(n)=JUXTAPOSITION{w(n-1),w'(n-1),w"(n-1)}, where w(k) becomes w'(k) by the cyclic permutation 1->2->3->1 and w"(k) = (w')'(k).
1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1, 3, 1, 2, 2, 3, 1, 3, 1, 2, 1, 2, 3, 2, 3, 1, 3, 1, 2, 1, 2, 3, 3, 1, 2, 1, 2, 3, 2, 3, 1, 1, 2, 3, 2, 3, 1
Offset: 1
Keywords
Examples
1; (123); (123)(231)(312); (123)(231)(312)(231)(312)(123)(312)(123)(231);
Links
Programs
-
Mathematica
Nest[ Flatten[ # /. {1 -> {1, 2, 3}, 2 -> {2, 3, 1}, 3 -> {3, 1, 2}}] &, {1}, 7] (* Robert G. Wilson v, Mar 08 2005 *)
-
PARI
{a(n) = if( n<2, n>0, (a((n + 2)\ 3) + n + 1 )%3 + 1)} /* Michael Somos, Sep 06 2008 */