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.

A351849 Irregular triangle read by rows, in which row n lists the computation of the tag system T_C(3,2) with alphabet {1, 2, 3}, deletion number 2, and production rules 1 -> 23, 2 -> 1, 3 -> 111, when started from the word encoding n.

This page as a plain text file.
%I A351849 #31 Apr 10 2022 15:33:28
%S A351849 1,11,23,1,111,123,323,3111,11111,11123,12323,32323,323111,3111111,
%T A351849 11111111,11111123,11112323,11232323,23232323,2323231,232311,23111,
%U A351849 1111,1123,2323,231,11,23,1,1111,1123,2323,231,11,23,1
%N A351849 Irregular triangle read by rows, in which row n lists the computation of the tag system T_C(3,2) with alphabet {1, 2, 3}, deletion number 2, and production rules 1 -> 23, 2 -> 1, 3 -> 111, when started from the word encoding n.
%C A351849 This tag system has no halting symbol: the halting condition is reached when the word 1 is produced.
%C A351849 As proved by De Mol (2008), this tag system encodes the Collatz 3x+1 function T(x), where T(x)=x/2 if x is even, (3x+1)/2 if x is odd.
%C A351849 For each row n >= 1, if the tag system is started from the configuration encoding n (a word composed by n ones), and provided the Collatz conjecture is true, the iterations of the system will always reach the word 1 (after A351850(n) steps).
%C A351849 In her original work De Mol uses the alphabet {alpha, c, y}, which is replaced here by {1, 2, 3}.
%H A351849 Paolo Xausa, <a href="/A351849/b351849.txt">Table of n, a(n) for n = 1..2660 (rows n = 1..26 of triangle, flattened)</a>
%H A351849 J. C. Lagarias, <a href="https://arxiv.org/abs/2111.02635">The 3x+1 Problem: An Overview</a>, arXiv:2111.02635 [math.NT], 2021, p. 17.
%H A351849 J. C. Lagarias, ed., <a href="http://www.ams.org/bookstore-getitem/item=mbk-78">The Ultimate Challenge: The 3x+1 Problem</a>, American Mathematical Society, 2010, p. 19.
%H A351849 Liesbeth De Mol, <a href="https://doi.org/10.1016/j.tcs.2007.10.020">Tag systems and Collatz-like functions</a>, Theoretical Computer Science, Volume 390, Issue 1, 2008, pp. 92-101.
%H A351849 Wikipedia, <a href="https://en.wikipedia.org/wiki/Tag_system">Tag system</a>.
%H A351849 <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>.
%e A351849 Written as an irregular triangle, the sequence begins:
%e A351849       1;
%e A351849      11,    23,     1;
%e A351849     111,   123,   323,  3111,  11111,   11123, ..., 2323, 231, 11, 23, 1;
%e A351849    1111,  1123,  2323,   231,     11,      23,   1;
%e A351849   11111, 11123, 12323, 32323, 323111, 3111111, ...,    1;
%e A351849   ...
%e A351849 Each row includes (in the same order of appearance) the words encoding the terms in the corresponding row of A070168. E.g., row 4 includes the words 1111, 11, 1, which encode the numbers 4, 2, 1, respectively.
%e A351849 The following computation shows how row 3 is generated. In each step, symbols coming from the production rules (based on the first symbol of the previous word) are appended; the first two symbols of the word are then deleted.
%e A351849   111             (corresponding to the integer 3)
%e A351849     123           (appending 23, from production rule 1 -> 23)
%e A351849       323         (appending 23, from production rule 1 -> 23)
%e A351849         3111      (appending 111, from production rule 3 -> 111)
%e A351849           11111   (appending 111, from production rule 3 -> 111)
%e A351849             ...
%e A351849               23  (appending 23, from production rule 1 -> 23)
%e A351849                 1 (appending 1, from production rule 2 -> 1)
%t A351849 t[s_]:=StringDrop[s,2]<>StringReplace[StringTake[s,1],{"1"->"23","2"->"1","3"->"111"}];
%t A351849 nrows=5;Table[NestWhileList[t,StringRepeat["1",n],#!="1"&],{n,nrows}]
%o A351849 (Python)
%o A351849 def A351849_row(n):
%o A351849     s = "1" * n
%o A351849     row = [int(s)]
%o A351849     while s != "1":
%o A351849         if s[0] == "1": s += "23"
%o A351849         elif s[0] == "2": s += "1"
%o A351849         else: s += "111"
%o A351849         s = s[2:]
%o A351849         row.append(int(s))
%o A351849     return row
%o A351849 nrows = 4
%o A351849 print([A351849_row(n) for n in range(1, nrows + 1)])
%Y A351849 Cf. A014682, A070168, A351850.
%K A351849 nonn,tabf
%O A351849 1,2
%A A351849 _Paolo Xausa_, Feb 22 2022