%I #34 Apr 05 2019 17:42:57
%S 0,0,0,1,1,1,2,0,0,0,1,1,1,2,0,0,0,0,0,0,1,1,1,2,0,0,0,1,1,1,2,0,0,0,
%T 0,0,0,1,1,1,2,0,0,0,1,1,1,2,0,0,0,1,1,1,2,0,0,0,0,0,0,1,1,1,2,0,0,0,
%U 1,1,1,2,0,0,0,0,0,0,1,1,1,2,0,0,0,1
%N Second digit in the expansion of n in Fraenkel's exotic ternary representation.
%C Let {p_i, i >= 0} = {1,3,7,17,41,99,...} denote the numerators of successive convergents to sqrt(2) (see A001333). Then any n >= 0 has a unique representation as n = Sum_{i >= 0} d_i*p_i, with 0 <= d_i <= 2, d_{i+1}=2 => d_i=0. Sequence gives a(n+1) = d_1.
%C Let x be the 3-symbol Pell word A294180 = 1, 2, 3, 1, 2, 3, 1, 1, 2, 3, 1, 2, ... Let delta be the morphism
%C 1 -> 000, 2 -> 111, 3 -> 2.
%C Then delta(x) = (a(n)). This can be proved by induction, starting from the knowledge that the sequence of first digits d_0 = d_0(n) of n in the exotic ternary expansion shifted by 1 is equal to x (see A263844).
%C More generally, the sequence of k-th digits d_k shifted by 1 is equal to delta_k(x), where the morphism delta_k is given by
%C 1 -> U_k, 2 -> V_k, 3 -> W_k.
%C Here U_k is a concatenation of p_{k+1} letters 0, V_k is a concatenation of p_{k+1} letters 1, and W_k is a concatenation of p_k letters 2.
%H Michel Dekking, <a href="/A307247/b307247.txt">Table of n, a(n) for n = 1..5000</a> (restored by _Georg Fischer_, Apr 05 2019)
%H F. Michel Dekking, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Dekking/dekk4.html">Morphisms, Symbolic Sequences, and Their Standard Forms</a>, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.1.
%H Aviezri S. Fraenkel, <a href="http://dx.doi.org/10.1016/S0012-365X(00)00138-2">On the recurrence f(m+1)= b(m)*f(m)-f(m-1) and applications</a>, Discrete Mathematics 224 (2000), pp. 273-279.
%H A. S. Fraenkel, <a href="/A263844/a263844.png">An exotic ternary representation of the first few positive integers</a> (Table 2 from Fraenkel (2000).)
%Y Cf. A263844, A001333.
%K nonn
%O 1,7
%A _Michel Dekking_, Apr 01 2019