The equation is: $ax_{n+1}-(n+1+a)x_n+nx_{n-1}=-n$, where $a$ is a constant and $0<a<1$. Any ideas on how to solve it? May be the z-transform is useful? Thank you!
Using the difference operator notation, $[aE^2-(n+2+a)E+(n+1)]x_n=-(n+1)$. I tried to factorize the difference operator but failed.
one solution to the homogeneous equation is given by the confluent hypergeometric function of the second kind, http://mathworld.wolfram.com/ConfluentHypergeometricFunctionoftheSecondKind.html
I am actually reading Abramowitz and Stegun, pages 504-507 especially.
Identity 13.4.16 reads $$ (b-a-1)U(a,b-1,z) + (1-b-z)U(a,b,z) + z U(a,b+1,z) = 0. $$ As a result, if we take $$ y_n = U(1,n+2,z) $$ then $$ n y_{n -1} - (1+n+z)y_n + z y_{n+1} = 0. $$ If you take this, setting $z$ to your original variable $a,$ you get something in the kernel.
The kernel is dimension two, so there is a linearly independent sequence as well. Anyway, given your specific solution in comment with a polynomial solution to the inhomogeneous problem, any other solutions are fairly horrible.