Periodic or non periodic function plotting I am currently working on plotting a function and figuring out if its periodic or not. The function is as follows:$$x_n=\beta\cdot x_{n-1}+\alpha\gamma\cdot\operatorname{sgn}(x_{n-3})+\alpha(1-\gamma)\cdot\operatorname{sgn}(x_{n-2})$$
I know $0<\beta<1$, $\alpha<0$, $0<\gamma<1$. Note that $\operatorname{sgn}$ is the sign function.
I have created an app on MATLAB which helps me figure out if it is periodic or not depending on the three initial values I start with. I have noticed that it can be $1$, $3$ or $4$-periodic so far.
I am having a hard time figuring out how to write this mathematically.
I am trying to find a negative delay. Any hints or sources that I can use would be really appreciated.
 A: Calling 
$$\delta(u,v)=\alpha(1-\gamma)\mbox{sign}(u)+\alpha\gamma \mbox{sign}(v)
$$
we have
$$
\min_{u,v}\delta(u,v)  \le \alpha(1-\gamma)\mbox{sign}(x_{n-2})+\alpha\gamma \mbox{sign}(x_{n-3})\le \max_{u,v}\delta(u,v)
$$
and the recurrences
$$
x_n^i = \beta x_{n-1}^i+\min_{u,v}\delta(u,v)\\
x_n^s = \beta x_{n-1}^s+\max_{u,v}\delta(u,v)\\
$$
have the solutions
$$
x_n^i = C_0 \beta^{n-1}+\frac{(1-\beta^n)}{\beta-1}\min_{u,v}\delta(u,v)\\
x_n^s = C_0 \beta^{n-1}+\frac{(1-\beta^n)}{\beta-1}\max_{u,v}\delta(u,v)\\
$$
and after a little transient
$$
x_n^i \le x_n\le x_n^s
$$
Attached the plot for $x_n^i, x_n^s$ in red and $x_n$ in blue. Note that the recurrences $x_n^i, x_n^s$ should begin at $x_3$. The values assumed are $\alpha=-3,\beta = 0.25, \gamma = 0.75$ and the initial conditions $x_1,x_2,x_3$ are random values in the range $(-10, 10)$

NOTE
Due to the structure
$$
x_n = \beta x_{n-1}+\cdots
$$
there is an exponential component all along $n\to\infty$ which eliminates the periodic behavior possibility.
If instead we consider the recurrence
$$
x_n = \alpha(1-\gamma)\mbox{sign}(x_{n-2})+\alpha\gamma \mbox{sign}(x_{n-3})
$$
with $\beta = 0$ then periodic solutions can appear when the initial conditions $x_1, x_2, x_3$ have different signs as for instance $x_1=1,x_2 = -1, x_3 = 0$ 

or $x_1=1,x_2 = -1, x_3 = 1$

To solve 
$$
z_n = \beta z_{n-1}+\alpha(1-\gamma)+\alpha\gamma
$$
which is a linear recurrence we use the fact
$$
z_n = z_n^h+z_n^p\\
z_n^h -\beta z_{n-1}^h = 0\\
z_n^p -\beta z_{n-1}^p=\alpha(1-\gamma)+\alpha\gamma
$$
then easily we find $z_n^h = C\beta^{n-1}$. Now considering $z_n^p = C_n\beta^{n-1}$ and substituting into the particular we can find also the recurrence for $C_n$ which is
$$
C_n-C_{n-1} = \alpha\beta^{1-n}
$$
with solution
$$
C_n = \frac{\alpha  \beta  \left(1-\beta ^{-n}\right)}{\beta -1}
$$
and finally
$$
z_n =  C\beta^{n-1}+ \frac{\alpha  \beta  \left(1-\beta ^{-n}\right)}{\beta -1}\beta^{n-1}=C \beta^{n-1}+\frac{\alpha(1-\beta^n)}{\beta-1}
$$
The general solution can be computed with the help of the following MATHEMATICA script
x2 = 2; x3 = 3; x1 = 1;
path = {x1, x2, x3};
beta = 0.5; alpha = 10; gamma = 3;
For[i = 1, i <= 30, i++, x4 = beta x3 + alpha (1 - gamma) Sign[x2] + alpha gamma Sign[x1]; 
AppendTo[path, x4]; x1 = x2; x2 = x3; x3 = x4]

ListPlot[path, PlotRange -> All]

