Question: Is there any sort of theory on periodic sequences given by recurrence relations? I cannot describe what makes the examples at the bottom interesting, or what I could possibly want to know about a general theory (if one exists). I hope they are more than just curiosities, but I cannot really tell where, in the mathematical world, they fit, or where I could go to learn anything about them.

What I know: (possibly a red herring, or running before crawling) To exclude sequences like $x \mapsto x + k \pmod p$ that are obviously periodic, the interesting examples I've seen so far have terms that are Laurent polynomials in the first two terms $a_1 = x$ and $a_2 = y$. This is even called the Laurent Phenomenon (I personally know very little about Laurent polynomials).

Based on my research (primarily Fomin and Reading's notes Root Systems and Generalized Associahedra and web searches), there are certain structures called cluster algebras (or, evidently, Laurent phenomenon algebras) that seem to have been created with these recurrence relations in mind, or as a motivation, or create them as a natural byproduct (I don't know).

Although I've taken some courses in combinatorics in which recurrence relations were covered, I really don't remember anything periodic happening, just the basic stuff (and I've forgotten most of that!).


Motivation: In this question, a sequence $a_i$ is given by the recurrence relation $a_i = a_{i - 1}a_{i + 1}$, or equivalently, $a_{i + 1} = \frac{a_i}{a_{i - 1}}$. It is shown in several answers that if $a_1 = x$ and $a_2 = y$, the terms of the sequence are

$$\underbrace{x,\, y,\, \frac{y}{x},\, \frac{1}{x},\, \frac{1}{y},\, \frac{x}{y}}_{\text{period}},\, x,\, y,\, \ldots$$

and so is periodic with period of $6$.

This reminded me of Fomin and Reading's notes Root Systems and Generalized Associahedra. The first topic there is a sequence defined recursively by \begin{align} f_1 &= x,\\ f_2 &= y, \\ f_{i+1} &= \frac{f_i + 1}{f_{i - 1}}, \end{align} whose terms are $$\underbrace{x,\, y,\, \frac{y+1}{x},\, \frac{x+y+1}{xy},\, \frac{x+1}{y}}_{\text{period}},\, x,\, y,\, \ldots$$

that turns out to have period $5$.


Following our conversation in the comments, "periodic sequences given by recurrence relations" is very close to the behavior of a discrete-time dynamical system (which indeed is a recurrence relation) that arrives, starting from a initial condition $x_0$ to a periodic $n$-orbit cycle attractor, in other words, a stable cycle of points, repeating the visit to those points in the same order.

Caveat: please if somebody can enhance my answer, any correction is welcomed.

As in your case you are working with a one-dimensional recurrence relation (aka map, aka discrete-time dynamical system), there is no chaos (it is required at least two dimensions to obtain a chaotic dynamical system), so no chaotic attractors will appear associated to the system, but you can arrive to sequences of points from which the recurrence formula cannot escape (it is the attractor). So the attractor would be your "periodic sequence".

For instance, the most famous case is the Logistic map, which is very useful to understand the basic concepts of the discrete-time maps:$$x_{n+1}=r \cdot x_n(1-x_n)$$

Where you can decide the initial condition $x_0$ of the system and you can decide the value of the control parameter $r$. Depending on the value of $r$ you will arrive to different stable $n$-orbit solutions. So some of them will arrive depending on the value of $r$ to a $2$-orbit cycle, $3$, $4$, many... or you never arrive to one, which is also possible depending on the definition of the dynamical system.

To see the whole picture of what happens when $r$ changes, you can study the bifurcation diagrams. They basically represent a graph in which the $x$-axis is one of the control parameters and in the $y$-axis you put the value of the $n$-orbit points where the specific $r$ case arrive. This leads to a graph where you can study the evolution of the system depending on the value of $r$. E.g. here is the bifurcation diagram of the Logistic map (credits to Wikipedia):

enter image description here

Another example: if we assume that the Collatz conjecture is true, then it behaves like a discrete-time dynamical system (in $\Bbb N$): it does not matter the initial condition $x_0$: you will arrive to the $3$-orbit $\{1,4,2\}$. Since the moment you arrive to $1$ you cannot escape from $\{1,4,2\}$.


The related question is finding functions such that their composition returns the argument: $$f(f(x))=x$$ Simple examples are: $$f(x)=1-x$$ $$f(x)=\frac{1}{x}$$ $$f(x)=\frac{1-x}{1+x}$$

They are called self-inverse functions, because by definition of inverse function:

$$f^{-1}(f(x))=x$$

A more general example:

$$f(x)=(1-x^a)^{1/a}$$

Self-inverse functions always give period $2$, but we can also search for functions such that: $$f(f(f(x)))=x$$ and so on. All of this allows for a 1st order recurrence relation to be periodic, instead of 2nd order which the OP provides.

A simple case of 1st order recurrence with period $N$ will be

$$z_{n+1}=z_n^{\omega_N}$$

where

$$\omega_N=\sqrt[N]{1} \neq 1$$

For example $\omega_3=e^{ \pm 2 \pi i/3}$ will give a recurrence with period $3$.