1 Introduction

In this paper, we study the dynamics of the non-autonomous difference equation

$$\begin{aligned} x_{n+1}=p_{n}+\frac{x_{n}}{x_{n-1}} \end{aligned}$$
(1)

where \(x_{0}\ge 0, x_{-1}>0\) and \(p_{n}\) is a positive bounded sequence. This kind of difference equations has been considered in some articles cited below. Interested reader can go bach to these titles and the references cited therein. In [10] the authors studied the difference equation

$$\begin{aligned} x_{n+1}=A_{n}+\frac{x^{p}_{n-1}}{x^{q}_{n}}, \end{aligned}$$
(2)

where \(x_{-1}\ge 0, x_{0}>0\), the sequence \(A_{n}\) is a positive bounded sequence, p and \(q \in [0,\infty )\). In [12] the authors studied an extension of this equation, which is

$$\begin{aligned} x_{n+1}=A+\frac{x^{p}_{n-1}}{x^{q}_{n}}. \end{aligned}$$
(3)

In addition, the authors in [4, 6, 11] studied the dynamics of the difference equation

$$\begin{aligned} x_{n+1}=\alpha +\frac{x_{n-k}^{p}}{x_{n}^{p}} \end{aligned}$$
(4)

where \(p, \alpha \in [0,\infty )\) and \(x_{-1}, x_{0}\) are positive numbers.

Finally, in [5, 8, 14] the authors studied the difference equation

$$\begin{aligned} x_{n+1}=p_{n}+\frac{x_{n-1}}{x_{n}} \end{aligned}$$
(5)

where \(x_{0}>0, x_{-1}\ge 0\) and \(p_{n}\) is a positive bounded sequence.

Motivated by the above papers we will study the boundedness and attractivity of the equation

$$\begin{aligned} x_{n+1}=p_{n}+\frac{x_{n}}{x_{n-1}}, \end{aligned}$$
(6)

where \(x_{0}\ge 0,x_{-1}>0\) and \(p_{n}\) is a positive bounded sequence.

Studying the dynamics of Nonautonomous difference equations is an important and interesting subject in its own right. Nonautonomous difference equations have many applications in different areas such as economics, social sciences, biology,...etc. We cite here the book by Sedaghat [13] for applications of nonautonomous difference equations. Equation (1) could be obtained from the population model \(y_{n+1}=(\mu K_n y_n)/(K_ny_{n-1}+(\mu -1)y_n)\) by taking \(x_n=1/y_n\).

In order to have a self-content article, we list below some definitions of basic concepts discussed in the paper.

Definition 1.1

We say that a solution \(\{x_n\}\) of a difference equation \(x_{n+1}=f(x_n,x_{n-1},\ldots ,x_{n-k})\) is bounded and persists if there exist positive constants m and M such that \(m\le x_n\le M\) for \(n=-1,0,\ldots \)

Definition 1.2

We say that a solution \(\{x_n\}\) of a difference equation \(x_{n+1}=f(x_n,x_{n-1},\ldots ,x_{n-k})\) is periodic if there exists a positive integer p such that \(x_{n+p}=x_n\). The smallest such positive integer p is called the prime period of the solution of the difference equation.

Definition 1.3

The equilibrium point of the equation \(x_{n+1}=f(x_n,x_{n-1},\ldots ,x_{n-k}),n=0,1,\ldots \) is the point that satisfies the condition \(\bar{x}=f(\bar{x},\bar{x},\ldots ,\bar{x})\).

Definition 1.4

Consider the difference equation \(x_{n+1}=f(x_n,x_{n-1},\ldots ,x_{n-k})\). Then

  1. (a)

    A positive semi-cycle of a solution \(\{x_n\}\) of this equation is a string of terms \(\{x_l,x_{l+1},\ldots ,x_m\}\), all greater than or equal to the equilibrium \(\bar{x}\), with \(l\le -k\) and \(m\le \infty \) and such that either \(l=-k\) or \(l>-k\) and \(x_{l-1}<\bar{x}\) and either \(m=\infty \) or \(m<\infty \) and \(x_{m+1}<\bar{x}\).

  2. (b)

    A negative semi-cycle of a solution \(\{x_n\}\) of this equation is a string of terms \(\{x_l,x_{l+1},\ldots ,x_m\}\), all less than or equal to the equilibrium \(\bar{x}\), with \(l\ge -k\) and \(m\le \infty \) and such that either \(l=-k\) or \(l>-k\) and \(x_{l-1}\ge \bar{x}\) and either \(m=\infty \) or \(m<\infty \) and \(x_{m+1}\ge \bar{x}\).

