I've been fiddling with the recursive sequence defined as follows:

$$\begin{equation} f_n=\begin{cases} a, & n=1.\\ b, & n=2.\\ c, & n=3.\\ f_{n-1}f_{n-2}f_{n-3} \mod[f_{n-1}+f_{n-2}+f_{n-3}], & n>3. \end{cases} \end{equation}$$

And no matter my initial choices of positive integers $a,b,c$, it seems $ \{ f_n \}$ always terminates (three consecutive zeros) or enters a cycle. For instance, if $a=12,b=12,c=9$, then the sequence becomes $12,12,9, 9,12,$ $12\dots$

**My question:** can we prove (or disprove) that for any positive integers $a,b,c$, the sequence $\{ f_n\}$ will always terminate (three consecutive zeros) or enter a cycle?

*More important remarks in quotes.*

**(Dec. 27) Remark 1.1:** it appears (though I have not proved it) that my conjecture is true for the simpler recursive sequence

$$\begin{equation} f_n=\begin{cases} a, & n=1.\\ b, & n=2.\\ f_{n-1}f_{n-2} \mod[f_{n-1}+f_{n-2}], & n>2. \end{cases} \end{equation}$$

Perhaps this would be a better starting point. Hereafter, I will only be referring to the above.

**(Dec. 28) Remark 1.2:** If $f_n=f_{n-1}$ and is odd, then $f_k=f_n$ for all $k>n$. If $f_n=f_{n-1}$ and is even, the sequence will terminate. This can be proven simply enough.

(Dec. 28) Remark 1.3:I conjecture that if $a$ is odd and $b>a+1$ is even, the sequence always terminates. Also, if $a$ is even and $b>a+1$ is odd, the sequence never terminates.

**(Dec. 28) Remark 1.4:** the sequence reaches the cycle $\dots 5,7,11,5,7,11\dots$ for many choices of $a,b.$ Some pairs $(a,b)$ for which $f_n$ enters the cycle $\dots 5,7,11 \dots$ are $(3,5), (5,7), (7,11),$ $(7,3),(35,11),(44,13).$ There are probably infinitely many pairs $(a,b)$ for which this occurs. The frequency with which I see $5,7,11$ is probably due to my relatively small choices of integers. I wonder what the minimum of $X+Y+Z > 3$ is, where $X,Y,Z$ is a cycle eventually reached by the function.

I wonder further if there are arbitrarily long sequences of numbers which this recurrence relation would cycle through for certain initial $a,b$. I have not found any cycles longer than three terms, though $5,7,11$ is not the only three-term cycle I have found. For $(a,b) = (7,111111101)$, the sequence eventually reaches the cycle $8496495, 3641355, 6068925$. If we have $(a,b) = (6, 99)$, the sequence reaches a different length-$3$ cycle.

**(Dec. 28) Remark 1.5:** almost always, it seems that when $f_n$ does not terminate, the repeated terms are multiples of $5$. Some exceptions are $\{ f_n \}^{(9,66)}$, $\{ f_n \}^{(6,99)}$, and $\{ f_n \}^{(3,11)}$, where $\{ f_n \}^{(x,y)}$ is the sequence generated for $a=x,b=y$.

(Dec. 28) Remark 1.6:I conjecture $5,7,11$ are the only primes that appear in a distinct cycle (see Def. 1.1). In fact, it may even be the case that $5,7,11$ is the only distinct cycle with primes.

**(Dec. 29) Remark 1.7:** I should probably state what the 'cycles' I am talking about are.

**Definition 1.1:** $\{ f_n \}$ is said to enter cycle $X,Y,Z$ if for some $k>0$ we have $f_{k+3n} = X, f_{k+3n+1} =Y$, and $f_{k+3n+2} = Z$ for all integer $n \geq 0$.

**Definition 1.2:** A cycle is said to be *non-constant* if $X,Y,Z$ are not all equal. Similarly, a cycle is said to be *distinct* if $X \neq Y \neq Z$.

(Dec. 29) Remark 1.8:It seems not every positive integer is part of a distinct cycle (see Def. 1.2) That is, there are some (in fact, many) integers for which, no matter our choice of integers $a,b > 0$, the sequence $\{ f_n \}^{(a,b)}$ will not enter a distinct cycle with that integer. I am not sure if the same is true for non-constant cycles. For constant cycles, this is trivially not the case.