# The3x+1 Problem as a String Rewriting System

Authors: Joseph Sinyor
Journal: International Journal of Mathematics and Mathematical Sciences
 (2010)

---

## Abstract

The3x+1 problem can be viewed, starting with the binary form for any n∈N, as a string of “runs” of 1s and 0s, using methodology introduced by Błażewicz and Pettorossi in 1983. A simple system of two unary operators rewrites the length of each run, so that each new string represents the next odd integer on the 3x+1 path. This approach enables the conjecture to be recast as two assertions. (I) Every odd n∈N lies on a distinct 3x+1 trajectory between two Mersenne numbers (2k−1) or their equivalents, in the sense that every integer of the form (4m+1) with m being odd is equivalent to m because both yield the same successor. (II) If Tr(2k−1)→(2l−1) for any r,k,l>0, l<k; that is, the  3x+1 function expressed as a map of k's is monotonically decreasing, thereby ensuring that the function terminates for every integer.


---

## Body

## 1. Introduction

The3x+1 problem is also known under various other names including Collatz’s problem, Ulam’s problem, and the Syracuse problem. It considers the following transformation of integers: (1.1)f(x)={(3x+1)ifxisodd,x2ifxiseven.
The conjecture states that, starting with any integer n (which for our purposes we will take as positive, although there is a negative version), f(x) will eventually reach 1 under iteration of the function. Thereafter it will enter the short cycle 4, 2, 1. The conjecture specifies that there are no other cycles and also that the function is not divergent. Another commonly used notation is Tk(n) for the value after k iterations.The conjecture has been verified up to 26 × 255as of April 2010 in independent computations by Oliveira e Silva [1] and Roosendaal [2].In this paper we will use another version of the problem(1.2)f(xi)=3xi-1+12mi-1,x0=n,
such that 2mi-1∣3xi-1+1 but 2mi-1+1 does not divide it.This version iterates directly from one odd integer to another, and the conjecture states thatxi=1 for some finite value of i. However, this form is less often used by researchers because of the difficulty of determining a  priori the values of mi-1.For a comprehensive review of the research to date, see Lagarias’ annotated bibliography and generalizations of the problem [3–5] and Chamberland’s 2003 update [6]. Wirsching’s lecture notes [7] consider the dynamical system generated by the function. Shallit [8] treats the function from the viewpoint of finite automata.Our approach builds on Błażewicz and Pettorossi’s 1983 paper [9] in which they introduce the notion of viewing the binary representation as an alternating series of “runs” of 1s and 0s. These can be rewritten using two unary operators and include appending a carry 1 as necessary to the output string to achieve the iterations correctly according to the 3x+1 algorithm.Clearly the binary notation can be expressed as lengths of runs. For example, we expressn=27 as 120112. We point out that this particular starting point is especially interesting because—as noted by several writers—it generates one of two of the longest trajectories for values of n<103. As Table 1 shows, 41 steps are required to reach 1 in terms of odd integers. The other long trajectory in that range is for n=703.Table 1
3x+1 path (odd integers) for n=27 expressed in integer and run notations.
No.IntegerRun notationNo.integerRun notation0272 1 2212832 1 2 3 11411 2 1 1 1224251 2 1 1 1 1 22315233196 2 13474 1 1244795 1 34713 3 1257194 2 2 1 151072 1 1 1 22610793 1 2 4 161611 4 1 1 12716192 2 1 1 1 2 271211 2 42824291 1 5 1 1 2 18912 1 2 1 1299114 3 391371 2 1 3 13013673 1 1 1 1 1 1 1 1101033 2 23120512 9 1111552 1 2 2 13230771 1 1 7 2122331 2 1 1 3335771 5 1 2 1131754 1 1 1 1344331 3 2 1 2142633 5 1353251 1 1 3 1 1 1153952 1 1 3 236611 1 4165931 3 1 1 1 2 137233 1 1174451 1 4 1 238192 3 1181693 2 1 1 139531 1 1 1 2192512 1 54051 1 1203771 2 4 1 14111We will dispense with explicitly showing 1s and 0s unless otherwise indicated because, as we will show, the same rewriting rules apply to both. Hencen=27 becomes {212}, and all positive odd integers are represented in this way, the only constraint being that the string is of odd length. Even values of n appear as trailing 0s and are simply deleted in the rewriting process.


## 2. The String Rewriting System (SRS) for the3x+1 Problem

We will now list the String Rewriting System (SRS) process specific to the3x+1 problem and then prove that it replicates the algorithm for odd integers. Since the rewriting will involve deletions as well as additions, for convenience, we will invert the normal sequence, so that deletions occur on the left (least significant digits) and additions of carry 1s at right (most significant digits).(i)
At the start of each iteration, we delete any leading 1sin  pairs. This action corresponds to the removal of (4k+1) factors whenever k is odd, which has no impact on the calculation.(ii)
Reset the output string to a null string.(iii)
Apply the following rewriting rules, one integer at a time, and concatenate to the output string, using the unary operatorsf and g. Every iteration starts with f:(2.1)(i)fork=1f1→+1gorg1→+1f,(ii)fork=2g2→2gorf2→11g,(iii)fork≥3gk→1(k-2)1gorfk→(k-1)1g,(iv)fork=ϕ(endofinputstring),gϕ⟶1f.
Note that, while in general we concatenate to the output string, the + sign (first rule) requires that we add 1 to the last integer on the output string. If there is no previous integer (output string is empty), then the 1 is simply discarded.Proof.
For this proof only, we will revert to the usual binary representation (least significant digits at right) and perform the3n+1 calculation by adding a 1 to the right of n and add n. We summarize some findings of Błażewicz and Pettorossi as follows.(i)
A runρ of 1s is translated by the function into 0ρ0, and a run of 0s changes to 1ρ1, so long as the length of ρ satisfies |ρ|≥2. For example, runs of |ρ|=5 are shown pictorially as follows; the operation f 5 is on the left and g 5 is on the right:
(2.2)(ii)
An alternating series of 1 and 0 results in a string of 0s(2.3)
this corresponds to a succession of (4k+1) factors which can be removed if they occur at right.(iii)
Single 0s or 1s disappear into the structures of their neighbors(2.4)(iv)
It is easily seen that the rewriting rules (ii) and (iii) maintain the parity of the string for operatorg and change it to even for f. Rule  1 has no effect on the parity. Hence, if the output string (which always starts with f) ends with g, we must add a 1 (the carry bit) to it to preserve the requirement that its length be odd.Rule (ii) can similarly be proved. Using the above, one can confirm that the rewriting rules (2.1) satisfy all the requirements of the 3x+1 algorithm.The above SRS has some useful properties.A Mersenne number (2k-1) which in binary is a row of k 1s is represented in our notation simply as {k}.It is easy to see that every integer of the form (4m+1) with m being odd is equivalent to m because both yield the same successor. In binary, the string for an odd integer m is followed by a 0 and a 1 to produce (4m+1). In our notation this translates even more simply as a pair of leading 1s. Given any odd integer one can write or immediately recognize an infinite number of equivalents simply by adding (or removing) pairs of 1s. Only adding 1s in pairs will maintain the correct parity of the string.


## 3. The3x+1 Problem and Mersenne Numbers

It is rather surprising that the Mersenne numbers should play a helpful role in the3x+1 problem because—as several writers have noted, for example, Kuttler [10]—it is easy to show that Tk(2k-1)=(3k-1); that is, the values appear to grow quickly (we caution here that Kuttler uses a variant of our definition (1.1) which results in a different set of iterations). However, if we complete the numerical evidence for small values of k (≤20), an interesting structure emerges. Figure 1 shows each vertex containing the kth Mersenne number and each edge representing the 3x+1 trajectory from that kth Mersenne number to the next. For example, the trajectory for n=27 is largely represented by the single edge between k=5 and k=4, that is, n=31 and n=61, where the latter is the equivalent of n=15 which cannot have a predecessor since it is 0 (mod3). Note that all the values of k in Figure 1 are monotonically decreasing in the direction of the arrows.Figure 1
The3x+1 map expressed as values of k≤20 for endpoints (2k-1).Define as usual the stopping time ofn, denoted by σ(n), as being the least k such that Tk(n)<n. It is easy to verify, as in Garner [11], the following stopping times; the σ(n) have been adjusted to count odd integers only: (3.1)σ(n)=1ifn≡1(mod⁡4),σ(n)=2ifn≡3(mod⁡16),σ(n)=3ifn≡11or23(mod⁡32),σ(n)=4ifn≡7,15or59(mod⁡128),σ(n)=5ifn≡39,79,95,123,175,199,or219(mod⁡256).Equivalently (see [12]), σ(n)≤5 unless n is congruent mod 256 one of the following:(3.2)2731476371103111127155159167191207223231239251255.
Clearly we can always find an n with arbitrarily long stopping time σ(n)=k. In our run notation, this means simply choosing an integer of the form {k⋯}. So stopping times alone will not suffice to resolve the problem. Looking at Figure 1 suggests that we consider the 3x+1 problem as a combination of two propositions: one for predecessors and another for successors.(i)
First we must show that every oddn∈N lies on the map described by Figure 1, either on the path between two Mersenne numbers (2k-1) or as the Mersenne numbers themselves. While we cannot predict where a particular n will fall on the map, we can say that this corresponds to the hypothesis that every n or an equivalent must have a Mersenne number as a predecessor. This condition is met if we can always find a valid predecessor of n smaller than n; that is, T-k(n)<n, identical to the stopping time condition except in the reverse direction. Note that, if n is 0 (mod3), we can convert it to an equivalent (in fact an infinite number of them) which has a valid predecessor.(ii)
The second proposition is that ifTr(2k-1)→(2l-1) for any r,k,l>0, l<k; that is, the 3x+1 function expressed as a map of k’s is monotonically decreasing, thereby ensuring that the function terminates for every integer. Note that we need only to concern ourselves here with Mersenne numbers, not all the points in between.Hence a counterexample must satisfyTk(n)>n for all k’s (positive and negative); that is, n must be a minimum with respect to its successor trajectory as well as its infinite number of predecessor paths.It remains to be seen whether the String Rewriting System (SRS) approach can lead to further advances in the3x+1 problem.



---

*Source: 458563-2011-01-23.xml*