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.
%I A105083 #58 Jul 23 2025 19:24:17 %S A105083 1,2,3,1,1,2,1,2,3,1,2,3,1,1,2,3,1,1,2,1,2,3,1,1,2,1,2,3,1,2,3,1,1,2, %T A105083 1,2,3,1,2,3,1,1,2,3,1,1,2,1,2,3,1,2,3,1,1,2,3,1,1,2,1,2,3,1,1,2,1,2, %U A105083 3,1,2,3,1,1,2,3,1,1,2,1,2,3,1,1,2,1,2,3,1,2,3,1,1,2,1,2,3,1,2 %N A105083 Trajectory of 1 under the morphism 1 -> 12, 2 -> 3, 3 -> 1. %H A105083 Aresh Pourkavoos, <a href="/A105083/b105083.txt">Table of n, a(n) for n = 0..10000</a> %H A105083 P. Arnoux and E. Harriss, <a href="http://www.ams.org/notices/201407/rnoti-p768.pdf">What is a Rauzy Fractal?</a>, Notices Amer. Math. Soc., 61 (No. 7, 2014), 768-770, also p. 704 and front cover. %H A105083 Marcy Barge and Jaroslaw Kwapisz, <a href="http://www.jstor.org/stable/40068030">Geometric theory of unimodular Pisot substitutions</a>, Amer. J. Math. 128 (2006), no. 5, 1219--1282. MR2262174 (2007m:37039). - _N. J. A. Sloane_, Aug 06 2014 %H A105083 Jeffrey Shallit, <a href="https://arxiv.org/abs/2503.01026">The Narayana Morphism and Related Words</a>, arXiv:2503.01026 [math.CO], 2025. %H A105083 Victor F. Sirvent and Yang Wang, <a href="http://dx.doi.org/10.2140/pjm.2002.206.465">Self-Affine Tiling via Substitution Dynamical Systems and Rauzy Fractals</a>, Pac. J. Math., 206 (2002), 465-485. See Example 2.2 and Figure 2 pp. 474-475. %H A105083 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A105083 From _Aresh Pourkavoos_, Jan 26 2021: (Start) %F A105083 Limit S(infinity) of the following strings: S(0) = 2, S(1) = 1, S(2) = 0, S(n+3) = S(n+2)S(n). S(n) has length A000930(n). %F A105083 Individual terms of a(n) may also be found by greedily writing n as a sum of entries of A000930. a(n) is 2 if the smallest term is 1, 3 if the smallest term is 2, and 1 otherwise. %F A105083 (End) %F A105083 a(n) = A005374(n+1) - A005374(n) - 2*(A202340(n+1) - 2). - _Alan Michael Gómez Calderón_, Jul 19 2025 %t A105083 Nest[ Function[ l, {Flatten[(l /. {1 -> {1, 2}, 2 -> {3}, 3 -> {1}})] }], {1}, 12] %o A105083 (Python) %o A105083 N_TERMS=10000 %o A105083 def a(): %o A105083 # Index of the current term %o A105083 n = 0 %o A105083 # Stores the place values of the greedy representation of n, %o A105083 # minus two since A000930 begins with duplicate ones. %o A105083 places = [] %o A105083 # Edge case: a(0)=1. %o A105083 yield 0, 1 %o A105083 while True: %o A105083 n += 1 %o A105083 # Add A000930(2+0)=1 to the representation of n %o A105083 places.append(0) %o A105083 # Apply carryover rule for as long as necessary: %o A105083 # if places contains n+2 and n, %o A105083 # both terms are replaced by n+3. %o A105083 while len(places) > 1 and places[-2] <= places[-1]+2: %o A105083 places.pop() %o A105083 places[-1] += 1 %o A105083 # Look at the smallest term to decide a(n) %o A105083 an = 1 if places[-1] > 1 else places[-1]+2 %o A105083 yield n, an %o A105083 # Asymptotic behavior is O(log(n)*log(log(n))) memory %o A105083 # and O(n) time to generate the first n terms, %o A105083 # although a term may take as long as O(log(n)). %o A105083 for n, an in a(): %o A105083 print(n, an) %o A105083 if (n >= N_TERMS): %o A105083 break %o A105083 # _Aresh Pourkavoos_, Jan 26 2021 %Y A105083 Cf. A005374, A073058, A092782, A202340, A245553, A245554, A000930. %K A105083 nonn %O A105083 0,2 %A A105083 _Roger L. Bagula_, Apr 06 2005 %E A105083 Edited by _N. J. A. Sloane_, Oct 10 2007 and Aug 03 2014