Definition 1.5

A solution of the difference equation \(x_{n+1}=f(x_n,x_{n-1},\ldots ,x_{n-k})\) is called nonoscillatory if there exists \(N\ge -k\) such that \(x_n>\bar{x}\) for all \(n\ge N\) of \(x_n<\bar{x}\) for all \(n\le N\). A solution \(\{x_n\}\) is called oscillatory if it is not nonoscillatory.

In the next section, we discuss boundedness, persistence and invariant interval of solutions of Eq. (6). Then, semi-cycle behavior and attractivity of solutions are considered. Finally, existence of periodic solutions is studied.

2 Boundedness and persistence

Let \(p_{n}\) is a positive bounded sequence with

$$\begin{aligned} \liminf _{n\rightarrow \infty }{p_{n}}=p\ge 0 \quad \text{ and }\quad \limsup _{n\rightarrow \infty }{p_{n}}=q<\infty . \end{aligned}$$
(7)

The following results can be obtained and proved directly as in [5]. For the convenience of the reader, we refer to the main arguments in the proof.

Lemma 2.1

Assume Eq. (7) is satisfied. Let \({x_{n}}\) be a solution of (6). Then,

  1. (i)

    If \(p>0\), then \(\{x_{n}\}\) persists.

  2. (ii)

    If \(p>1\), then \(\{x_{n}\}\) is bounded from above.

Proof

Assume that \(p>0\). It’s clear that \(x_{n+1}>p_n\) from which we conclude that \(\lim \inf _{n\rightarrow \infty }x_n\ge p\). Thus, \(x_n\) persists. To prove the second part we assume that \(p>1\). From part (i) we have \(x_{n+1}\ge p-\epsilon \). Then we have \(x_{n+1}\le p_n+\frac{x_n}{p-\epsilon }\). Referring to theorem B in [5], we get the result. \(\square \)

The following results are readily obtained as in [5]

Lemma 2.2

Assume that Eq. (7) is satisfied and \(p>1\), and let \(x_{n}\) be a solution of Eq. (6). If

$$\begin{aligned} \lambda =\liminf _{n\rightarrow \infty }x_{n}\quad \text{ and }\quad \mu =\limsup _{n\rightarrow \infty }x_{n}, \end{aligned}$$

then

$$\begin{aligned} \frac{pq-1}{q-1}\le \lambda \le \mu \le \frac{pq-1}{p-1} \end{aligned}$$
(8)

Proof

Let \(\epsilon >0\), then for \(n\ge N_{0}(\epsilon )\), we have \(\lambda -\epsilon \le x_{n} \le \mu +\epsilon \) and \(p-\epsilon \le p_{n}\le q+\epsilon \). Then,

$$\begin{aligned} x_{n+1}\ge p-\epsilon +\frac{\lambda -\epsilon }{\mu +\epsilon }, \text{ as }\quad n\rightarrow \infty \quad \lambda \ge p+\frac{\lambda }{\mu }, \end{aligned}$$
(9)

and

$$\begin{aligned} x_{n+1}\le q+\epsilon +\frac{\mu +\epsilon }{\lambda -\epsilon }, \text{ as } \quad n\rightarrow \infty \quad \mu \le q+\frac{\mu }{\lambda }. \end{aligned}$$
(10)

Hence,

$$\begin{aligned} \mu p+\lambda \le \lambda \mu \le q\lambda +\mu . \end{aligned}$$

Then,

$$\begin{aligned} \mu (p-1)\le \lambda (q-1), \end{aligned}$$

so we get

$$\begin{aligned} \frac{\mu }{\lambda }\le \frac{q-1}{p-1}\quad \text{ and }\quad \frac{\lambda }{\mu }\ge \frac{p-1}{q-1}. \end{aligned}$$

For \(n>N_{0}\) Eqs. (9) and (10) give

