cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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}.

This page as a plain text file.
%I A105202 #19 Aug 12 2017 13:03:02
%S A105202 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,
%T A105202 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,
%U A105202 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
%N 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}.
%C A105202 Row n contains 3^n symbols.
%H A105202 Antti Karttunen, <a href="/A105202/b105202.txt">Table of n, a(n) for n = 0..9840</a>
%H A105202 F. M. Dekking, <a href="http://dx.doi.org/10.1016/0001-8708(82)90066-4">Recurrent sets</a>, Advances in Mathematics, vol. 44, no. 1 (1982), 78-104; page 96, section 4.10.
%F A105202 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
%e A105202 From _Antti Karttunen_, Aug 12 2017: (Start)
%e A105202 The rows 0 .. 3 of this irregular triangle:
%e A105202   1
%e A105202   1;2;1
%e A105202   1 2 1;2 3 2;1 2 1;
%e A105202   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
%e A105202 (End)
%t A105202 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 *)
%o A105202 (Scheme, with memoization-macro definec)
%o A105202 (definec (A105202 n) (if (zero? n) 1 (let* ((r (A062153 (+ 1 (* 2 n)))) (c (- n (A003462 r))) (p (A105202 (+ (A003462 (- r 1)) (/ (- c (modulo c 3)) 3))))) (if (= 2 (modulo n 3)) (+ 1 (modulo p 3)) p))))
%o A105202 ;; _Antti Karttunen_, Aug 12 2017
%Y A105202 Cf. A003462, A062153, A073058, A105141.
%Y A105202 Each row is a prefix of A105203.
%K A105202 nonn,tabf
%O A105202 0,3
%A A105202 _Roger L. Bagula_, Apr 09 2005
%E A105202 More terms from _Robert G. Wilson v_, Apr 12 2005