<s>[INST] Solution to a second order recurrence relation with non constant coefficient I have the following equation:
$(aq^n+b+s)C_n(s)=aq^nC_{n+1}(s)+bC_{n-1}(s)$ , for $n\geq1$.
$C_0(s)=1$ ,  and for all $s\geq 0$ we have $0\leq C_n(s)\leq1$.
$a>0$,   $b>0$, $0\leq q\leq1$.
In fact, $C_n(s)$ is a Laplace Transform of a non-negative RV, for all n.
Any thoughts on how to solve this equation?
Thanks!
 [/INST] As
$$
G_n(s) = \frac{1}{a q^{n-1}}\left((a q^{n-1}+b+s)G_{n-1}(s)-b G_{n-2}(s)\right)
$$
with
$$
G_0(s) = 1, \ \ \ G_1(s) = \frac{c_1}{s+b_1}
$$
the recurrence formula which follows, in MATHEMATICA, generates all the instances for $G_n(s)$
G[s, 0] = 1;
G[s, 1] = Subscript[c, 1] /(s + b_0);
G[s_, n_] := ((a q^(n - 1) + b + s) G[s, n - 1] - b G[s, n - 2]) q^(1 - n)/a

G[s,4] // Expand

$$
G_4(s) = \frac{1}{s+b_1}\left(\frac{b^3 c_1}{a^3 q^6}-\frac{b^3 s}{a^3 q^6}-\frac{b_1 b^3}{a^3 q^6}+\frac{3 b^2 c_1 s}{a^3 q^6}-\frac{2 b^2 s^2}{a^3 q^6}-\frac{2
   b_1 b^2 s}{a^3 q^6}+\frac{3 b c_1 s^2}{a^3 q^6}-\frac{b s^3}{a^3 q^6}-\frac{b_1 b s^2}{a^3 q^6}+\frac{c_1 s^3}{a^3 q^6}+\frac{b^2
   c_1}{a^2 q^3}-\frac{b^2 s}{a^2 q^3}-\frac{b_1 b^2}{a^2 q^3}+\frac{b c_1 s}{a^2 q^5}+\frac{b c_1 s}{a^2 q^4}+\frac{2 b c_1 s}{a^2
   q^3}-\frac{b s^2}{a^2 q^4}-\frac{b_1 b s}{a^2 q^4}-\frac{b s^2}{a^2 q^3}-\frac{b_1 b s}{a^2 q^3}+\frac{c_1 s^2}{a^2 q^5}+\frac{c_1
   s^2}{a^2 q^4}+\frac{c_1 s^2}{a^2 q^3}+\frac{b c_1}{a q}-\frac{b s}{a q}-\frac{b_1 b}{a q}+\frac{c_1 s}{a q^3}+\frac{c_1 s}{a
   q^2}+\frac{c_1 s}{a q}+c_1\right)
$$
So $G_n(s)$ is non causal for $n \ge 2$.
</s>