$$\begin{aligned} x_{n+1}\ge p-\epsilon +\frac{\lambda -\epsilon }{\mu +\epsilon }=\frac{pq-1}{q-1}+O(\epsilon ), \end{aligned}$$

and

$$\begin{aligned} x_{n+1}\le q+\epsilon +\frac{\mu +\epsilon }{\lambda -\epsilon }=\frac{pq-1}{p-1}+O(\epsilon ). \end{aligned}$$

Then,

$$\begin{aligned} \lambda \ge \frac{pq-1}{q-1},\quad \text{ and }\quad \mu \le \frac{pq-1}{p-1}. \end{aligned}$$

So we get

$$\begin{aligned} \frac{pq-1}{q-1}\le \lambda \le \mu \le \frac{pq-1}{p-1}. \end{aligned}$$

which is the required result. \(\square \)

Theorem 2.1

Consider the interval \(I=[\frac{PQ-1}{Q-1},\frac{PQ-1}{P-1}]\), where \(1<P\le p_{n}\le Q\), for \(n=0, 1, 2,\ldots \) If \(x_{n}\) is a solution of Eq. (6) such that \(x_{-1}, x_{0}\in I\), then \(x_{n}\in I\) for all \(n=1, 2,\ldots \)

Proof

$$\begin{aligned} x_{1}=p_{0}+\frac{x_{0}}{x_{-1}}. \end{aligned}$$

Now, \(x_{-1}, x_{0}\in I= \left[ \frac{PQ-1}{Q-1},\frac{PQ-1}{P-1}\right] \) then,

$$\begin{aligned} x_{1}=p_{0}+\frac{x_{0}}{x_{-1}}\le \frac{PQ-1}{P-1}, \end{aligned}$$

and

$$\begin{aligned} x_{1}=p_{0}+\frac{x_{0}}{x_{-1}}\ge \frac{PQ-1}{Q-1}. \end{aligned}$$

So \(x_{1}\in I\). Then we proceed by induction. \(\square \)

3 Attractivity

Assume that \(\bar{x}\) is a positive solution of (6). Here we are interested in finding sufficient conditions such that \(\bar{x}\) attracts all the positive solutions of the equation \(x_n\) of Eq. 6. Now, let

$$\begin{aligned} y_{n}=\frac{x_{n}}{\bar{x}_{n}},\quad n=-1,0,1,\ldots . \end{aligned}$$
(11)

Equation (6) becomes after substituting from (11)

$$\begin{aligned} y_{n+1}=\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\frac{y_{n}}{y_{n-1}}}{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}. \end{aligned}$$
(12)

Lemma 3.1

Let \(x_{n}\) be a positive solution of Eq. (6). Then the following are true

  1. (i)

    Equation (12) has a positive equilibrium solution \(\bar{y}=1\).

  2. (ii)

    If for some \(n,y_{n-1}<y_{n}\), then \(y_{n+1}>1\). Similarly, if for some \(n,y_{n-1}\ge y_{n}\), then \(y_{n+1}\le 1\).

Proof

(ii)Assume that for some \(n,y_{n-1}<y_{n}\), then \(\frac{y_{n}}{y_{n-1}}>1\).

$$\begin{aligned} y_{n+1}=\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\left( \frac{y_{n}}{y_{n-1}}\right) }{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}} >\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}=1. \end{aligned}$$

So \(y_{n+1}>1\).

Similarly, assume \(y_{n-1}\ge y_{n}\), then \(\frac{y_{n}}{y_{n-1}}\le 1\). Now,

$$\begin{aligned} y_{n+1}=\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\left( \frac{y_{n}}{y_{n-1}}\right) }{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}} \le \frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}=1. \end{aligned}$$

So \(y_{n+1}\le 1\). \(\square \)

