OFFSET
0,3
COMMENTS
Row n contains 3^n symbols.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..9840
F. M. Dekking, Recurrent sets, Advances in Mathematics, vol. 44, no. 1 (1982), 78-104; page 96, section 4.10.
FORMULA
Let r = A062153(1+(2*n)) [index of the row], let c = n - A003462(r) [index of the column], then a(n) = 1 + (a(A003462(r-1)+floor(c/3)) mod 3) if n ≡ 2 mod 3, otherwise a(n) = a(A003462(r-1)+floor(c/3)). - Antti Karttunen, Aug 12 2017
EXAMPLE
From Antti Karttunen, Aug 12 2017: (Start)
The rows 0 .. 3 of this irregular triangle:
1
1;2;1
1 2 1;2 3 2;1 2 1;
1 2 1 2 3 2 1 2 1;2 3 2 3 1 3 2 3 2;1 2 1 2 3 2 1 2 1
(End)
MATHEMATICA
f[n_] := Nest[ Flatten[ # /. {1 -> {1, 2, 1}, 2 -> {2, 3, 2}, 3 -> {3, 1, 3}}] &, {1}, n]; Flatten[ Table[ f[n], {n, 0, 4}]] (* Robert G. Wilson v, Apr 12 2005 *)
PROG
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Roger L. Bagula, Apr 09 2005
EXTENSIONS
More terms from Robert G. Wilson v, Apr 12 2005
STATUS
approved