# Exponential Canonical Form

Consider a Collatz trajectory of some number $$n$$, such as:

$$
n \xrightarrow{x_0} R_0(n) \xrightarrow{x_1} R(n_0) \xrightarrow{x_2} R(n_1) \xrightarrow{x_3} \ldots \xrightarrow{x_m} R(n_{m-1})
$$

The **Exponential Canonical Form** (ECF) is a canonical representation of this trajectory, without necessarily depending on $$n$$. ECF is defined as a list, with elements ordered in ascending order:

$$
\{x_0, x_0 + x_1, \ldots, x_0 + x_1 + \ldots + x_m\}
$$

Notice that elements are in accumulated sums as we iterate the list. Alternatively, we can write the trajectory as:&#x20;

$$
n \xrightarrow{p_0} R_0(n) \xrightarrow{p_1 - p_0} R(n_0) \xrightarrow{p_2 - p_1} R(n_1) \xrightarrow{p_3 - p_2} \ldots \xrightarrow{p_m - p_{m-1}} R(n_{m-1})
$$

The ECF of this trajectory is written a lot cleaner this way:

$$
\{p_0, p_1, p_2\ldots, p_m\}
$$

{% hint style="info" %}
ECF of a reduced trajectory $$3 \xrightarrow{0} 3 \xrightarrow{1} 5 \xrightarrow{4} 1$$ looks like $$\{0, 1, 5\}$$.
{% endhint %}

## Prefix

Consider ECFs of two trajectories, $$\{p_0, p_1, \ldots, p_m\}$$ and $$\{q_0, q_1, \ldots, q_k\}$$. The prefix of these trajectories (or ECFs) is defined as:

$$
\{\rho_0, \rho_1, \ldots, \rho_t\}
$$

where $$\forall i : 0 \leq i \leq t$$ we have $$p_i = q_i = \rho_i$$ for largest $$t$$. In simpler terms, if we think of ECFs as strings, the prefix is the common prefix in both of these strings. Prefix can be an empty list, in which case we say that there is no prefix. Prefix itself is also an ECF!

{% hint style="info" %}
For example, the sequences of 3 and 11 are as follows:

* $$3 \xrightarrow{0} 3 \xrightarrow{1} 5 \xrightarrow{4} 1$$ with ECF $$\{0, 1, 5\}$$.
* $$11 \xrightarrow{0} 11 \xrightarrow{1} 17 \xrightarrow{2} 13 \xrightarrow{3} 5 \xrightarrow{4} 1$$ with ECF $$\{0, 1, 3, 6, 10\}$$.
* Their prefix is thus $$\{0, 1\}$$.
{% endhint %}

## Bijective Mapping

Any ECF $$\{p_0, p_1, \ldots, p_m\}$$ can be represented by a unique positive integer. They are defined as follows:

$$
2^{p_0} + 2^{p_1} + \ldots + 2^{p_m}
$$

{% hint style="info" %}
The sequence of 3 was shown by ECF $$\{0, 1, 5\}$$, which can be represented by $$35 = 2^0 + 2^1 + 2^5$$.
{% endhint %}