Theorem 3.1

  1. (a)

    Assume that there exists n such that \(y_{n-1}<1\) and \(y_{n}>1\) and \(y_{n+2}<y_{n+3}<y_{n+4}<\cdots \)

    1. (i)

      If \(y_{n}>y_{n+1}\), then \(y_{n+k}>1\) for all \(k=4,5,\ldots \)

    2. (ii)

      If \(y_{n}<y_{n+1}\) and \(y_{n+2}>y_{n+1}\), then \(y_{n+k}>1\) for all \(k=1,2,\ldots \)

  2. (b)

    Assume that there exists n such that \(y_{n-1}>1\) and \(y_{n}<1\) and \(y_{n+2}<y_{n+3}<y_{n+4}<\cdots \)

    1. (i)

      If \(y_{n}>y_{n+1}\) and \(y_{n+2}>y_{n+1}\), then \(y_{n+k}>1\) for all \(k=3,4,\ldots \)

    2. (ii)

      If \(y_{n}<y_{n+1}\), then \(y_{n+k}>1\) for all \(k=2,3,\ldots \)

Proof

(a) Assume that \(y_{n-1}<1\) and \(y_{n}>1\), then \(\frac{y_{n}}{y_{n-1}}>1\), which concludes that

$$\begin{aligned} y_{n+1}=\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\left( \frac{y_{n}}{y_{n-1}}\right) }{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}} >\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}=1. \end{aligned}$$

(i) It follow that \(y_{n+2}\) and \(y_{n+3}\) are less than 1.

Now, to prove the main result we will use the mathematical induction.

Assume that \(y_{n+2}<y_{n+3}<y_{n+4}<\ldots \)

For \(k=4\)

$$\begin{aligned} y_{n+4}=\frac{p_{n+3}+\frac{\bar{x}_{n+3}}{\bar{x}_{n+2}}\left( \frac{y_{n+3}}{y_{n+2}}\right) }{p_{n+3}+\frac{\bar{x}_{n+3}}{\bar{x}_{n+2}}}>\frac{p_{n+3}+\frac{\bar{x}_{n+3}}{\bar{x}_{n+2}}.(1)}{p_{n+3}+\frac{\bar{x}_{n+3}}{\bar{x}_{n+2}}}=1. \end{aligned}$$

Assume that \(y_{n+k}>1\) for all \(k=5,6,7,\ldots ,m\). We will prove the result for \(k=m+1\). According to the assumption \(y_{n+m}>y_{n+m-1}\), then \(\frac{y_{n+m}}{y_{n+m-1}}>1\), and as a result

$$\begin{aligned} y_{n+m+1}=\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}\left( \frac{y_{n+m}}{y_{n+m-1}}\right) }{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}>\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}.(1)}{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}=1 \end{aligned}$$

Hence \(y_{n+k}>1\) for all \(k=4,5,6,\ldots \)

(ii) One can easily show that \(y_{n+2}\) and \(y_{n+3}\) are greater than 1. Assume that \(y_{n+k}>1\) for all \(k=4,5,6,\ldots ,m\). We will prove the result for \(k=m+1\). According to the assumption \(y_{n+m}>y_{n+m-1}\), then \(\frac{y_{n+m}}{y_{n+m-1}}>1\), and as a result

$$\begin{aligned} y_{n+m+1}=\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}\left( \frac{y_{n+m}}{y_{n+m-1}}\right) }{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}>\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}.(1)}{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}=1. \end{aligned}$$

Hence \(y_{n+k}>1\) for all \(k=1,2,\ldots \)

(b) Assume that \(y_{n-1}>1\) and \(y_{n}<1\), then \(\frac{y_{n}}{y_{n-1}}<1\), thus we have

$$\begin{aligned} y_{n+1}=\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\left( \frac{y_{n}}{y_{n-1}}\right) }{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}} <\frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}.(1)}{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}=1. \end{aligned}$$

(i) The assumption in this implies that \(y_{n+2}<1\) and \(y_{n+3}>1\).

Assume that the result holds for \(k=4, 5, 6,\ldots ,m\). We need to prove the result for \(k=m+1\). It’s assumed that \(y_{n+m-1}<y_{n+m}\), so \(\frac{y_{n+m}}{y_{n+m-1}}>1\) and as a result

$$\begin{aligned} y_{n+m+1}=\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}\left( \frac{y_{n+m}}{y_{n+m-1}}\right) }{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}>\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}.(1)}{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}=1. \end{aligned}$$

Then \(y_{n+k}>1\) for all \(k=3, 4,\ldots \)

(ii) Clearly, we have \(y_{n+2}>2\) in this case.

