If $D_n=pD_{n-1}+rD_{n-2},n\ge 3$ is recurrence relation with constant coefficients,
If $r=0\Rightarrow D_n=p^{n-1}D_1$
If $r\neq 0$ then solve equation
$x^2-px-r=0$
If $$\Delta>0\Rightarrow x_1=\frac{p+\sqrt{\Delta}}{2},x_2=\frac{p-\sqrt{\Delta}}{2},D_n=\frac{D_2-x_2D_1}{x_1(x_1-x_2)}x_1^n+\frac{D_2-x_1D_1}{x_2(x_2-x_1)}x_2^n$$
If $$\Delta = 0\Rightarrow x_1=x_2,D_n=x_1^{n-1}D_1+(n-1)x_1^{n-2}(D_2-x_1D_1)$$
What is the equation for $D_n$ if $\Delta < 0$?
If $\Delta\lt 0$, then $$D_n=\frac{D_2-x_2D_1}{x_1(x_1-x_2)}x_1^n+\frac{D_2-x_1D_1}{x_2(x_2-x_1)}x_2^n$$ where $x_1=\frac{p+\sqrt{-\Delta}i}{2},x_2=\frac{p-\sqrt{-\Delta}i}{2}$.