On Collatz' Words, Sequences and Trees

Abstract: Motivated by a recent work of Trümper we consider the general Collatz word (up-down pattern) and the sequences following this pattern. The recurrences for the first and last sequence entries are given, obtained from repeated application of the general solution of a binary linear inhomogeneous Diophantine equation. These recurrences are then solved. The Collatz tree is also discussed.

\section{Introduction}
The Collatz map $C$ for natural numbers maps an odd number $m$ to $3\,m\,+\, 1$ and an even number to \dstyle{\frac{m}{2}}.  The {\sl Collatz} conjecture  \cite{Lagarias}, \cite{WikiC}, \cite{WeissteinC} is the claim that every natural number $n$ ends up, after sufficient iterations of the map $C$, in the trivial cycle $(4,\, 2,\, 1)$. Motivated by the work of {\sl Tr\"umper} ~\cite{Truemper} we consider a general finite {\sl Collatz} word on the alphabet $\{u,\,d\}$, where $u$ (for `up') indicates application of the map $C$ on an odd number, and $d$ (for `down')  for applying the map $C$ on an even number. The task is to find all sequences which follow this word pattern (to be read from the left to the right). These sequences will be called $CS$ (for {\sl Collatz} sequence also for the plural) realizing the CW (for {\sl Collatz} word also for the plural) under consideration. This problem was solved by {\sl Tr\"umper} \cite{Truemper} under the restriction that the first and last sequence entries are odd. Here we shall not use this restriction.The solution will be given in terms of recurrence relations for the first and last entries of the $CS$ for a given $CW$. This involves a repeated application of the general solution on positive numbers of the linear inhomogeneous {\sl Diophant}ine equation $a\,x\,+\, b\,y\,=\, c$, with $a\,=\, 3^m$ and $b\,=\, 2^n$ and given integer $c$. Because $gcd(3,2)\,=\, 1$ one will always have a countable infinite number of solutions. This general solution depends on a non-negative integer parameter $k$. We believe that our solution is more straightforward than the one given in \cite{Truemper}.
\section{Collatz words, sequences and the Collatz tree}\label{section2}
The {\sl Collatz} map $C:\ \mathbb{N} \to \mathbb{N},\ m \mapsto 3\,m\,+\, 1$ if $m$ is odd,  \dstyle{m \mapsto \frac{m}{2}} if $m$ is even, leads to an increase $u$ (for `up') or decrease $d$ (for `down'), respectively. Finite {\sl Collatz} words over the alphabet $\{u,\,d\}$ are considered with the restriction that, except for the one letter word $u$, every $u$ is followed by a $d$, because $2\,m\,+\, 1 \,\mapsto\, 2\,(3\,m+1)$. This is the reason for introducing (with \cite{Truemper}) also $s\, :=\, ud$. Thus $s$ stands for  $2\,m\,+\, 1\,\mapsto\, 3\,m\,+\, 1$. The general finite word is encoded by an $(S+1)-$tuple $\vec n_{S}\,=\, [n_0,\,n_1,\,...,\,n_S ]$ with $S\,\in\, \mathbb N$.
\begin{eqnarray} \label{CW}
 CW(\vec n_{S+1}) &\,=\,& d^{n_0}\,s\,d^{n_1-1}\,s\, \cdots\, s\,d ^{n_S-1} \\
                              &\,=\, &   (d^{n_0}\,s)\,(d^{n_1-1}\,s)\, \cdots\, \,(d ^{n_{S-1}-1}\,s)\, d ^{n_S-1}\ , \nonumber
\end{eqnarray}
with $n_0\,\in\, {\mathbb N}_0\, :=\, {\mathbb N}\, \cup\, \{0\} $, $n_i\,\in\, \mathbb N$, for $i\,=\, 1,\,2,\,...,\, S$. The number of $u$ (that is  of $s\,=\, ud$) letters in the word $CW(\vec n_{S})$, or $CW(S)$, for short, is $S$ (which is why we have used $\vec n_S$ not $\vec n_{S+1}$ for the $S+1$ tuple), and the number of $d$ is \dstyle{D(S)\, :=\, \sum_{j=0}^{S}\,n_j }. In \cite{Truemper} $n_0\,=\, 0$ (start with an odd number), $y\,=\, S$ and $x\,=\, D(S)$.\par\smallskip\noindent
Some special words are not covered by this notation: first the one letter word $u$ with the {\sl Collatz} sequence ($CS$) of length two $CS(u;\,k)\,=\, [2\,k\,+\, 1,\, 2\,(3\,k\,+\,  2)]$, and $CW([n_0])\,=\, d^{n_0}$ with the family of  sequences $CS([n_0];k) \,=\, [2^{n_0}\,k,2^{n_0 - 1}\,k,\,...,\,1\,k] $ with  $k\,\in\, {\mathbb N}_0$. \par\smallskip\noindent
A {\sl Collatz} sequence $CS$ realizing a word $CW(\vec n_{S})$  is of length $L\,=\, D\,+\, S\,+\, 1$ and follows the word pattern from the left to the right. $CS(\vec n_{S})\,=\, [c_1,\, c_2,\,...,\,c_L]$. For example, $CW([1,2,1])\,=\, dsds$ with  $S\,=\, 2$,  $D(2)\,=\, 2$, and length $L\,=\, 7$ with $SC_0(\vec n_S) \,=\, [2, 1, 4, 2, 1, 4, 2]$ is the first of these sequences (for non-negative integers), the one with smallest start number $c_1$. In order to conform with the notation used in \cite{Truemper} we shall use for the start number $c_1\,=\, M$ and for the last number $c_L \,=\, N$. However, in \cite{Truemper} $M$ and $N$ are restricted  to be odd which will not be the case here. Later one can get the words with odd start number M by choosing $n_0\,=\, 0$. In order to have also $N$ odd one has to pick from $SC_k([0,n_1,...,n_S])$, for $k\,\in\, \mathbb N_0$ only the odd members.\par\smallskip\noindent
In \cite{Truemper} the monoid of Collatz words, with the unit element $e\,=\,$ {\it empty word} is treated. This will not be considered in this work. Also the connection to the $3\,m\,-\, 1$ problem will not be pursued here.\par\smallskip\noindent
The {\sl Collatz} tree CT is an infinite (incomplete) ternary tree, starting with the root, the number $8$ on top at level $l=0$. Three  branches, labeled $L$, $V$ and $R$ can be present:
If a node (vertex) has label $n\,\equiv\, 4\,(mod\,6))$ the out-degree is $2$ with the a left edge (branch) labeled $L$ ending in a node with label \dstyle{\frac{n-1}{3}} and a right edge (label $R$) ending in the node labeled $2\,n$. In the other cases, $n\,\equiv\, 0,\,1,\,2,\,3,\,5,\,(mod\,6)$, with out-degree $1$, a vertical edge (label $V$) ends in the node labeled $2\,n$. The root labeled $8$ stands  for the trivial cycle $8$\, repeat$(4,\,2,\,1)$. See the {Figure 1} for $CT_7$ with only the first eight levels. It may seem that this tree is left-right  symmetric (disregarding the node labels) but this is no longer the case starting at level $l\,=\, 12$. At level $l=10$ the $mod\, 6$ structure of the left and right part of $CT$, also taking into account the node labels, is broken for the first time, but the node labels $4 (mod\, 6)$ are still symmetric. At the next level $l\,=\, 11$ the left-right symmetry concerning the labels $4 (mod\, 6)$ is also broken, leading at level $l\,=\, 12$ to a symmetry breaking in the branch structure of the left and right part of $CT$. Thus at level $l\,=\, 12$ the number of nodes becomes odd for the first time: $15$ nodes on the left side versus $14$  nodes on the right one. See rows $ l \,+\,  3$ of \seqnum{A127824} for the node labels of the first levels, and \seqnum{A005186}$(l+3)$ for the number of nodes. The number of $4\, (mod\, 6)$ nodes at level $l$ is given in \seqnum{A176866}$(l+4)$. \par\smallskip\noindent
A $CS$ is determined uniquely from its start number $M$. Therefore no number can appear twice in $CT$, except for the numbers $1,\,2,\,4$ of the (hidden) trivial cycle. The Collatz conjecture is that every natural number appears in CT at some level ($1, 2,$ and $4$ are hidden in the root $8$). A formula for $l\,=\, l(n)$ would prove the conjecture.
\par\smallskip\noindent
Reading $CT$ from bottom to top, beginning with some number $M$ at a certain level $l$, recording the edge labels up to level $l=0$, leads to a certain $L,V,R$-sequence. E.g., $M\,=\, 40$ at level $l\,=\, 5$ generates the length $5$ sequence $[V,R,V,L,V]$. This is related to the CS starting with $M\,=\, 40$, namely  $[40,20,10,5,16,8]$, one of the realizations of the CW  $d,d,d,u,d\,=\, d^3s$, with $S\,=\, 1$ and $\vec n_1\,=\, [3,1]$. (Later it will be seen that this is the realizations with the third smallest start number, the smaller once are $8$ and $24$). One has to map $V$ and $R$ to $d$ and $L$ to $u$. This shows that the map from a $L,V,R$-sequence to a CW is not one to one. The numbers $n\,\equiv\, 4\, (mod\ 6)$ except $4$ (see \seqnum{A016957}) appear exactly in two distinct CS. For example, $64 \,\equiv\, 4\,(mod\, 6)$ shows up in all $CS$ starting at any vertex which descends from the bifurcation at $64$, {\it e.g.},\, $21,\,128$; $42,\,256$; $84,\,85,\,512$; \, {\it etc.}\,  \par\bigskip\noindent

\par\smallskip\noindent
\parbox{16cm}{\begin{center}
{\includegraphics[height=10cm,width=.8\linewidth]{CollatzTree}}
\end{center}
}
\par\smallskip\noindent
\hskip 6cm {\bf  Figure: Collatz Tree $\bf CT_7$}

\section{Solution of a certain linear inhomogeneous Diophantine equation}\label{section3}
The derivation of the recurrence relations for the start and end numbers $M$ and $N$ of {\sl Collatz} sequences ($CS$) with prescribed up-down pattern (realizing  a given  $CW$) we shall need the general solution of the following linear and inhomogeneous {\sl Diophant}ine equation.
\begin{equation}\label{Diophant}
D(m,n;c):\hskip 2cm 3^m\,x\,-\, 2^n\,y\,=\, c(m,n),\ \ m\,\in\, \mathbb N_0, \ n\,\in\, \mathbb N_0,\ c(m,n) \,\in\, \mathbb Z\ .
\end{equation}
It is well known \cite{NZM}, pp. 212-214, how to solve the equation $a\,x\,+\, b\,y\,=\, c$
for integers $a,\, b$ (not $0$) and $c$ provided $g\,=\, gcd(a,\,b)$ divides $c$ (otherwise there is no solution) for integers $x$ and $y$. One will find a sequence of solutions parameterized by $t\,\in\, \mathbb Z$. Then one has to restrict the $t$ range to obtain all positive solutions. The procedure is to find first a special solution $(x_0,\, y_0)$ of the equation with $c\,=\, g$. Then the general solution is $(x\,=\, \frac{c}{g}\, x_0\,+\, \frac{b}{g}\, t,\, y\,=\, \frac{c}{g}\, y_0\,-\, \frac{a}{g}\, t)$ with $t\,\in\, Z$. The proof is found in \cite{NZM}. For our problem $g\,=\, gcd(3^m,\, 2^n)\,=\, 1$ for non-negative $m,\, n$ which will divide any $c(m,\, n)$. \par\bigskip\noindent
\begin{lemma}\label{SolDiophant} {\bf Solution of $\bf D(m,n;c)$}\par\smallskip\noindent
{\bf a)} A special positive integer solution of  D(m,n;1) is\par\smallskip\noindent
\begin{eqnarray}\label{x0y0}
y_0(m,n) &\,=\,& \left(\frac{3^m\,+\, 1}{2}\right)^{n\,+\, 3^{m-1}}\, (mod\, 3^m)\ , \nonumber\\
x_0(m,n) &\,=\,& \frac{1\,+\, 2^n\,y_0(m,n)}{3^m}\ .
 \end{eqnarray}
 {\bf b)} The general solution with positive $x$ and $y$ is\par\smallskip\noindent
\begin{eqnarray}\label{Solxy}
x(m,n) &\,=\,& c(m,n)\,x_0(m,n)\,+\, 2^n\,t_{min}(m,n;sign(c)) \,+\, 2^n\,k \ ,\nonumber  \\
y_0(m,n) &\,=\,& c(m,n)\,y_0(m,n)\,+\, 3^m\,t_{min}(m,n;sign(c)) \,+\, 3^m\,k \ ,
 \end{eqnarray}
