A105202 Irregular triangle read by rows: row n gives the word f(f(f(...(1)))) [with n applications of f], where f is the morphism 1->{1,2,1}, 2->{2,3,2}, 3->{3,1,3}.
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, 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, 2, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 3, 1, 2, 1, 3, 1, 3, 2, 3, 2, 3, 1, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3
Offset: 0
Examples
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)
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.
Programs
-
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 *)
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
Extensions
More terms from Robert G. Wilson v, Apr 12 2005
Comments