> For the complete documentation index, see [llms.txt](https://erhany96.gitbook.io/collatz-prefixes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://erhany96.gitbook.io/collatz-prefixes/theory/operation-table/navigating.md).

# Navigating

Navigating the table

There are several equations we can derive from the table, that allow various methods of navigation within the table from one cell to another. We have the following navigation methods, considering a row $$n$$ and column $$\rho$$ which maps to ECF $${p\_0, p\_1, \ldots, p\_m}$$:

* **Changing rows**: $$\beta(n,\rho) \to \beta(n+k, \rho)$$.
* **Doubling**: $$\beta(n, \rho) \to \beta(n, 2\rho)$$.&#x20;
* **Appending**: $$\beta(n, \rho) \to \beta(n, \rho + 2^q)$$ where $$2^q > \rho$$.&#x20;
* **Prepending**: $$\beta(n, \rho) \to \beta(n, \rho+1)$$ where $$\rho \equiv 0 \bmod 2$$.&#x20;

## Changing Rows

Consider $$\beta(n,\rho)$$ and $$\beta(n+k,\rho)$$ with $$\rho$$ being the ECF $${p\_0, p\_1, \ldots, p\_m}$$.

$$
n = \beta(n, \rho)\frac{2^{p\_{m}}}{3^{m}} - \frac{2^{p\_{m-1}}}{3^{m}} - \frac{2^{p\_{m-2}}}{3^{m-1}} - \ldots - \frac{2^{p\_1}}{3^2} - \frac{2^{p\_0}}{3^1}
$$

$$
n+k = \beta(n+k, \rho)\frac{2^{p\_{m}}}{3^{m}} - \frac{2^{p\_{m-1}}}{3^{m}} - \frac{2^{p\_{m-2}}}{3^{m-1}} - \ldots - \frac{2^{p\_1}}{3^2} - \frac{2^{p\_0}}{3^1}
$$

Almost all the terms on the right hand-side are equal, expect the leftmost term. When we subtract the first equation from the second we get:

$$
k = (\beta(n + k, \rho) - \beta(n, \rho))\frac{2^{p\_m}}{3^m}
$$

So, the difference between two cells in the same column have a really neat formula:

$$
\beta(n + k, \rho) = \beta(n, \rho) +\frac{3^{m}}{2^{p\_m}}(k)
$$

## Doubling

Going from $$\beta(n, \rho)$$ to $$\beta(n,2\rho)$$ is also easy to calculate. Let us write down their ICFs:

$$
n = \beta(n, \rho)\frac{2^{p\_{m}}}{3^{m}} - \frac{2^{p\_{m-1}}}{3^{m}} - \frac{2^{p\_{m-2}}}{3^{m-1}} - \ldots - \frac{2^{p\_1}}{3^2} - \frac{2^{p\_0}}{3^1}
$$

$$
n = \beta(n, 2\rho)\frac{2^{p\_{m}+1}}{3^{m}} - \frac{2^{p\_{m-1}+1}}{3^{m}} - \frac{2^{p\_{m-2}+1}}{3^{m-1}} - \ldots - \frac{2^{p\_1+1}}{3^2} - \frac{2^{p\_0+1}}{3^1}
$$

When we subtract the first equation from the second, we get:

$$
0 = \left(2\beta(n, 2\rho)-\beta(n, \rho)\right)\frac{2^{p\_m}}{3^m} - \frac{2^{p\_{m-1}}}{3^{m}} - \frac{2^{p\_{m-2}}}{3^{m-1}} - \ldots - \frac{2^{p\_1}}{3^2} - \frac{2^{p\_0}}{3^1}
$$

$$
0 = \left(2\beta(n, 2\rho)-\beta(n, \rho)\right)\frac{2^{p\_m}}{3^m} + n - \beta(n, \rho)\frac{2^{p\_m}}{3^m}
$$

$$
\left(\beta(n, \rho)-\beta(n, 2\rho)\right)\frac{2^{p\_m+1}}{3^m} = n
$$

Finally, we can find the difference as:

$$
\beta(n, 2\rho) = \beta(n, \rho) - \frac{3^m}{2^{p\_m}}\left(\frac{n}{2}\right)
$$

## Appending

Consider $$\rho$$ as the ECF $${p\_0, p\_1, \ldots, p\_m}$$ for some number $$n$$. Then, consider another ECF $${p\_0, p\_1, \ldots, p\_m, q}$$ where $$q > p\_m$$ again for number $$n$$. Note that this ECF maps to $$\rho+2^q$$.

Well, this is equivalent to continuing a trajectory, as in doing an imprecise reduced Collatz function$$\mathcal{R}(\beta(n, \rho), q-p\_m)$$. In short:

$$
\beta(n, \rho+2^q) = \frac{3\beta(n, \rho)+1}{2^{q-p\_m}}
$$

## Prepending

Consider $$\rho$$ as the ECF $${p\_0, p\_1,  \ldots, p\_m}$$. This time, suppose that $$p\_0 > q$$; and consider another ECF $${q, p\_0, p\_1, \ldots, p\_m}$$ which maps to $$\rho+2^q$$. Let us look at the ICFs of these for number $$n$$.

$$
n = \beta(n, \rho)\frac{2^{p\_{m}}}{3^{m}} - \frac{2^{p\_{m-1}}}{3^{m}} - \frac{2^{p\_{m-2}}}{3^{m-1}} - \ldots - \frac{2^{p\_1}}{3^2} - \frac{2^{p\_0}}{3^1}
$$

$$
n = \beta(n, \rho + 2^q)\frac{2^{p\_{m}+q}}{3^{m+1}} - \frac{2^{p\_{m-1}+q}}{3^{m+1}} - \frac{2^{p\_{m-2}+q}}{3^{m}} - \ldots - \frac{2^{p\_1+q}}{3^3} - \frac{2^{p\_0+q}}{3^2} - \frac{2^q}{3^1}
$$

Lets do a $$3\frac{n}{2^q}+1$$ operation on the second equation:

$$
3\frac{n}{2^q}+1 = \beta(n, \rho+2^q)\frac{2^{p\_{m}}}{3^{m}} - \frac{2^{p\_{m-1}}}{3^{m}} - \frac{2^{p\_{m-2}}}{3^{m-1}} - \ldots - \frac{2^{p\_1}}{3^2} - \frac{2^{p\_0}}{3^1}
$$

Now, we subtract the first equation from this new equation:

$$
3\frac{n}{2^q}+1-n = (\beta(n, \rho+2^q) - \beta(n, \rho))\frac{2^{p\_m}}{3^m}
$$

This finally gives us:

$$
\beta(n, \rho+2^q) = \beta(n, \rho) + \frac{3^m}{2^{p\_m}}(3\frac{n}{2^q}+1-n)
$$

For $$q = 0$$ we get a nice result:

$$
\beta(n, \rho+1) = \beta(n, \rho) + \frac{3^m}{2^{p\_m}}(2n+1)
$$

## Identities

To summarize all of these navigation methods for some number $$n$$ with ECF $$\rho$$ that maps to $${p\_0, p\_1, \ldots, p\_m}$$:

<table><thead><tr><th width="177">Operation</th><th width="381">Equation</th><th width="286">Condition</th></tr></thead><tbody><tr><td>Changing Rows</td><td><span class="math">\beta(n + k, \rho) = \beta(n, \rho) +\frac{3^{m}}{2^{p_m}}(k)</span></td><td>-</td></tr><tr><td>Doubling</td><td><span class="math">\beta(n, 2\rho) = \beta(n, \rho) - \frac{3^m}{2^{p_m}}\left(\frac{n}{2}\right)</span></td><td>-</td></tr><tr><td>Appending</td><td><span class="math">\beta(n, \rho+2^q) = \frac{3\beta(n, \rho)+1}{2^{q-p_m}}</span></td><td><span class="math">2^q > \rho</span></td></tr><tr><td>Prepending</td><td><span class="math">\beta(n, \rho+1) = \beta(n, \rho) + \frac{3^m}{2^{p_m}}(2n+1)</span></td><td><span class="math">\rho \equiv 0 \bmod 2</span></td></tr></tbody></table>

Looking at the table, we may connect some navigation methods together and obtain cool identity functions!&#x20;

For $$n \equiv 0 \bmod 2$$ we have:

$$
\beta(n/2,\rho)=\beta(n,2\rho)
$$

For $$\rho \equiv 0 \bmod 2$$ we have:

$$
\beta(3n+1, \rho)=\beta(n, \rho+1)
$$

With the first identity, we can also derive for $$k \in \mathbb{N}$$:

$$
\beta(1, \rho) = \beta(2^k, 2^k\rho)
$$