with $k\,\in\, \mathbb N_0$, and
\begin{equation}\label{tmin}
t_{min}(m,n;sign(c))\,=\, {\Caseszwei{\ceil{\abs{c(m,n)}\,\frac{x_0(m,n)}{2^n}}}{${\rm if} \ c\,<\, 0 \ ,$} {\ceil{-c(m,n)\,\frac{y_0(m,n)}{3^m}}} {${\rm if} \ c\,\geq\,  0\ .$}}
\end{equation}
\end{lemma}
\noindent
For the proof we shall use the following {\sl Lemma}:
\begin{lemma}\label{Anm}
$ A(n,m)\, :=\, {\binomial{n-1}{m-1}}\, \frac{gcd(m,n)}{m}$\, is a positive integer for $ m\,=\, 1,\,2\, ...\, n,\  n\,\in\, \mathbb N$\, .
\end{lemma}
\begin{proof}\par\smallskip\noindent
[due to {\sl Peter Bala}, see \seqnum{A107711}, history, Feb 28 2014]:\par\noindent
This is the triangle \seqnum{A107711} with A(0,0) =1.
By a rearrangement of factors one also has  \dstyle{A(n,m)\,=\, {\binomial{n}{m}}\,\frac{gcd(n,m)}{n}}. Use $gcd(n,m)\,lcm(m,n)\,=\, n\, m$ ({\it e.g.},\, \cite{FR}), theorem 2.2.2., pp. 15-16, where also the uniqueness of the $lcm$ is shown). \dstyle{A(n,m)\,=\, \frac{a(n,m)}{lcm(n,m)}} with \dstyle{a(n,m)\,=\, {\binomial{n}{m}}\,m}, a positive integer because the binomial is a combinatorial number. $m\,|\, a(n,m)$ and $n\,|\, a(n,m)$ because \dstyle{a(n,m) \,=\, n\,{\binomial{n-1}{m-1}}} by a rearrangement. Hence $a(n,m)\,=\, k_1\,m\,=\, k_2\,n$, {\it i.e.},\, $a(n,m)$ is a common multiple of $n$ and $m$ (call it $cm(n,m)$). $lcm(n,m)\,|\, a(n,m)$ because $lcn(n,m)$ is the (unique) lowest $cm(n,m)$. Therefore \dstyle{\frac{a(n,m)}{lcm(n,m)}\,\in\, \mathbb N}, since only natural numbers are in the game.
\end{proof}\noindent
Now to the proof of  {\sl Lemma\ 1}.\par\noindent
\begin{proof} \par\smallskip\noindent
{\bf a)}  \dstyle{x_0(m,n) \,=\, \frac{1\,+\, 2^n\,y_0(m,n)}{3^m}} is a solution of $D(m,n;1)$ for any $y_0(m,n)$. The given $y_0(m,n)$ is a positive integer $\,\in\, \{1,\,2,\,...,\, 3^{m}\,-\, 1\},\  m\,\in\, \mathbb N$ and $y_0(0,n)\,=\, 1$ for $n\,\in\, \mathbb N_0$. One has to prove that $x_0(m,n)$ is a positive integer. This can be done by showing that $1\,+\, 3^n\,y_0(n,m)\,\equiv\, 0\,(mod\,3^m)$ for $m\,\in\, \mathbb N$. One first observes that \dstyle{\frac{3^m\,+\, 1}{2}\,\equiv\, \frac{1}{2}\,(mod\, 3^m)}, because obviously \dstyle{2\,\frac{3^m\,+\, 1}{2} \,\equiv\, 1\, (mod\, 3^m)} ($2$ is a unit in the ring $\mathbb Z_{3^m}$). For $m\,=\, 0$ one has $x_0(0,n) \,=\, 1\,+\, 2^n$, $n\,\in\, \mathbb N_0$, which is positive. In the following $m\,\in\, \mathbb N$.
\begin{equation}
1\,+\, 2^n\,\left(\frac{3^m\,+\, 1}{2}\right)^{n+3^{m-1}} \,\equiv\, 1 + 2^n\, \left(\frac{1}{2}\right)^{n+3^{m-1}} \,\equiv\, 1\,+\,  \left(\frac{1}{2}\right)^{3^{m-1}}\, (mod\, 3^m)\ .
\end{equation}
Now we show that \dstyle{L(m)\, :=\,  \left(\frac{3^m\,+\, 1}{2}\right)^{3^{m-1}}\,\equiv\, 0\, (mod\, 3^m)} by using \dstyle{\frac{3^m\,+\, 1}{2} \,=\, 3\, k(m)\,-\, 1} with  \dstyle{k(m)\, :=\, \frac{3^{m-1}\sspp1}{2}}, a positive integer. The binomial theorem leads with $ a(m)\,=\, 3^{m\,-\, 1}$ to
\begin{eqnarray}
(3\,k(m)\,-\, 1)^{a(m)} &\,=\,& \sum_{j=0}^{a(m)-1}\,{\binomial{a(m)}{j}}\, (-1)^j\, (3\,k(m))^{a(m)-j} \nonumber \\
&\,=\,& 3^m\,\Sigma_1(m) \,+\, \Sigma_2(m),  {\rm with} \\
\Sigma_1(m) &\,=\,& \sum_{j=0}^{a(m)-m}\, (-1)^j\,{\binomial{a(m)}{j}}\,k(m)^{a(m)-j}\,3^{a(m)-m-j}, \ {\rm and} \\
\Sigma_2(m) &\,=\,& \sum_{j=a(m)-m+1}^{a(m)-1}\, (-1)^j\,{\binomial{a(m)}{j}}\,(3\, k(m))^{a(m)-j}\ .
\end{eqnarray}
$\Sigma_1(m)$ is an integer because of $a(m)-j\,\geq\,  a(m)-m-j\,\geq\,  0$  and the integer binomial, hence $L(m)\,\equiv\, \Sigma_2 \,(mod\, 3^m)$. Rewriting $\Sigma_2$ with $j'\,=\, j-a(m)+m-1$, using also the symmetry of the binomial, one has
\begin{eqnarray}
\Sigma_2(m)&\,=\,& \sum_{j=0}^{m-2}\,{\binomial{a(m)}{j}}\, (-1)^{j-m}\,(3\,k(m))^{m-1-j}\nonumber \\
&\,=\,& \sum_{j=1}^{m-1}\,(-1)^{j+1}\, {\binomial{a(m)}{j}}\, (3\,k(m))^j \,=\, 3^m\,\widehat\Sigma_2(m)\, \ {\rm with}\\
\widehat\Sigma_2(m)&\,=\,& \sum_{j=1}^{m-1}\,(-1)^{1+j}\,{\binomial{a(m)}{j}}\,k(m)^j\,3^{j-m}\nonumber \\
&\,=\,&  \sum_{j=1}^{m-1}\,(-1)^{1+j}\,k(m)^j\,{\binomial{a(m)-1}{j-1}}\,\frac{1}{j}\,3^{j-1}\ .
\end{eqnarray}
In the last step a rearrangement of the binomial has been applied, remembering that $a(m)\,=\, 3^{m-1}$. It remains to be shown that \dstyle{A_{m,j}\, :=\,  3^{j-1}\,{\binomial{3^{m-1}-1}{j-1}}\,\frac{1}{j}} is a(positive) integer for $j\,=\, 1,\,2,\,...\,m-1$. Here {\sl Lemma 2}  comes to help. Consider there $A(3^{m-1},j)$ for $j\,=\, 1,\,2,\,...,\,m-1$  ($m=0$ has been treated separately above), which is a positive integer. If $3\, \not|\, j$ then $3^{j-1}\,A(3^{m-1},j) \,=\, A_{m,j}$, hence a positive integer. If $j\,=\, 3^k\,J$, with $k\,\in\, \mathbb N$ the largest power of $3$ dividing $j$ then $gcd(3,J)\,=\, 1$, and  $j\,=\, 3^k\,J \sspleq m-1\,<\, 3^{m-1}$ and $gcd(3^{m-1},3^k\,J)\,=\, 3^q$ with $q\,=\, min(k,m-1)$.
\end{proof}\noindent
\begin{proof} \par\smallskip\noindent
{\bf b)} The general integer solution of ~\ref{Diophant} is then (see \cite{NZM}, pp. 212-214; note that there $b>0$, here $b<0$, and we have changed $t\mapsto -t$)
\begin{eqnarray}
x\,=\, \hat x(m,n;t)&\,=\,& c(m,n)\,x_0(m,n)\,+\, 2^n\,t\, ,\nonumber \\
y\,=\, \hat y(m,n;t)&\,=\,& c(m,n)\,y_0(m,n)\,+\, 3^m\,t\, , \ t\,\in\, \mathbb Z\,.
\end{eqnarray}
In order to find all  positive solutions for $x$ and $y$ one has to restrict the $t$ range, depending on the sign of $c$. If $c(m,n)\,\geq\,  0$  then, because $x_0$ and $y_0$ are positive and \dstyle{\frac{x_0(m,n)}{2^n}\,=\, \frac{y_0(m,n)}{3^m}\,+\, \frac{1}{2^n\,3^m}},\  \dstyle{t\,>\, -\frac{c(m,n)\,x_0(m,n)}{2^n}} and  \dstyle{t\,>\, -\frac{c(m,n)\,y_0(m,n)}{3^m}}, {\it i.e.},\, \par\noindent
\dstyle{t\,\geq\,  \ceil{max\left( - \frac{c(m,n)\,x_0(m,n)}{2^n},\, -\frac{c(m,n)\,y_0(m,n)}{3^m}\right)}} \dstyle{\,=\,  \ceil{-c(m,n)\,min\left(\frac{x_0(m,n)}{2^n},\, \frac{y_0(m,n)}{3^m}  \right)}} \par\noindent
\dstyle{\,=\, \ceil{-c(m,n)\, \frac{y_0(m,n)}{3^m} }\,=\,  t_{min}(m,n;+)}. \par\noindent
If $c(m,n)\,<\, 0$ then  \dstyle{t\,\geq\,  \ceil{ \abs{c(m,n)}\, max\left(\frac{x_0(m,n)}{2^n},\, \frac{y_0(m,n)}{3^m}\right)}\,=\, \ceil{\abs{c(m,n)}\, \frac{x_0(m,n)}{2^n}}} $\,=\,  t_{min}(m,n;-)$. Thus with $t\,=\, t_{min}(m,n;sign(c)) \,+\, k$, with $k\,\in\, \mathbb N_0$ one has the desired result. Note that $(x_0(m,n),\, y_0(m,n))$ is the smallest positive solution of the equation  $D(m,n;1)$,  eq.~\ref{Diophant}, because, for $c(m,n)\,=\, 1$, $t_{min}(m,n;+) \,=\, \ceil{-\frac{y_0(m,n)}{3^m}}$, but with $y_0(m,n)\,\in\, \{1,\,2,\,...\,3^m-1\}$ this is $0$.
\end{proof} \noindent
A proposition on the periodicity of the solution $y_0(m,n)$ follows.\par\smallskip\noindent
\begin{proposition} \label{y0Periodicity}
{\bf Periodicity of $\bf y_0(m,n)$ in $\bf n$}\par\smallskip\noindent
{\bf a)} The sequence $y_0(m,n)$ is periodic in $n$ with primitive period length $L_0\,=\, \varphi(3^m)$, for $m\,\in\, \mathbb N_0\, $ with {\sl Euler}'s totient function $\varphi(n)\,=\,$\seqnum{A000010}$(n)$, where $\varphi(1)\, :=\, 1$.
\par\smallskip\noindent
{\bf b)} The sequence $x_0(m,n\,+\, L_0(m))\,=\, q(m)\,x_0(m,n)\,-\, r(m)$, $m\,\in\, \mathbb N_0$,  with $q(m)\, :=\, 2^{\varphi(3^m)}$ and \dstyle{r(m) \, :=\, \frac{2^{\varphi{(3^m)}}\,-\, 1}{3^m}}. See \seqnum{A152007}.\par\smallskip\noindent
{\bf c)} The set $Y_0(m)\, :=\, \{y_0(m,n) \,|\, n\,=\, 0,\,1,\,...,\, \varphi(3^m)\,-\, 1\} $, is, for $m\,\in\, \mathbb N_0$, a representation of the set $RRS(3^m)$, the smallest positive restricted residue system  modulo $3^m$. See \cite{TApostol} for the definition. The multiplicative group modulo $3^m$,  called \dstyle{\mathbb Z_{3^m}^{\times}\,=\, (\mathbb Z/3^m\,\mathbb Z)^\times} is congruent to the cyclic group $C_{\varphi(3^m)}$. See, e.g., \cite{WikiRRS},\par\smallskip\noindent
\end{proposition}
\begin{proof}\par\smallskip\noindent
{\bf a)} By {\sl Euler}'s theorem ({\it e.g.},\, \cite{FR}, theorem 2.4.4.3 on p. 32) $a^{\varphi(n)} \,\equiv\, 1\, (mod\, n)$, provided $gcd(a,n)\,=\, 1$. Now \dstyle{gcd\left(\frac{3^m+1}{2},3^m\right) \,=\, gcd\left(\frac{3^m+1}{2},3\right)\,=\, 1} because \dstyle{\frac{3^m+1}{2} \,\equiv\, \frac{1}{2}\, (mod\, 3^m)} (see above) and hence  \dstyle{\frac{3^m+1}{2} \,\not\equiv  \, 0\, (mod\, 3^m)}. This shows that $L_0(m)$ is a period length, but we have to show that it is in fact the length of the primitive period, {\it i.e.},\, we have to prove that the order of  \dstyle{\frac{3^m+1}{2}} modulo $3^m$ is $L_0(m)$. (See {\it e.g.},\, \cite{FR}, Definition 2.4.4.1. on p.31, for the order definition.) In other words we want to show that  \dstyle{\frac{3^m+1}{2}} is a primitive root (of $1$) modulo $3^m$. Assume that $k(m)$ is this order (the existence is certain due to {\sl Euler}'s theorem), hence $(\frac{1}{2})^{k(m)} \,\equiv\, 1\, (mod\, 3^m)$ and $k(m)\,|\, L_0(m)$. It is known that the module $3^m$ possesses primitive roots, and the theorem on the primitive roots says that there are precisely $\varphi(\varphi(3^m))$ incongruent ones ({\it e.g.},\, \cite{NZM}, pp. 205, 207, or \cite{Nagell}, theorem 62, 3., p. 104 and theorem, 65, p. 107). In our case this number is  $\varphi(2\cdot 3^{m-1}) \,=\, 2\cdot 3^{m-2}$ if $m \,\geq\,  1$. The important point, proven in \cite{Nagell}, theorem 65.3 on p. 107, is that if we have a primitive root $r$ modulo an odd prime, here $3$, then, if $r^{3-1}\,-\, 1$ is not divisible by $3^2$, it follows that $r$ is in fact a primitive root for any modulus $3^q$, with $q\,\in\, \mathbb N_0 $. One of the primitive roots modulo $3$ is $2$, because $2^2\,=\, 4\,\equiv\, 1\, (mod\, 3)$ and $2^1\,\not\equiv  \, 1\, (mod\ 3)$. Also $2^{3-1}\,-\, 1 \,=\, 3$ is not divisible by $3^2$, hence $2$ is a primitive root of any modulus  $3^q$ for $q\,\in\, \mathbb N_0$. From this we proof that \dstyle{\frac{3^m+1}{2}\,\equiv\, \frac{1}{2}\,(mod\, 3^m)} is a primitive root modulo $3^m$.  Consider  \dstyle{\left(\frac{3^m+1}{2}\right)^k\,\equiv\, \frac{1}{2^k}\,(mod\, 3^m)} for $k\,=\, 1,\,2,\,...,\, \varphi(3^m)$. In order to have \dstyle{\left(\frac{1}{2}\right )^k \,\equiv\, 1\, (mod\, 3^m)} one needs $2^k\,\equiv\, 1\, (mod\, 3^m)$. But due to \cite{Nagell} theorem 65.3. p. 107, for $p\,=\, 3$, a primitive root modulo $3^m$ is $2$, and the smallest positive $k$ is therefore $\varphi(3^m)$, hence \dstyle{\frac{3^m+1}{2}} is a primitive root (of $1$) of modulus $3^m$. \par\smallskip\noindent
{\bf b)} \dstyle{x_0(m,n\,+\, \varphi(3^m))\,=\,  \frac{1\,+\, 2^n\,2^{\varphi(3^m)}\,y_0(m,n)}{3^m}} from the periodicity of $y_0$. Rewritten as \dstyle{\frac{2^{\varphi(3^m)}\,\left( ( 2^{-\varphi(3^m)} \,-\, 1) \,+\, (1\,+\, 2^n\,y_0(m,n) \right)} {3^m}\,=\,}  \dstyle{-\frac{1}{3^m}\,(2^{\varphi(3^m)}\,-\, 1) \,+\, 2^{\varphi(3^m)}\,x_0(m,n)\,=\, }  \dstyle{ q(m)\, x_0(m,n) \,-\, r(m)} with the  values given in the {\sl Proposition}.\par\smallskip\noindent
{\bf c)} This follows from the reduced residue system modulo $3^m$ for  $m\,\in\, \mathbb N_0$, \par\noindent
\dstyle{\left\{ \left(\frac{1}{2}\right)^0,\,\left(\frac{1}{2}\right)^1,\, ...,\, \left(\frac{1}{2}\right)^{\varphi(3^m)\sspm1} \right\}}, because \dstyle{\frac{1}{2}} is a primitive root modulo $3^m$ (from part {\bf b)}).  With $a(m)\, :=\, \frac{3^m\,+\, 1}{2}$  one has $1\,=\, gcd(a(m),3)\,=\, gcd(a(m),3^m)\,=\, gcd(a(m)^{b(m)},3^m)$ with $b(m)\, :=\, 3^{m\,-\, 1}$, also\par\noindent
 \dstyle{\left\{a(m)^{b(m)}\, \left(\frac{1}{2}\right)^0,\,a(m)^{b(m)}\, \left(\frac{1}{2}\right)^1,\,...,\,a(m)^{b(m)}\, \left(\frac{1}{2}\right)^{\varphi(3^m)\sspm1}\right\}} is a reduced residue system modulo $3^m$ (see \cite{TApostol}, theorem 5.16, p. 113). Thus \par\noindent