Assume that the result holds for \( k=3, 4,\ldots ,m\), we must prove that this result holds for \(k=m+1\) and we have that \(y_{n+m-1}<y_{n+m}\). Thus

$$\begin{aligned} y_{n+m+1}=\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}\left( \frac{y_{n+m}}{y_{n+m-1}}\right) }{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}>\frac{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}.(1)}{p_{n+m}+\frac{\bar{x}_{n+m}}{\bar{x}_{n+m-1}}}= 1. \end{aligned}$$

Hence, \(y_{n+k}>1\) for all \(k=2, 3,\ldots \) \(\square \)

We have also the following theorem which can be proved as above.

Theorem 3.2

  1. (a)

    Assume that there exists n such that \(y_{n-1}<1,y_{n}>1\) and \(y_{n+2}>y_{n+3}>y_{n+4}>\cdots \)

    1. (i)

      If \(y_{n}>y_{n+1}\), then \(y_{n+k}<1\) for all \(k=2, 3,\ldots \)

    2. (ii)

      If \(y_{n}<y_{n+1}\) and \(y_{n+2}<y_{n+1}\), then \(y_{n+k}<1\) for all \(k=3, 4,\ldots \)

  2. (b)

    Assume that there exists n such that \(y_{n-1}>1,y_{n}<1\) and \(y_{n+2}>y_{n+3}>y_{n+4}>\cdots \)

    1. (i)

      If \(y_{n}<y_{n+1}\), then \(y_{n+k}<1\) for all \(k=4,5,\ldots \)

    2. (ii)

      If \(y_{n}>y_{n+1}\), then \(y_{n+k}<1\) for all \(k=1, 2,\ldots \)

Theorem 3.3

If \(y_{n}>y_{n+1}>1\) and \(\frac{y_{n+k}}{y_{n+k-1}}>1\) for \(k=2l+1\), where l is an odd number and \(\frac{y_{n+k}}{y_{n+k-1}}<1\) for \(k=4l+1,l=1,2,3,\ldots \), then every semicycle has two terms with positive semicycle followed by negative semicycle each of which consists of two terms.

Proof

To prove this theorem we use mathematical induction. Assume \(y_{n+1}>1\) and \(y_{n+2}<1\), then \(y_{n+3}<1\) and according to the assumption \(y_{n+4}>1\), consequently \(y_{n+5}>1\).Assume that the result holds for l, in other words for \(k=7, 11,\ldots ,2l+1\), where l is an odd number we have that \(\frac{y_{n+k}}{y_{n+k-1}}>1\), and for \(k=5, 9,\ldots ,4l+1\), where \(l=1,2,\ldots \) we have that \(\frac{y_{n+k}}{y_{n+k-1}}<1\) , and thus every positive semicycle with two terms is followed by a negative semicycle with two terms, in other words

$$\begin{aligned} y_{n+2l+2}=\frac{p_{n+2l+1}+\frac{\bar{x}_{n+2l+1}}{\bar{x}_{n+2l}}\left( \frac{y_{n+2l+1}}{y_{n+2l}}\right) }{p_{n+2l+1}+\frac{\bar{x}_{n+2l+1}}{\bar{x}_{n+2l}}}>1 \end{aligned}$$

and \(y_{n+2l+3}>1\), the elements \(y_{n+2l+2}\) and \(y_{n+2l+3}\) constitute a positive semicycle with two terms. And

$$\begin{aligned} y_{n+4l+2}=\frac{p_{n+4l+1}+\frac{\bar{x}_{n+4l+1}}{\bar{x}_{n+4l}}\left( \frac{y_{n+4l+1}}{y_{n+4l}}\right) }{p_{n+4l+1}+\frac{\bar{x}_{n+4l+1}}{\bar{x}_{n+4l}}}<1 \end{aligned}$$

and \(y_{n+4l+3}>1\), the elements \(y_{n+4l+2}\) and \(y_{n+4l+3}\) form a negative semicycle with two terms.

Now, for \(k=2(l+2)+1=2l+5,l\) is an odd number we have

