Rewrite the equation as ann(an+2−an+1)=k. If an is a polynomial in n, say an=r(n)=∑i=0drini, then the limit limn→∞ann(an+2−an+1) must exist and be equal to k. But
n→∞limann(an+2−an+1)=n→∞lim∑i=0drinin(∑i=0dri(n+2)i−∑i=0dri(n+1)i)=n→∞lim∑i=0drinin∑i=0dri((n+2)i−(n+1)i)=n→∞lim∑i=0drinin∑i=0dri((n+2)i−1+(n+2)i−2(n+1)+⋯+(n+1)i−1)=n→∞limnd∑i=0drini−dnd∑i=0drini−d((1+n2)i−1+(1+n2)i−2(1+n1)+⋯+(1+n1)i−1)=n→∞limrdrd((1+n2)d−1+(1+n2)d−2(1+n1)+⋯+(1+n1)d−1)=d
So if an is a polynomial in n then k is the degree of an and is a nonnegative integer.
Now we need to show an example of polynomial rk(n) for each nonnegative integer k. For k=0 and k=1, one may consider r0(n)=0 and r1(n)=n. For k≥2, let's find a polynomial
r(n)=nk+rk−1nk−1+⋯+r1n+r0
such that n(r(n+2)−r(n+1))=kr(n) for all n.
Expanding (n+2)i and (n+1)i via binomial theorem, we obtain the system of equations
3(k−2k)+(k−2k−1)rk−1=krk−17(k−3k)+3(k−3k−1)rk−1+(k−3k−2)rk−2=krk−2…(2j−1)(k−jk)+(2j−1−1)(k−jk−1)rk−1+⋯+(k−jk−j+1)rk−j+1=krk−j+1…
Since (k−jk−j+1)=k−j+1=k it is possible to find rk−j+1 in each equation and the system is possible, so there is such a polynomial.
For the second part, rewrite the given equation as n(an+1an+2−1)=kan+1an. If there exists polynomials p and q such that anan+1=q(n)p(n), then
n(q(n+1)p(n+1)−1)=kp(n)q(n)⟺n(p(n+1)−q(n+1))p(n)=kq(n+1)q(n)
We may suppose without loss of generality that p(n) and q(n) don't have common factors. Let m and m′ be the degrees of p and q, respectively. If m=m′ then the right hand side has degree 2m and the degree of p(n+1)−q(n+1) is m−1. This means that the leading coefficients of p and q are equal. Since p(n) and q(n) don't have common factors, p(n) divides q(n+1), which in this case means p(n)=q(n+1). Substituting yields n(q(n+2)−q(n+1))=kq(n), and q satisfies the first part of the problem, and thus k must be a nonnegative integer.
If m=m′ by checking degrees we must have 1+max(m,m′)+m=2m′⇒2m′≤1+m+m′⟺m<m′⇒1+m′+m=2m′⟺m′=m+1. The polynomials q(n+1) and p(n+1)−q(n+1) don't have common factors, so q(n) divides p(n+1)−q(n+1). These two polynomials have both degree m′ and opposite leading coefficients, so p(n+1)=q(n+1)−q(n). Substituting yields the polynomial identity n(q(n)−q(n−1))=−kq(n+1). Now if r(n)=q(1−n) and m=−n then n(r(m+2)−r(m+1))=−kr(m) and we reduce the problem to the first part again for −k instead of k. So, in this case, k must be a nonpositive integer.
Conversely, it's not hard to obtain p(n) and q(n) from the above case, so the answer for the second part is k integer.