New results on the stopping time behaviour\\ of the Collatz 3x + 1 function
Mike Winkler\footnote{mike.winkler@gmx.de
\noindent Let $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$. For the Collatz 3x + 1 function exists for each $n\in\mathbb{N$ a set of different residue classes $(mod\ 2^{\sigma_n)$ of starting numbers $s$ with finite stopping time $\sigma(s)=\sigma_n$. Let $z_n$ be the number of these residue classes for each $n\geq0$ as listed in the OEIS as A100982. It is conjectured that for each $n\geq4$ the value of $z_n$ is given by the formula \begin{align* z_n=\binom{\big\lfloor\frac{5(n-2){3\big\rfloor{n-2-\sum_{i=2^{n-1\binom{\big\lfloor\frac{3(n-i)+\delta{2\big\rfloor{n-i\cdot z_i, \end{align* where $\delta\in\mathbb{Z$ assumes different values within the sum at intervals of 5 or 6 terms. This allows to create an iterative algorithm which generates $z_n$ for each $n>12$. This has been proved for each $n\leq10000$. The number $z_{10000$ has 4527 digits.
New_results_on_the_stopping_time_behaviour_of_the_Collatz_3x_+_1_function.tex
\documentclass[10pt]{article}

\usepackage{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot
\chead{\scriptsize{M. Winkler - New results on the stopping time behaviour of the Collatz 3x + 1 function}}
\cfoot{\pagemark}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{listings}
\lstset{language=c,
        basicstyle=\footnotesize\ttfamily,
        keywordstyle=\bfseries\ttfamily\color{blau},
        commentstyle=\color{braun}\ttfamily,
        showstringspaces=false,
        flexiblecolumns=false,
        tabsize=2,
        numbers=left,
        numberstyle=\scriptsize,
        numberblanklines=false,
        stepnumber=1,
        numbersep=2pt,
        xleftmargin=10pt
       }

\usepackage{colortbl}
\definecolor{gruen}{rgb}{0.0, 0.5, 0.0}
\definecolor{braun}{rgb}{0.4, 0.2, 0.1}
\definecolor{blau}{rgb}{0.01, 0.28, 1.0}
\definecolor{lila}{rgb}{0.58, 0.0, 0.83}
\definecolor{orang}{rgb}{0.8, 0.33, 0.0}
\definecolor{rot}{rgb}{0.76, 0.13, 0.28}

\usepackage{hyperref}
\hypersetup{linktocpage,colorlinks=true,pdfborder={0 0 0}}
\newcommand{\OEIS}[1]{\href{https://oeis.org/#1}{#1}}

\usepackage{geometry}
\geometry{left=4.7cm, right=4.7cm, top=4cm, bottom=4cm}

\title{New results on the stopping time behaviour\\ of the Collatz 3x + 1 function}
\author{Mike Winkler\footnote{mike.winkler@gmx.de}}
\date{\small{March 27, 2015}}


\begin{document}
  
  \maketitle
  
  \begin{abstract}
	\noindent Let $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$. For the Collatz 3x + 1 function exists for each $n\in\mathbb{N}$ a set of different residue classes $(mod\ 2^{\sigma_n})$ of starting numbers $s$ with finite stopping time $\sigma(s)=\sigma_n$.
	Let $z_n$ be the number of these residue classes for each $n\geq0$ as listed in the OEIS as A100982.
	It is conjectured that for each $n\geq4$ the value of $z_n$ is given by the formula
	\begin{align*}
	  z_n=\binom{\big\lfloor\frac{5(n-2)}{3}\big\rfloor}{n-2}-\sum_{i=2}^{n-1}\binom{\big\lfloor\frac{3(n-i)+\delta}{2}\big\rfloor}{n-i}\cdot z_i,
	\end{align*}
	where $\delta\in\mathbb{Z}$ assumes different values within the sum at intervals of 5 or 6 terms. This allows to create an iterative algorithm which generates $z_n$ for each $n>12$. This has been proved for each $n\leq10000$. The number $z_{10000}$ has 4527 digits.
  \end{abstract}
  
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center}
  \scriptsize\textit{Keywords and phrases}: Collatz conjecture, Collatz graph, 3x + 1 problem, 3n + 1 function, stopping time, residue class, permutations in lexicographic ordering, binomial coefficients, iterative algorithm, binary tuple, Diophantine equation, self-reference, A020914, A177789, A100982
  
  \newpage  
  \normalsize
  
  \tableofcontents
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center} \begin{center}\end{center}
  \begin{center}\end{center}
  \small\textit{Note}: This paper is in the first place an analysis of the Collatz problem and contains no proofs. But all theorems in this text are based on algorithms, which are shown in this paper. In the sense of mathematical correctness all theorems and algorithms in this paper are conjectures.
  \\
  
  \newpage 
  \normalsize
  
  \section{The Collatz $3x + 1$ conjecture}
  
  The Collatz $3x + 1$ function is defined as a function $T:\mathbb{N}\rightarrow\mathbb{N}$ on
  the set of positive integers by
  \begin{align*}
    T(x):=\left\{\begin{array}{lcr}T_0:=\displaystyle{\frac{x}{2}} & \mbox{if $x$ is even},\\ \\T_1:=\displaystyle{\frac{3x+1}{2}} & \mbox{if $x$ is odd}.\end{array}\right.
  \end{align*}
  \\ \\
  Let $T^0(s)=s$ and $T^k(s)=T\left(T^{k-1}(s)\right)$ for $k\in\mathbb{N}$. Then the Collatz sequence for $s\in\mathbb{N}$ is $C(s)=\left(T^k(s)\mid k=0,1,2,3,\dotsc\right)$.
  \\ \\
  For example, the starting number $s=11$ generates the Collatz sequence
    \[C(11)=(11,17,26,13,20,10,5,8,4,2,1,2,1,2,1,\dotsc).\]
  A Collatz sequence can only assume two possible forms. Either it falls into a cycle or it grows to infinity. The unproved conjecture to this problem is that each Collatz sequence enters the cycle $(1,2)$.
  \\
  
  \section{Stopping time}
  
  \subsection{The stopping time $\sigma(s)$}
  
  Collatz's conjecture is equivalent to the conjecture that for each $s\in\mathbb{N},s>1$, there exists $k\in\mathbb{N}$ such that $T^k(s)<s$. The least $k\in\mathbb{N}$ such that $T^k(s)<s$ is called the stopping time of $s$, which we will denote by $\sigma(s)$. It is not hard to verify that
  \\ \\
  \hspace*{10mm} $\sigma(s)=1$ \quad if \, $s\equiv0\ (mod\ 2)$,\\
  \hspace*{10mm} $\sigma(s)=2$ \quad if \, $s\equiv1\ (mod\ 4)$,\\
  \hspace*{10mm} $\sigma(s)=4$ \quad if \, $s\equiv3\ (mod\ 16)$,\\
  \hspace*{10mm} $\sigma(s)=5$ \quad if \, $s\equiv11,23\ (mod\ 32)$,\\
  \hspace*{10mm} $\sigma(s)=7$ \quad if \, $s\equiv7,15,59\ (mod\ 128)$,\\
  \hspace*{10mm} $\sigma(s)=8$ \quad if \, $s\equiv39,79,95,123,175,199,219\ (mod\ 256)$,\\
  \hspace*{10mm} $\sigma(s)=10$	\, if \, $s\equiv287,347,367,423,507,575,583,\dotsc\ (mod\ 1024)$,\\
  \hspace*{10mm} and so forth.
  \\ \\
  Let $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$ then generally applies for all $n\in\mathbb{N},\,n\geq0$, that
  \begin{align*}
    \sigma(s)=\sigma_n \quad \text{if} \quad s\equiv x_1,x_2,x_3,\dotsc,x_z\ (mod\ 2^{\sigma_n}).
  \end{align*}
  \\
  Let $z_n$ be the number of residue classes $(mod\ 2^{\sigma_n})$ for each $n\geq0$. Then we have
  \begin{align*}
    z_0=1,\ z_1=1,\ z_2=1,\ z_3=2,\ z_4=3,\ z_5=7,\ z_6=12,\ z_7=30,\ \dotsc
  \end{align*}
  
  \noindent\textbf{Theorem 1}: Let $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$ then for each $n\in\mathbb{N},\,n\geq0$, there exists a set of $z_n$ residue classes $(mod\ 2^{\sigma_n})$ of starting numbers $s$ with finite stopping time $\sigma(s)=\sigma_n$. For each $n>6$ there is $z_n>2\cdot z_{n-1}$. \textit{(End of theorem)}
  \\ \\
  \textsc{Everett[1]} proves that almost all $k\in\mathbb{N}$ have finite stopping time, and \textsc{Terras[3]} gives a probability distribution function for stopping times.
  \\ \\
  The possible stopping times $\sigma(s)$ are listed in the OEIS as \OEIS{A020914}. The associated residue classes $(mod\ 2^{\sigma_n})$ are listed in the OEIS as \OEIS{A177789}. The number of residue classes $z_n$ for $n\geq1$ are listed in the OEIS as \OEIS{A100982}.
  \\ \\
  Appendix 5.4 shows a list of the first residue classes $(mod\ 2^{\sigma_n})$ up to $\sigma(s)=15$.
  \\
  
  \subsection{A stopping time term formula for odd $s$}
  
  \textbf{Theorem 2}: Let $C^a(s)=\left(T^k(s)\mid k=0,\dotsc,a\right)$ with $a\geq1$ be a finite subsequence of $C(s)$, and let $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$. Then for each $n\in\mathbb{N}$ an odd starting number $s$ has the stopping time $\sigma(s)=\sigma_n$, if the appropriate subsequence $C^{\sigma_n-1}(s)$ consists of $n$ odd terms, and $\alpha_i=k$, if and only if $T^k(s$) in $C^{\sigma_n-1}(s)$ is odd. Then, there is
  \begin{align}
    T^{\sigma_n}(s)=\frac{3^n}{2^{\sigma_n}}\cdot s+\sum_{i=1}^n \frac{3^{n-i}2^{\alpha_i}}{2^{\sigma_n}}<T^0(s).
  \end{align}
  \textit{(End of theorem)}
  \\ \\
  \textit{Example}: For $n=4$ there is $\sigma_4=\lfloor1+4\cdot\log_23\rfloor=7$. For $s=59$ we get by equation (1)
  \begin{align*}
    T^{7}(59)=\frac{3^4}{2^7}\cdot59+ \frac{3^3 2^0+3^2 2^1+3^1 2^3+3^0 2^4}{2^7}=38<59.
  \end{align*}
  \\
  \textit{Explanation}: The subsequence $C^6(59)=(59,89,134,67,101,152,76)$ consists of  four $(n=4)$ odd terms $59,89,67,101$. The powers of two $\alpha_i$ yield as follows: $T^0=59$ is odd, so $\alpha_1=0$. $T^1=89$ is odd, so $\alpha_2=1$. $T^2=134$ is even. $T^3=67$ is odd, so $\alpha_3=3$. $T^4=101$ is odd, so $\alpha_4=4$. $T^5=152$ is even. $T^6=76$ is even.
  \\ \\
  \textit{Note}: There is $\sigma(s)=7$ not only for $s=59$, but for every $s\equiv59\ (mod\ 2^7)$.
  \\
  
  \section{Diophantine equations}
  
  \subsection{Subsequences and their binary simplification}
  
  \textbf{Theorem 3}: Let $m=\big\lfloor\frac{2(n-2)}{3}\big\rfloor$ and $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$ for each $n\in\mathbb{N},\,n\geq4$. According to the conditions of theorem 2, if an odd starting number $s$ has the stopping time $\sigma(s)=\sigma_n$, then the first $m+n$ terms in $C(s)$ represents sufficiently the stopping time of $s$, because all further terms are even before the term $T^{\sigma_n}(s)<s$ is reached. \textit{(End of theorem)}
  \\ \\
  To simplify the distribution of the even and odd terms in $C(s)$ let "0" represents an even term and "1" represents an odd term.
  \\ \\
  \textit{Example}: For $n=4$ there is $m=\big\lfloor \frac{2(4-2)}{3}\big\rfloor=1$ and $\sigma_4=\lfloor1+4\cdot\log_23\rfloor=7$. Then for the subsequences $C^{\sigma_n}(s)$ there is
  \begin{align*}
    C^7(7)&=(7,11,17,26,13,20,10,5) & \text{simplified by} \quad (1,1,1,0,1,0,0,1),\\
    C^7(15)&=(15,23,35,53,80,40,20,10) & \text{simplified by} \quad (1,1,1,1,0,0,0,0),\\
    C^7(59)&=(59,89,134,67,101,152,76,38) & \text{simplified by} \quad (1,1,0,1,1,0,0,0).
  \end{align*}
  \\
  And for the sufficiently subsequences $C^{m+n-1}(s)$ there is
  \begin{align*}
    C^4(7)&=(7,11,17,26,13) & \text{simplified by} \quad (1,1,1,0,1),\\
    C^4(15)&=(15,23,35,53,80) & \text{simplified by} \quad (1,1,1,1,0),\\
    C^4(59)&=(59,89,134,67,101) & \text{simplified by} \quad (1,1,0,1,1).
  \end{align*}
  
  \subsection{Binary tuples}
  
  Let $m=\big\lfloor \frac{2(n-2)}{3}\big\rfloor$ for each $n\in\mathbb{N},\,n\geq4$.
  \\ \\
  Let $\mathcal{A}(n)$ be a binary $(m+n-2)$-tuple for each $n\in\mathbb{N},\,n\geq4$, defined by
    \[\mathcal{A}(n)=(a_1, \cdots, a_m,a_{m+1}, \cdots, a_{m+n-2}),\]
    \[with \quad a_1, \cdots, a_m:=0 \quad and \quad a_{m+1}, \cdots, a_{m+n-2}:=1.\]
  \\
  Let $\mathbb{A}_j(n)$ be the set of $\mathcal{A}(n)$ and all permutations in lexicographic ordering of $\mathcal{A}(n)$ for each $n\in\mathbb{N},\,n\geq4$, whereby $j$ is the number of all these tuples for each $n$, calculated by 
    \[j=\frac{(m+n-2)!}{m!\cdot(n-2)!}=\binom{\big\lfloor\frac{5(n-2)}{3}\big\rfloor}{n-2}.\]
  \\
  Let $\mathcal{B}(n)$ be a binary $(m+n)$-tuple for each $n\in\mathbb{N},\,n\geq4$, defined by
    \[\mathcal{B}(n)=(b_1, \cdots, b_{m+n}) \quad with \quad b_1:=1, \ b_2:=1.\]
  Let $\mathbb{B}_j(n)$ be the set of $j$ tuples $\mathcal{B}(n)$ for each $n\in\mathbb{N},\,n\geq4$, where $b_3, \cdots, b_{m+n}$ is equal to exactly one tuple of $\mathbb{A}_j(n)$.
  \\ \\
  \textit{Example}: For $n=7$ there is $m=3$ and $j=56$. Therefore we get the 8-tuple $\mathcal{A}(7)=(0,0,0,1,1,1,1,1)$. There are further 55 permutations in lexicographic ordering of $\mathcal{A}(7)$. Because of this $\mathbb{A}_{56}(7)$ contains 56 different 8-tuples, and $\mathbb{B}_{56}(7)$ contains 56 different 10-tuples  $\mathcal{B}(7)$. Appendix 5.2 shows these example in detail.
  \\
  
  \subsection{The Diophantine equations and their solutions}
  
  According to theorem 2, the behaviour of a Collatz sequence is clearly related to the way in which the powers of 2 are distributed among the powers of 3 in the term $3^{n-i}2^{\alpha_i}$ of equation (1).
  \\ \\
  According to theorem 3, for each $n\in\mathbb{N},n\geq4$, only for the $j$ binary tuples of $\mathbb{B}_j(n)$ the conditions of theorem 2 and equation (1) are complied.
  \\ \\
  \textbf{Theorem 4}:  Let $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$. By interpreting the binary tuples of $\mathbb{B}_j(n)$ as such a binary simplification for the even and odd terms in $C^{m+n-1}(s)$, there exists for each $n\in\mathbb{N},\,n\geq4$, according to theorem 2, for each binary tuple of $\mathbb{B}_j(n)$ a Diophantine equation 
  \begin{align}
    y=\frac{3^n}{2^{\sigma_n}}\cdot x+\sum_{i=1}^n \frac{3^{n-i}2^{\alpha_i}}{2^{\sigma_n}},
  \end{align}
  which has exactly one integer solution $(x,y)$ for $0<x<2^{\sigma_n}$, so that $y=T^{\sigma_n}(x)<x$ in $C(x)$. \textit{(End of theorem)}
  \\ \\
  \textbf{Theorem 5}: For each $n\geq4$ the $j$ solutions $(x,y)$ represent $j$ different residue classes of starting numbers $s$ with stopping time $4\leq\sigma(s)\leq\sigma_n$. More precise: For each $n\geq4$ the $j$ solutions represent $z_n$ residue classes of starting numbers $s$ with the stopping time $\sigma(s)=\sigma_n$, and $j-z_n$ residue classes of starting numbers $s$ with stopping time $4\leq\sigma(s)<\sigma_n$. For the $z_n$ solutions $(x,y)$ with $\sigma(x)=\sigma_n$, there is $x$ the smallest number of the residue class $[x]_{2^{\sigma_n}}$. \textit{(End of theorem)}
  \\ \\
  \textit{Example}: For $n=5$ there are $j=10$ integer solutions $(x,y)$. The next table shows the 10 binary tuples of $\mathbb{B}_{10}(5)$ and the appropriate integer solution $(x,y)$.
  \small
  \lstset{numbers=none}
  \begin{lstlisting}
             (1, 1, 0, 0, 1, 1, 1)   (211, 202)
             (1, 1, 0, 1, 0, 1, 1)   (107, 103)
             (1, 1, 0, 1, 1, 0, 1)   (123, 118)
             (1, 1, 0, 1, 1, 1, 0)   (219, 209)
             (1, 1, 1, 0, 0, 1, 1)   (183, 175)
             (1, 1, 1, 0, 1, 0, 1)   (199, 190)
             (1, 1, 1, 0, 1, 1, 0)   ( 39,  38)
             (1, 1, 1, 1, 0, 0, 1)   ( 79,  76)
             (1, 1, 1, 1, 0, 1, 0)   (175, 167)
             (1, 1, 1, 1, 1, 0, 0)   ( 95,  91)
  \end{lstlisting}
  \normalsize
  Of these 10 solutions, there are $z_5=7$ solutions for which $x$ has the stopping time $\sigma(x)=\sigma_5=8$, and $10-7=3$ solutions for which $x$ has stopping time $4\leq\sigma(x)<8$.
  \\ \\
  It is $\ 211\in[3]_{16}$, $\ 107\in[11]_{32}$ and $\ 183\in[23]_{32}$. So these 10 solutions represent 10 different residue classes of starting numbers $s$ with stopping time $4\leq\sigma(s)\leq8$. According to chapter 2, there is
  \\ \\
  \hspace*{10mm} $\sigma(s)=4$ \quad if \, $s\equiv3\ (mod\ 16)$,\\
  \hspace*{10mm} $\sigma(s)=5$ \quad if \, $s\equiv11,23\ (mod\ 32)$,\\
  \hspace*{10mm} $\sigma(s)=8$ \quad if \, $s\equiv39,79,95,123,175,199,219\ (mod\ 256)$.
  \\
  Note that for $\sigma(s)=8$ the 7 residue classes are equal to the values of $x$.
  \\ \\
  The next table shows the distribution of the solutions $(x,y)$ to the possible stopping times $\sigma(x)$ for $n=4,\dots,12$.
  \small
  \begin{center}
    \begin{tabular}{|c|c|r|r|r|r|r|r|r|r|r|}
      \hline & $n$&  4 & 5 &  6 &  7 &  8 &   9&  10 &   11 &   12\\
      \hline $\sigma(x)$&&&&    &    &    &    &     &      &     \\
      \hline  4 & &  0 & 1 &  1 &  6 & 28 &  36& 165 &  715 & 1001\\
      \hline  5 & &  0 & 2 &  2 & 10 & 42 &  56& 240 &  990 & 1430\\
      \hline  7 & &  3 & 0 &  0 &  3 & 15 &  18&  84 &  360 &  495\\
      \hline  8 & &    & 7 &  0 &  7 & 28 &  35& 147 &  588 &  840\\
      \hline 10 & &    &   & 12 &  0 & 12 &  12&  60 &  252 &  336\\
      \hline 12 & &    &   &    & 30 &  0 &   0&  30 &  150 &  180\\
      \hline 13 & &    &   &    &    & 85 &   0&  85 &  340 &  425\\
      \hline 15 & &    &   &    &    &    & 173&   0 &  173 &  173\\
      \hline 16 & &    &   &    &    &    &    & 476 &  476 &  476\\
      \hline 18 & &    &   &    &    &    &    &     &  961 &    0\\
      \hline 20 & &    &   &    &    &    &    &     &      & 2652\\
      \hline\hline Sum&  & 3& 10& 15& 56& 210& 330& 1287& 5005& 8008\\
      \hline
    \end{tabular}
  \end{center}
  \normalsize
  \textit{How to read}: "Sum" is equal to the value of $j$ and means the sum of the values of $\sigma(x)$ for each $n$. For $n=5$ there are 1+2+7=10 integer solutions $(x,y)$. From these solutions, there are 7 with $\sigma(x)=8$, 2 with $\sigma(x)=5$ and 1 with $\sigma(x)=4$. No entry is equal to "0".
  \\ \\
  The PARI/GP programs 1 - 3 in Appendix 5.1 make the algorithm of this chapter more clearly. Program 2 generates the table of page 6, and program 3 computes the values of the upper table. Appendix 5.3 shows $\mathbb{B}_j(n)$ with integer solutions $(x,y)$ for $n=4,\dotsc,7$.
  \\
  
  \subsection{Analysis of the solutions}
  
  When analysing the entries of the last table, we can find that for each $\sigma(x)$ the number of solutions for all $n\geq4$ are integer multiples of
  \textcolor{rot}{$z_n$}.
  \small
  \begin{center}
    \begin{tabular}{|c|c|r|r|r|r|r|r|r|r|r|}
      \hline & $n$&  4 & 5 &  6 &  7 &  8 &   9&  10 & 11& 12\\
      \hline $\sigma(x)$&&&&   &   &    &   &     &   &  \\
      \hline  4 & & $0\cdot1$ & $1\cdot1$ & $1\cdot1$ & $\textcolor{lila}6\cdot1$ & $\textcolor{braun}{28}\cdot1$ & $\textcolor{lila}{36}\cdot1$ & $\textcolor{braun}{165}\cdot1$ & $\textcolor{blau}{715}\cdot1$ & $\textcolor{braun}{1001}\cdot1$\\
      \hline  5 & & $0\cdot2$ & $1\cdot2$ & $1\cdot2$ & $\textcolor{lila}5\cdot2$ & $\textcolor{braun}{21}\cdot2$ & $\textcolor{lila}{28}\cdot2$ & $\textcolor{braun}{120}\cdot2$ & $\textcolor{blau}{495}\cdot2$ & $\textcolor{braun}{715}\cdot2$\\
      \hline  7 & & $1\cdot\textcolor{rot}3$ &  $0\cdot3$ &  $0\cdot3$ & $\textcolor{lila}1\cdot3$ & $\textcolor{braun}5\cdot3$ & $\textcolor{lila}6\cdot3$ & $\textcolor{braun}{28}\cdot3$ & $\textcolor{blau}{120}\cdot3$ & $\textcolor{braun}{165}\cdot3$\\
      \hline  8 & &    &  $1\cdot\textcolor{rot}7$ &  $0\cdot7$ & $\textcolor{lila}1\cdot7$ & $\textcolor{braun}4\cdot7$ & $\textcolor{lila}5\cdot7$ & $\textcolor{braun}{21}\cdot7$ & $\textcolor{blau}{84}\cdot7$ & $\textcolor{braun}{120}\cdot7$\\
      \hline 10 & &    &   & $1\cdot\textcolor{rot}{12}$ &  $0\cdot12$ & $\textcolor{braun}1\cdot12$ & $\textcolor{lila}1\cdot12$ & $\textcolor{braun}5\cdot12$ & $\textcolor{blau}{21}\cdot12$ & $\textcolor{braun}{28}\cdot12$\\
      \hline 12 & &    &   &   & $1\cdot\textcolor{rot}{30}$ & $0\cdot30$ & $0\cdot30$ & $\textcolor{lila}1\cdot30$ & $\textcolor{braun}5\cdot30$ & $\textcolor{lila}6\cdot30$\\
      \hline 13 & &    &   &   &   & $1\cdot\textcolor{rot}{85}$ & $0\cdot85$ & $\textcolor{lila}1\cdot85$ & $\textcolor{braun}4\cdot85$ & $\textcolor{lila}5\cdot85$\\
      \hline 15 & &    &   &   &   &    &  $1\cdot\textcolor{rot}{173}$ & $0\cdot175$ & $\textcolor{braun}1\cdot173$ & $\textcolor{lila}1\cdot173$\\
      \hline 16 & &    &   &   &   &    &    &  $1\cdot\textcolor{rot}{476}$& $\textcolor{braun}1\cdot476$ & $\textcolor{lila}1\cdot476$\\
      \hline 18 & &    &   &   &   &    &    &     &  $1\cdot\textcolor{rot}{961}$ & $0\cdot961$\\
      \hline 20 & &    &   &   &   &    &    &     & & $1\cdot\textcolor{rot}{2652}$\\
      \hline\hline Sum& & 3& 10& 15& 56& 210& 330& 1287& 5005& 8008\\
      \hline
    \end{tabular}
  \end{center}
  \normalsize
  
  \noindent It is not hard to recognize that the multiplying factors of $z_n$ like $1,4,5,6,21,\dotsc$ are numbers of Pascal's triangle. It seems that these numbers are given for each $n$ by the following binomial coefficients for $k\in\mathbb{N}$. Note the different colours.
  \begin{align*}
    \binom{\big\lfloor\frac{3k-2}{2}\big\rfloor}{k}=& \ \textcolor{lila}{0,1,1,5,6,28,36,165,220,1001,1365,6188,8568,38760,\dotsc}
    \\ \\
    \binom{\big\lfloor\frac{3k-1}{2}\big\rfloor}{k}=& \ \textcolor{braun}{1,1,4,5,21,28,120,165,715,1001,4368,6188,27132,\dotsc}
    \\ \\
    \binom{\big\lfloor\frac{3k}{2}\big\rfloor}{k}=& \ \textcolor{blau}{1,3,4,15,21,84,120,495,715,3003,4368,18564,27132,\dotsc}
  \end{align*}
  
  \noindent Now we can conjecture that for each $n\geq4$ the value of $z_n$ is equal to the difference of $j$ and the sum of $n-2$ terms, where each term is given by the product of a special binomial coefficient and a number $z_n$ for $n=2,\dotsc,n-1$. Let
  \begin{align}
    z_n=\binom{\big\lfloor\frac{5(n-2)}{3}\big\rfloor}{n-2}-\sum_{i=2}^{n-1}\binom{\big\lfloor\frac{3(n-i)+\delta}{2}\big\rfloor}{n-i}\cdot z_i,
  \end{align}
  where $\delta\in\mathbb{Z}$ assumes different values within the sum at intervals of 5 or 6 terms. The example for $n=13$ on page 9 and the algorithm on page 10 will make this clear.
  \\ \\
  The next table shows the conjectured values for $n=13,\dotsc,19$. These values are not computed with program 3, but generated with program 4.
  \small
  \begin{center}
    \begin{tabular}{|c|c|r|r|r|r|r|r|r|}
      \hline&$n$& 13& 14& 15& 16& 17& 18& 19\\
      \hline$\sigma(x)$&&&&&&&&\\
      \hline4&&$\textcolor{blau}{4368}\cdot1$ & $\textcolor{gruen}{18564}\cdot1$ & $\textcolor{blau}{27132}\cdot1$ & $\textcolor{gruen}{116280}\cdot1$ &  $\textcolor{orang}{490314}\cdot1$ & $\textcolor{gruen}{735471}\cdot1$ & $\textcolor{orang}{3124550}\cdot1$\\
      \hline5&&$\textcolor{blau}{3003}\cdot2$ & $\textcolor{gruen}{12376}\cdot2$ & $\textcolor{blau}{18564}\cdot2$ & $\textcolor{gruen}{77520}\cdot2$ &  $\textcolor{orang}{319770}\cdot2$ & $\textcolor{gruen}{490314}\cdot2$ & $\textcolor{orang}{2042975}\cdot2$\\
      \hline7&&$\textcolor{blau}{715}\cdot3$ & $\textcolor{gruen}{3003}\cdot3$ & $\textcolor{blau}{4368}\cdot3$ & $\textcolor{gruen}{18564}\cdot3$ & $\textcolor{orang}{77520}\cdot3$ &   $\textcolor{gruen}{116280}\cdot3$ & $\textcolor{orang}{490314}\cdot3$\\
      \hline8&&$\textcolor{blau}{495}\cdot7$ & $\textcolor{gruen}{2002}\cdot7$ & $\textcolor{blau}{3003}\cdot7$ & $\textcolor{gruen}{12376}\cdot7$ &  $\textcolor{orang}{50388}\cdot7$ & $\textcolor{gruen}{77520}\cdot7$ & $\textcolor{orang}{319770}\cdot7$\\
      \hline10&&$\textcolor{blau}{120}\cdot12$ & $\textcolor{gruen}{495}\cdot12$ & $\textcolor{blau}{715}\cdot12$ & $\textcolor{gruen}{3003}\cdot12$ &  $\textcolor{orang}{12376}\cdot12$ & $\textcolor{gruen}{18564}\cdot12$ & $\textcolor{orang}{77520}\cdot12$\\
      \hline12&&$\textcolor{braun}{28}\cdot30$ & $\textcolor{blau}{120}\cdot30$ & $\textcolor{braun}{165}\cdot30$ & $\textcolor{blau}{715}\cdot30$ & $\textcolor{gruen}{3003}\cdot30$ & $\textcolor{blau}{4368}\cdot30$ & $\textcolor{gruen}{18564}\cdot30$\\
      \hline13&&$\textcolor{braun}{21}\cdot85$ & $\textcolor{blau}{84}\cdot85$& $\textcolor{braun}{120}\cdot85$ & $\textcolor{blau}{495}\cdot85$ & $\textcolor{gruen}{2002}\cdot85$ & $\textcolor{blau}{3003}\cdot85$ & $\textcolor{gruen}{12376}\cdot85$\\
      \hline15&&$\textcolor{braun}{5}\cdot173$ & $\textcolor{blau}{21}\cdot173$ & $\textcolor{braun}{28}\cdot173$ & $\textcolor{blau}{120}\cdot173$ & $\textcolor{gruen}{495}\cdot173$ &
      $\textcolor{blau}{715}\cdot173$ & $\textcolor{gruen}{3003}\cdot173$\\
      \hline16&&$\textcolor{braun}{4}\cdot476$ & $\textcolor{blau}{15}\cdot476$ & $\textcolor{braun}{21}\cdot476$ & $\textcolor{blau}{84}\cdot476$ & $\textcolor{gruen}{330}\cdot476$ & $\textcolor{blau}{495}\cdot476$ & $\textcolor{gruen}{2002}\cdot476$\\
      \hline18&&$\textcolor{braun}{1}\cdot961$ &  $\textcolor{blau}{4}\cdot961$ & $\textcolor{braun}{5}\cdot961$ & $\textcolor{blau}{21}\cdot961$ & $\textcolor{gruen}{84}\cdot961$ & $\textcolor{blau}{120}\cdot961$ & $\textcolor{gruen}{495}\cdot961$\\
      \hline20&& $0\cdot2652$ & $\textcolor{braun}{1}\cdot2652$ & $\textcolor{lila}{1}\cdot2652$ & $\textcolor{braun}{5}\cdot2652$ & $\textcolor{blau}{21}\cdot2652$ & $\textcolor{braun}{28}\cdot2652$ & $\textcolor{blau}{120}\cdot2652$\\
      \hline21&&$1\cdot\textcolor{rot}{8045}$ & $\textcolor{braun}{1}\cdot8045$ & $\textcolor{lila}{1}\cdot8045$ & $\textcolor{braun}{4}\cdot8045$ & $\textcolor{blau}{15}\cdot8045$ & $\textcolor{braun}{21}\cdot8045$ & $\textcolor{blau}{84}\cdot8045$\\
      \hline23&&&$1\cdot\textcolor{rot}{17637}$ & $0\cdot17637$ & $\textcolor{braun}{1}\cdot17637$ & $\textcolor{blau}{4}\cdot17637$ & $\textcolor{braun}{5}\cdot17637$ & $\textcolor{blau}{21}\cdot17637$\\
      \hline24&&&&$1\cdot\textcolor{rot}{51033}$ & $\textcolor{braun}{1}\cdot51033$ & $\textcolor{blau}{3}\cdot51033$ & $\textcolor{braun}{4}\cdot51033$ & $\textcolor{blau}{15}\cdot51033$\\
      \hline26&&&&&$1\cdot\textcolor{rot}{108950}$ & $\textcolor{blau}{1}\cdot108950$ & $\textcolor{braun}{1}\cdot108950$ & $\textcolor{blau}{4}\cdot108950$\\
      \hline27&&&&&&$1\cdot\textcolor{rot}{312455}$ & $\textcolor{braun}{1}\cdot312455$ & $\textcolor{blau}{3}\cdot312455$\\
      \hline29&&&&&&&$1\cdot\textcolor{rot}{663535}$ & $\textcolor{blau}{1}\cdot663535$\\
      \hline31&&&&&&&&$1\cdot\textcolor{rot}{1900470}$\\
      \hline\hline Sum&&31824& 125970& 203490& 817190& 3268760& 5311735& 21474180\\
      \hline
    \end{tabular}
  \end{center}  
  \normalsize
  
  \noindent For $n=14,\dotsc,19$ we need two new binomial coefficients. Note the new colours.
  \begin{align*}
    \binom{\big\lfloor\frac{3k+1}{2}\big\rfloor}{k}=& \ \textcolor{gruen}{2,3,10,15,56,84,330,495,2002,3003,12376,18564,77520,\dotsc}
    \\ \\
    \binom{\big\lfloor\frac{3k+2}{2}\big\rfloor}{k}=& \ \textcolor{orang}{2,6,10,35,56,210,330,1287,2002,8008,12376,50388,77520,\dotsc}
  \end{align*}
  \\
  
  \noindent\textit{Example}: This example shows the working of equation (3) for $n=13$.
  \begin{align*}
    z_n&=\binom{\big\lfloor\frac{5(n-2)}{3}\big\rfloor}{n-2}-\sum_{i=2}^{n-1}\binom{\big\lfloor\frac{3(n-i)+\delta}{2}\big\rfloor}{n-i}\cdot z_i
    \\ \\
    \textcolor{rot}{z_{n}}&=\binom{\big\lfloor\frac{5(n-2)}{3}\big\rfloor}{n-2}-\textcolor{blau}{\sum_{i=2}^{6}\binom{\big\lfloor\frac{3(n-i)+0}{2}\big\rfloor}{n-i}}\cdot z_i-\textcolor{braun}{\sum_{i=7}^{11}\binom{\big\lfloor\frac{3(n-i)-1}{2}\big\rfloor}{n-i}}\cdot z_i-\sum_{i=12}^{12}\binom{\big\lfloor\frac{3(n-i)-2}{2}\big\rfloor}{n-i}\cdot z_i
    \\ \\
    \textcolor{rot}{z_{13}}&=\binom{\big\lfloor\frac{5(13-2)}{3}\big\rfloor}{13-2}-\textcolor{blau}{\sum_{i=2}^{6}\binom{\big\lfloor\frac{3(13-i)}{2}\big\rfloor}{13-i}}\cdot z_i-\textcolor{braun}{\sum_{i=7}^{11}\binom{\big\lfloor\frac{3(13-i)-1}{2}\big\rfloor}{13-i}}\cdot z_i-\binom{\big\lfloor\frac{3(13-12)-2}{2}\big\rfloor}{13-12}\cdot z_{12}
    \\ \\
    \textcolor{rot}{z_{13}}&=\binom{\big\lfloor\frac{55}{3}\big\rfloor}{11}-\textcolor{blau}{\sum_{i=2}^{6}\binom{\big\lfloor\frac{39-i}{2}\big\rfloor}{13-i}}\cdot z_i-\textcolor{braun}{\sum_{i=7}^{11}\binom{\big\lfloor\frac{38-i}{2}\big\rfloor}{13-i}}\cdot z_i-\binom{\big\lfloor\frac{1}{2}\big\rfloor}{1}\cdot z_{12}
    \\ \\
    \textcolor{rot}{z_{13}}&=31824-\textcolor{blau}{4368}\cdot 1-\textcolor{blau}{3003}\cdot 2-\textcolor{blau}{715}\cdot 3-\textcolor{blau}{495}\cdot 7-\textcolor{blau}{120}\cdot 12-\textcolor{braun}{28}\cdot 30\\&\quad\quad\quad\ \ \, -\textcolor{braun}{21}\cdot 85-\textcolor{braun}{5}\cdot 173-\textcolor{braun}{4}\cdot 476-\textcolor{braun}{1}\cdot961-0\cdot2652
    \\ \\
    \textcolor{rot}{z_{13}}&=31824-17424-6355=\textcolor{rot}{8045}.
    \\
  \end{align*}
  
  \subsection{An iterative stopping time algorithm}
  
  The results of the analysis of the solutions and equation (3) enables us to devise an iterative algorithm which generates with only twelve initial numbers $z_1,\dotsc,z_{12}$ each further number $z_n$ and also the number of all integer solutions $(x,y)$ for $0<x<2^{\sigma_n}$ from the Diophantine equation (2) with same stopping time $\sigma(x)$ as seen in the tables on page 7 and 8.
  \\ \\
  The next PARI/GP program 4 shows this algorithm, which outputs a list of the numbers $z_n$ for $12<n\leq limit$, as listed in the OEIS as \href{https://oeis.org/A100982/list}{simple list} of A100982.
  \\
  
  \newpage
  
  \noindent The correctness of this algorithm for the values of $z_n$ has been proved with a counting-algorithm by \textsc{Roosendaal/Noe[4]} for each $n\leq10000$. The number $z_{10000}$ has 4527 digits. Maybe the algorithm must slightly be modified for higher values of $n$. But the basic structure as seen in equation (3) will never been changed.
  \\
  \lstset{numbers=left}
  \begin{lstlisting}
  {/* Program 4 - The Winkler stopping time algorithm */
   limit=10000;
   zn=[]; for(k=1, limit, zn=concat(zn,k));
   /* 12 initial numbers */
   zn[1]=1;   zn[2]=1;    zn[3]=2;    zn[4]=3;
   zn[5]=7;   zn[6]=12;   zn[7]=30;   zn[8]=85;
   zn[9]=173; zn[10]=476; zn[11]=961; zn[12]=2652;
   /* main algorithm */
   for(n=12, limit,
     Sum=0; a=-1;
     for(k=0, n-11, a=a+(-1)^floor(2*(k-2)/3));
     for(i=2, 6, Sum=Sum+binomial(floor((3*(n-i)+a)/2),n-i)*zn[i]);
     for(i=7, 11, Sum=Sum+binomial(floor((3*(n-i)+a-1)/2),n-i)*zn[i]);
     for(h=0, floor((limit-12)/6),
       v=12; w=5;
   	   if((h<58) && (frac((h-6)/9)==0), w=4);
   	   for(k=0, 5, if(h>=k*9+7, v--));
   	   c2=58;
   	   for(k=1, floor(n/20),
         if(frac(k/2)!=0, d=52; e=5, d=61; e=6);
         c1=c2; c2=c1+d;
   	     if((h>=c1) && (h<c2) && (frac((h-6+k*2)/9)==0), w=4);
   	     for(f=0, e, if(h>=f*9+c1+1, v--));
   	   );
       p=0; q=0;
       for(i=v+h*6, v+h*6+w,
         delta=a-2-h;
         Sum=Sum+binomial(floor((3*(n-i)+delta)/2),n-i)*zn[i];
         z_n=binomial(floor(5*(n-2)/3),n-2)-Sum;
         r1=0; r2=0; p++;
         for(t=0, floor(n/15),
           c1=5; c2=6; d=0;
           if(t>c1, r1=2); if(t>c2, r2=2);
   	       for(k=2, floor(n/50),
   	         if(frac(k/2)==0, d=6, d=7);
   	         c1=c1+d; c2=c2+d;
   	         if(t>c1, r1=k*2); if(t>c2, r2=k*2);
   	       );
           for(k=t*9-r2, t*9+8-r1,
             if((n>k*6-t) && (h==k-2) && (p==n-k*6+t),
               print(n" "z_n); zn[n]=z_n; q=1; break;
             );
           );
           if(q==1, break);
         );
         if(q==1, break);
       );
       if(q==1, break);
     );
   );
  }
  \end{lstlisting}
  
  \newpage
  
  \noindent The lines 12, 13 and 28, 29 of program 4 show the main calculations of equation (3). The only complicated thing is the computation of the pattern of the lower and upper bounds of the index of summation $i$ and the appropriate value of $\delta$.
  \\ \\
  The upper limits of the \textit{for loops} in the lines 19, 31 and 34 are dependent on the value of $n$ or \textit{limit} and must be large enough. The bigger the values of these upper limits, the longer the runtime of the algorithm. For example, for the small fixed upper limits 2, 24 and 2 the algorithm computes up to $n=1024$ much faster.
  \\ \\
  The PARI/GP programs 5 and 6 in Appendix 5.1 show this algorithm with different outputs as seen in the tables on page 7 and 8.
  \\ \\
  For another algorithm which generates the values of $z_n$ by a different way see \href{http://mikewinkler.co.nf/collatz\_algorithm.pdf}{\textsc{Winkler[7]}} and  \href{http://mikewinkler.co.nf/collatz\_teilfolgen\_2014.pdf}{\textsc{Winkler[10]}}. But this older algorithm from 2011 is not yet immature.
  \\
  
  \section{Conclusion and some answers}
  
  \subsection{A general stopping time theorem}
  
  We see that the fact, if an odd starting number $s$ has finite stopping time is only dependent on how the first $m$ even and $n$ odd terms are distributed in $C^{m+n-1}(s)$ and $C^{\sigma_n-1}(s)$. Now we are able to formulate a general stopping time theorem without the use of equation (1).
  \\ \\
  \textbf{Theorem 6}: Let $m=\big\lfloor \frac{2(n-2)}{3}\big\rfloor$ and $\sigma_n=\lfloor1+n\cdot\log_23\rfloor$. For all $n\in\mathbb{N},\,n\geq4$, an odd starting number $s$ has stopping time $4\leq\sigma(s)\leq\sigma_n$, if the binary simplification of the even and odd terms in the subsequence $C^{m+n-1}(s)$ is equal to a binary tuple of $\mathbb{B}_j(n)$ and if the subsequence $C^{\sigma_n-1}(s)$ consists of $n$ odd terms. \textit{(End of theorem)}
  \\
  
  \subsection{\small Why the Collatz conjecture is a Diophantine equation problem?}
  
  According to theorem 1, the Collatz conjecture is true, if the set of the residue classes $(mod\ 2^{\sigma_n})$ of starting numbers for all $n\geq0$ is equal to $\mathbb{N}$.  According to theorem 4 and 5, all possible residue classes for the stopping times are given by the Diophantine equations as their integer solutions. Therefore the Collatz conjecture is true, if there exists for each necessary residue class an appropriate Diophantine equation.
  \\
  
  \subsection{\small What are the consequences, if there exists another cycle than (1,2) or a sequence with infinite growth?}
  
  Then, according to theorem 6, there exist an odd starting number $s$ without stopping time. This starting number $s$ has the property that for each $n\in\mathbb{N},\,n\geq4$, there is no accordance of the binary simplification of the even and odd terms in the subsequence $C^{m+n-1}(s)$ and a binary tuple of $\mathbb{B}_j(n)$, or the subsequence $C^{\sigma_n-1}(s)$ consists not of $n$ odd terms.
  \\
  
  \subsection{\small Why has a small starting number like $s=27$ a so comparatively large stopping time $\sigma(27)=59$?}
  
  Because out of the finite sets of Diophantine equations for each $n\geq4$ not until $n=37$ a Diophantine equation has the solution $x=27$ or the residue class $27\ (mod\ 2^{59})$. Another answer: Not until $n=37$ the binary simplification of the even and odd terms in the subsequence $C^{m+n-1}(27)$ is equal to a binary tuple of $\mathbb{B}_j(n)$ while the subsequence $C^{\sigma_n-1}(27)$ consists of $n$ odd terms.
  \\
  
  \subsection{Future work on the Collatz graph}
  
  My future work is about the self-reference of the Collatz graph. I have devised two different directed graphs\footnote{See figure 1 on the next page.}, which illustrate that there exists a self-reference of odd subsequences $C^a(s)$, clarified by the same background colour between both graphs and arrows in the first graph.
  \\ \\
  This means on the one hand that odd subsequences $C^a(s)$ with a small number of steps to reach 1 are connected with subsequences $C^a(2s\pm1)$ or $C^a(4s\pm3)$ with a big number of steps to reach 1. For example $C^3(15)=(15,23,35,53)$ and $C^3(31)=(31,47,71,107)$.
  \\ \\
  And on the other hand shows the first graph why and where to find numbers in the second graph. For example shows the green arrow in the first graph why $C^1(27)=(27,41)$ must hit the subsequence $C^4(31)=(31,47,71,107,161)$. In the second graph the subsequence $C^6(27)=(27,41,31,47,71,107,161)$ is located in column 9.
  \\ \\
  This is only a very brief and insufficient exposition of the theory of self-reference. For details of the construction of the second graph and its correctness see \href{http://mikewinkler.co.nf/collatz\_konstruktion.pdf}{\textsc{Winkler[6]}}. Click \href{http://mikewinkler.co.nf/collatz\_tree2.pdf}{here} for a picture of the second graph which contains all odd numbers up to 341, and \href{http://mikewinkler.co.nf/collatz\_tree1.pdf}{here} for the complete structure up to column 6.
  \\
  
  \newpage
  
  \begin{figure}[ht]
  	\centering
    \includegraphics[scale=0.5]{collatz_graph_self-reference.png}
    \caption{Two directed Collatz graphs}
  \end{figure}
  
  \newpage
  
  \section{Appendix}
  
  \subsection{Algorithms in PARI/GP}
  
  The programs 1 - 3 use the function "NextPermutation(a)", which generates all permutations in lexicographic ordering of a binary tuple $\mathcal{A}(n)$.
  
  \begin{lstlisting}
  NextPermutation(a)=
  {
   i=#a-1;
   while(!(i<1 || a[i]<a[i+1]), i--);
   if(i<1, return(0));
   k=#a;
   while(!(a[k]>a[i]), k--);
   t=a[k]; a[k]=a[i]; a[i]=t;
   for(k=i+1, (#a+i)/2,
     t=a[k]; a[k]=a[#a+1+i-k]; a[#a+1+i-k]=t;
   );
   return(a); 
  }
  \end{lstlisting}
  
  \noindent\\ \\ Program 1 computes all integer solutions $(x,y)$ for $0<x<2^{\sigma_n}$ from the Diophantine equation (2) for $n=7$.
  \begin{lstlisting}
  {/* Program 1 */
   n=7;
   m=floor(2*(n-2)/3);
   Sigma=floor(1+n*log(3)/log(2));
   j=(m+(n-2))!/(m!*(n-2)!);
   /* vectors for binary tuple */
   Alpha=[0,0,0,0,0,0,0];
       A=[0,0,0,1,1,1,1,1];
       B=[1,1,0,0,0,0,0,0,0,0];
   z=0; q=0;
   until(z==j, z++;
     /* generate B(n) from A(n) */
     for(i=1, m+n-2, B[2+i]=A[i]);
     /* determine the n values for Alpha[i] */
     i=1; for(k=1, m+n, if(B[k]==1, Alpha[i]=k-1; i++));
     /* calculate integer solutions from Diophantine equation */
     for(x=0, 2^Sigma,
       Sum=0; for(i=1, n, Sum=Sum+3^(n-i)*2^Alpha[i]);
       y=(3^n*x+Sum)/2^Sigma;
       if(frac(y)==0, print(B"   ("x", "y")"); q++);
     );
     A=NextPermutation(A);
   );
   print("There are "q" integer solutions (x,y) for n=7.");
  }
  \end{lstlisting}
  
  \newpage
  
  \noindent Program 2 computes all integer solutions $(x,y)$ for $0<x<2^{\sigma_n}$ from the Diophantine equation (2) for $2\leq n\leq limit$.
  \begin{lstlisting}
  {/* Program 2 */
   limit=100;
   for(n=2, limit,
     m=floor(2*(n-2)/3);
     Sigma=floor(1+n*log(3)/log(2));
     j=(m+(n-2))!/(m!*(n-2)!);
     /* generate vectors for binary tuple */
     Alpha=[]; for(i=1, n, Alpha=concat(Alpha,i));
               for(i=1, n, Alpha[i]=0);
     A=[]; for(i=1, m+n-2, A=concat(A,i));
           for(i=1, m+n-2, if(i<=m, A[i]=0, A[i]=1));
     B=[]; for(i=1, m+n, B=concat(B,i));
           for(i=1, m+n, if(i<=2, B[i]=1, B[i]=0));
     z=0; q=0;
     until(z==j, z++;
       /* generate B(n) from A(n) */
       for(i=1, m+n-2, B[2+i]=A[i]);
       /* determine the n values for Alpha[i] */
       i=1; for(k=1, m+n, if(B[k]==1, Alpha[i]=k-1; i++));
       /* calculate integer solutions from Diophantine equation */
       for(x=0, 2^Sigma,
         Sum=0; for(i=1, n, Sum=Sum+3^(n-i)*2^Alpha[i]);
         y=(3^n*x+Sum)/2^Sigma;
         if(frac(y)==0, print(B"   ("x", "y")"); q++);
       );
       A=NextPermutation(A);
     );
     print("There are "q" integer solutions (x,y) for n="n".");
     print;
   );
  }
  \end{lstlisting}
  
  \noindent\\ Program 3 computes all integer solutions $(x,y)$ for $0<x<2^{\sigma_n}$ from the Diophantine equation (2) for $2\leq n\leq10$ and counts the solutions with same stopping time $\sigma(x)$.
  \begin{lstlisting}
  {/* Program 3 */
   for(n=2, 10,
     m=floor(2*(n-2)/3);
     Sigma=floor(1+n*log(3)/log(2));
     j=(m+(n-2))!/(m!*(n-2)!);
     /* initialize stopping time counters */
     w1=w2=w3=w4=w5=w6=w7=w8=w9=w10=0;
     /* generate vectors for binary tuple */
     Alpha=[]; for(i=1, n, Alpha=concat(Alpha,i));
               for(i=1, n, Alpha[i]=0);
     A=[]; for(i=1, m+n-2, A=concat(A,i));
           for(i=1, m+n-2, if(i<=m, A[i]=0, A[i]=1));
     B=[]; for(i=1, m+n, B=concat(B,i));
           for(i=1, m+n, if(i<=2, B[i]=1, B[i]=0));
     z=0; q=0;
     until(z==j, z++;
       /* generate B(n) from A(n) */
       for(i=1, m+n-2, B[2+i]=A[i]);
       /* determine the n values for Alpha[i] */
       i=1; for(k=1, m+n, if(B[k]==1, Alpha[i]=k-1; i++));
       /* calculate integer solutions from Diophantine equation */
       for(x=0, 2^Sigma,
         Sum=0; for(i=1, n, Sum=Sum+3^(n-i)*2^Alpha[i]);
         y=(3^n*x+Sum)/2^Sigma;
         if(frac(y)==0, q++;
           /* calculate stopping time ST of x */
           ST=0; c=x;
           until(c<x, if(frac(c/2)<>0, ST++; c=(3*c+1)/2);
             if(frac(c/2)==0, ST++; c=c/2;
               if((frac(c/2)<>0) && (c<x), break);
             );
           );   
           if(ST==2, w1++); if(ST==4, w2++); if(ST==5, w3++);
           if(ST==7, w4++); if(ST==8, w5++); if(ST==10, w6++);
           if(ST==12, w7++); if(ST==13, w8++); if(ST==15, w9++);
           if(ST==16, w10++);
         );
       );
       A=NextPermutation(A);
     );
     print;
     print("There are "q" integer solutions (x,y) for n="n".");
     print("number of x with ST= 2: "w1);
     print("number of x with ST= 4: "w2);
     print("number of x with ST= 5: "w3);
     print("number of x with ST= 7: "w4);
     print("number of x with ST= 8: "w5);
     print("number of x with ST=10: "w6);
     print("number of x with ST=12: "w7);
     print("number of x with ST=13: "w8);
     print("number of x with ST=15: "w9);
     print("number of x with ST=16: "w10);
   );
  }
  \end{lstlisting}
  \normalsize
  Appendix 5.3 shows the output of program 2 for $n=4,\dotsc,7$.
  
  \newpage
  
  \noindent Program 5 is equal to program 4 from chapter 3.5 but prints the number of all integer solutions as seen in the table on page 8.
  \begin{lstlisting}
  {/* Program 5 - The Winkler stopping time algorithm */
   limit=10000; zn=[]; for(k=1, limit, zn=concat(zn,k));
   /* 12 initial numbers */
   zn[1]=1;   zn[2]=1;    zn[3]=2;    zn[4]=3;
   zn[5]=7;   zn[6]=12;   zn[7]=30;   zn[8]=85;
   zn[9]=173; zn[10]=476; zn[11]=961; zn[12]=2652;
   /* main algorithm */
   for(n=12, limit,
     Sum=0; a=-1;
     for(k=0, n-11, a=a+(-1)^floor(2*(k-2)/3));
     for(i=2, 6, Sum=Sum+binomial(floor((3*(n-i)+a)/2),n-i)*zn[i];
       print(binomial(floor((3*(n-i)+a)/2),n-i)" * "zn[i]);
     );
     for(i=7, 11, Sum=Sum+binomial(floor((3*(n-i)+a-1)/2),n-i)*zn[i];
       print(binomial(floor((3*(n-i)+a-1)/2),n-i)" * "zn[i]);
     );
     for(h=0, floor((limit-12)/6),
       v=12; w=5;
   	   if((h<58) && (frac((h-6)/9)==0), w=4);
   	   for(k=0, 5, if(h>=k*9+7, v--));
   	   c2=58;
   	   for(k=1, floor(n/20),
         if(frac(k/2)!=0, d=52; e=5, d=61; e=6);
         c1=c2; c2=c1+d;
   	     if((h>=c1) && (h<c2) && (frac((h-6+k*2)/9)==0), w=4);
   	     for(f=0, e, if(h>=f*9+c1+1, v--));
   	   );
       p=0; q=0;
       for(i=v+h*6, v+h*6+w,
         delta=a-2-h;
         Sum=Sum+binomial(floor((3*(n-i)+delta)/2),n-i)*zn[i];
         if(n>12, print(binomial(floor((3*(n-i)+a-2-h)/2),n-i)" * "zn[i]));
         z_n=binomial(floor(5*(n-2)/3),n-2)-Sum;
         r1=0; r2=0; p++;
         for(t=0, floor(n/15),
           c1=5; c2=6; d=0;
           if(t>c1, r1=2); if(t>c2, r2=2);
   	       for(k=2, floor(n/50),
   	         if(frac(k/2)==0, d=6, d=7);
   	         c1=c1+d; c2=c2+d;
   	         if(t>c1, r1=k*2); if(t>c2, r2=k*2);
   	       );
           for(k=t*9-r2, t*9+8-r1,
             if((n>k*6-t) && (h==k-2) && (p==n-k*6+t),
               zn[n]=z_n; q=1; break;
             );
           );
           if(q==1, break);
         );
         if(q==1, break);
       );
       if(q==1, break);
     );
     print("1 * "z_n); print; print; print;
   );
  }
  \end{lstlisting}
  
  \newpage
  
  \noindent Program 6 is equal to program 5 but prints the number of all integer solutions as seen in the upper table on page 7.
  \begin{lstlisting}
  {/* Program 6 - The Winkler stopping time algorithm */
   limit=10000; zn=[]; for(k=1, limit, zn=concat(zn,k));
   /* 12 initial numbers */
   zn[1]=1;   zn[2]=1;    zn[3]=2;    zn[4]=3;
   zn[5]=7;   zn[6]=12;   zn[7]=30;   zn[8]=85;
   zn[9]=173; zn[10]=476; zn[11]=961; zn[12]=2652;
   /* main algorithm */
   for(n=12, limit,
     Sum=0; a=-1;
     for(k=0, n-11, a=a+(-1)^floor(2*(k-2)/3));
     for(i=2, 6, Sum=Sum+binomial(floor((3*(n-i)+a)/2),n-i)*zn[i];
       print(binomial(floor((3*(n-i)+a)/2),n-i)*zn[i]);
     );
     for(i=7, 11, Sum=Sum+binomial(floor((3*(n-i)+a-1)/2),n-i)*zn[i];
       print(binomial(floor((3*(n-i)+a-1)/2),n-i)*zn[i]);
     );
     for(h=0, floor((limit-12)/6),
       v=12; w=5;
   	   if((h<58) && (frac((h-6)/9)==0), w=4);
   	   for(k=0, 5, if(h>=k*9+7, v--));
   	   c2=58;
   	   for(k=1, floor(n/20),
         if(frac(k/2)!=0, d=52; e=5, d=61; e=6);
         c1=c2; c2=c1+d;
   	     if((h>=c1) && (h<c2) && (frac((h-6+k*2)/9)==0), w=4);
   	     for(f=0, e, if(h>=f*9+c1+1, v--));
   	   );
       p=0; q=0;
       for(i=v+h*6, v+h*6+w,
         delta=a-2-h;
         Sum=Sum+binomial(floor((3*(n-i)+delta)/2),n-i)*zn[i];
         if(n>12, print(binomial(floor((3*(n-i)+a-2-h)/2),n-i)*zn[i]));
         z_n=binomial(floor(5*(n-2)/3),n-2)-Sum;
         r1=0; r2=0; p++;
         for(t=0, floor(n/15),
           c1=5; c2=6; d=0;
           if(t>c1, r1=2); if(t>c2, r2=2);
   	       for(k=2, floor(n/50),
   	         if(frac(k/2)==0, d=6, d=7);
   	         c1=c1+d; c2=c2+d;
   	         if(t>c1, r1=k*2); if(t>c2, r2=k*2);
   	       );
           for(k=t*9-r2, t*9+8-r1,
             if((n>k*6-t) && (h==k-2) && (p==n-k*6+t),
               zn[n]=z_n; q=1; break;
             );
           );
           if(q==1, break);
         );
         if(q==1, break);
       );
       if(q==1, break);
     );
     print(z_n); print; print; print;
   );
  }
  \end{lstlisting}
    
  \newpage
  
  \subsection{Permutations in lexicographic ordering for $n=7$}
  
  \normalsize For $n=7$ there is $\mathcal{A}(7)=(0,0,0,1,1,1,1,1)$,
  \\ \\
  $\mathbb{A}_{56}(7)=$
  \lstset{basicstyle=\scriptsize\ttfamily,numbers=none}
  \begin{lstlisting}
			      { (0,0,0,1,1,1,1,1) ,     (1,0,1,0,1,1,0,1) ,
				      (0,0,1,0,1,1,1,1) ,     (1,0,1,0,1,1,1,0) ,
				      (0,0,1,1,0,1,1,1) ,     (1,0,1,1,0,0,1,1) ,
				      (0,0,1,1,1,0,1,1) ,     (1,0,1,1,0,1,0,1) ,
				      (0,0,1,1,1,1,0,1) ,     (1,0,1,1,0,1,1,0) ,
				      (0,0,1,1,1,1,1,0) ,     (1,0,1,1,1,0,0,1) ,
				      (0,1,0,0,1,1,1,1) ,     (1,0,1,1,1,0,1,0) ,
				      (0,1,0,1,0,1,1,1) ,     (1,0,1,1,1,1,0,0) ,
				      (0,1,0,1,1,0,1,1) ,     (1,1,0,0,0,1,1,1) ,
				      (0,1,0,1,1,1,0,1) ,     (1,1,0,0,1,0,1,1) ,
				      (0,1,0,1,1,1,1,0) ,     (1,1,0,0,1,1,0,1) ,
				      (0,1,1,0,0,1,1,1) ,     (1,1,0,0,1,1,1,0) ,
				      (0,1,1,0,1,0,1,1) ,     (1,1,0,1,0,0,1,1) ,
				      (0,1,1,0,1,1,0,1) ,     (1,1,0,1,0,1,0,1) ,
				      (0,1,1,0,1,1,1,0) ,     (1,1,0,1,0,1,1,0) ,
				      (0,1,1,1,0,0,1,1) ,     (1,1,0,1,1,0,0,1) ,
				      (0,1,1,1,0,1,0,1) ,     (1,1,0,1,1,0,1,0) ,
				      (0,1,1,1,0,1,1,0) ,     (1,1,0,1,1,1,0,0) ,
				      (0,1,1,1,1,0,0,1) ,     (1,1,1,0,0,0,1,1) ,
				      (0,1,1,1,1,0,1,0) ,     (1,1,1,0,0,1,0,1) ,
				      (0,1,1,1,1,1,0,0) ,     (1,1,1,0,0,1,1,0) ,
				      (1,0,0,0,1,1,1,1) ,     (1,1,1,0,1,0,0,1) ,
				      (1,0,0,1,0,1,1,1) ,     (1,1,1,0,1,0,1,0) ,
				      (1,0,0,1,1,0,1,1) ,     (1,1,1,0,1,1,0,0) ,
				      (1,0,0,1,1,1,0,1) ,     (1,1,1,1,0,0,0,1) ,
				      (1,0,0,1,1,1,1,0) ,     (1,1,1,1,0,0,1,0) ,
				      (1,0,1,0,0,1,1,1) ,     (1,1,1,1,0,1,0,0) ,
				      (1,0,1,0,1,0,1,1) ,     (1,1,1,1,1,0,0,0)  }
  \end{lstlisting}
  
  \noindent$\mathbb{B}_{56}(7)=$
  \begin{lstlisting}
			  { (1,1,0,0,0,1,1,1,1,1) , (1,1,1,0,1,0,1,1,0,1) ,
			    (1,1,0,0,1,0,1,1,1,1) , (1,1,1,0,1,0,1,1,1,0) ,
			    (1,1,0,0,1,1,0,1,1,1) , (1,1,1,0,1,1,0,0,1,1) ,
			    (1,1,0,0,1,1,1,0,1,1) , (1,1,1,0,1,1,0,1,0,1) ,
			    (1,1,0,0,1,1,1,1,0,1) , (1,1,1,0,1,1,0,1,1,0) ,
			    (1,1,0,0,1,1,1,1,1,0) , (1,1,1,0,1,1,1,0,0,1) ,
			    (1,1,0,1,0,0,1,1,1,1) , (1,1,1,0,1,1,1,0,1,0) ,
			    (1,1,0,1,0,1,0,1,1,1) , (1,1,1,0,1,1,1,1,0,0) ,
			    (1,1,0,1,0,1,1,0,1,1) , (1,1,1,1,0,0,0,1,1,1) ,
			    (1,1,0,1,0,1,1,1,0,1) , (1,1,1,1,0,0,1,0,1,1) ,
			    (1,1,0,1,0,1,1,1,1,0) , (1,1,1,1,0,0,1,1,0,1) ,
			    (1,1,0,1,1,0,0,1,1,1) , (1,1,1,1,0,0,1,1,1,0) ,
			    (1,1,0,1,1,0,1,0,1,1) , (1,1,1,1,0,1,0,0,1,1) ,
			    (1,1,0,1,1,0,1,1,0,1) , (1,1,1,1,0,1,0,1,0,1) ,
			    (1,1,0,1,1,0,1,1,1,0) , (1,1,1,1,0,1,0,1,1,0) ,
			    (1,1,0,1,1,1,0,0,1,1) , (1,1,1,1,0,1,1,0,0,1) ,
			    (1,1,0,1,1,1,0,1,0,1) , (1,1,1,1,0,1,1,0,1,0) ,
			    (1,1,0,1,1,1,0,1,1,0) , (1,1,1,1,0,1,1,1,0,0) ,
			    (1,1,0,1,1,1,1,0,0,1) , (1,1,1,1,1,0,0,0,1,1) ,
			    (1,1,0,1,1,1,1,0,1,0) , (1,1,1,1,1,0,0,1,0,1) ,
			    (1,1,0,1,1,1,1,1,0,0) , (1,1,1,1,1,0,0,1,1,0) ,
			    (1,1,1,0,0,0,1,1,1,1) , (1,1,1,1,1,0,1,0,0,1) ,
			    (1,1,1,0,0,1,0,1,1,1) , (1,1,1,1,1,0,1,0,1,0) ,
			    (1,1,1,0,0,1,1,0,1,1) , (1,1,1,1,1,0,1,1,0,0) ,
			    (1,1,1,0,0,1,1,1,0,1) , (1,1,1,1,1,1,0,0,0,1) ,
			    (1,1,1,0,0,1,1,1,1,0) , (1,1,1,1,1,1,0,0,1,0) ,
			    (1,1,1,0,1,0,0,1,1,1) , (1,1,1,1,1,1,0,1,0,0) ,
			    (1,1,1,0,1,0,1,0,1,1) , (1,1,1,1,1,1,1,0,0,0)  }
  \end{lstlisting}
  
  \newpage
  
  \subsection{$\mathbb{B}_j(n)$ with integer solutions $(x,y)$ for $n=4,\dotsc,7$}
  This is also the output of program 2 for $n=4,\dotsc,7$.
  \\
  \lstset{basicstyle=\scriptsize\ttfamily,
          keywordstyle=\bfseries\ttfamily}
  \begin{lstlisting}
    (1, 1, 0, 1, 1)   (59, 38)
    (1, 1, 1, 0, 1)   (7, 5)
    (1, 1, 1, 1, 0)   (15, 10)
    There are 3 integer solutions (X,Y) for n=4.
  \end{lstlisting}
  \begin{lstlisting}
    (1, 1, 0, 0, 1, 1, 1)   (211, 202)
    (1, 1, 0, 1, 0, 1, 1)   (107, 103)
    (1, 1, 0, 1, 1, 0, 1)   (123, 118)
    (1, 1, 0, 1, 1, 1, 0)   (219, 209)
    (1, 1, 1, 0, 0, 1, 1)   (183, 175)
    (1, 1, 1, 0, 1, 0, 1)   (199, 190)
    (1, 1, 1, 0, 1, 1, 0)   (39, 38)
    (1, 1, 1, 1, 0, 0, 1)   (79, 76)
    (1, 1, 1, 1, 0, 1, 0)   (175, 167)
    (1, 1, 1, 1, 1, 0, 0)   (95, 91)
    There are 10 integer solutions (X,Y) for n=5.
  \end{lstlisting}
  \begin{lstlisting}
    (1, 1, 0, 0, 1, 1, 1, 1)   (595, 425)
    (1, 1, 0, 1, 0, 1, 1, 1)   (747, 533)
    (1, 1, 0, 1, 1, 0, 1, 1)   (507, 362)
    (1, 1, 0, 1, 1, 1, 0, 1)   (347, 248)
    (1, 1, 0, 1, 1, 1, 1, 0)   (923, 658)
    (1, 1, 1, 0, 0, 1, 1, 1)   (823, 587)
    (1, 1, 1, 0, 1, 0, 1, 1)   (583, 416)
    (1, 1, 1, 0, 1, 1, 0, 1)   (423, 302)
    (1, 1, 1, 0, 1, 1, 1, 0)   (999, 712)
    (1, 1, 1, 1, 0, 0, 1, 1)   (975, 695)
    (1, 1, 1, 1, 0, 1, 0, 1)   (815, 581)
    (1, 1, 1, 1, 0, 1, 1, 0)   (367, 262)
    (1, 1, 1, 1, 1, 0, 0, 1)   (735, 524)
    (1, 1, 1, 1, 1, 0, 1, 0)   (287, 205)
    (1, 1, 1, 1, 1, 1, 0, 0)   (575, 410)
    There are 15 integer solutions (X,Y) for n=6.
  \end{lstlisting}
  \begin{lstlisting}    
    (1, 1, 0, 0, 0, 1, 1, 1, 1, 1)   (3523, 1883)
    (1, 1, 0, 0, 1, 0, 1, 1, 1, 1)   (3827, 2045)
    (1, 1, 0, 0, 1, 1, 0, 1, 1, 1)   (1299, 695)
    (1, 1, 0, 0, 1, 1, 1, 0, 1, 1)   (979, 524)
    (1, 1, 0, 0, 1, 1, 1, 1, 0, 1)   (2131, 1139)
    (1, 1, 0, 0, 1, 1, 1, 1, 1, 0)   (2899, 1549)
    (1, 1, 0, 1, 0, 0, 1, 1, 1, 1)   (3979, 2126)
    (1, 1, 0, 1, 0, 1, 0, 1, 1, 1)   (1451, 776)
    (1, 1, 0, 1, 0, 1, 1, 0, 1, 1)   (1131, 605)
    (1, 1, 0, 1, 0, 1, 1, 1, 0, 1)   (2283, 1220)
    (1, 1, 0, 1, 0, 1, 1, 1, 1, 0)   (3051, 1630)
    (1, 1, 0, 1, 1, 0, 0, 1, 1, 1)   (187, 101)
    (1, 1, 0, 1, 1, 0, 1, 0, 1, 1)   (3963, 2117)
    (1, 1, 0, 1, 1, 0, 1, 1, 0, 1)   (1019, 545)
    (1, 1, 0, 1, 1, 0, 1, 1, 1, 0)   (1787, 955)
    (1, 1, 0, 1, 1, 1, 0, 0, 1, 1)   (1755, 938)
    (1, 1, 0, 1, 1, 1, 0, 1, 0, 1)   (2907, 1553)
    (1, 1, 0, 1, 1, 1, 0, 1, 1, 0)   (3675, 1963)
    (1, 1, 0, 1, 1, 1, 1, 0, 0, 1)   (1435, 767)
    (1, 1, 0, 1, 1, 1, 1, 0, 1, 0)   (2203, 1177)
    (1, 1, 0, 1, 1, 1, 1, 1, 0, 0)   (2587, 1382)
    (1, 1, 1, 0, 0, 0, 1, 1, 1, 1)   (2007, 1073)
    (1, 1, 1, 0, 0, 1, 0, 1, 1, 1)   (3575, 1910)
    (1, 1, 1, 0, 0, 1, 1, 0, 1, 1)   (3255, 1739)
    (1, 1, 1, 0, 0, 1, 1, 1, 0, 1)   (311, 167)
    (1, 1, 1, 0, 0, 1, 1, 1, 1, 0)   (1079, 577)
    (1, 1, 1, 0, 1, 0, 0, 1, 1, 1)   (2311, 1235)
    (1, 1, 1, 0, 1, 0, 1, 0, 1, 1)   (1991, 1064)
    (1, 1, 1, 0, 1, 0, 1, 1, 0, 1)   (3143, 1679)
    (1, 1, 1, 0, 1, 0, 1, 1, 1, 0)   (3911, 2089)
    (1, 1, 1, 0, 1, 1, 0, 0, 1, 1)   (3879, 2072)
    (1, 1, 1, 0, 1, 1, 0, 1, 0, 1)   (935, 500)
    (1, 1, 1, 0, 1, 1, 0, 1, 1, 0)   (1703, 910)
    (1, 1, 1, 0, 1, 1, 1, 0, 0, 1)   (3559, 1901)
    (1, 1, 1, 0, 1, 1, 1, 0, 1, 0)   (231, 124)
    (1, 1, 1, 0, 1, 1, 1, 1, 0, 0)   (615, 329)
    (1, 1, 1, 1, 0, 0, 0, 1, 1, 1)   (3727, 1991)
    (1, 1, 1, 1, 0, 0, 1, 0, 1, 1)   (3407, 1820)
    (1, 1, 1, 1, 0, 0, 1, 1, 0, 1)   (463, 248)
    (1, 1, 1, 1, 0, 0, 1, 1, 1, 0)   (1231, 658)
    (1, 1, 1, 1, 0, 1, 0, 0, 1, 1)   (1199, 641)
    (1, 1, 1, 1, 0, 1, 0, 1, 0, 1)   (2351, 1256)
    (1, 1, 1, 1, 0, 1, 0, 1, 1, 0)   (3119, 1666)
    (1, 1, 1, 1, 0, 1, 1, 0, 0, 1)   (879, 470)
    (1, 1, 1, 1, 0, 1, 1, 0, 1, 0)   (1647, 880)
    (1, 1, 1, 1, 0, 1, 1, 1, 0, 0)   (2031, 1085)
    (1, 1, 1, 1, 1, 0, 0, 0, 1, 1)   (2143, 1145)
    (1, 1, 1, 1, 1, 0, 0, 1, 0, 1)   (3295, 1760)
    (1, 1, 1, 1, 1, 0, 0, 1, 1, 0)   (4063, 2170)
    (1, 1, 1, 1, 1, 0, 1, 0, 0, 1)   (1823, 974)
    (1, 1, 1, 1, 1, 0, 1, 0, 1, 0)   (2591, 1384)
    (1, 1, 1, 1, 1, 0, 1, 1, 0, 0)   (2975, 1589)
    (1, 1, 1, 1, 1, 1, 0, 0, 0, 1)   (1087, 581)
    (1, 1, 1, 1, 1, 1, 0, 0, 1, 0)   (1855, 991)
    (1, 1, 1, 1, 1, 1, 0, 1, 0, 0)   (2239, 1196)
    (1, 1, 1, 1, 1, 1, 1, 0, 0, 0)   (383, 205)
    There are 56 integer solutions (X,Y) for n=7.
  \end{lstlisting}
  
  \subsection{Stopping time residue classes up to $\sigma(s)=15$}
  
  \tiny\noindent
  $\sigma(s)=1$\\
  if \ $s\equiv$ \ 0 \ $(mod\ 2)$\\
  \\
  $\sigma(s)=2$\\
  if \ $s\equiv$ \ 1 \ $(mod\ 4)$\\
  \\
  $\sigma(s)=4$\\
  if \ $s\equiv$ \ 3 \ $(mod\ 16)$\\
  \\
  $\sigma(s)=5$\\
  if \ $s\equiv$ \ 11, 23 \ $(mod\ 32)$\\
  \\
  $\sigma(s)=7$\\
  if \ $s\equiv$ \ 7, 15, 59 \ $(mod\ 128)$\\
  \\
  $\sigma(s)=8$\\
  if \ $s\equiv$ \ 39, 79, 95, 123, 175, 199, 219 \ $(mod\ 256)$\\
  \\
  $\sigma(s)=10$\\
  if \ $s\equiv$ \ 287, 347, 367, 423, 507, 575, 583, 735, 815, 923, 975, 999 \ $(mod\ 1024)$\\
  \\
  $\sigma(s)=12$\\
  if \ $s\equiv$ \ 231, 383, 463, 615, 879, 935, 1019, 1087, 1231, 1435, 1647, 1703, 1787, 1823, 1855, 2031, 2203, 2239, 2351, 2587, 2591, 2907, 2975, 3119, 3143, 3295, 3559, 3675, 3911, 4063 \ $(mod\ 4096)$\\
  \\
  $\sigma(s)=13$\\
  if \ $s\equiv$ \ 191, 207, 255, 303, 539, 543, 623, 679, 719, 799, 1071, 1135, 1191, 1215, 1247, 1327, 1563, 1567, 1727, 1983, 2015, 2075, 2079, 2095, 2271, 2331, 2431, 2607, 2663, 3039, 3067, 3135, 3455, 3483, 3551, 3687, 3835, 3903, 3967, 4079, 4091, 4159, 4199, 4223, 4251, 4455, 4507, 4859, 4927, 4955, 5023, 5103, 5191, 5275, 5371, 5439, 5607, 5615, 5723, 5787, 5871, 5959, 5979, 6047, 6215, 6375, 6559, 6607, 6631, 6747, 6815, 6983, 7023, 7079, 7259, 7375, 7399, 7495, 7631, 7791, 7847, 7911, 7967, 8047, 8103 \ $(mod\ 8192)$\\
  \\
  $\sigma(s)=15$\\
  if \ $s\equiv$ \ 127, 411, 415, 831, 839, 1095, 1151, 1275, 1775, 1903, 2119, 2279, 2299, 2303, 2719, 2727, 2767, 2799, 2847, 2983, 3163, 3303, 3611, 3743, 4007, 4031, 4187, 4287, 4655, 5231, 5311, 5599, 5631, 6175, 6255, 6503, 6759, 6783, 6907, 7163, 7199, 7487, 7783, 8063, 8187, 8347, 8431, 8795, 9051, 9087, 9371, 9375, 9679, 9711, 9959, 10055, 10075, 10655, 10735, 10863, 11079, 11119, 11567, 11679, 11807, 11943, 11967, 12063, 12143, 12511, 12543, 12571, 12827, 12967, 13007, 13087, 13567, 13695, 13851, 14031, 14271, 14399, 14439, 14895, 15295, 15343, 15839, 15919, 16027, 16123, 16287, 16743, 16863, 16871, 17147, 17727, 17735, 17767, 18011, 18639, 18751, 18895, 19035, 19199, 19623, 19919, 20079, 20199, 20507, 20527, 20783, 20927, 21023, 21103, 21223, 21471, 21727, 21807, 22047, 22207, 22655, 22751, 22811, 22911, 22939, 23231, 23359, 23399, 23615, 23803, 23835, 23935, 24303, 24559, 24639, 24647, 24679, 25247, 25503, 25583, 25691, 25703, 25831, 26087, 26267, 26527, 26535, 27111, 27291, 27759, 27839, 27855, 27975, 28703, 28879, 28999, 29467, 29743, 29863, 30311, 30591, 30687, 30715, 30747, 30767, 30887, 31711, 31771, 31899, 32155, 32239, 32575, 32603 \ $(mod\ 32768)$\\
  \\
  and so forth.
  \\
  
  \newpage
  
  \section{References}
  
  \noindent\scriptsize  
  1. C. J. Everett, Iteration of the number-theoretic function f(2n) =  n, f(2n + 1) = 3n + 2, Advances in Math. 25 (1977), 42.
  \\ \\
  2. L. E. Garner, On the Collatz 3n + 1 Algorithm, Proc. Amer. Math. Soc., Vol. 82 (1981), 19-22. [Chapter 2]\\
  (http://ams.org/journals/proc/1981-082-01/S0002 -9939-1981-0603593-2/S0002-9939-\\1981-0603593-2.pdf)
  \\ \\
  3. R. Terras, A stopping time problem on the positive integers, Acta Arith. 30 (1976), 241.
  \\ \\
  4. The On-Line Encyclopedia of Integer Sequences (OEIS)\\
  (http://oeis.org) A020914, A177789, A100982 (Roosendaal/Noe)
  \\ \\
  5. The PARI Group - PARI/GP Version 2.3.4\\ (http://pari.math.u-bordeaux.fr)
  \\ \\
  6. M. Winkler, Die Konstruktion der speziellen Baumstruktur, May 2010.\\
  (http://mikewinkler.co.nf/collatz\_konstruktion.pdf)
  \\ \\
  7. M. Winkler, On a stopping time algorithm of the 3n + 1 function, May 2011.\\
  (http://mikewinkler.co.nf/collatz\_algorithm.pdf)
  \\ \\
  8. M. Winkler, On the structure and the behaviour of Collatz 3n + 1 sequences - Finite subsequences and the role of the Fibonacci sequence, November 2014.\\
  (http://arxiv.org/pdf/1412.0519v1.pdf)
  \\ \\
  9. M. Winkler, \"Uber das Stoppzeit-Verhalten der Collatz-Iteration, October 2010.\\
  (http://mikewinkler.co.nf/collatz\_algorithm\_2010.pdf)
  \\ \\
  10. M. Winkler, \"Uber die Struktur und das Wachstumsverhalten von Collatz 3n + 1 Folgen, March 2014.\\
  (http://mikewinkler.co.nf/collatz\_teilfolgen\_2014.pdf)
  \\ \\
  \\ \\
  \\ \\
  \begin{center}
    \normalsize\textsc{Acknowledgements}
  \end{center}
  \scriptsize
  The devising and programming of the iterative stopping time algorithm in chapter 3.5 is the most wonderful discovery and work in my mathematical career and research until today. As an amateur mathematician it would be the greatest honour for me if my work could help solve the Collatz problem.
  \\ \\
  I dedicate this paper to my high school math teacher \textsc{Franz Hagen} who has mediated me the joy of mathematics.
  \\ \\
  Thanks to "matph" from Matroids Matheplanet for the PARI/GP function "NextPermutation(a)".\\
  (http://matheplanet.de)
  \\ \\
  If you have any questions to this paper please contact me by e-mail.
  \\ \\
  \\ \\
  \\ \\
  \begin{center}
    \footnotesize{Mike Winkler, Ernst-Abbe-Weg 4, 45657 Recklinghausen, Germany}
  \end{center}
  \begin{center}
    \small{mike.winkler(at)gmx.de}
  \end{center}
  
  
\end{document}