$$\begin{aligned} y_{n+k+1}=\frac{p_{n+k}+\frac{\bar{x}_{n+k}}{\bar{x}_{n+k-1}}\left( \frac{y_{n+k}}{y_{n+k-1}}\right) }{p_{n+k}+\frac{\bar{x}_{n+k}}{\bar{x}_{n+k-1}}}. \end{aligned}$$
$$\begin{aligned} y_{n+2l+6}=\frac{p_{n+2l+5}+\frac{\bar{x}_{n+2l+5}}{\bar{x}_{n+2l+4}}\left( \frac{y_{n+2l+5}}{y_{n+2l+4}}\right) }{p_{n+2l+5}+\frac{\bar{x}_{n+2l+5}}{\bar{x}_{n+2l+4}}}>1, \end{aligned}$$

and \(y_{n+2l+7}>1\), so \(\{y_{n+2l+6}, y_{n+2l+7}\}\) is a positive semicycle with two terms.

For \(k=4(l+1)+1=4l+5\), where \(l=1, 2,\ldots \)

$$\begin{aligned} y_{n+4l+6}=\frac{p_{n+4l+5}+\frac{\bar{x}_{n+4l+5}}{\bar{x}_{n+4l+4}}\left( \frac{y_{n+4l+5}}{y_{n+4l+4}}\right) }{p_{n+4l+5}+\frac{\bar{x}_{n+4l+5}}{\bar{x}_{n+4l+4}}}<1, \end{aligned}$$

and \(y_{n+4l+7}<1\), so \(\{y_{n+4l+6}, y_{n+4l+7}\}\) is a negative semicycle with two terms. \(\square \)

Theorem 3.4

If \(y_{n+1}>y_{n}>1\) and \(\frac{y_{n+k}}{y_{n+k-1}}<1\) for \(k=2l+1,l\) is an odd number and \(\frac{y_{n+k}}{y_{n+k-1}}>1\) for \(k=2,k=4l+1,l=1,2,3,\ldots \), then every semicycle has two terms with positive semicycle followed by two terms negative semicycle.

Theorem 3.5

If \(y_{n}<y_{n+1}<1\) and \(\frac{y_{n+k}}{y_{n+k-1}}<1\) for \(k=2l+1,l\) is an odd number and \(\frac{y_{n+k}}{y_{n+k-1}}>1\) for \(k=4l+1,l=1,2,3,\ldots \), then every semicycle has two terms with positive semicycle followed by negative semicycle.

Theorem 3.6

If \(y_{n+1}<y_{n}<1\) and \(\frac{y_{n+k}}{y_{n+k-1}}<1\) for \(k=2,k=4l+1,l=1,2,3,\ldots \) and \(\frac{y_{n+k}}{y_{n+k-1}}>1\) for \(k=2l+1,l\) is an odd n, then every semicycle has two terms with negative semicycle followed by positive semicycle.

Theorem 3.7

Every nonoscillatory solution to Eq. (12) converges to 1.

Proof

Let \(y_{n}\) be a nonoscillatory solution of Eq. (12), then

$$\begin{aligned} y_{n}<1,\quad \text{ or }\quad y_{n}>1,\quad n\ge N_{0}. \end{aligned}$$

Without loss of generality, assume that \(y_{n}<1\), for \(n\ge N_{0}\).

Claim

$$\begin{aligned} y_{n+1}<y_{n}. \end{aligned}$$

In order to prove this claim, assume the contrary, in other words there exists m such that

$$\begin{aligned} y_{m+1}>y_{m}. \end{aligned}$$

Now,

$$\begin{aligned} \frac{y_{m+1}}{y_{m}}>1, \end{aligned}$$

which implies that \(y_{m+2}>1\). This contradicts the assumption, so our claim is valid. Hence,

$$\begin{aligned} y_{n+1}<y_{n},\quad n\ge N_{0}. \end{aligned}$$

Now,

$$\begin{aligned} y_{n+1}= & {} \frac{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\frac{y_{n}}{y_{n-1}}}{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}.\nonumber \\ \left| y_{n+1}-1\right|= & {} \left| \frac{\frac{\bar{x}_{n}}{\bar{x}_{n-1}}\left( \frac{y_{n}}{y_{n-1}}-1\right) }{p_{n}+\frac{\bar{x}_{n}}{\bar{x}_{n-1}}}\right| . \end{aligned}$$
(13)

\(p_{n}\) is a positive sequence. So