\dstyle{Y_0(m)\,\equiv\, \{a(m)^{b(m)}\,1,\, a(m)^{b(m)+1},\,...,\,  a(m)^{b(m) \,+\, \varphi(3^m)\,-\, 1}\}} is a reduced residue system modulo $3^m$. Therefore this gives a permutation of the reduced residue system modulo $3^m$ with the smallest positive integers sorted increasingly.
\end{proof}     \par\smallskip\noindent
\begin{example}  For $m\,=\, 3$, $\varphi(3^3)\,=\, 2\cdot 3^2\,=\, 18\,=\, L_0(3)$, \par\noindent
$\{y_0(3,n)\}_{n=0}^{17}\,=\, \{26,\, 13,\, 20, \,10,\, 5,\, 16,\, 8,\, 4,\, 2, \,1,\, 14,\, 7,\, 17,\, 22,\, 11,\, 19,\, 23,\, 25\}$ a permutation of the standard reduced residue system modulo $27$, obtained by resorting the found system increasingly. See \seqnum{A239125}. For $m=1,\, 2$ and $ 4$ see \seqnum{A007583},\ \seqnum{A234038} and \seqnum{A239130}  for the solutions $(x_0(m,n),\, y_0(m,n))$.
\end{example}
\par\smallskip\noindent
\section{Recurrences and their solution}\label{section4}
After these preparations it is straightforward to derive the recurrence for the start and end numbers $M$ and $N$ for any given $CW(\vec n_S)$, for $S\,\in\, \mathbb N$. \par\smallskip\noindent
{\bf A)} We first consider the case of words with $n_S\,=\, 1$. {\it i.e.},\, $\vec n_S\,=\, [n_0,\,n_1\,,...\,n_{S-1},\,1]$. This is the word $CW(\vec n_S )\,=\, \rprod_{j=0}^{S-1}\, d^{n_j}\, s$ (with an ordered product, beginning with $j=0$ at the left-hand side). In order to simplify the notation we use $M(S)$, $N(S)$, $y_0(S)$, $x_0(S)$, and $c(S)$ for $ M(\vec n_S )$, $N(\vec n_S)$ ,  $y_0(S,n_S)$,  $x_0(S,n_S)$ and $c(S,n_S)$,  respectively.
For $S=1$, the input for the recurrence, one has
\begin{equation}
M(1;k) \,=\, 2^{n_0}\,(2\,k+1)\  \text{and}\ N(1;k) \,=\, 3\,k\,+\, 2,\ {\text for}\ k \,\in\, \mathbb N\ ,
\end{equation}
because there are $n_0$ factors of $2$ from $d^{n_0}$, and then an odd number $2\,k\,+\, 1$ leads after application of $s$ to $3\,k\,+\, 2$. Thus $M(1)\,=\, 2^{n_0}$ and $N(1)\,=\, 2$.\par\smallskip\noindent
\begin{proposition} {\bf Recurrences for $\bf M(S)$ and $\bf N(S)$ with $\bf n_S\,=\, 1$} \label{Rec}\par\smallskip\noindent
{\bf a)} The coupled recurrences for $M(S,t)$ and $N(S,t)$, the first and last entry of the {\sl Collatz} sequences $CS(\vec n_S;t)$ for the word $ CW(\vec n_S)$ with $\vec n_S\,=\, [n_0,\,n_1,\,...\, n_{S-1},1]$  ($n_S\,=\, 1$) are \par\smallskip\noindent
\begin{eqnarray}
M(S,t)\,=\, M(S)&\,+\,& 2^{\hat D(S)}\, t\ , \nonumber \\
N(S,t)\,=\, N(S)&\,+\,& 3^S\,t\, ,\  {\rm with}\ t\,\in\, \mathbb Z\ ,
\end{eqnarray}
 where \dstyle{\hat D(S)\, :=\, \sum_{j=0}^{S-1}\,n_j} (we prefer to use a new symbol for the $n_S\,=\, 1$ case), and the recurrences for $M(S)$ and $\widetilde N(S)\,=\, N(S)\,-\, 2$ are
 \begin{eqnarray}
M(S) \,=\, M(S-1) &\,+\,& 2^{\hat D(S-1)}\,c(S-1)\, x_0(S-1) \ , \nonumber \\
 \widetilde N(S) &\,=\,& 3\,y_0(S-1)\, c(S-1)\,
\end{eqnarray}
with
\begin{equation}
c(S-1) \,=\, 2\,(2^{n_{S-1}-2}\,-\, 1) \,-\, \widetilde N(S-1) \,=:\, A(S-1) \,-\,  \widetilde N(S-1)\ .
\end{equation}
The recurrence for $c(S)$ is\par\smallskip\noindent
\begin{equation}
c(S) \,=\, -3\,y_0(S-1)\,c(S-1) \,+\, A(S)\  , S\,\geq\,  2,
\end{equation}
and the input is $M(1)\,=\, 2^{n_0}$, $\widetilde N(1)\,=\, 0$ and $c(1) = A(1)$.\par\smallskip\noindent
{\bf b)} The general positive integer solution is
\begin{eqnarray}
M(S;k) &\,=\, & M(S) \,+\, 2^{\hat D(S)}\,t_{min}(S-1) \,+\, 2^{\hat D(S)}\,k\,,\nonumber \\
N(S;k) &\,=\, & 2\,+\, \widetilde N(S) \,+\, 3^S\,t_{min}(S-1) \,+\, 3^S\,k, \ k\,\in\, \mathbb N_0 \, ,
\end{eqnarray}
 where
