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 A317948 #41 Feb 01 2021 02:18:43 %S A317948 0,1,0,2,3,0,3,1,2,0,0,2,3,1,0,1,0,1,2,3,0,2,3,0,3,1,2,0,3,1,2,0,2,3, %T A317948 1,0,0,2,3,1,0,1,2,3,0,1,0,1,2,3,0,3,1,2,0,2,3,0,3,1,2,0,2,3,1,0,3,1, %U A317948 2,0,2,3,1,0,1,2,3,0,0,2,3,1,0,1,2,3,0 %N A317948 An example of a morphic word: the sorted (by length, then alphabetically) sequence of words of the form a*b* under the action of a finite automaton defined as follows: start state is 0; a and b map states [0, 1, 2, 3] to states [1, 2, 3, 0] and [0, 3, 1, 2], respectively. %C A317948 The DuchĂȘne et al. (2011) reference mentions many other sequences that are of great interest. %C A317948 From _Kevin Ryde_, Dec 26 2020: (Start) %C A317948 This sequence can be taken as a square array S(m,k) read by upwards antidiagonals with rows m >= 0 and columns k >= 0. S(m,k) is the final state for input word a^m b^k where ^ denotes repetition. Input a's cycle around states 0,1,2,3 so S(m,0) = m mod 4. Within an array row, input b's are no change at state 0 (so a row of 0's), or a repeating cycle 3,2,1 starting at m mod 4. %C A317948 Antidiagonal d of the array is input words of length d = m+k, so terms S(d-k,k). These are words a^(d-k) b^k and the combination of d-k mod 4 and k mod 3 is 12-periodic within a diagonal. The sequence can also be taken as a triangle read by rows T(d,k) = S(d-k,k) for d >= 0 and 0 <= k <= d. %C A317948 Rigo (2000, section 2.1 remark 2) notes that the sequence (flat sequence) is not periodic because pairs of terms 0,0 are at ever-increasing distances apart. They are a(n)=a(n+1)=0 iff n = 2*t*(4*t+1) = A033585(t) for t >= 1, which is every fourth triangular number. %C A317948 (End) %H A317948 Eric DuchĂȘne, Aviezri S. Fraenkel, Richard J. Nowakowski, and Michel Rigo, <a href="https://orbi.uliege.be/handle/2268/100440">Extensions and restrictions of Wythoff's game preserving Wythoff's sequence as set of P-positions</a>, Slides from a talk, LIAFA, Paris, October 21, 2011. See around the 35th slide, a slide with first line "In fact, this is a special case of the following result...". %H A317948 Michel Rigo, <a href="https://doi.org/10.1016/S0304-3975(00)00163-8">Generalization of automatic sequences for numeration systems on a regular language</a>, Theoret. Comput. Sci., 244 (2000) 271-281. See section 2.1 sequence u. %H A317948 Michel Rigo and Arnaud Maes, <a href="https://www.jalc.de/issues/2002/issue_7_3/abs-351.pdf">More on generalized automatic sequences</a>, Journal of Automata, Languages and Combinatorics 7.3 (2002): 351-376. See Fig. 3. %F A317948 From _Kevin Ryde_, Dec 26 2020: (Start) %F A317948 S(m,k) = 0 if m==0 (mod 4), otherwise S(m,k) = (((m mod 4) - k - 1) mod 3) + 1. %F A317948 T(d,k) = S(d-k,k) = p(3*d+k mod 12) where p(0..11) = 0,2,3,1, 0,1,2,3, 0,3,1,2. %F A317948 (End) %e A317948 From _Kevin Ryde_, Dec 26 2020: (Start) %e A317948 Array S(m,k) begins %e A317948 k=0 1 2 3 4 5 6 7 %e A317948 +------------------------- %e A317948 m=0 | 0, 0, 0, 0, 0, 0, 0, 0, %e A317948 m=1 | 1, 3, 2, 1, 3, 2, 1, %e A317948 m=2 | 2, 1, 3, 2, 1, 3, sequence by upwards %e A317948 m=3 | 3, 2, 1, 3, 2, antidiagonals, %e A317948 m=4 | 0, 0, 0, 0, %e A317948 m=5 | 1, 3, 2, 12-periodic in diagonals %e A317948 m=6 | 2, 1, (3 or 1-periodic in rows) %e A317948 m=7 | 3, (4-periodic in columns) %e A317948 (End) %o A317948 (Python) %o A317948 aut0, aut1 = [1, 2, 3, 0], [0, 3, 1, 2] %o A317948 a, row = [0], [0] %o A317948 for i in range(1, 10): %o A317948 row = [aut0[row[0]]] + [aut1[x] for x in row] %o A317948 a += row %o A317948 print(a) %o A317948 # _Andrey Zabolotskiy_, Aug 17 2018 %o A317948 (PARI) S(m,k) = if(m%=4, (m-k-1)%3+1, 0); \\ _Kevin Ryde_, Dec 26 2020 %K A317948 nonn,tabl %O A317948 1,4 %A A317948 _N. J. A. Sloane_, Aug 12 2018 %E A317948 New name and terms a(51) and beyond from _Andrey Zabolotskiy_, Aug 17 2018