$$\begin{aligned} \left| y_{n+1}-1\right| <1.\left| \frac{y_{n}}{y_{n-1}}-1\right| \end{aligned}$$

Now, \(\frac{y_{n}}{y_{n-1}}<1\) and \(y_{n+1}<1\), hence,

$$\begin{aligned} 1-y_{n+1}<1-\frac{y_{n}}{y_{n-1}}, \end{aligned}$$

then

$$\begin{aligned} -y_{n+1}<-\frac{y_{n}}{y_{n-1}}, \end{aligned}$$

thus,

$$\begin{aligned} y_{n+1}>\frac{y_{n}}{y_{n-1}}, \end{aligned}$$
(14)

\(y_{n+1}<1\), so as \(n\rightarrow \infty \) we have \(\liminf _{n\rightarrow \infty }y_{n}=\eta \le 1\), that is

$$\begin{aligned} \liminf _{n\rightarrow \infty }y_{n}=\eta \le 1. \end{aligned}$$

And according to Eq. (14) we conclude that

$$\begin{aligned} y_{n+1}y_{n-1}y_{n}^{-1}>1. \end{aligned}$$

As \(n\rightarrow \infty \)

$$\begin{aligned} \eta ^{1+1-1}=\eta \ge 1. \end{aligned}$$

So

$$\begin{aligned} \eta =\liminf _{n\rightarrow \infty }y_{n}=1. \end{aligned}$$

Also we have \(y_{n+1}<1\), so as \(n\rightarrow \infty \) we have \(\limsup _{n\rightarrow \infty }y_{n}=\gamma \le 1\), that is

$$\begin{aligned} \limsup _{n\rightarrow \infty }y_{n}=\gamma \le 1. \end{aligned}$$

And according to Eq. (14) we conclude that

$$\begin{aligned} y_{n+1}y_{n-1}y_{n}^{-1}>1. \end{aligned}$$

As \(n\rightarrow \infty \)

$$\begin{aligned} \gamma ^{1+1-1}=\gamma \ge 1. \end{aligned}$$

So

$$\begin{aligned} \gamma =\limsup _{n\rightarrow \infty }y_{n}=1. \end{aligned}$$

Then, \(\liminf _{n\rightarrow \infty }y_{n}=\limsup _{n\rightarrow \infty }y_{n}=1\), then \(\lim _{n\rightarrow \infty } y_{n}=1\). \(\square \)

4 Periodic solutions

Definition 4.1

We say that \(\{p_{n}\}\) is periodic with prime period k if

$$\begin{aligned} p_{n+k}=p_{n}\quad \text{ for }\quad n=-1, 0,\ldots \end{aligned}$$

Assume that \(\{p_{n}\}\) is periodic with prime period k.

$$\begin{aligned} p=\liminf _{n\rightarrow \infty }p_{n} \end{aligned}$$

and

$$\begin{aligned} q=\limsup _{n\rightarrow \infty }p_{n} \end{aligned}$$

Lemma 4.1

A necessary condition for the existence of a periodic solution \(\{x_{n}\}\) of Eq. (6) with prime period k is that \(\{p_{n}\}\) is periodic with prime period k.

Proof

Assume that \(x_{n}\) is a periodic solution with prime period k, so we have \(x_{n+k}=x_{n}\), for \(n=-1,0,\ldots \), we have

$$\begin{aligned} x_{n+k+1}=p_{n+k}+\frac{x_{n+k}}{x_{n+k-1}}. \end{aligned}$$

So we get that

$$\begin{aligned} p_{n+k}=x_{n+k+1}-\frac{x_{n+k}}{x_{n+k-1}}=x_{n+1}-\frac{x_{n}}{x_{n-1}}=p_{n}. \end{aligned}$$

Then \(p_{n+k}=p_{n}\), this means that \(p_{n}\) is periodic with period k. \(\square \)

Theorem 4.1

Assume that \(p_{n}\) is periodic with prime period k, and let \(1<p<q.\) Then there exists a positive periodic solution \(\{\bar{x}_{n}\}\) of Eq. (6) with prime period k.

Proof

We aim here to show that there is a periodic solution for Eq. (6) with period k. It is enough to show that the system has a positive solution