\begin{equation}
t_{min}(S) \,=\, t_{min}(S, n_S,sign(c(S))) \,=\, {\Caseszwei{\ceil{\abs{c(S)}\,\frac{x_0(S)}{2^{n_S}}}}{${\rm if} \ c(S)\,<\, 0 \ ,$} {\ceil{-c(S)\,\frac{y_0(S)}{3^S}}} {${\rm if} \ c(S)\,\geq\,  0\ .$}}
\end{equation}
\end{proposition}
\begin{corollary}
\begin{eqnarray}
M(S;k) &\,\equiv\,& M(S) \,+\, 2^{\hat D(S)}\,t_{min}(S-1)\, (mod\, 2^{\hat D(S)})\, , \nonumber \\
N(S;k) &\,\equiv\,& \widetilde N(S) \,+\,  3^S\,t_{min}(S-1)\, (mod\, 3^S)\, .
\end{eqnarray}
\end{corollary} \par\smallskip\noindent
In Terras' article \cite{Terras} the first congruence corresponds to {\sl theorem 1.2}, where the encoding vector $E_k(n)$ refers to the modified {\sl Collatz} tree using only $d$ and $s$ operations.
\begin{proof} \par\smallskip\noindent
{\bf a)} By induction over $S$. For $S\,=\, 1$  the input $M(1)\,=\, 2^{n_0}$, $N(1)\,=\, 2$ or $\widetilde N(1)\,=\, 0$ provides the start of the induction. Assume that part {\bf a)} of the proposition is true for $S$ values $1,\,2,\,...,\,S-1$. To find $M(S)$ one has to make sure that $d^{n_{S-1}}\,s$ can be applied to $N(S-1;k)$, the end number of step $S-1$ sequence $CS(\vec n_{S-1};t)$ which is $N_{int}(S-1,t)\,=\, N(S-1) +3^{S-1}\, t$, with integer $t$,  by the induction hypothesis. This number has to be of the form $2^{n_{S-1}-1}\,(2\, m\sspp1)$ (one has to have an odd number after $n_{S-1}$ $d-$steps such that $s$ can be applied). Thus \dstyle{3^{S-1}\,t \,-\, 2^{n_{S-1}}\,m \,=\, 2^{n_{S-1}-1}\,-\, N(S-1) \,=\, A(S-1)\,-\, \widetilde N(S-1)\,=:\, c(S-1)}, where $\widetilde N(S-1)\,=\, N(S-1) \,-\, 2$ and $ A(S-1)\,=\, 2\,(2^{n_{S-1}-2}\,-\, 1)$. Due to {\sl Lemma}~\ref{SolDiophant} the general solution, with $t\,\to\, x(S-1,n_{S-1};t)\, \hat =\,  x(S-1;t)$, $m\,\to\, y(S-1,n_{S-1};t)\, \hat =\,  y(S-1;t)$, to shorten the notation, is
\begin{eqnarray}
t\,\to\, x(S;t) &\,=\,& c(S-1)\,x_0(S-1) \,+\, 2^{n_{S-1}}\,t \, , \nonumber \\
m\,\to\,  y(S;t) &\,=\,& c(S-1)\,y_0(S-1) \,+\, 3^{S-1}\,t\, , \ t\,\in\, \mathbb Z\ .
\end{eqnarray}
Therefore the first entry of the sequence $CS(\vec n_S;t)$ is \dstyle{M(S;t)\,=\, M(s-1,x(S-1,t))} which is
\begin{equation}
M_{int}(S;t)\,=\, M(S-1) \,+\, 2^{\hat D(S-1)}\,c(S-1)\,x_0(S-1) \,+\, 2^{\hat D(S)}\, t\, ,
\end{equation}
hence \dstyle{M(S)\,=\, M(S-1)\,+\, 2^{\hat D(S-1)}\,c(S-1)\, x_0(S-1)}, the claimed  recurrence for $M(S)$.\par\noindent
The last member of $CS(\vec n_{S-1};t)$ is $3\,m+2$ (after applying $s$ on $2\,m\,+\, 1$ from above). Thus \dstyle{N_{int}(S;t) \,=\, 3\,y(S;t)\,+\, 2}, or \dstyle{N_{int}(S;t)\,-\, 2\,=\, 3\,c(S-1)\,y_0(S-1)\,+\, 3^S\, t}. Therefore, $\widetilde N(S) \,=\, N(S)\,-\, 2 \,=\, 3\,c(S-1)\,y_0(S-1)$  the claim for the $\widetilde N$ recurrence. Note that the remainder structure of eqs. $(20)$ and $(21)$, expressed also in the {\sl Corollary}, has also been verified by this inductive proof. The recurrence for $c(S)\,=\, A(S) \,-\, \widetilde N(S)$  follows from the one for $\widetilde N(S)$. \par\smallskip\noindent
{\bf b)} Positive integer solutions from $M_{int}(S;t)$ and $N_{int}(S;t)$ of part {\bf a)} are found from the second part of  {\sl Lemma} ~\ref{SolDiophant} applied to the equation $3^{S-1}\, x \,-\, 2^{n_{S-1}}\,y\,=\, c(S-1)$, determining $t_{min}(S-1)$ as claimed. This leads finally to the formulae for $M(S;k)$ and $N(S;k)$ with $k\,\in\, \mathbb N_0$.
\end{proof}
\begin{example} {\bf $\bf (sd)^{S-1}\,s$ Collatz sequences}\par\smallskip\noindent
Here $n_0 \,=\, 0 \,=\,  n_S $ and $n_{j}\,=\, 2$ for $j\,=\, 1,\,2\, ...,\,S-1$.
The first entries $M(S;k)$ and the last entries $N(S;k)$ of the {\sl Collatz} sequence $CS([0,2,...,2];k)$  (with $S-1$ times a $2$), whose length is $3\,S$,  are $M(S;k)\,=\, 1\,+\, 2^{2\,S-1}\,k$ and $N(S;k)\,=\, 2 \,+\, 3^S\,k$. For $S=3$ a complete {\sl Collatz} sequence $CS([0,2,2];3)$ of length $9$ is $[97, 292, 146, 73, 220, 110, 55, 166, 83]$ which is a special realization of the word $sdsds$ with start number $M(3;3)\,=\, 97$ ending in $N(3;3)\,=\, 83$. Note that for this $u-d$ pattern the start and end numbers have remainders $ M(S;0) = M(1;0) \,=\, 1$  and $N(S;0)\,=\, N(1;0) \,=\, 2$. See the tables \seqnum{A240222} and \seqnum{A240223}.
\end{example}\par\smallskip\noindent
The recurrences for $M(S)\, \hat =\,  M(\vec n_{S-1})$,  $\tilde N(S)\, \hat =\,  \tilde N(\vec n_{S-1})$ or $N(S)\, \hat =\,  N(\vec n_{S-1})$ and $c(S)\, \hat =\,  c(\vec n_{S-1}$ are solved by iteration with the given inputs $M(1)\,=\, 2^{n_0}$, $\tilde N(1)\,=\, 0$ and $c(1)\,=\, A(1)\,=\, 2\,(2^{n_0-2}\,-\, 1)$. \par\smallskip\noindent
\begin{proposition} {\bf Solution of the recurrences for $\bf n_s\,=\, 1$} \label{SolRec}\par\smallskip\noindent
The solution of the recurrences of {\sl Proposition}~\ref{Rec} with the given inputs are, for $S\,\in\, \mathbb N$:\par\smallskip\noindent
\begin{eqnarray}
c(S)&\,=\,&  A(S) \,+\, \sum_{j=1}^{S-1} \,(-3)^j\,A(S-j)\,\prod_{l=1}^j\,y_0(S-l) \, , \nonumber \\
\tilde n(S)&\,=\,& A(S) \,-\,  c(S) \,=\, -\sum_{j=1}^{S-1}\,(-1)^j\,A(S-j)\, \prod_{l=1}^{j}\,y_0(S-l)\, , \nonumber \\
N(s)&\,=\,& \tilde N(S)\,+\, 2\, , \nonumber \\
M(S) &\,=\,& 2^{n_0}\,+\, \sum_{j=1}^{S-1}\,R(S-j)\, ,
\end{eqnarray}
with \dstyle{\hat D(S)\, :=\, 1\,+\, \sum_{j=0}^{S-1}\, n_j},\  \dstyle{A(S)\, :=\, 2\,(2^{n_S-2}\,-\, 1)},\ \dstyle{R(S)\, :=\, 2^{\hat D(S)} \,x_0(S)\,c(S)}\  and $y_0(S)\, \hat =\,  y_0(S,n_S)$, $x_0(S)\, \hat =\,  x_0(S,n_S)$, given in {\sl Lemma} ~\ref{SolDiophant}.
\end{proposition}
\begin{proof}\par\smallskip\noindent
This is obvious.
\end {proof} \par\noindent
{\bf B)} The general case $n_S \,\geq\,  1$ can now be found by appending the operation $d^{n_S-1}$ to the above result. This leads to the following {\sl theorem}.\par\smallskip\noindent
\begin{theorem} \label{GenSol} {\bf The general case $\bf {\overrightarrow n}_S$} \par\smallskip\noindent
 For the Collatz word $CW(\vec n_S)\,=\, d^{n_0}\,\rprod_{j=1}^{S}\,(s\,d^{n_j-1}) \,=\, d^{n_0}\, s\,\rprod_{j=1}^{S}\,(d^{n_j-1}\, s)\,d^{n_S-1}$ (the ordered product begins with $j=1$ on the left-hand side) with  $n_0\,\in\, \mathbb N_0$ , $n\,\in\, \mathbb N$, the first and last entries of the corresponding Collatz sequences $\{CS(\vec n_S;k)\}$, of length $L(S) \,=\, n_0 \,+\, 2\,\sum_{j=1}^S n_j$,  for $k\,\in\, \mathbb N_0$, are\par\smallskip\noindent
