\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}

\usepackage{multicol}

\newcommand{\p}[1]{(#1)}
\newcommand{\pb}{\p}
\newcommand{\st}[1]{\{#1\}}
\newcommand{\abk}[1]{\left<#1\right>}
\newcommand{\fl}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\quot}[1]{``#1''}

\newcommand{\As}{\lambda}
\newcommand{\Bs}{\mu}
\newcommand{\Cs}{\gamma}


\newcommand{\Rh}{B}

\newcommand{\modd}[2]{#1\ \mbox{\rm (mod}\ #2\mbox{\rm )}}

\begin{document}

\begin{center}
\includegraphics[width=4in]{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\begin{center}
\vskip 1cm{\LARGE\bf The Behavior of a Three-Term\\
Hofstadter-Like Recurrence with\\
\vskip .11in
Linear Initial Conditions
}
\vskip 1cm
\large
Nathan Fox\\
Department of Quantitative Sciences\\
Canisius University\\
2001 Main St.\\
Buffalo, New York 14208\\
USA\\
\href{mailto:fox42@canisius.edu}{\tt fox42@canisius.edu} \\
\end{center}

\vskip .2 in
\begin{abstract}
We study the three-term nested recurrence relation 	$B(n)=B(n-B(n-1))+B(n-B(n-2))+B(n-B(n-3))$ subject to initial conditions where the first $N$ terms are the integers $1$ through $N$. This recurrence is the three-term analog of Hofstadter's famous $Q$-recurrence. Nested recurrences are highly sensitive to their initial conditions. Some initial conditions lead to finite sequences, others lead to predictable sequences, and yet others lead to sequences that appear to be chaotic and infinite.
This work parallels a previous study on the $Q$-recurrence. As with that work, we consider two families of sequences, one where terms with nonpositive indices are undefined and a second where terms with nonpositive indices are defined to be zero. We find similar results here as with the $Q$-recurrence, as we can completely characterize the sequences for sufficiently large $N$. The results here are, in a sense, simpler, as our sequences are all finite for sufficiently large $N$.
\end{abstract}

\section{Introduction}
Numerous studies have focused on the Hofstadter $Q$-recurrence~\cite{geb}
\[
Q\p{n}=Q\p{n-Q\p{n-1}}+Q\p{n-Q\p{n-2}}
\]
and the sequences it generates from various choices of initial conditions. Hofstadter's original $Q$-sequence starts with initial conditions $Q\p{1}=Q\p{2}=1$. This sequence, \seqnum{A005185} in the OEIS~\cite{oeis}, has tantalizing properties that have thus far evaded proof, though they have been the subject of statistical studies~\cite{spotbased,pinn}. As such, most studies of the $Q$-recurrence analyze sequences generated by other initial conditions~\cite{genrusk, gengol,symbhof, golomb, rusk}. One recent approach involves studying a family of initial conditions described by a parameter~\cite{hof1thruN}.

In this paper, we apply the parametrized initial condition approach to a different recurrence, the three-term Hofstadter-like recurrence
\[
\Rh\p{n}=\Rh\p{n-\Rh\p{n-1}}+\Rh\p{n-\Rh\p{n-2}}+\Rh\p{n-\Rh\p{n-3}}.
\]
This recurrence is known to generate a well-behaved sequence~\cite{slowtrihof} when given initial conditions $\Rh\p{1}=1$, $\Rh\p{2}=2$, $\Rh\p{3}=3$, $\Rh\p{4}=4$, and $\Rh\p{5}=5$. For convenience, we refer to this well-behaved sequence (\seqnum{A278055}) as the \emph{$\Rh$-sequence}. Aside from that one article, this recurrence has not been widely reported on. This is presumably because most natural initial conditions lead to finite sequences. If a sequence $\Rh^*\p{n}$ generated by the $\Rh$-recurrence ever has $\Rh^*\p{n-1}\geq n$ or $\Rh^*\p{n-1}\leq0$, then $\Rh^*\p{n}$ would be undefined. When this sort of behavior occurs, we say that the sequence \emph{dies} after $n-1$ terms, or that it dies at index $n$. This assumes, as is standard, that the first term defined by the initial conditions is $\Rh^*(1)$. In this paper, we consider such initial conditions, but we also consider infinite initial conditions that define values for $\Rh^*(n)$ when $n\leq0$. In this realm, $\Rh^*(n-1)\geq n$ does not lead to sequence death, but $\Rh^*(n-1)\leq 0$ still does. So, to avoid some confusion later in the paper, when a sequence dies because $\Rh^*\p{n-1}\leq0$, we say that the sequence \emph{ends}.

\subsection{Notation}

Going forward, the only recurrence relation we discuss is the $\Rh$-recurrence, but we study it with many different initial conditions.  We introduce analogous notation to prior work of this type on the $Q$-recurrence~\cite{hof1thruN}. The notation $\Rh\p{n}$ refers to the $n$th term of the $\Rh$-sequence itself.  The notation $\Rh^*\p{n}$ refers to a generic sequence that satisfies the $\Rh$-recurrence.  For other specific sequences satisfying the $\Rh$-recurrence, we use $\Rh$ with a subscript that we define for each of those particular sequences.

We use angle brackets to denote our initial conditions.  For example, $\abk{1,2,3,4,5}$ is shorthand for the initial conditions for the $\Rh$-sequence.  Sometimes, we wish to define $\Rh^*\p{n}=0$ for all $n\leq0$ in order to prevent our sequences from dying too soon.  This convention is noted with a symbol $\bar{0}$ followed by a semicolon at the start of the initial conditions.  For example, $\abk{\bar{0};1,1,1}$ is shorthand for $\Rh^*\p{n}=0$ for $n\leq0$, $\Rh^*\p{1}=1$, $\Rh^*\p{2}=1$, and $\Rh^*\p{3}=1$.

\subsection{Methodology}\label{ss:methods}
Our approach to studying families of solutions to the $\Rh$-recurrence mirrors the process from previous work on the $Q$-recurrence~\cite{hof1thruN}. We start from symbolic initial conditions in terms of a symbol $N$ representing a large positive integer. Then, we attempt to sequentially compute terms immediately following the initial conditions. Both the indices and values of these terms are in terms of $N$. While doing these calculations, we keep track of several requirements that give lower bounds on the values of $N$ for which our calculations are valid.
\begin{itemize}
\item Whenever a term of the form $\Rh^*(a)$ occurs for some positive integer $a$, we must have $N\geq a$. This ensures that $\Rh^*(a)$ is described by the initial conditions.
\item Whenever a term of the form $\Rh^*(N-a)$ occurs for some positive integer $a$, we must have $N>a$. This ensures that $\Rh^*(N-a)$ is described by the initial conditions.
\item Whenever a term of the form $\Rh^*(b-aN)$ occurs for some positive real number $a$ and some real number $b$, we must have $N\geq\frac{b}{a}$. This ensures that $b-aN\leq 0$, meaning that $\Rh^*(b-aN)$ is undefined or zero (depending on whether or not the initial conditions include $\bar{0}$).
\end{itemize}
We continue to compute terms and bound $N$ from below as long as we need to for the particular application. Often, we compute terms until the sequence dies, leading to a description of the behaviors of the whole family of sequences for sufficiently large $N$. Other times, we are able to describe all terms of the sequence up to around index $2N$. In situations like that, we are able take the original initial conditions together with the newly described terms as new initial conditions and apply the method again to compute more terms.

\subsection{Structure of this paper}
This paper's structure mirrors that of the analogous study on the $Q$-recurrence~\cite{hof1thruN}. In Section~\ref{s:wd}, we characterize the sequences generated by the $\Rh$-recurrence via the family of initial conditions of the form $\abk{1,2,3,\ldots,N}$. Then, in Section~\ref{s:sd}, we study the more general initial conditions $\abk{\bar{0};1,2,3,\ldots,N}$.  Finally, we suggest some future research directions in Section~\ref{s:future}.

Several results throughout the paper rely on tedious computations. In order to streamline this paper, lengthy computations are omitted. Full computational results, along with associated code, can be found on GitHub: \href{https://github.com/nhf216/B-recurrence-data}{\tt https://github.com/nhf216/B-recurrence-data}.


\section{Behavior of the $\Rh$-recurrence with linear initial conditions}\label{s:wd}


In this section, we consider sequences obtained from the $\Rh$-recurrence and initial conditions of the form $\abk{1,2,3,\ldots,N}$ for some integer $N\geq3$.  Henceforth, we let $\Rh_N$ denote this sequence for a given value of $N$.

We have the following result, which characterizes the behaviors of almost all of these sequences.

\begin{theorem}\label{thm:1thruN}
For $N=3$, $N=4$, or $N\geq10$, the sequence $\Rh_N$ dies.  Furthermore, if $N\geq14$, the sequence has exactly $N+24$ terms.
\end{theorem}

\begin{proof}
Computing terms, we obtain that $\Rh_3\p{4}=6$, $\Rh_4\p{5}=6$, $\Rh_{10}\p{1015}=1036$, $\Rh_{11}\p{117}\newline=120$, $\Rh_{12}\p{45}=47$, and $B_{13}\p{73}=82$. So, these sequences all die.


Now, we treat $N$ as a symbolic parameter and apply the process outlined in Subsection~\ref{ss:methods}. That is, we start from the symbolic initial conditions $\abk{1,2,3,\ldots,N}$ and then attempt to compute $\Rh_N(N+1),\Rh_N(N+2),\Rh_N(N+3),\ldots$ in terms of $N$. While doing so, we track lower bounds on $N$ for which our calculations are valid.
In the current setting, this allows us to compute $24$ terms following the initial conditions.  These $24$ terms are given in Table~\ref{tab:24terms}. The full length of the computations, along with bounds on $N$, can be found on \href{https://github.com/nhf216/B-recurrence-data}{GitHub}. In particular, these calculations are valid for $N\geq9$.

The last term we have is $\Rh\p{N+24}=2N+11$.  We now try to compute the next term.
\begin{align*}
    \Rh_N\p{N+25}&=\Rh_N\p{N+25-\Rh_N\p{N+24}}+\Rh_N\p{N+25-\Rh_N\p{N+23}}\\
    &\phantom{=}+\Rh_N\p{N+25-\Rh_N\p{N+22}}\\
    &=\Rh_N\p{N+25-\pb{2N+11}}+\Rh_N\p{N+25-21}\\
    &\phantom{=}+\Rh_N\p{N+25-22}\\
    &=\Rh_N\pb{-N+14}+\Rh_N\pb{N+4}+\Rh_N\pb{N+3}.
    \end{align*}
If $N\geq14$, then $-N+14\leq0$, so $\Rh_N\p{-N+14}$ is undefined and the sequence dies, as required.
\end{proof}
\begin{center}
\begin{table}
	\[
	\begin{array}{|c|c|c|c|c|c|c|}\hline
		\textbf{Index} & N+1 & N+2 & N+3 & N+4 & N+5 & N+6 \\\hline
		\textbf{Term} & 6 & N + 1& N + 2& N + 3& 9& N + 4\\\hline\hline
		\textbf{Index} & N+7 & N+8 & N+9 & N+10 & N+11 & N+12\\\hline
		\textbf{Term} & N + 5& N + 6 & 12& N + 7& N + 8& N + 9\\\hline\hline
		\textbf{Index} & N+13 & N+14 & N+15 & N+16 & N+17 & N+18\\\hline
		\textbf{Term} & 15& N + 10& N + 11& 17& N + 13& 18\\\hline\hline
		\textbf{Index} & N+19 & N+20 & N+21 & N+22 & N+23 & N+24\\\hline
		\textbf{Term} & N + 13& N + 15& N + 16& 22& 21& 2N + 11\\\hline
	\end{array}
	\]
	\caption{Terms $B_N(N+1)$ through $B_N(N+24)$ whenever $N\geq9$.}
	\label{tab:24terms}
\end{table}
\end{center}

Theorem~\ref{thm:1thruN} says that $\Rh_N$ dies for all but five values $N$.  The sequences $\Rh_5$ and $\Rh_6$ are identical; both are the $\Rh$-sequence~\cite{slowtrihof}. Sequences $B_7$, $B_8$, and $B_9$ (\seqnum{A373227}, \seqnum{A373228}, and~\seqnum{A373229}) are more akin to Hofstadter's Q sequence.  Like Hofstadter's, it is unclear whether these sequences die.  All last for at least $30$ million terms.
Plots of the first hundred thousand terms of each of these sequences are shown in Figure~\ref{fig:b789}. Sequences $B_{10}$, $B_{11}$, $B_{12}$, and $B_{13}$ are prefixes of OEIS sequences \seqnum{A373230}, \seqnum{A373231}, \seqnum{A373232}, and~\seqnum{A373233} respectively.

\begin{figure}[H]
\begin{center}
\begin{multicols}{3}
\includegraphics[width=1.9in]{B7.png}

\includegraphics[width=1.9in]{B8.png}

\includegraphics[width=1.9in]{B9.png}
\end{multicols}
\caption{Plots of the first 100,000 terms of $\Rh_7$ (left, \seqnum{A373227}), $\Rh_8$ (center, \seqnum{A373228}), and $\Rh_9$ (right, \seqnum{A373229}).}
\label{fig:b789}
\end{center}
\end{figure}

\section{Linear initial conditions with extra zeroes}\label{s:sd}
The sequences in Section~\ref{s:wd} almost all die.  As in previous work on the $Q$-recurrence~\cite{hof1thruN}, we now consider what happens if we prevent them from dying quickly by defining their values to be zero at nonpositive integers.  For an integer $N\geq3$, let $\Rh_{\bar{N}}$ denote the sequence obtained from the $\Rh$-recurrence with initial conditions $\abk{\bar{0};1,2,3,\ldots,N}$.  


Previously~\cite{hof1thruN}, it was seen that the corresponding behavior for the $Q$-recurrence depends on the congruence class of $N$ modulo~$5$. Three of those cases lead to the end of the sequence, one leads to a semi-predictable pattern that seems to go on forever, and the fifth case leads to a dependence on the congruence class of $N$ modulo~$25$ and, thereafter, potentially higher powers of $5$. For the sequences $\Rh_{\bar{N}}$, the dependence is instead on the congruence class of $N$ modulo~$7$. Here, all seven cases lead to the end of the sequence without needing to consider cases involving higher powers of $7$. But, all cases require fairly large values of $N$ to be valid.
We have the following main result.


\begin{theorem}\label{thm:trihof1N}
Let $N\geq72$ be 
a 
natural number.  Then the following period-$7$ pattern begins at index $N+67$ in $\Rh_{\bar{N}}$, where $k$ denotes a positive integer:
\begin{align*}
\Rh_{\bar{N}}\p{N+7k}&=7k+2\text{;}\\
\Rh_{\bar{N}}\p{N+7k+1}&=N+7k+2\text{;}\\
\Rh_{\bar{N}}\p{N+7k+2}&=N+7k+4\text{;}\\
\Rh_{\bar{N}}\p{N+7k+3}&=7\text{;}\\
\Rh_{\bar{N}}\p{N+7k+4}&=2N+2k+45\text{;}\\
\Rh_{\bar{N}}\p{N+7k+5}&=2N+k-7\text{;}\\
\Rh_{\bar{N}}\p{N+7k+6}&=N-2\text{.}
\end{align*}
This pattern lasts through index $2N+\nu$, where
\[
\nu=\begin{cases}
	-1, & \text{if $N\equiv\modd{0}{7}$;}\\
	-2, & \text{if $N\equiv\modd{1}{7}$;}\\
	-2, & \text{if $N\equiv\modd{2}{7}$;}\\
	-2, & \text{if $N\equiv\modd{3}{7}$;}\\
	2, & \text{if $N\equiv\modd{4}{7}$;}\\
	1, & \text{if $N\equiv\modd{5}{7}$;}\\
	0, & \text{if $N\equiv\modd{6}{7}$.}\\
\end{cases}
\]
After this,
\begin{itemize}
\item If $N\equiv \modd{0}{7}$ and $N\geq196$, then $\Rh_{\bar{N}}$ ends after $2N+27$ terms.
\item If $N\equiv \modd{1}{7}$ and $N\geq2087$, then $\Rh_{\bar{N}}$ ends after $2N+254$ terms.
\item If $N\equiv \modd{2}{7}$ and $N\geq3201$, then $\Rh_{\bar{N}}$ ends after $2N+524$ terms.
\item If $N\equiv \modd{3}{7}$ and $N\geq4315$, then $\Rh_{\bar{N}}$ ends after $2N+560$ terms.
\item If $N\equiv \modd{4}{7}$ and $N\geq200$, then $\Rh_{\bar{N}}$ ends after $2N+20$ terms.
\item If $N\equiv \modd{5}{7}$ and $N\geq32478$, then $\Rh_{\bar{N}}$ ends after $2N+4547$ terms.
\item If $N\equiv \modd{6}{7}$ and $N\geq118$, then $\Rh_{\bar{N}}$ ends after $2N+9$ terms.
\end{itemize}
\end{theorem}



The proof of Theorem~\ref{thm:trihof1N} uses the following lemma.
\begin{lemma}\label{lem:7cyc}
Let $K\geq 7$, $c\geq1$ and $0\leq\Cs\leq 6$. Then, let $\As$ and $\Bs$ be integers such that
\[
\As\geq\begin{cases}
-2c+2, & \text{if $\Cs=0$;}\\
-2c+1, & \text{if $\Cs=1$;}\\
-2c+4, & \text{if $\Cs=2$;}\\
-2c+3, & \text{if $\Cs=3$;}\\
-2c+2, & \text{if $\Cs=4$;}\\
-2c+1, & \text{if $\Cs=5$;}\\
-2c, & \text{if $\Cs=6$.}
\end{cases}
\quad\quad\text{and}\quad\quad
\Bs\geq\begin{cases}
-c, & \text{if $\Cs=0$;}\\
-c, & \text{if $\Cs=1$;}\\
-c+3, & \text{if $\Cs=2$;}\\
-c+2, & \text{if $\Cs=3$;}\\
-c+1, & \text{if $\Cs=4$;}\\
-c, & \text{if $\Cs=5$;}\\
-c-1, & \text{if $\Cs=6$.}
\end{cases}
\]
Define $L=K-7c-\Cs$ and $M=K+L+5$.
Then, for arbitrary integers $a_1,a_2,\ldots,a_L$, let $\Rh_C$ denote the sequence resulting from the $\Rh$-recurrence and the 
initial conditions
\[
\abk{\bar{0};1,2,\ldots,K,6,a_1,a_2,\ldots,a_L,2K+\As-2,2K+\Bs-1,K-2}.
\]
The sequence $\Rh_C$ follows the following pattern from $\Rh_C\p{M-3}$ through $B_C\p{2K+\nu}$
\begin{align*}
\Rh_C\p{M+7k}&=L+7k+7\text{;}\\
\Rh_C\p{M+7k+1}&=M+7k+2\text{;}\\
\Rh_C\p{M+7k+2}&=M+7k+4\text{;}\\
\Rh_C\p{M+7k+3}&=7\text{;}\\
\Rh_C\p{M+7k+4}&=2K+2k+\As\text{;}\\
\Rh_C\p{M+7k+5}&=2K+k+\Bs\text{;}\\
\Rh_C\p{M+7k+6}&=K-2\text{;}
\end{align*}
where
\[
\nu=\begin{cases}
-2, & \text{if $\Cs=0$;}\\
-2, & \text{if $\Cs=1$;}\\
2, & \text{if $\Cs=2$;}\\
1, & \text{if $\Cs=3$;}\\
0, & \text{if $\Cs=4$;}\\
-1, & \text{if $\Cs=5$;}\\
-2, & \text{if $\Cs=6$.}
\end{cases}
\]
\end{lemma}
\begin{proof}
The proof is by induction on the index.  The base cases are $B_C\p{M-3}$ through $B_C\p{M-1}$, which are part of the initial conditions.  Now, suppose $M\leq n\leq2K+\nu$,  
and suppose that $\Rh_C\p{n'}$ is what we want it to be for all $M-3\leq n'<n$.  
 
There are seven cases to consider:
\begin{description}
\item[$n-M\equiv\modd{0}{7}$:] In this case, $n=M+7k$ for some $k$.  Applying the $\Rh$-recurrence, we have
\begin{align*}
\Rh_C\p{M+7k}&=\Rh_C\p{M+7k-\Rh_C\p{M+7k-1}}\\
&\quad +\Rh_C\p{M+7k-\Rh_C\p{M+7k-2}}\\
&\quad +\Rh_C\p{M+7k-\Rh_C\p{M+7k-3}}\\
&=\Rh_C\p{M+7k-\pb{K-2}} \\
&\quad + \Rh_C\p{M+7k-\pb{2K+k-1+\Bs}}\\
&\quad +\Rh_C\p{M+7k-\pb{2K+2k-2+\As}}\\
&=\Rh_C\p{L+7k+7}+\Rh_C\p{-K+L+6k+6-\Bs}\\
&\quad +\Rh_C\p{-K+L+5k+7-\As}.
\end{align*}
We know that $n\leq 2K+\nu$. Since $n=M+7k$, we have $n-M=7k\leq2K+\nu-M=K-L-5+\nu=7c+\Cs-5+\nu$. Observe that
\[
\Cs-5+\nu=\begin{cases}
-7, & \text{if $\Cs=0$;}\\
-6, & \text{if $\Cs=1$;}\\
-1, & \text{otherwise.}
\end{cases}
\]
Since $7k\equiv\modd{0}{7}$, we actually have $7k\leq 7c-7$, since $\fl{\frac{\Cs-5+\nu}{7}}$ always equals $-1$.
In particular, this means that $L+7k+7\leq L+7c=K-\Cs\leq K$. 
As a result, $\Rh_C\p{L+7k+7}=L+7k+7$.

We also have
\begin{align*}
-K+L+6k+6-\Bs&=-7c-\Cs+6k+6-\Bs\\
&\leq-7c-\Cs+\frac{6}{7}\p{7c-7}+6-\Bs\\
&=-c-\Cs-\Bs.
\end{align*}
Observe that
\[
-c-\Cs-\Bs\leq\begin{cases}
0, & \text{if $\Cs=0$;}\\
-1, & \text{if $\Cs=1$;}\\
-5, & \text{otherwise,}
\end{cases}
\]
which implies that $-c-\Cs-\Bs\leq0$. In turn, this means that $-K+L+6k+6-\Bs\leq0$, implying that $\Rh_C\p{-K+L+6k+6-\Bs}=0$.

Similarly, we have that
\begin{align*}
-K+L+5k+7-\As&=-7c-\Cs+5k+7-\As\\
&\leq-7c-\Cs+\frac{5}{7}\p{7c-7}+7-\As\\
&=-2c-\Cs+2-\As.
\end{align*}
Observe that
\[
-2c-\Cs+2-\As\leq\begin{cases}
0, & \text{if $\Cs=0$ or $\Cs=1$;}\\
-4, & \text{otherwise,}
\end{cases}
\]
which implies that $-2c-\Cs+2-\As\leq0$. In turn, this means that $-K+L+5k+7-\As\leq0$, implying that $\Rh_C\p{-K+L+5k+7-\As}=0$.
So, $\Rh_C\p{M+7k}=L+7k+7$, as required.


\item[$n-M\equiv\modd{1}{7}$:] In this case, $n=M+7k+1$ for some $k$.  Applying the $\Rh$-recurrence in a similar manner to the first case, we obtain
\begin{align*}
\Rh_C\p{M+7k+1}&=\Rh_C\p{K-1}+\Rh_C\p{L+7k+8}\\
&\phantom{=}+\Rh_C\p{-K+L+6k+7-\Bs}.
\end{align*}
We know that $\Rh_C\p{K-1}=K-1$. 
We also know that $n\leq 2K+\nu$. Since $n=M+7k+1$, we have $n-M-1=7k\leq2K+\nu-M-1=K-L-6+\nu=7c+\Cs-6+\nu$. Observe that
\[
\Cs-6+\nu=\begin{cases}
-8, & \text{if $\Cs=0$;}\\
-7, & \text{if $\Cs=1$;}\\
-2, & \text{otherwise.}
\end{cases}
\]
Since $7k\equiv\modd{0}{7}$, we actually have
\[
7k\leq
\begin{cases}
7c-14, & \text{if $\Cs=0$;}\\
7c-7, & \text{otherwise.}
\end{cases}
\]
In particular, this means that if $\Cs=0$ then $L+7k+8\leq L+7c-6=K-6<K$, and if $\Cs\neq0$ then $L+7k+8\leq L+7c+1=K-\Cs+1\leq K$. 
As a result, $\Rh_C\p{L+7k+8}=L+7k+8$.

We also have $-K+L+6k+7-\Bs=-7c-\Cs+6k+7-\Bs$.
When $\Cs=0$, we have  $-7c-\Cs+6k+7-\Bs\leq-7c-\Cs+\frac{6}{7}\p{7c-14}+7-\Bs=-c-\Cs-5-\Bs=-5<0.$ When $\Cs\neq0$, we have 
$-7c-\Cs+6k+7-\Bs\leq-7c-\Cs+\frac{6}{7}\p{7c-7}+7-\Bs=-c-\Cs+1-\Bs.$
Observe that
\[
-c-\Cs+1-\Bs\leq\begin{cases}
1, & \text{if $\Cs=0$;}\\
0, & \text{if $\Cs=1$;}\\
-4, & \text{otherwise.}
\end{cases}
\]
So, $-c-\Cs+1-\Bs\leq0$ when $\Cs\neq0$. In turn, this means that $-K+L+6k+7-\Bs\leq0$ for all $\Cs$, implying that $\Rh_C\p{-K+L+6k+7-\Bs}=0$.
So, $\Rh_C\p{M+7k+1}=\pb{K-1}+\pb{L+7k+8}=K+L+7k+7=M+7k+2$, as required.

\item[$n-M\equiv\modd{2}{7}$:] In this case, $n=M+7k+2$ for some $k$.  Applying the $\Rh$-recurrence in a similar manner to the first case, we obtain
\begin{align*}
\Rh_C\p{M+7k+2}&=\Rh_C\p{0}+\Rh_C\p{K}+\Rh_C\p{L+7k+9}.
\end{align*}
We know that $\Rh_C\p{0}=0$ and that $\Rh_C\p{K}=K$. 
We also know that $n\leq 2K+\nu$. 
Since $n=M+7k+2$, we have $n-M-2=7k\leq2K+\nu-M-2=K-L-7+\nu=7c+\Cs-7+\nu$. Observe that
\[
\Cs-7+\nu=\begin{cases}
-9, & \text{if $\Cs=0$;}\\
-8, & \text{if $\Cs=1$;}\\
-3, & \text{otherwise.}
\end{cases}
\]
Since $7k\equiv\modd{0}{7}$, we actually have
\[
7k\leq
\begin{cases}
7c-14, & \text{if $\Cs=0$ or $\Cs=1$;}\\
7c-7, & \text{otherwise.}
\end{cases}
\]
In particular, this means that if $\Cs\leq1$ then $L+7k+9\leq L+7c-4=K-\Cs-4<K$, and if $\Cs\geq2$ then $L+7k+9\leq L+7c+2=K-\Cs+2\leq K$. 
As a result, $\Rh_C\p{L+7k+9}=L+7k+9$.
So, $\Rh_C\p{M+7k+2}=K+L+7k+9=M+7k+4$, as required.

\item[$n-M\equiv\modd{3}{7}$:] In this case, $n=M+7k+3$ for some $k$.  Applying the $\Rh$-recurrence in a similar manner to the first case, we obtain
\begin{align*}
\Rh_C\p{M+7k+3}
&=\Rh_C\p{-1}+\Rh_C\p{1}+\Rh_C\p{K+1}=0+1+6=7,
\end{align*}
as required.

\item[$n-M\equiv\modd{4}{7}$:] In this case, $n=M+7k+4$ for some $k$.  Applying the $\Rh$-recurrence in a similar manner to the first case, we obtain
\begin{align*}
\Rh_C\p{M+7k+4}
&=\Rh_C\p{M+7k-3}+\Rh_C\p{0}+\Rh_C\p{2}.
\end{align*}
We know that $\Rh_C\p{0}=0$ and that $\Rh_C\p{2}=2$. By induction, we have $\Rh_C\p{M+7k-3}=2K+2k+\As-2$. So, $\Rh_C\p{M+7k+4}=2K+2k+\As$, as required.

\item[$n-M\equiv\modd{5}{7}$:] In this case, $n=M+7k+5$ for some $k$.  Applying the $\Rh$-recurrence in a similar manner to the first case, we obtain
\begin{align*}
\Rh_C\p{M+7k+5}
&=\Rh_C\p{-K+L+5k+10-\As}\\
&\phantom{=}+\Rh_C\p{M+7k-2}+\Rh_C\p{1}.
\end{align*}
We know that $\Rh_C\p{1}=1$. By induction, we have $\Rh_C\p{M+7k-2}=2K+k+\Bs-1$. 
We also know that $n\leq 2K+\nu$. 
Since $n=M+7k+5$, we have $n-M-5=7k\leq2K+\nu-M-5=K-L-10+\nu=7c+\Cs-10+\nu$. Observe that
\[
\Cs-10+\nu=\begin{cases}
-12, & \text{if $\Cs=0$;}\\
-11, & \text{if $\Cs=1$;}\\
-6, & \text{otherwise.}
\end{cases}
\]
Since $7k\equiv\modd{0}{7}$, we actually have
\[
7k\leq
\begin{cases}
7c-14, & \text{if $\Cs=0$ or $\Cs=1$;}\\
7c-7, & \text{otherwise.}
\end{cases}
\]
 From here, we have $-K+L+5k+10-\As=-7c-\Cs+5k+10-\As$.
When $\Cs\leq1$, we have  $-7c-\Cs+5k+10-\As\leq-7c-\Cs+\frac{5}{7}\p{7c-14}+10-\As=-2c-\Cs-\As<0.$ When $\Cs\geq2$, we have
$-7c-\Cs+5k+10-\As\leq-7c-\Cs+\frac{5}{7}\p{7c-7}+10-\As=-2c-\Cs+5-\As.$
Observe that $-2c-\Cs+5-\As\leq-1$ when $\Cs\geq2$, which is less than $0$. In turn, this all means that $-K+L+5k+10-\As\leq0$ regardless of value of $\Cs$, implying that $\Rh_C\p{-K+L+5k+10-\As}=0$. 
Therefore $\Rh_C\p{M+7k+5}=2K+k+\Bs$, as required.

\item[$n-M\equiv\modd{6}{7}$:] In this case, $n=M+7k+6$ for some $k$.  Applying the $\Rh$-recurrence, we have
\begin{align*}
\Rh_C\p{M+7k+6}
&=\Rh_C\p{-K+L+6k+11-\Bs}\\
&\phantom{=}+\Rh_C\p{-K+L+5k+11-\As}\\
&\phantom{=}+\Rh_C\p{M+7k-1}.
\end{align*}
By induction, we have $\Rh_C\p{M+7k-1}=K-2$. 
We also know that $n\leq 2K+\nu$. 
Since $n=M+7k+6$, we have $n-M-6=7k\leq2K+\nu-M-6=K-L-11+\nu=7c+\Cs-11+\nu$. Observe that
\[
\Cs-11+\nu=\begin{cases}
-13, & \text{if $\Cs=0$;}\\
-12, & \text{if $\Cs=1$;}\\
-7, & \text{otherwise.}
\end{cases}
\]
Since $7k\equiv\modd{0}{7}$, we actually have
\[
7k\leq
\begin{cases}
7c-14, & \text{if $\Cs=0$ or $\Cs=1$;}\\
7c-7, & \text{otherwise.}
\end{cases}
\]
 From here, we have $-K+L+6k+11-\Bs=-7c-\Cs+6k+11-\Bs$.
When $\Cs\leq1$, we have  $-7c-\Cs+6k+11-\Bs\leq-7c-\Cs+\frac{6}{7}\p{7c-14}+11-\Bs=-c-\Cs-1-\Bs<0.$ When $\Cs\geq2$, we have 
$-7c-\Cs+6k+11-\Bs\leq-7c-\Cs+\frac{6}{7}\p{7c-7}+11-\Bs=-c-\Cs+5-\Bs.$
Observe that $-c-\Cs+5-\Bs\leq0$ when $\Cs\geq2$. In turn, this all means that $-K+L+6k+11-\Bs\leq0$ regardless of value of $\Cs$, implying that $\Rh_C\p{-K+L+6k+11-\Bs}=0$.
Similarly, we have $-K+L+5k+11-\As=-7c-\Cs+5k+11-\As$.
When $\Cs\leq1$, we have  $-7c-\Cs+5k+11-\As\leq-7c-\Cs+\frac{5}{7}\p{7c-14}+11-\As=-2c-\Cs+1-\As<0.$ When $\Cs\geq2$, we have
$-7c-\Cs+5k+11-\As\leq-7c-\Cs+\frac{5}{7}\p{7c-7}+11-\As=-2c-\Cs+6-\As.$
Observe that $-2c-\Cs+6-\As\leq0$ when $\Cs\geq2$. In turn, this all means that $-K+L+5k+11-\As\leq0$ regardless of value of $\Cs$, implying that $\Rh_C\p{-K+L+5k+11-\As}=0$.
Therefore, $\Rh_C\p{M+7k+6}=K-2$, as required.
\end{description}
\end{proof}

We now prove Theorem~\ref{thm:trihof1N}.
\begin{proof}
We refer the reader to Table~\ref{tab:24terms} for terms $\Rh_{\bar N}\p{1}$ through $\Rh_{\bar N}\p{N+28}$. The calculations for $\Rh_N$ also apply to $\Rh_{\bar N}$. From there, Table~\ref{tab:69terms} lists terms $\Rh_{\bar N}\p{N+25}$ through $\Rh_{\bar N}\p{N+69}$. Those calculations, which are available in detail on \href{https://github.com/nhf216/B-recurrence-data}{GitHub}, are all valid provided $N\geq67$. 
Observe that the values $K=N$, $c=\fl{\frac{N-65}{7}}$, $\Cs=\pb{N-65}\bmod 7$, $\As=65$, and $\Bs=3$ satisfy the conditions of Lemma~\ref{lem:7cyc} provided that $N\geq72$ (so that $c\geq1$), and the first $N+69$ terms of $\Rh_{\bar N}$ can be used as initial conditions as per that lemma. Keeping in mind that these choices of parameters mean that $L=65$ and $M=N+70$, Lemma~\ref{lem:7cyc} implies we have the following pattern for $B_{\bar N}$ for some time:
\begin{align*}
\Rh_{\bar N}\p{N+70+7k'}&=65+7k'+7=7k'+72\text{;}\\
\Rh_{\bar N}\p{N+70+7k'+1}&=N+70+7k'+2=N+7k'+72\text{;}\\
\Rh_{\bar N}\p{N+70+7k'+2}&=N+70+7k'+4=N+7k'+74\text{;}\\
\Rh_{\bar N}\p{N+70+7k'+3}&=7\text{;}\\
\end{align*}
\begin{align*}
\Rh_{\bar N}\p{N+70+7k'+4}&=2N+2k'+65\text{;}\\
\Rh_{\bar N}\p{N+70+7k'+5}&=2N+k'+3\text{;}\\
\Rh_{\bar N}\p{N+70+7k'+6}&=N-2\text{.}
\end{align*}
Re-indexing so that $k=k'+10$ allows us to rewrite this pattern as
\begin{align*}
\Rh_{\bar N}\p{N+7k}&=7\pb{k-10}+72=7k+2\text{;}\\
\Rh_{\bar N}\p{N+7k+1}&=N+7\pb{k-10}+72=N+7k+2\text{;}\\
\Rh_{\bar N}\p{N+7k+2}&=N+7\pb{k-10}+74=N+7k+4\text{;}\\
\Rh_{\bar N}\p{N+7k+3}&=7\text{;}\\
\Rh_{\bar N}\p{N+7k+4}&=2N+2\pb{k-10}+65=2N+2k+45\text{;}\\
\Rh_{\bar N}\p{N+7k+5}&=2N+\pb{k-10}+3=2N+k-7\text{;}\\
\Rh_{\bar N}\p{N+7k+6}&=N-2\text{,}
\end{align*}
which is the desired pattern. Lemma~\ref{lem:7cyc} guarantees that this pattern persists through index $2N+\nu$, where $\nu$ depends on $\Cs$, which, in turn, depends on $N$. Here, we have the required result:
\[
\nu=\begin{cases}
-1, & \text{if $N\equiv \modd{0}{7}$;}\\
-2, & \text{if $N\equiv \modd{1}{7}$;}\\
-2, & \text{if $N\equiv \modd{2}{7}$;}\\
-2, & \text{if $N\equiv \modd{3}{7}$;}\\
2, & \text{if $N\equiv \modd{4}{7}$;}\\
1, & \text{if $N\equiv \modd{5}{7}$;}\\
0, & \text{if $N\equiv \modd{6}{7}$.}\\
\end{cases}
\]

\begin{center}
\begin{table}
	\[
	\begin{array}{|c|c|c|c|c|c|c|}\hline
		\textbf{Index} & N+25 & N+26 & N+27 & N+28 & N+29 & N+30 \\\hline
		\textbf{Term} & 2N + 5 & 9 & 18 & 2N + 20 & 2N + 23 & N + 9\\\hline\hline
		\textbf{Index} & N+31 & N+32 & N+33 & N+34 & N+35 & N+36\\\hline
		\textbf{Term} & 22 & N + 30 & N + 35 & N + 13 & 27 & 36\\\hline\hline
		\textbf{Index} & N+37 & N+38 & N+39 & N+40 & N+41 & N+42\\\hline
		\textbf{Term} & N + 37 & 2N + 10 & N + 4 & 39 & N + 38 & N + 44\\\hline\hline
		\textbf{Index} & N+43 & N+44 & N+45 & N+46 & N+47 & N+48\\\hline
		\textbf{Term} & N + 8 & 42 & N + 40 & N + 47 & 16 & N + 39\\\hline\hline
        \textbf{Index} & N+49 & N+50 & N+51 & N+52 & N+53 & N+54\\\hline
   		\textbf{Term} & N + 8 & 42 & N + 40 & N + 47 & 16 & N + 39\\\hline\hline
   		\textbf{Index} & N+55 & N+56 & N+57 & N+58 & N+59 & N+60\\\hline
   		\textbf{Term} & N + 16 & 46 & N + 49 & N + 60 & 25 & 38\\\hline\hline
   		\textbf{Index} & N+61 & N+62 & N+63 & N+64 & N+65 & N+66\\\hline
   		\textbf{Term} & 58 & 4N + 51 & 2N + 14 & N + 4 & 61 & 71\\\hline\hline
        \textbf{Index} & N+67 & N+68 & N+69 &  & & \\\hline
   		\textbf{Term} & 2N + 63 & 2N + 2 & N - 2& & & \\\hline
	\end{array}
	\]
	\caption{Terms $B_{\bar N}(N+25)$ through $B_{\bar N}(N+69)$ whenever $N\geq67$.}
	\label{tab:69terms}
\end{table}
\end{center}

We now prove the remainder of Theorem~\ref{thm:trihof1N}, regarding the ways in which $B_{\bar N}$ can end.  For each possibility of $N\bmod 7$, we can compute terms of $B_{\bar N}$ from index $2N+\nu+1$ onward, using the now known values of $B_{\bar N}$ for all smaller indices. These computations are akin to those done for the initial terms of $B_{\bar N}$, and like those we track how large $N$ needs to be for the computations to be valid. The result is a lengthy and tedious list of terms and bounds, but the claimed end conditions in the statement of the theorem are all validated. The full length of the computations can be found on \href{https://github.com/nhf216/B-recurrence-data}{GitHub}. The repository includes one file for each value of $N\bmod 7$.
\end{proof}

The sequences corresponding to the minimum values of $N$ for each congruence class in Theorem~\ref{thm:trihof1N} are all available in OEIS: \seqnum{A373234}, \seqnum{A373235}, \seqnum{A373236}, \seqnum{A373237}, \seqnum{A373238}, \seqnum{A274058}, and~\seqnum{A373239}.


\subsection{The remaining values of $N$}\label{ss:sporadic}

Theorem~\ref{thm:trihof1N} characterizes the behavior of $B_{\bar N}$ for all but $6079$ values of $N\geq3$. 
These sequences can be studied individually by generating the sequences and observing the terms.  This study is carried out in Fox's doctoral thesis~\cite{thesis}; what follows is a summary of those findings.  All of these sequences end before $150$ million terms except when
\begin{align*}
N &\in \{4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 81, 182, 193, 429, 822, \\
&\quad\quad\quad 1892, 2789, 3442, 7292, 20830, 23511, 25163\}.
\end{align*}
 Of these $B_{\bar 5}$ and $B_{\bar 6}$ are the $B$-sequence (\seqnum{A278055}), so they last forever. For
 \[
 N\in\st{4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18},
 \]
 $B_{\bar N}$ appears to last forever but exhibits chaotic behavior, akin to the sequences in Figure~\ref{fig:b789}. To discuss the remaining values, we need four more results like Lemma~\ref{lem:7cyc}. All come from Fox's thesis and are stated here without proof. All proofs are straightforward but tedious inductive arguments, much like the proof of Lemma~\ref{lem:7cyc}. Here, unlike in Lemma~\ref{lem:7cyc}, the bounds on the parameters are generally not optimized.

\begin{lemma}\label{lem:2cyc}\cite[Proposition~9.9]{thesis}
Let $K\geq 1$ and $M\geq K+5$ be integers.
Then, for arbitrary integers $a_1,a_2,\ldots,a_K$, let $\Rh_D$ denote the sequence resulting from the $\Rh$-recurrence and the 
initial conditions
\[
\abk{\bar{0};a_1,a_2,\ldots,a_K,2,M,2}.
\]
The sequence $\Rh_D$ follows the following pattern starting from $\Rh_D\p{K+1}$ (and lasting forever):
\begin{align*}
\Rh_D\p{K+2k}&=2^{k-1}\cdot M\text{;}\\
\Rh_D\p{K+2k+1}&=2\text{.}
\end{align*}
\end{lemma}

\begin{lemma}\label{lem:5cyc}\cite[Proposition~9.10]{thesis}
Let $K\geq 3$, and $\Bs\geq1$ be integers.
Then, for arbitrary integers $a_4,a_5,\ldots,a_K$, let $\Rh_E$ denote the sequence resulting from the $\Rh$-recurrence and the 
initial conditions
\[
\abk{\bar{0};1,2,3,a_4,a_5,\ldots,a_K,K+\Bs,3,K+3,K+\Bs+1,5}.
\] 
The sequence $\Rh_E$ follows the following pattern from $\Rh_E\p{K+1}$ through $\Rh_E\pb{K+\fl{\frac{5\Bs-15}{2}}}$:
\begin{align*}
\Rh_E\p{K+5k}&=5\text{;}\\
\Rh_E\p{K+5k+1}&=K+3k+\Bs\text{;}\\
\Rh_E\p{K+5k+2}&=3\text{;}\\
\Rh_E\p{K+5k+3}&=K+5k+3\text{;}\\
\Rh_E\p{K+5k+4}&=K+3k+\Bs+1\text{.}
\end{align*}
\end{lemma}

\begin{lemma}\label{lem:16cyc1}\cite[Proposition~9.13]{thesis}
Let $K$, $\As$, $\Bs_1$, $\Bs_2$, and $\Cs$ be positive integers with $\As>31+K$, $\Bs_1>\As$, $\Bs_2>\As$, and $\Cs>\As$.
Then, for arbitrary integers $a_1,a_2,\ldots,a_K$, let $\Rh_T$ denote the sequence resulting from the $\Rh$-recurrence and the 
initial conditions
\[
\abk{\bar{0};a_1,a_2,\ldots,a_K,\As,7,\Bs_2,16,\Bs_2,16,\Bs_1,\As,7,\Bs_2,16,2\Bs_2,16,\Bs_2,25,\Cs,\As,7}.
\]
The sequence $\Rh_T$ follows the following pattern from $\Rh_T\p{K+1}$ through $\Rh_T(\As)$:
\begin{align*}
\Rh_T\p{K+16k}&=\Bs_1\cdot2^{k-1}+\Cs-\Bs_1\text{;}\\
\Rh_T\p{K+16k+1}&=\As\text{;}\\
\Rh_T\p{K+16k+2}&=7\text{;}\\
\Rh_T\p{K+16k+3}&=\Bs_2\cdot2^k\text{;}\\
\Rh_T\p{K+16k+4}&=16\text{;}\\
\Rh_T\p{K+16k+5}&=\Bs_2\cdot2^k\text{;}\\
\Rh_T\p{K+16k+6}&=16\text{;}\\
\Rh_T\p{K+16k+7}&=\Bs_1\cdot2^k\text{;}\\
\Rh_T\p{K+16k+8}&=\As\text{;}\\
\Rh_T\p{K+16k+9}&=7\text{;}\\
\end{align*}
\begin{align*}
\Rh_T\p{K+16k+10}&=\Bs_2\cdot2^k\text{;}\\
\Rh_T\p{K+16k+11}&=16\text{;}\\
\Rh_T\p{K+16k+12}&=\Bs_2\cdot2^k\text{;}\\
\Rh_T\p{K+16k+13}&=16\text{;}\\
\Rh_T\p{K+16k+14}&=\Bs_2\cdot2^k\text{;}\\
\Rh_T\p{K+16k+15}&=25\text{.}
\end{align*}
\end{lemma}

\begin{lemma}\label{lem:16cyc2}\cite[Proposition~9.16]{thesis}
Let $K$, $\As$, $\Bs_1$, $\Bs_2$, $\Cs_1$, $\Cs_2$, and $\Cs_3$ be positive integers with $\As>31+K$, $\Bs_1>\As$, $\Bs_2>\As$, $\Cs_1>\As$,  $\Cs_2>\As$, and $\Cs_3>\As$.
Then, for arbitrary integers $a_1,a_2,\ldots,a_K$, let $\Rh_U$ denote the sequence resulting from the $\Rh$-recurrence and the 
initial conditions
\[
\abk{\bar{0};a_1,a_2,\ldots,a_K,16,\Bs_2,7,\Cs_2,\As,16,\As,16,\Bs_1,10,\Cs_3,\Bs_2,7,\As,16,\Cs_1}.
\]
The sequence $\Rh_U$ follows the following pattern from $\Rh_U\p{K+1}$ through $\Rh_U(\As)$:
\begin{align*}
\Rh_U\p{K+16k}&=\Bs_1\cdot2^k+\Cs_1-2\Bs_1\text{;}\\
\Rh_U\p{K+16k+1}&=16\text{;}\\
\Rh_U\p{K+16k+2}&=\Bs_2\cdot2^k\text{;}\\
\Rh_U\p{K+16k+3}&=7\text{;}\\
\Rh_U\p{K+16k+4}&=7k+\Cs_2\text{;}\\
\Rh_U\p{K+16k+5}&=\As\text{;}\\
\Rh_U\p{K+16k+6}&=16\text{;}\\
\Rh_U\p{K+16k+7}&=\As\text{;}\\
\Rh_U\p{K+16k+8}&=16\text{;}\\
\Rh_U\p{K+16k+9}&=\Bs_1\cdot2^k\text{;}\\
\Rh_U\p{K+16k+10}&=10\text{;}\\
\Rh_U\p{K+16k+11}&=16k+\Cs_3\text{;}\\
\Rh_U\p{K+16k+12}&=\Bs_2\cdot2^k\text{;}\\
\Rh_U\p{K+16k+13}&=7\text{;}\\
\Rh_U\p{K+16k+14}&=\As\text{;}\\
\Rh_U\p{K+16k+15}&=16\text{.}
\end{align*}
\end{lemma}

For $N\in\st{81,182,429,822,1892,2789,7292,23511,25163}$, Lemma~\ref{lem:2cyc} eventually applies, so these sequences continue forever~\cite[Table~9.1]{thesis}. Both $B_{\overline{193}}$ (\seqnum{A28334}) and $B_{\overline{3442}}$ (\seqnum{A283885}) also continue forever. Infinitely many prefixes of these sequences satisfy the hypotheses of Lemma~\ref{lem:5cyc}. In other words, these sequences consist of infinitely many chunks of the sort described by Lemma~\ref{lem:5cyc} with some sporadic terms in between~\cite[Propositions~9.11 and~9.12]{thesis}. Each such chunk lasts approximately six times as long as the previous one. The first ten million terms of $\Rh_{\overline{193}}$ are shown in Figure~\ref{fig:b193}.
The only remaining sequence is $B_{\overline{20830}}$ (\seqnum{A283887}). This sequence ends, but it has a total of $84975\cdot2^{560362}+31$ terms, far too many to compute. First, some initial terms of $B_{\overline{20830}}$ satisfy the conditions of Lemma~\ref{lem:16cyc1}, so that lemma governs the behavior of the sequence for awhile. Then, shortly after the chunk of $B_{\overline{20830}}$ described by Lemma~\ref{lem:16cyc1} concludes, Lemma~\ref{lem:16cyc2} applies. That lemma then governs the behavior of the sequence for a long time. That chunk terminates at index $84975\cdot2^{560362}$, after which the sequence lasts only $31$ additional terms~\cite[Lemma~9.17]{thesis}. 

\begin{center}
\begin{figure}
	\begin{multicols}{2}
		\includegraphics[width=2.9in]{B193.png}
		
		\includegraphics[width=2.9in]{B193_log.png}
	\end{multicols}
	\caption{Plots of the first 10,000,000 terms of $\Rh_{\overline{193}}$ (\seqnum{A283884}) with linear scale (left) and logarithmic scale (right).}
	\label{fig:b193}
\end{figure}
\end{center}

\section{Future work}\label{s:future}
Studying nested recurrence relations with symbolic initial conditions of this type was initiated recently with Hofstadter's $Q$-recurrence~\cite{hof1thruN}, and it is continued here with the three-term analog to that recurrence. The obvious idea is to continue adding more terms to the recurrence. But, that study was undertaken in Fox's doctoral thesis~\cite[Section~9.3]{thesis}, and it suggests that chaos reigns supreme for the recurrences with four or more terms, even for large $N$. One question, then, would be whether there exist other symbolic initial conditions that lead to predictable solutions to these recurrences. Another direction would be to study these same sorts of initial conditions with other recurrences, such as the Conolly recurrence~\cite{con} or the Tanny recurrence~\cite{tanny}.

The other big research direction suggested by this work is further exploration and discovery of results like Lemmas~\ref{lem:7cyc}, \ref{lem:2cyc}, \ref{lem:5cyc}, \ref{lem:16cyc1}, and~\ref{lem:16cyc2}. These five lemmas all describe temporary or permanent solutions to the $\Rh$-recurrence that consist of interleavings of simpler sequences. These particular results appear in this paper because they are needed to analyze the sequences $\Rh_{\bar{N}}$ for various values of $N$. But, they are by no means exhaustive among results of this type. The first known solution of this type to a nested recurrence is Golomb's solution (\seqnum{A244477}) to the $Q$-recurrence~\cite{golomb}, which uses initial conditions $\abk{3,2,1}$. Later, Ruskey gave a solution (\seqnum{A188670}) to the $Q$-recurrence with exponentially growing subsequences~\cite{rusk} via initial conditions $\abk{\bar{0};3,6,5,3,6,8}$. A general algorithmic framework for finding and proving these sorts of solutions was laid out previously~\cite{symbhof}. All of these solutions last forever; the first known occurrence of temporary interleaved solutions is in analogous work to this paper on the $Q$-recurrence~\cite{hof1thruN}. Perhaps such solutions could also be worked into aforementioned algorithmic framework~\cite{symbhof}.

\bibliographystyle{jis}
\begin{thebibliography}{10}
	
	\bibitem{con}
	B.~W. Conolly, Meta-{F}ibonacci sequences, {C}hapter {X}{I}{I} in {S}. {V}ajda,
	\textit{{F}ibonacci \& {L}ucas Numbers, and the Golden Section}, Dover, 1989, pp. 127--138.
	
	\bibitem{spotbased}
	B. Dalton, M. Rahman, and S. Tanny, Spot-based generations for
	meta-{F}ibonacci sequences, {\em Exp. Math.} {\bf 20}
	(2011), 129--137.
	
	\bibitem{genrusk}
	N. Fox, Linear recurrent subsequences of generalized meta-{F}ibonacci
	sequences, {\em J. Difference Equ. Appl.}  (2016), 1019--1026.
	
	\bibitem{gengol}
	N. Fox, Quasipolynomial solutions to the {H}ofstadter $Q$-recurrence, {\em
		Integers} {\bf 16} (2016), A68.
	
	\bibitem{thesis}
	N. Fox, {\em An Exploration of Nested Recurrences Using {E}xperimental
		{M}athematics}, PhD thesis, Rutgers, The State University of New Jersey,
	2017.
	
	\bibitem{slowtrihof}
	N. Fox, A slow relative of {H}ofstadter's $Q$-sequence, {\em J. Integer
		Sequences} {\bf 20} (2017),
		\href{https://cs.uwaterloo.ca/journals/JIS/VOL20/Fox/fox2.html}{Article 17.7.3}.
	
	\bibitem{symbhof}
	N. Fox, Discovering linear-recurrent solutions to {H}ofstadter-like
	recurrences using symbolic computation, {\em J. Symbolic Comput.} {\bf 87}
	(2018), 99--126.
	
	\bibitem{hof1thruN}
	N. Fox, A new approach to the {H}ofstadter $Q$-recurrence, {\em Integers}
	{\bf 20A} (2020), A8.
	
	\bibitem{golomb}
	S.~W. Golomb, Discrete chaos: sequences
	satisfying \quot{Strange} recursions, preprint, 1991.
	
	\bibitem{geb}
	D. Hofstadter, {\em G\"odel, {E}scher, {B}ach: an {E}ternal {G}olden
		{B}raid}, Basic Books, 1979.
	
	\bibitem{pinn}
	K. Pinn, Order and chaos in {H}ofstadter's $Q(n)$ sequence, {\em Complexity}
	{\bf 4} (1999), 41--46.
	
	\bibitem{rusk}
	F. Ruskey, Fibonacci meets {H}ofstadter, {\em Fibonacci Quart.} {\bf 49}
	(2011), 227--230.
	
	\bibitem{oeis}
	N.~J.~A. Sloane et al., The On-Line Encyclopedia of Integer Sequences, \url{https://oeis.org}.
	
	\bibitem{tanny}
	S.~M. Tanny, A well-behaved cousin of the {H}ofstadter sequence, {\em
		Discrete Math.} {\bf 105} (1992), 227--239.
	
\end{thebibliography}


\bigskip
\hrule
\bigskip

\noindent 2020 {\it Mathematics Subject Classification}: 11B37.

\noindent \emph{Keywords: } recurrence relation, nested recurrence,
meta-Fibonacci sequence, Hofstadter $Q$-sequence, symbolic computation.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences
\seqnum{A005185},
\seqnum{A188670},
\seqnum{A244477},
\seqnum{A274058},
\seqnum{A278055},
\seqnum{A283884},
\seqnum{A283885},
\seqnum{A283887},
\seqnum{A373227},
\seqnum{A373228},
\seqnum{A373229},
\seqnum{A373230},
\seqnum{A373231},
\seqnum{A373232},
\seqnum{A373233},
\seqnum{A373234},
\seqnum{A373235},
\seqnum{A373236},
\seqnum{A373237},
\seqnum{A373238}, and
\seqnum{A373239}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received June 10 2024;
revised versions received  September 2 2024; September 7 2024.
Published in {\it Journal of Integer Sequences},
September 7 2024.

\bigskip
\hrule
\bigskip

\noindent
Return to
\htmladdnormallink{Journal of Integer Sequences home page}{https://cs.uwaterloo.ca/journals/JIS/}.
\vskip .1in


\end{document}