$$\begin{aligned} x_{1}= & {} p_{0}+\frac{x_{0}}{x_{-1}}=p_{k}+\frac{x_{k}}{x_{k-1}}\\ x_{2}= & {} p_{1}+\frac{x_{1}}{x_{0}}=p_{1}+\frac{x_{1}}{x_{k}}\\&\vdots \\ x_{k}= & {} p_{k-1}+\frac{x_{k-1}}{x_{k-2}}. \end{aligned}$$

Define a function \(F:R_{+}^{k}\rightarrow R_{+}^{k}\) such that,

$$\begin{aligned} F(u_{1},u_{2}, \ldots ,u_{k})=\left( p_{k}+\frac{u_{k}}{u_{k-1}}, p_{1}+\frac{u_{1}}{u_{k}}, \ldots ,p_{k-1}+\frac{u_{k-1}}{u_{k-2}}\right) . \end{aligned}$$

In addition define an interval \(I=\left[ \frac{pq-1}{q-1}, \frac{pq-1}{p-1}\right] \). Now, we aim to show that \(I^{k}\) is invariant under the function F. If \(u_{1}, u_{2},\ldots , u_{k}\in I\), we have

$$\begin{aligned} p_{i}+\frac{u_{i}}{u_{j}}\le & {} \frac{pq-1}{p-1},\quad i=1, 2,\ldots ,k, j=(i-1)mod(k),\\ p_{i}+\frac{u_{i}}{u_{j}}\ge & {} \frac{pq-1}{q-1}, \quad i=1, 2,\ldots , k, j=(i-1)mod (k). \end{aligned}$$

Then \(p_{i}+\frac{u_{i}}{u_{j}}\in I\) for \(i=1, \ldots , k, j=(i-1)mod(k).\) So \(I^{k}\) is invariant under the function F. Now, we have \(F:I^{k}\rightarrow I^{k}\) and F is continuous on \(I^{k}\) and \(I^{k}\) is convex and compact. Then, by Brower Fixed Point Theorem F has a fixed point in \(I^{k}\).

Assume that the fixed point is \((\bar{u}_{1}, \bar{u}_{2},\ldots , \bar{u}_{k})\in I^{k}\). Define the sequence

$$\begin{aligned} \bar{x}_{-1}=\bar{u}_{k-1},\quad \bar{x}_{0}=\bar{u}_{k} \quad \text{ and }\quad \bar{x}_{mk+i}=\bar{u}_{i}, \quad \text{ for }\quad i=1, 2,\ldots ,\quad m=0,1,\ldots . \end{aligned}$$

This sequence satisfies the Eq. (6) and is periodic with period k. \(\square \)

Corollary 4.1

Assume that \(\{p_{n}\}\) is a convergent sequence and

$$\begin{aligned} \lim _{n\rightarrow \infty }p_{n}=p>1. \end{aligned}$$

Then every solution \(\{x_{n}\}\) of Eq. (6) is convergent and

$$\begin{aligned} \lim _{n\rightarrow \infty }x_{n}=p+1. \end{aligned}$$

Proof

\(p_{n}\) is bounded so \(\{x_{n}\}\) is bounded and persists according to (2.1). Moreover, we have

$$\begin{aligned} \lambda =\liminf _{n\rightarrow \infty }x_{n} \quad \text{ and }\quad \mu =\limsup _{n\rightarrow \infty }x_{n}. \end{aligned}$$

And

$$\begin{aligned} p=\liminf _{n\rightarrow \infty }p_{n}\quad \text{ and }\quad q=\limsup _{n\rightarrow \infty }p_{n}. \end{aligned}$$

And from Lemma (2.2) we have that

$$\begin{aligned} \frac{pq-1}{q-1}\le \lambda \le \mu \le \frac{pq-1}{p-1}. \end{aligned}$$

\(p_{n}\) is convergent so \(p=\liminf _{n\rightarrow \infty }p_{n}=\limsup _{n\rightarrow \infty }p_{n}=q\). Then we have that

$$\begin{aligned} p+1=\frac{p^{2}-1}{p-1}\le \lambda \le \mu \le \frac{p^{2}-1}{p-1}=p+1. \end{aligned}$$

So we have \(\lambda =\mu =p+1\). Then as a result we get \(\lim _{n\rightarrow \infty }x_{n}=p+1\). \(\square \)