\begin{eqnarray}
M(\vec n_S;k) &\,=\,& M(S) \,-\, 2^{\hat D(S)}\,N(S)\,x_0(S,n_S-1)\,+\, 2^{D(S)}\,t_{min}(S,n_S-1,sign(c_{new}(S)) \nonumber\\
&&  \,+\, 2^{D(S)}\,k\, , \nonumber \\
N(\vec n_S;k) &\,=\,& c_{new}(S)\,y_0(S,n_S-1)\,+\, 3^S\, t_{min}(S,n_S-1,sign(c_{new}(S))\sspp3^S\, k\ ,
\end{eqnarray}
\end{theorem}\noindent
with $c_{new}(S)\, :=\, -N(S)$, $\hat D(S) \,=\, 1\,+\, \sum_{j=0}^{S-1}\,n_j$, $D(S)\,=\, \sum_{j=0}^S\, n_j$.
\begin {proof}\par\smallskip\noindent
In order to be able to apply to the {\sl Collatz} sequences $CS([n_0,n_1,...,n_S-1,1])$ (with the results from part A) above) the final $d^{n_S-1}$ operation one needs for the last entries  $N_{int}(S;t) \,=\, N(S) \,+\, 3^S\,t \,=\, 2^{n_S-1}\,m$ with some (even or odd) integer m. The new last entries of $CS([n_0,n_1,...,n_S];t)$ will then be $m$. The general solution of $3^S\,-\, 2^{n_S-1}\,m\,=\, -N(S)\,=:\, c_{new}(S)$ is according to {\sl Lemma}~\ref{SolDiophant} \par\smallskip\noindent
\begin{eqnarray}
t\,\to\, x(S;t)&\,=\,&  c_{new}(S)\, x_0(S,n_S-1)\,+\, 2^{n_S-1}\,t,\, \nonumber \\
m\,\to\, y(S;t)&\,=\,&  c_{new}(S)\, y_0(S,n_S-1)\,+\, 3^S\,t,\,\ t\,\in\, \mathbb Z\, .
\end{eqnarray}
This leads to positive integer solutions after the shift $t\,\to\, t_{min}\,+\, k$,  with \par\noindent
$t_{min} \,=\, t_{min}(S,n_S-1,sign(c_{new}(S)))$ to the claimed result $N(S;k)$ for the new last number of $CS(\vec n;k)$, with $k\,\in\, \mathbb N_0$. The new start value $M(S;k)$ is obtained by replacing $t\,\to\, x(S;t)$ in the old $M_{int}(S;t)$ (with $n_S\,=\, 1$). $M(S;k)\,=\, M_{int}(S,x(S;t))$ with $t\,\to\, t_{min}\,+\, k$, also leading to the claimed formula.
\end{proof} \par\smallskip\noindent
The remainder structure modulo $2^{D(S)}$ for $M(\vec n_S,k)$ and modulo $3^S$ for $N(\vec n_S,k)$ is manifest.\par\smallskip\noindent
The explicit sum versions of the results for case $n_S\,=\, 1$, given in {\sl Proposition}~\ref {GenSol}, can be inserted here.
\begin{example} {$\bf ud^{m}\,=\, sd^{m-1}$}\par\smallskip\noindent
For $m \,=\,  1,\,2,\, 3$ and $ k\,=\, 0,\,1,\,...,\,10$ one finds for $N([0,m],k)$:\par\noindent    $[2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32]$,\  $[1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31]$,\ \par\noindent
$ [2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32]$, and for $M([0,m],k)$:\par\noindent
 $[1,3,5,7,9,11,13,15,17,19,21]$,\ $[1,5,9,13,17,21,25,29,33,37,41]$,\ \par\noindent
$[5,13,21,29,37,45,53,61,69,77,85]$. Only the odd members of $N([0,m],k)$, that is the odd indexed entries, and the corresponding $M([0,m],k)$  appear in \cite{Truemper}, example 2.1. See \seqnum{A238475} for $M([0,2\,n],k)$  and  \seqnum{A238476} for  $M([0,2\,n\,-\, 1],k)$. The odd $N([0,2\,n],k)$ values are the same for all $n$, namely $5\,+\, 6\,k$, and  $N([0,2\,n-1],k)\,=\,  1\,+\, 6\,k$ for all $n\,\in\, \mathbb N$.
\end{example}
\begin{example} {$\bf (ud)^{n}\,=\, s^{S}, S\,\in\, \mathbb N$}\par\smallskip\noindent
$\vec n_S\,=\, [0,1,...,1]$ with $S$ times a $1$. For $S \,=\,  1,\,2,\, 3$ and $ k\,=\, 0,\,1,\,...,\,10$ one finds $N(\vec n_S,k)$\ \par\noindent
 $[5,\,8,\,11,\,14,\,17,\,20,\,23,\,26,\,29,\,32]$,\ $[17,\,26,\,35,\,44,\,53,\,62,\,71,\,80,\,89,\,98]$,\ \par\noindent
$[53,\,80,\,107,\,134,\,161,\,188,\,215,\,242,\,269,\,296]$, and for $M(\vec n_S,k)$:\par\noindent
 $[3,\, 5,\, 7, \,9,\, 11,\, 13,\, 15,\, 17,\, 19, \,21]$,\ $ [7,\, 11,\, 15,\, 19, \,23,\, 27, \,31, \,35,\, 39,\, 43]$,\ \par\noindent
$[15, \,23,\, 31, \,39, \,47, \,55, \,63, \,71, \,79, \,87]$,. For odd $N$ entries, and corresponding $M$ entries this is  \cite{Truemper}, example 2.1. See \seqnum{A239126} for these $M$ values, and \seqnum{A239127} for these $N$ values, which are here $S$ dependent.
\end{example} \par\smallskip\noindent
In conclusion the author does not think that the knowledge of all {\sl Collatz} sequences with a given up-down pattern (a given {\sl Collatz} word) will help to prove the {\sl Collatz} conjecture. Nevertheless the problem considered in this paper is a nice application of a simple {\sl Diophan}tine equation.\par\bigskip\noindent
{\bf Acknowlegement}\par\smallskip\noindent
Thanks go to {\sl Peter Bala} who answered the author's question for a proof that all triangle \seqnum{A107711} entries are non-negative integers. See the history there,  Feb 28 2014.
\par\bigskip\noindent
\par\bigskip\noindent

On Collatz' Words, Sequences and Trees


The Generalized Kauffman-Harary Conjecture is True

Abstract: For a reduced alternating diagram of a knot with a prime determinant $p,$ the Kauffman-Harary conjecture states that every non-trivial Fox $p$-coloring of the knot assigns different colors to its arcs. In this paper, we prove a generalization of the conjecture stated nineteen years ago by Asaeda, Przytycki, and Sikora: for every pair of distinct arcs in the reduced alternating diagram of a prime link with determinant $\delta,$ there exists a Fox $\delta$-coloring that distinguishes them.

\section{History of the alternation conjecture}

In 1998, Louis H. Kauffman and Frank Harary formulated the following conjecture \cite{HK}:

\begin{conjecture*}

    Let $D$ be a reduced, alternating diagram of a knot $K$ having determinant $p$, where $p$ is prime. Then every non-trivial $p$-coloring of $D$ assigns different colors to different arcs.

\end{conjecture*}

This conjecture is now known as the Kauffman-Harary conjecture. It was proved for rational knots \cite{KLa, PDDGS}, Montesinos knots \cite{APS}, some Turk's head knots \cite{DMMS}, and for algebraic knots \cite{DS}. In 2009, Thomas W. Mattman and Pablo Solis proved this conjecture using the notion of pseudo colorings. A generalization of this conjecture, known as the generalized Kauffman-Harary (GKH) conjecture, was formulated by Marta M. Asaeda, Adam S. Sikora, and the fifth author in 2004 \cite{APS}. They proved this conjecture for Montesinos links in the same paper. In this paper, we prove it in full generality.

\

The paper is structured as follows. In the next section we introduce the GKH conjecture and we prove it in Section \ref{proofconjecture}. In Section \ref{nonprimealt}, we reformulate and prove the conjecture for non-prime alternating links.  We illustrate the results with some examples in Section \ref{exfoxsection}. In the last  section, we discuss pseudo colorings followed by some open questions.

\section{Preliminaries}

 In this section, we state the original and alternate versions of the GKH conjecture. The difference between the original and generalized versions of the conjecture is that the former is about links with prime determinant, while the generalized version is about links with determinant not necessarily prime. It is important to note that the only link whose determinant is prime is the Hopf link.

\begin{conj*}

    If $D$ is a reduced alternating diagram of a prime link $L$, then different arcs of $D$ represent different elements of $H_1(M^{(2)}_L,\mathbb Z)$, where $M^{(2)}_L$ denotes the double branched cover of $S^3$ branched along $L$.

\end{conj*}

The GKH conjecture was formulated in \cite{APS} using the homology of the double branched cover of $S^3$ branched along $L$. In this paper we use a diagrammatic version of this conjecture by using the universal\footnote{Analogous to the fundamental group and the fundamental quandle, this group is often called the fundamental group of Fox colorings.} group of Fox colorings $Col(D)$ for a prime link $L$ with diagram $D$.

\begin{definition}

    The group  $\boldsymbol{Col(D)}$ is the abelian group whose generators are indexed by the arcs of $D$, denoted by $arcs(D)$, and whose relations are
    $2b-a-c=0$ given by the crossings of $D$. More precisely, $$Col(D) = \displaystyle \bigg\{ \text {arcs}(D) \ | \ \ \vcenter {\hbox{
\begin{overpic}[scale = .08]{CrossingMatrixRelation.jpg}
\put(26, 26.5){\tiny{$b$}}
\put(0, -1){\tiny{$b$}}
\put(14, -1){\tiny{$c=2b-a$}}
\put(0, 26.5){\tiny{$a$}}
\end{overpic} }} \ \ \ \ \ \ \bigg\}.$$

\end{definition}

It is known that $Col(D)=  \mathbb Z \oplus H_1(M^{(2)}_L,\mathbb Z)$ (see, for example, \cite{Prz1}).

\begin{definition}\label{coltrivialdefi}

    Let $Col^{trivial}(D) \cong \mathbb Z$ be the group of trivial colorings of $D$. This group is embedded in $Col(D)$ and the quotient group $\displaystyle \frac{Col(D)}{Col^{trivial}(D)}$ is called the \textbf{reduced group of Fox colorings}. We denote it by $Col^{red}(D)$.

\end{definition}

Notice that, for a diagram $D$ of a link $L$, $Col^{red}(D)=H_1\big(M^{(2)}_L,\mathbb Z\big)$ and for non-split alternating links, this group is finite with non-zero determinant.

\

The first two statements of the following conjecture are equivalent to the original GKH conjecture, while part $(c)$ offers an extension.

\begin{conjecture}[Alternate forms of the generalized Kauffman-Harary conjecture]\label{ConAPS}

\

 Let $D$ be a reduced alternating diagram of an alternating prime link and let $\delta(D)$ denote the absolute value of its determinant.

\begin{enumerate}

\item [\namedlabel{a}{(a)}] Let $\mathbb{Z}^{|arcs|}$ denote the free abelian group $\mathbb{Z}^{|arcs|} = \{arcs(D) \mid \emptyset \}$. Consider the map
$\mathbb{Z}^{|arcs|} \xrightarrow{\beta} Col(D).$
Then $\beta$ is injective on the arcs of $D$, that is, $\beta(a_i) \neq \beta(a_j)$ for $i \neq j$.

\item [\namedlabel{b}{(b)}]  The diagram $D$ has $t$ Fox $\delta(D)$-colorings $y_1, y_2, \hdots, y_t$, such that for every pair of distinct arcs $a_i, a_j$, there exists $y_k$ such that $y_k(a_i) \neq y_k(a_j)$.

\item [\namedlabel{c}{(c)}] If $Col^{red}(D) = \mathbb Z_{n_1} \oplus \mathbb Z_{n_2} \oplus \cdots \oplus \mathbb Z_{n_s}$ with $n_{i+1} | n_i$, then there are $s$ Fox $n_1$-colorings that distinguish all the arcs of $D$. Note that, $s$ is strictly less than the number of crossings of $D$.

\end{enumerate}
\end{conjecture}

\begin{remark}

    Parts \ref{a} and \ref{b} of Conjecture \ref{ConAPS} are equivalent to each other, since for a finite group $G$, we have $G \cong Hom(G, \mathbb{Z}_{n_1})\cong Hom(G, \mathbb{Z}_{\delta(D)})$, where $G=\mathbb{Z}_{n_1}\oplus \mathbb Z_{n_2} \oplus \cdots \oplus \mathbb{Z}_{n_s}$, with $n_{i+1} | n_i$ and $\delta(D) =n_{1}n_{2}\cdots n_{s}$. In particular, $Hom(Col^{red}(D), \mathbb{Z}_{\delta(D)}) \cong Hom(Col^{red}(D), \mathbb{Z}_{n_1}) \cong Col^{red}(D)$. Thus, we can work with a group or its dual. To distinguish elements in the group we often analyze its homomorphisms  (dual elements) into the given ring. See \cite{lang}, for example.

\end{remark}

\section{Proof of the generalized Kauffman-Harary conjecture}\label{proofconjecture}

The proof of the GKH conjecture is organized as follows. First, we define the crossing matrix $C'(D)$ and coloring matrix $L(D)$ of a link diagram $D$. Following \cite{MS} we prove that every column of the coloring matrix represents a non-trivial Fox $\delta(D)$-coloring. Then using the fact that the coloring matrix of the mirror image of $D$ is the transpose of $L$, we prove part \ref{b}, and equivalently, part \ref{a} of Conjecture \ref{ConAPS}. Additionally, we show that the columns of the coloring matrix generate the group $Col^{red}(D)$ and use this fact to prove part \ref{c} of Conjecture \ref{ConAPS}.

\begin{definition}

	A \textbf{Fox} $\boldsymbol{k}$\textbf{-coloring} of a diagram $D$ is a function $f: \mathit{arcs}(D) \to \mathbb{Z}_{k}$, satisfying the property that every arc is colored by an element of $\mathbb{Z}_{k}=\left\lbrace 0, 1, 2, 3, \dots, k-1\right\rbrace $ in such a way that at each crossing the sum of the colors of the undercrossings is equal to twice the color of the overcrossing modulo $k$. That is, if at a crossing $v$ the overcrossing is colored by $b$, and the undercrossings are colored by $a$ and $c$, then  $2b-a-c \equiv0$ modulo $k$. See Figure \ref{CrossingMatrixRelation} for an illustration. The group of Fox $k$-colorings of a diagram $D$ is denoted by $\mathit{Col}_{k}(D)$ and the number of Fox $k$-colorings is denoted by $\mathit{col}_{k}(D)$. Analogous to Definition \ref{coltrivialdefi}, we divide the group $Col_{k}(D)$ by the group of trivial colorings and denote the quotient group by $Col^{red}_{k}(D)$.

\end{definition}

The matrix describing the space of colorings $Col(D)$ is referred to, by Mattman and Solis, as the crossing matrix for a fixed arbitrary ordering of the crossings \cite{MS}. Here we do not assume that the diagram is alternating.

\begin{definition}

Fix an ordering of the crossings of a reduced link diagram $D$. Then the set of arcs inherits the order of the set of crossings. In this way, the over-arc has the same index as the crossing. The \textbf{crossing matrix}\footnote{The alternative, more descriptive, name could be {\it unreduced fundamental Fox colorings matrix.}} of  $D$, denoted by $C'(D)$, is an $n \times n$ matrix such that each row corresponds to a crossing  that gives the relation $2b-a-c=0$ (see Figure \ref{CrossingMatrixRelation}). The entries of the matrix are defined as follows\footnote{It is possible that two under-arcs at a crossing are not distinct. Then the relation $2b-a-c=0$ becomes $2b-2a=0$. For instance, this may occur for the Hopf link.}:

\begin{minipage}{0.5\textwidth}
$$ C_{ij}' = \left\{ \begin{array}{rr}
2 & \text{if  } a_i \
 \text{is the over-arc at } c_i, \\
-1 &  \text{ if } a_j \text{ is an under-arc at } c_i \text{ }(i\neq j), \text{and} \\
0 & \text{ otherwise}.
\end{array}
\right.$$
\end{minipage}
\begin{minipage}{0.47\textwidth}
\centering
\includegraphics[scale=0.45]{FoxrelationOverpic.png}
\captionof{figure}{Fox coloring relation at crossing $v$.}
\label{CrossingMatrixRelation}
\end{minipage}

\end{definition}

\begin{figure}[ht]
\centering
$$\vcenter{\hbox{
\begin{overpic}[scale = .44]{Crossingchange.png}
\put(80, 125){$c_k$}
\put(80, 83){$c_i$}
\put(80, 40){$c_j$}
\put(92, 70){$a_i$}
\put(65, 135){$a_k$}
\put(65, 50){$a_j$}
\put(385, 125){$c_k$}
\put(360, 125) {$\overline{a_k}$}
\put(385, 83){$c_i$}
\put(369, 95){$\overline{a_i}$}
\put(385, 40){$c_j$}
\put(360, 40){$\overline{a_j}$}

\end{overpic} }}$$
	\caption{Neighborhood of the crossing $c_i$ in $D$ (on the left) and $\overline{D}$.}
	\label{mirrorcrossing}
\end{figure}

The following lemma holds only for alternating links and plays an important role in the proof of the GKH conjecture.

\begin{lemma}\label{Mirror}

Let $D$ be a reduced alternating link diagram with crossing matrix $C'(D)$ and let $\overline{D}$ be its mirror image. Then the matrix $C'^{T}$ is a crossing matrix for $\overline{D}$.

\end{lemma}

\begin{proof}

Denote the crossings of the diagram $D$ by $c_1, \dots,c_n$ and let the over-arc at the crossing $c_i$ be denoted by $a_i$. Notice that, in the matrix $C'(D)$ all entries on the diagonal are $2$. We obtain $\overline{D}$ by crossing-change operations and we keep the ordering and names of the crossings. Now, let $\overline{a_i}$ denote the  over-arc at the crossing $c_i$ in the diagram $\overline{D}$. In the row corresponding to the crossing $c_i$, suppose the columns corresponding to the arcs $a_j$ and $a_k$ have $-1$ as entries. Then in the matrix $C'(\overline{D})$, the column corresponding to $\overline{a_i}$ must have entries $-1$ in the rows corresponding to the crossings $c_j$ and $c_k$; see Figure \ref{mirrorcrossing}.

\end{proof}

Recall that if $\delta(D)\neq0$, then  $Col^{red}(D)$ is a finite group whose invariant factor decomposition is $Col^{red}(D) = \mathbb Z_{n_1}\oplus \mathbb Z_{n_2}\oplus \cdots \oplus \mathbb Z_{n_s}$, with $n_{i+1} | n_i$ for all $i$. Notice that, $s$ is the minimum number of generators of this group and $n_{1}$ is the annihilator of the group. Let $C(D)$ denote the reduced crossing matrix of $D$, which is the matrix obtained from $C'(D)$ by removing its last row and last column. We call the arc corresponding to the last column of $C'(D)$ the \textbf{base arc}. This matrix describes the group $Col^{red}(D)$. The matrix $C^{-1}(D)$ is a matrix with rational entries. However, $n_1C^{-1}(D)$ is an integral matrix, which we denote by $L_{n_1}(D).$ Observe that the columns of $L_{n_1}(D)$ modulo $n_1$ represent Fox $n_1$-colorings of the diagram $D$ after coloring the base arc by color $0$.

\

The following result also holds for reduced non-alternating links.

\begin{theorem}\label{generatorlemma}
        Let $D$ be a reduced  diagram of a link with non-zero determinant. Then the columns of $L_{n_1}(D)$  modulo $n_1$  generate the space of Fox $n_1$-colorings of $D$.

\end{theorem}

\begin{proof}

 Let $C(D)$ be the reduced crossing matrix of $D$ and let $Col^{red}(D) = \mathbb Z_{n_1}\oplus \mathbb Z_{n_2}\oplus \cdots \oplus \mathbb Z_{n_s}$, with $n_{i+1} | n_i$ for all $i$. After row and column operations, $C(D)$ can be reduced to its Smith normal form, denoted by $C_{SNF}(D)$, given below.

\begin{equation*}
C_{SNF}(D) =
\begin{pmatrix}
    n_{1} & &  && \\
    &n_{2} &  &&&\text{\Huge0}& \\
    & & \ddots&&& \\
    & &&n_s && \\
     &&&&1 && \\
&\text{\Huge0}&&&&\ddots &&\\
    & & &&&& 1
  \end{pmatrix}
\end{equation*}

Its inverse matrix, $C^{-1}_{SNF}(D)$, with entries in $\mathbb{Q}$ has the following form.
\begin{equation*}
C^{-1}_{SNF}(D) =
\begin{pmatrix}
    1/n_{1} & &  && \\
    &1/n_{2} &  &&&\text{\Huge0}& \\
    & & \ddots&&& \\
    & &&1/n_s && \\
     &&&&1 && \\
&\text{\Huge0}&&&&\ddots &&\\
    & & &&&& 1
  \end{pmatrix}
\end{equation*}

Thus, we obtain the following integral matrix $L^{SNF}_{n_1}(D)$.
\begin{equation*}
L^{SNF}_{n_1}(D)=n_1 C^{-1}_{SNF}(D)=
\begin{pmatrix}
    n_1/n_{1} & &  && \\
    &n_1/n_{2} &  &&&\text{\Huge0}& \\
    & & \ddots&&& \\
    & &&n_1/n_s && \\
     &&&&n_1 && \\
&\text{\Huge0}&&&&\ddots &&\\
    & & &&&& n_1
  \end{pmatrix}
\end{equation*}

\

Now, the $i^{\mathit{th}}$ column $(0, 0, \dots, n_{1}/n_{i}, \dots, 0)^T$ of $L^{SNF}_{n_1}(D)$ modulo $n_1$  with $i \le s$ generates the subgroup  $\mathbb{Z}_{n_i}$ of $\mathbb{Z}_{n_1}$. Since $Col^{red}_{n_1}(D) = Hom(\mathbb Z_{n_1}\oplus \mathbb Z_{n_2}\oplus \cdots  \oplus \mathbb Z_{n_s},  \mathbb Z_{n_1})$, therefore, the columns of $L^{SNF}_{n_1}$ generate the group $Col^{red}_{n_1}(D)$, as desired.\\
\end{proof}

For alternating diagrams we can prove the following stronger result, which proves part \ref{b}, and equivalently, part \ref{a} of Conjecture \ref{ConAPS}.

\begin{theorem}\label{mainlemma}

    Let $D$ be a reduced alternating diagram of a prime link. For any two arcs $a_i$ and $a_j$, there exists a column of $L_{n_1}(D)$ which distinguishes them.

\end{theorem}

\begin{proof}

Suppose the arcs (indexing rows) of the coloring matrix $n_{1}C^{-1}(D) = L_{n_1}(D)$ are given by $a_1$, $a_2$, \dots, $a_{n-1}$ as shown below. $$L_{n_1}(D)=n_{1}C^{-1}(D) = \begin{pNiceMatrix}[first-row,last-row,first-col,last-col]
     \ \ \ \ \  &         &          &    &   \\
\textcolor{blue}{a_1:}  \ \ \ \ \ \  & c_{1,1} &  c_{1,2} & \cdots & c_{1,n-1} & \ \ \\
   \textcolor{blue}{a_2:} \ \ \ \ \ \   & c_{2,1} & c_{2,2} & \cdots & c_{2,n-1} & \ \ \\
    \textcolor{blue}{\vdots \ \ \ } \ \ \ \ \ \  & \vdots & \vdots & \vdots & \vdots & \ \ \\
 \textcolor{blue}{a_{n-1}:}\ \ \ \ \ \  &  c_{n-1,1} & c_{n-1,2} & \cdots & c_{n-1,n-1} & \ \ \\
 \textcolor{blue}{a_n:} \ \ \ \ \ \  & 0 & 0 & \cdots & 0     & \ \ \\
\end{pNiceMatrix}$$

Recall that, the reduced crossing matrix $C(D)$ is obtained from $C'(D)$ by removing its last row and last column. Now, each column of $L_{n_1}(D)$ colors the the remaining first $n-1$ arcs of the diagram. For a complete Fox $n_1$-coloring of $D$ we color the last (base) arc $a_n$ by color $0$. If any $c_{i,1}=0 \mod n_1$ for $i < n$, then column $C_1$ modulo $n_1$ cannot distinguish between the arcs $a_n$ and $a_i$. If all the entries of the rows corresponding to $a_i$ and $a_j$  are not identical  modulo $n_1$, then they can be automatically distinguished by the column in which they are different.

\

\textbf{Step 1:}  If there is no column $C_j$ of $L_{n_1}(D)$ such that $c_{i,j} \neq 0$ mod $n_1$, then every entry in the $i^{\mathit{th}}$ row is $0$ mod $n_1$. It follows that in the transpose matrix $L_{n_1}^{T}(D)$, the column $C_{i}^{T}$ is the zero column  modulo $n_1$. This would result in the existence of a pseudo coloring of $\overline{D}$ (see Definition \ref{pseudodef} and \cite{MS}), which is a contradiction. Thus, the base arc $a_n$ can be distinguished from any other arc by some column in $L_{n_1}(D)$ modulo $n_1$.

\

\textbf{Step 2:} Furthermore, if there are two arcs $a_i$ and $a_j$ with the same color in every column of $L_{n_1}(D)$, then we choose arc $a_j$ as the base arc, which implies that the colors of $a_i$ are equal to zero. So we are back to Step 1.

\end{proof}

The next theorem proves part \ref{c} of Conjecture \ref{ConAPS}, which is a more general version of Theorem \ref{mainlemma}.

\begin{theorem}\label{mainlemma2}

    If $Col^{red}(D) = \mathbb Z_{n_1} \oplus \mathbb Z_{n_2} \oplus \cdots \oplus \mathbb Z_{n_s}$, with $n_{i+1} | n_i$, then there are $s$ Fox $n_1$-colorings (not necessarily corresponding to the columns of the coloring matrix) which distinguish all arcs. That is, for every pair of arcs of $D$, one of these $n_{1}$-colorings distinguishes them.

\end{theorem}

\begin{proof}

 Denote the generators of the group $Col^{red}(D)$ by $a_1$, $a_2$, \dots, $a_s$. Every generator $a_i$ is a linear combination of some columns of the coloring matrix $L_{n_1}(D)$ modulo $n_1$ (see Theorem \ref{generatorlemma}). Therefore, they correspond to some coloring of the diagram $D$. Hence, for every pair of arcs there is a column of $L_{n_1}(D)$ modulo $n_1$ that distinguishes them.

\end{proof}

\begin{corollary}\label{Coro}

If $Col^{red}(D)$ is the cyclic group $\mathbb{Z}_{n_1}$,\hfill

\begin{itemize}
    \item [(a)] then there exists a non-trivial Fox $n_1$-coloring that distinguishes all arcs.

    \item [(b)] Additionally, if $n_1$ is a prime number, then the original Kauffman-Harary conjecture holds.  That is, every non-trivial Fox $n_1$-coloring distinguishes all arcs.
\end{itemize}

\end{corollary}

\begin{proof}

Part (a) follows directly from Theorem \ref{mainlemma2}, for $s=1$. Part (b) follows because every non-zero element of $\mathbb{Z}_{n_1}$ is its generator.

\end{proof}

\section{Non-prime alternating links}\label{nonprimealt}

Theorems \ref{mainlemma} and \ref{mainlemma2}  do not hold as stated for the connected sum of alternating links\footnote{The connected sum of alternating links, is an alternating link. For example, see \cite{PBIMW}.} (see part \ref{(a)} of Lemma \ref{nonprimelemma}). In Theorem \ref{connectedsumnonprime}, we present a version of the GKH conjecture which holds for non-prime alternating links.

\begin{lemma}\cite{Prz1}
\label{nonprimelemma}

    Let $D= D_1 \ \# \ D_2$ be the connected sum of two link diagrams. Then,

\begin{itemize}
    \item [\namedlabel{(a)}{(a)}] the arcs connecting the two components represent the same element in $Col(D)$, and

    \item[(b)] $Col^{red}(D_1 \ \# \ D_2) \cong Col^{red}(D_1)\oplus Col^{red}(D_2) $.

\end{itemize}

\end{lemma}

\begin{theorem}\label{connectedsumnonprime}

    Let $D=  D_1 \ \# \ \ D_2  \  \# \ \cdots \  \# \ D_n$, where $D_i$ is a reduced alternating diagram of a prime link $L_i$, for $i=1, 2, \dots, n$. Then,

\begin{itemize}

    \item [(a)] for any pair of arcs different from arcs joining $D_i$  with $D_{i+1}$, there exists a Fox $n_1$-coloring which distinguishes them, and

    \item [(b)] there are $t$ ($t \leq s$) Fox $n_1$-colorings such that any pair of arcs different from the ones joining $D_i$ with $D_{i+1}$, is distinguished by one of them.

\end{itemize}

\end{theorem}

\begin{proof}

    This result follows from Theorems \ref{generatorlemma} and \ref{mainlemma}, and Lemma \ref{nonprimelemma}.

\end{proof}

\begin{remark}

    Theorem \ref{connectedsumnonprime}  was formulated for connected sums of diagrams. However, from William W. Menasco's result (see \cite{Men,Hos}), it follows that if an alternating diagram represents the connected sum of alternating links, then it is already a connected sum of diagrams.

\end{remark}

\begin{example}

Let $D$ be an alternating diagram of the square knot, that is $D= \overline{3}_1 \ \# \ 3_1$, with reduced crossing matrix $C(D)$ (see Figure \ref{FoxSquareknot}). Then
  $Col^{red}(\overline{3}_1 \ \# \ 3_1)=
  \mathbb Z_3 \oplus \mathbb Z_3$. Observe that columns 3 and 5 of $L_3(D)$ modulo $3$ (Figure \ref{matricesSquareKnot}) distinguish all pairs of arcs except the ones connecting $\overline 3_1$ with $3_1.$ Also, the third row (corresponding to the third crossing in the chosen ordering and, therefore, to the third arc) has all zero entries. That is, the third arc  cannot be distinguished from the base arc.

\begin{figure}[H]
	\begin{subfigure}{.4\textwidth}
$ C(D) =
\begin{pmatrix*}[r]
2 &  -1 &  0 &  0 &  0\\  -1 &  2 &  -1 &  0 &  0\\  -1 &  -1 &  2 &  0 &  0\\  0 &  0 &  -1 & 2 &
-1 \\  0 &  0 &  0 &  -1 &  2
    \end{pmatrix*}$
	\end{subfigure}
\begin{subfigure}{.3\textwidth}
\centering
$$\vcenter{\hbox{
\begin{overpic}[scale = 1.7]{squareknot}

\put(55, 60){$(1,0)$}
\put(29, 52){$(2,0)$}
\put(37, 135){$(0,0)$}
\put(133, 65){$(0,1)$}
\put(105, 54){$(0,2)$}
\put(30, 5){$(0,0)$}

\end{overpic} }}$$

 \end{subfigure}
 \caption{The reduced crossing matrix for the square knot (on the left). The square knot $\overline{3}_1 \ \# \ 3_1$ with two Fox $3$-colorings distinguishing every pair of arcs (on the right).} \label{FoxSquareknot}
\end{figure}

\begin{figure}[h]
$ L_3(D) =  3 C^{-1}(D) =
\begin{pmatrix}
3 &  2 &  1 &  0 &  0\\  3 &  4 &  2 &  0 &  0\\  3 &  3 &  3 &  0 &  0\\  2 &  2 &  2 &  2 &  1\\
 1 &  1 &  1 &  1 &  2
 \end{pmatrix} \ \ \ \ \
L_3(D) \ \text{mod 3}=
\begin{pmatrix}
0 &  2 &  1 &  0 &  0\\  0 &  1 &  2 &  0 &  0\\  0 &  0 &  0 &  0 &  0\\  2 &  2 &  2 &  2 &  1\\
 1 &  1 &  1 &  1 &  2
\end{pmatrix} $
\caption{Matrices $L_3(D)$ and $L_3(D)$ modulo $3$ for the square knot.}\label{matricesSquareKnot}

\end{figure}

\end{example}

\section{Examples of Fox colorings}\label{exfoxsection}

In this section we study examples of alternating link diagrams and their Fox colorings. For the structure of the group $Col^{red}(D)=H_{1}(M_{D}^{(2)}, \mathbb{Z})$ for knots up to 10 crossings, see Appendix C in \cite{BZ}.

\begin{example}

Kauffman and Harary
 showed that the knot $7_7$ is a counterexample to their conjecture for a knot with non-prime determinant \cite{HK}. We have, $det \ ( 7_7)= 21$ and $Col^{red}(7_7)=\mathbb{Z}_{21}$.\footnote{It was noticed in \cite{KLa} that the Kauffman-Harary conjecture holds for any rational (2-bridge) knot without  restrictions on the determinant of the knot.  However, as they note, the formulation of the conjecture needs to be changed from ``every non-trivial Fox $D$-coloring" to ``there exists a Fox $D$-coloring." See Corollary \ref{Coro}.} See Figure \ref{7_7 figure} for a Fox $21$-coloring distinguishing all arcs.

\begin{figure}[h]
$L(7_7)=\begin{pmatrix}
   24 & 20 & 12 & 10 & 16 & 11 \\
 12 & 24 & 6 & 12 & 15 & 9 \\
 15 & 16 & 18 & 8 & 17 & 13 \\
 6 & 5 & 3 & 13 & 4 & 8 \\
 18 & 22 & 9 & 11 & 26 & 10 \\
 12 & 10 & 6 & 5 & 8 & 16 \\
\end{pmatrix} \ \ \ \ \
L(7_7) \ \text{mod} \ 21=\begin{pmatrix}
   3 & 20 & 12 & 10 & 16 & 11 \\
 12 & 3 & 6 & 12 & 15 & 9 \\
 15 & 16 & 18 & 8 & 17 & 13 \\
 6 & 5 & 3 & 13 & 4 & 8 \\
 18 & 1 & 9 & 11 & 5 & 10 \\
 12 & 10 & 6 & 5 & 8 & 16 \\
\end{pmatrix} $
\caption{Matrices $L(7_7)$ and $L(7_7)$ modulo $21$. Some non-trivial Fox $21$-colorings of $7_7$ do not distinguish all arcs; for example, columns 1 or 3 of $L$ modulo $21$. However, columns $2$, $4$, $5$, and $6$ distinguish all arcs.}

\end{figure}

\begin{figure}[h]
$$\vcenter{\hbox{
\begin{overpic}[scale = 0.8]{7_7.png}

\put(170, 130){$1$}
\put(142, 100){$2$}
\put(53, 138){$4$}
\put(75, 100){$7$}
\put(2, 20){$12$}
\put(70, 40){$20$}
\put(195, 45){$0$}

\end{overpic} }}$$
\caption{The knot $7_7$ with a Fox $21$-coloring which distinguishes all arcs.}\label{7_7 figure}
\end{figure}

\end{example}

\begin{example}

Consider the family of links obtained by closing the braids $(\sigma_1\sigma_2^{-1})^{n}$. These links are sometimes called Turk's head links and can also be obtained by drawing the Tait diagrams of the wheel graphs $W_n$. The closed formula for the determinant of the $D(W_n)$ is given in \cite{Prz-Goeritz}. Examples for $n=5$ and $n=6$ are drawn in Figure \ref{W5andW6} and their reduced groups of Fox colorings are as follows:

\begin{itemize}

    \item [(a)] For $n=5$, $D(W_5)$ is $10_{123}$ in Rolfsen's table \cite{Rol}. $Col^{red}(D(W_5)) = \mathbb Z_{11} \oplus \mathbb Z_{11} $.

    \item [(b)]  For $n=6$, $D(W_6)$ is the link $12^{3}_{474}$ in Thistlethwaite's tables \cite{Prz-Goeritz, Thi}.
$Col^{red}(D(W_6)) = \mathbb Z_{40} \oplus \mathbb Z_{8}$.

\end{itemize}

\begin{figure}[ht]
	\centering
	\includegraphics[width=1\linewidth]{W_5.png}
	\caption{The knot $D(W_5)$ with two Fox colorings distinguishing all arcs (on the left), and the link $D(W_6)$ with two Fox colorings distinguishing all arcs (on the right).}
	\label{W5andW6}
\end{figure}

\end{example}

\begin{example}

The group $Col^{red}$ for pretzel links is given in Proposition $7$ in \cite{APS} and its generalization to Montesinos links is given in Proposition $8$ in \cite{APS}. Here we show two examples together with their coloring matrices modulo $n_1$.

\begin{itemize}

\item[(a)] Let $P(3,3,3,3,3)$ be a pretzel knot with $15$ crossings. Its group  $Col^{red}$ is equal to $\mathbb{Z}_{15} \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_3$. See its coloring matrix, $L(P(3,3,3,3,3))$ modulo $15$ in Figure \ref{coloringpretzel1}.

\item[(b)]  Let $P(3,3,3,6)$ be a pretzel knot with $15$ crossings. Its group $Col^{red}$ is equal to $\mathbb{Z}_{21} \oplus \mathbb{Z}_3 \oplus \mathbb{Z}_3$. See its coloring matrix, $L(P(3,3,3,6))$ modulo $21$ in Figure \ref{coloringpretzel2}.

\end{itemize}

\end{example}

\begin{figure}
$L(P(3,3,3,3,3))\ mod \ 15=\left(
\begin{array}{cccccccccccccc}
 5 & 1 & 1 & 1 & 12 & 12 & 7 & 8 & 3 & 3 & 14 & 14 & 14 & 10 \\
 10 & 5 & 10 & 10 & 10 & 10 & 5 & 10 & 0 & 10 & 10 & 10 & 10 & 10 \\
 10 & 1 & 11 & 1 & 12 & 12 & 7 & 8 & 13 & 3 & 4 & 14 & 14 & 10 \\
 10 & 12 & 12 & 7 & 14 & 14 & 9 & 6 & 11 & 11 & 13 & 3 & 3 & 10 \\
 10 & 1 & 1 & 1 & 7 & 12 & 7 & 8 & 13 & 13 & 4 & 4 & 14 & 10 \\
 10 & 12 & 12 & 12 & 14 & 9 & 9 & 6 & 11 & 11 & 13 & 13 & 3 & 0 \\
 10 & 8 & 8 & 8 & 6 & 6 & 11 & 4 & 9 & 9 & 7 & 7 & 7 & 5 \\
 5 & 7 & 7 & 7 & 9 & 9 & 4 & 11 & 6 & 6 & 8 & 8 & 8 & 10 \\
 0 & 3 & 13 & 13 & 11 & 11 & 6 & 9 & 9 & 14 & 12 & 12 & 12 & 10 \\
 10 & 14 & 4 & 4 & 13 & 13 & 8 & 7 & 12 & 7 & 1 & 1 & 1 & 10 \\
 10 & 3 & 3 & 13 & 11 & 11 & 6 & 9 & 14 & 14 & 7 & 12 & 12 & 10 \\
 10 & 14 & 14 & 4 & 3 & 13 & 8 & 7 & 12 & 12 & 1 & 11 & 1 & 10 \\
 10 & 10 & 10 & 10 & 10 & 0 & 10 & 5 & 10 & 10 & 10 & 10 & 5 & 10 \\
 10 & 14 & 14 & 14 & 3 & 3 & 8 & 7 & 12 & 12 & 1 & 1 & 1 & 5 \\
\end{array}
\right)$
\caption{$L(P(3,3,3,3,3))$ modulo $15$. The colorings given by the columns 3, 4, and 10 distinguish all arcs.}\label{coloringpretzel1}
\end{figure}

\begin{figure}
$L(P(3,3,3,6)) \ mod \ 21=\left(
\begin{array}{cccccccccccccc}
 9 & 5 & 1 & 10 & 11 & 18 & 18 & 5 & 7 & 3 & 20 & 1 & 1 & 14 \\
 1 & 6 & 11 & 12 & 9 & 16 & 16 & 20 & 14 & 19 & 3 & 18 & 18 & 14 \\
 14 & 7 & 0 & 14 & 7 & 14 & 14 & 14 & 0 & 14 & 7 & 14 & 14 & 14 \\
 6 & 8 & 10 & 16 & 5 & 12 & 12 & 8 & 7 & 9 & 11 & 10 & 10 & 14 \\
 15 & 13 & 11 & 5 & 16 & 9 & 9 & 13 & 14 & 12 & 10 & 11 & 11 & 7 \\
 13 & 15 & 17 & 9 & 12 & 12 & 19 & 15 & 14 & 16 & 18 & 17 & 3 & 0 \\
 11 & 17 & 2 & 13 & 8 & 15 & 8 & 17 & 14 & 20 & 5 & 2 & 16 & 14 \\
 13 & 15 & 17 & 9 & 12 & 19 & 19 & 8 & 14 & 16 & 18 & 3 & 3 & 14 \\
 5 & 16 & 6 & 11 & 10 & 17 & 17 & 2 & 0 & 11 & 1 & 20 & 20 & 14 \\
 18 & 17 & 16 & 13 & 8 & 15 & 15 & 17 & 7 & 6 & 5 & 16 & 16 & 14 \\
 10 & 18 & 5 & 15 & 6 & 13 & 13 & 11 & 14 & 1 & 9 & 12 & 12 & 14 \\
 12 & 16 & 20 & 11 & 10 & 17 & 3 & 2 & 14 & 18 & 1 & 13 & 20 & 14 \\
 14 & 14 & 14 & 7 & 14 & 0 & 14 & 14 & 14 & 14 & 14 & 14 & 7 & 14 \\
 12 & 16 & 20 & 11 & 10 & 3 & 3 & 16 & 14 & 18 & 1 & 20 & 20 & 7 \\
\end{array}
\right)$
\caption{$L(P(3,3,3,6))$ modulo $21$. The colorings given by columns 1 and 6 distinguish all arcs.}\label{coloringpretzel2}
\end{figure}

\section{Odds and ends}\label{odds}

\subsection{Pseudo colorings}

An important tool in our proof of Theorem \ref{mainlemma} is the idea of pseudo colorings. In \cite{MS} and in this paper, it is shown that no pseudo colorings exist for reduced, prime, alternating link diagrams. However, the existence of pseudo colorings can be used to see how far a diagram is from being an alternating link diagram. In this section, we briefly explore this concept. In \cite{MS}, Proposition 3.2 depends on the fact that for reduced alternating diagrams the rows of the crossing matrix add to zero. This does not hold for non-alternating diagrams, as we illustrate in the following examples.

\begin{definition}\label{pseudodef}

Let $D$ be a link diagram and $\epsilon \in \{-1,+1\}$. Following Mattman and Solis \cite{MS}, we define an $\boldsymbol{\epsilon}$\textbf{-pseudo coloring} of $D$ as colorings of the arcs of $D$ such that, at all but two crossings the Fox coloring convention $2b - a - c = 0$ is satisfied. We denote the other two crossings by $c_{+1}$ and $c_{\epsilon},$ where the coloring conventions are $2b - a - c = +1$ and $2b - a - c = \epsilon,$ respectively. To obtain the pseudo colorings as defined in \cite{MS}, put $\epsilon=-1$.

\end{definition}

For an alternating link diagram $D$, our convention was to order crossings first and then, the set of arcs inherits the order of the set of crossings. Compare Definition \ref{CrossingMatrixRelation}. The reason for such a choice is that $C'(\overline{D})$ is the same as $C'(D)^{T}$. This does not work for non-alternating link diagrams.

\

In general, we can arbitrarily order crossings and arcs.  In Figure \ref{orderarcs} we give an example of ordering crossings and arcs for the knot $8_{19}$. We first choose a base point and an orientation (shown by an arrow on the left-hand side of Figure \ref{orderarcs}). Starting at this base point, we move along the knot and order crossings. Next, arcs can be ordered arbitrarily with the base arc always being the last one. In Figure \ref{orderarcs} the first coordinate gives the number of the crossing and the second one gives the number of the arc.

\begin{figure}[ht]
	\centering
	\begin{subfigure}{.5\textwidth}
		$$\vcenter{\hbox{
\begin{overpic}[scale = 1.7]{8_19aspretzel}
\put(103, 72){$1,5$}
\put(103, 45){$2,1$}
\put(25, 30){$3,7$}
\put(25, 58){$4,4$}
\put(25, 85){$5,6$}
\put(62, 85){$6,3$}
\put(65, 58){$7,8$}
\put(65, 31){$8,2$}

\end{overpic} }}$$
	\end{subfigure}%
	\begin{subfigure}{.5\textwidth}		$$\vcenter{\hbox{
\begin{overpic}[scale = 1.7]{8_19aspretzel}

\put(70, 105){$0$}
\put(70, 13){$-1$}
\put(27, 27){$0$}
\put(-3, 40){$0$}
\put(-3, 75){$0$}
\put(65, 124){$0$}
\put(69, 70){$0$}
\put(110, 31){$0$}
\put(47, 20){$c_{+1}$}
\put(103, 45){$c_{+1}$}

\end{overpic} }}$$

 \end{subfigure}
 \caption{The torus knot $T(3,4)$ ($8_{19}$ in Rolfsen's table \cite{Rol}) depicted as the pretzel knot $P(3,3,-2)$ showing ordering of crossings and arcs (on the left). On the right, there is pseudo coloring given by the second column; compare Remark \ref{remarkpseudo}.} \label{orderarcs}
\end{figure}

\

In the following example, we analyze non-split, non-prime alternating diagrams.

\begin{example}\label{Ex52}

Let $D = D_1 \ \# \ D_2$ be a non-split, non-prime alternating link diagram. $D$ always has a $-1$-pseudo coloring using color $1$ on $D_1$ and color $0$ on $D_2$. We illustrate this idea for the square knot $\overline{3}_1 \ \# \ 3_1$ in Figure \ref{PseudoSquare}.

\begin{figure}[h]
\centering
$$\vcenter{\hbox{
\begin{overpic}[scale = 1.7]{squareknot}

\put(57, 70){$1$}
\put(32, 78){$1$}
\put(40, 132){$0$}
\put(5,103){$c_{+1}$}
\put(108, 48){$0$}
\put(134, 60){$0$}
\put(32, 4){$1$}
\put(85,23){$c_{-1}$}

\end{overpic} }}$$
	\caption{$-1$-pseudo coloring of the square knot with the $+1$-crossing denoted by $c_{
+1}$ and the $-1$-crossing denoted by $c_{
-1}$.}\label{PseudoSquare}
\end{figure}
\end{example}

 On the other hand, non-alternating link diagrams often have $-1$-pseudo colorings and $+1$-pseudo colorings. See Examples \ref{Ex53} and \ref{Ex819}. If the determinant of a knot with diagram $D$ is equal to $1$, we have $L(D) = C^{-1}(D)$ and every column of $C^{-1}(D)$ colors the first $n-1$ arcs of the diagram. Then for a complete $\epsilon$-pseudo coloring of $D$, we color the last (base) arc $a_n$ by color $0$.
 \begin{example}\label{Ex53}

Consider the braid word $\sigma^{3}_{2}\sigma^{}_{1}\sigma^{-1}_{3}\sigma^{-2}_{2}\sigma^{}_{1}\sigma^{-1}_{2}\sigma^{}_{1}\sigma^{-1}_{3}$ whose closure is the Conway knot. The determinant of this knot is $1$ and its crossing matrix $C'(D)$ is given in Figure \ref{CMCK}. The $+1$-pseudo coloring given by column $4$ and the $-1$-pseudo coloring given by column $1$ in the matrix shown in Figure \ref{pseudoConwayKnot} are illustrated in Figure \ref{CKpic} on the left and on the right, respectively.

\end{example}

 \begin{figure}[ht]
	\centering
	\begin{subfigure}{.5\textwidth}
		$$\vcenter{\hbox{
\begin{overpic}[scale = 0.9]{CK}

\put(55, 150){$2$}
\put(35.5, 118){$-8$}
\put(40, 108){$-5$}
\put(42, 86){$-2$}
\put(5, 222){$5$}
\put(1, 110){$0$}
\put(20, 210){$9$}
\put(18, 165){$6$}
\put(18, 149){$3$}
\put(60, 100){$-3$}
\put(3, 72){$1$}
\put(50, 60){$c_{+1}$}
\put(14, 76){$c_{+1}$}

\end{overpic} }}$$
\label{CKpicA}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}		$$\vcenter{\hbox{
\begin{overpic}[scale = 0.9]{CK}

\put(55, 150){$6$}
\put(35.5, 118){$-33$}
\put(38.5, 108){$-21$}
\put(42, 86){$-9$}
\put(5, 225){$21$}
\put(1, 110){$0$}
\put(20, 212){$39$}
\put(13, 165){$26$}
\put(13, 149){$13$}
\put(60, 100){$-13$}
\put(3, 72){$3$}
\put(50, 60){$c_{-1}$}
\put(55, 130){$c_{+1}$}

\end{overpic} }}$$
	\label{CKpicB}
 \end{subfigure}
 \caption{The Conway knot with $+1$-pseudo coloring (on the left) and with $-1$-pseudo coloring (on the right). The last crossing $c_{+1}$ in the left figure changes to $c_{-1}$ in the right figure.}\label{CKpic}
\end{figure}

\begin{figure}[ht]
$$C'(D)=\left(
\begin{array}{ccccccccccc}
 -1 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & 2 & 0 & 0 \\
 0 & -1 & -1 & 0 & 2 & 0 & 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 2 & 0 & -1 & -1 & 0 & 0 & 0 & 0 & 0\\
 2 & 0 & -1 & -1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 2 & 0 & -1 & -1 & 0 & 0 & 0 & 0 \\
 0 & 0 & 0 & -1 & -1 & 0 & 0 & 0 & 0 & 0 & 2 \\
 -1 & 0 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 0 & -1 \\
 0 & 0 & 0 & 0 & 0 & 0 & -1 & -1 & 0 & 2& 0 \\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2 & 0 & -1 & -1 \\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 & -1 & 0 & 2 \\
 2& 0 & 0&0 & 0 & 0&0 &0 &-1 & -1 &0 \\
\end{array}
\right)$$
\caption{The crossing matrix of the Conway knot. Notice that the rows of the crossing matrix satisfy the linear equation $R_{1}-R_2-R_3-R_4-R_5-R_6-R_7+R_8+R_9+R_{10}+R_{11}=0.$}\label{CMCK}

\end{figure}

\begin{figure}[h]
$$L(D)= \begin{pNiceMatrix}[r,first-row,last-row,first-col]
     \ \ \ \ \          &  \text{ \ } & \text{ \ }  & \text{ \ }  & \text{ \ }  & \text{ \ }   & \text{ \ }  & \text{ \ }  & \text{ \ }  & \text{ \ }  & \text{ \ }   \\
\ \ \ \ \ \ \   & \textbf{6} & -6 & -2 & \textbf{2} & -4 & -10 & -3 & 4 & 8 & 12  \ \ \\
 \ \ \ \ \ \    & \textbf{-33} & 32 & 12 & \textbf{-8} & 22 & 52 & 17 & -22 & -44 & -66 \ \ \\
 \ \ \ \ \ \  & \textbf{-9} & 9 & 4 & \textbf{-2} & 6 & 14 & 5 & -6 & -12 & -18 \ \ \\
 \ \ \ \ \ \  & \textbf{21} & -21 & -8 & \textbf{5} & -14 & -34 & -11 & 14 & 28 & 42 \ \ \\
\ \ \ \ \ \  &\textbf{-21} & 21 & 8 & \textbf{-5} & 14 & 33 & 11 & -14 & -28 & -42 \\
 \ \ \ \ \ \  &\textbf{3} & -3 & -1 & \textbf{1} & -2 & -5 & -1 & 2 & 4 & 6 \\
\ \ \ \ \ \ & \textbf{39} & -39 & -15 & \textbf{9} & -27 & -63 & -21 & 26 & 52 & 78 \\
\ \ \ \ \ \ & \textbf{13} & -13 & -5 & \textbf{3} & -9 & -21 & -7 & 9 & 18 & 26 \\
\ \ \ \ \ \ & \textbf{-13} & 13 & 5 & \textbf{-3} & 9 & 21 & 7 & -9 & -18 & -27 \\
 \ \ \ \ \ \ &\textbf{26} & -26 & -10 & \textbf{6} & -18 & -42 & -14 & 18 & 35 & 52 \\
  & \textbf{0} & 0 & 0 & \textbf{0} & 0 & 0 & 0 & 0 & 0  & 0 \ \ \\
\end{pNiceMatrix}$$
\caption{Coloring matrix for the Conway knot. The last row of zeroes correspond to the coloring of the base arc.}\label{pseudoConwayKnot}
\end{figure}

\begin{example}\label{Ex819}

Consider the torus knot $T(3,4)$ with diagram $D$ and crossings and arcs ordered as illustrated in Figure \ref{orderarcs} . Its crossing matrix is shown in Figure \ref{CprimeMatrix819}. Three columns of $C^{-1}(D)$ (shown in Figure \ref{CMatrix819}) are integral and they yield $\epsilon$-pseudo colorings. Column 5 gives a $-1$-pseudo coloring (shown on the right in Figure \ref{8_19aspretzel}) and columns 1 and 2 give -1-pseudo colorings. The $+1$-pseudo coloring corresponding to column $1$ is shown on the left of Figure \ref{8_19aspretzel}.

\begin{figure}[ht]
	\centering	\includegraphics[width=0.85\linewidth]{8_19aspretzel.png}
	\caption{The torus knot $T(3,4)$ ($8_{19}$ in the Rolfsen's table \cite{Rol}) depicted as the pretzel knot $P(3,3,-2)$. } \label{8_19aspretzel}
\end{figure}

\begin{figure}[h]
$C'(D)=\left(
\begin{array}{rrrrrrrr}
2& 0 &0 &0 & -1 & -1 & 0&0 \\
 -1 & -1 & 0 &0 &2 &0 &0 &0  \\
 0& 0 & 0 &0  &2 &0 &-1&-1  \\
0&0  &0  &-1 &-1 &0 &2 &0 \\
0& 0 &0  & 2&0 &-1 &-1 &0  \\
 2& 0 & -1  &-1 &0 & 0&0 &0  \\
 -1 & 0 & 2 &0 & 0& 0&0  & -1  \\
0& -1  & -1 &0 &0 &0 &0 & 2 \\
\end{array}
\right)$
\caption{The crossing matrix $C'(P(3,3,-2))$. The rows satisfy the linear relation
$R_1 +R_2 - R_3 -R_4 -R_5 -R_6 -R_7 - R_8 = 0$.}
\label{CprimeMatrix819}
\end{figure}

\setlength{\tabcolsep}{20pt}
\renewcommand{\arraystretch}{1.5}
\begin{figure}[ht]
$\displaystyle C^{-1}(D)=\displaystyle \left(
\begin{array}{rrrrrrr}
 -2 & 0 & -\frac{2}{3} & \frac{2}{3} & 2 & \frac{10}{3} & \frac{5}{3} \\
 0 & -1 & \frac{4}{3} & \frac{2}{3} & 0 & -\frac{2}{3} & -\frac{1}{3} \\
 -1 & 0 & -\frac{1}{3} & \frac{1}{3} & 1 & \frac{5}{3} & \frac{4}{3} \\
 -3 & 0 & -1 & 1 & 3 & 4 & 2 \\
 -1 & 0 & \frac{1}{3} & \frac{2}{3} & 1 & \frac{4}{3} & \frac{2}{3} \\
 -4 & 0 & -\frac{5}{3} & \frac{2}{3} & 3 & \frac{16}{3} & \frac{8}{3} \\
 -2 & 0 & -\frac{1}{3} & \frac{4}{3} & 2 & \frac{8}{3} & \frac{4}{3} \\
\end{array}
\right)$
\caption{$C^{-1}(D)$ corresponding to $T(3,4)$ with three integral columns.}
\label{CMatrix819}
\end{figure}
\end{example}

Non-alternating link diagrams always have $\epsilon$-pseudo colorings, as we describe in the following remark.

\begin{remark}\label{remarkpseudo}
Let $D$ be a non-alternating link diagram.

\begin{enumerate}

\item[(1)] Every integral column of $C^{-1}(D)$ leads to some $\epsilon$-pseudo coloring.

\item[(2)] $D$ has an  $\epsilon$-pseudo coloring. This follows from the fact that every non-alternating diagram has a tunnel of length at least two. Now, we can color $D$ by coloring one of the arcs of the tunnel by color $-1$ and all other arcs by color $0$ to get the $+1$-pseudo coloring. An example of such a coloring is shown on the right-hand side of Figure \ref{orderarcs}.
\end{enumerate}

\end{remark}

\subsection{Future directions}
The Kauffman-Harary conjecture was extended to the case of virtual knots by Mathew Williamson \cite{Wil} and proved by Zhiyun Cheng \cite{Che}. A natural question is to ask whether the conjecture in \cite{APS} holds for virtual links whose determinants are not prime. Another path of further research is to look for a natural generalization to non-alternating diagrams using a set theoretic Yang-Baxter operator or a general Yang-Baxter operator.

\

An interesting prospect is to approach the generalized Kauffman-Harary conjecture from the perspective of incompressible surfaces in the double branched cover $M^{(2)}_L$ of $S^3$ branched along $L$. This was outlined in \cite{APS} with the hope of proving the GKH conjecture. Now that the GKH conjecture is proved, we can proceed in the opposite direction and analyze incompressible surfaces in $M^{(2)}_L$.

\section*{Acknowledgements}

The first author acknowledges the support of Dr. Max Rössler, the Walter Haefner Foundation, and the ETH Zürich Foundation. The third author acknowledges the support of the National Science Foundation through Grant DMS-2212736. The fourth author was supported by the American Mathematical Society and the Simons Foundation through the AMS-Simons Travel Grant. The fifth author was partially supported by the Simons Collaboration Grant 637794.