OFFSET
1,2
LINKS
FORMULA
EXAMPLE
1;
(123);
(123)(231)(312);
(123)(231)(312)(231)(312)(123)(312)(123)(231);
MATHEMATICA
Nest[ Flatten[ # /. {1 -> {1, 2, 3}, 2 -> {2, 3, 1}, 3 -> {3, 1, 2}}] &, {1}, 7] (* Robert G. Wilson v, Mar 08 2005 *)
PROG
(PARI) {a(n) = if( n<2, n>0, (a((n + 2)\ 3) + n + 1 )%3 + 1)} /* Michael Somos, Sep 06 2008 */
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved