Solution (source code)

= Solution

The initial values are $p_0=1$ and $p_1=1/2$. The <characteristic polynomial> of the <linear recurrence> is
$$
16r^2-8r-3=(4r-3)(4r+1),
$$
with roots $3/4$ and $-1/4$. Hence $p_n=a(3/4)^n+b(-1/4)^n$. The initial conditions give $a+b=1$, $3a-b=2$, so $a=3/4$, $b=1/4$. Therefore
$$
\boxed{p_n=\frac34\left(\frac34\right)^n+\frac14\left(-\frac14\right)^n
=\frac{3^{n+1}+(-1)^n}{4^{n+1}},\qquad n\geq0.}
$$