<s>[INST] Solve for closed form $a_j$ given $a_j = 1 + pa_{j+1} + (1-p)a_{j-1}$ where $a_1 = 0$. 
Solve for a closed form expression for $a_j$ given constant $p \in (0,1)$ and $q=1-p$ and:
\begin{align*}
  a_j &= 1 + pa_{j+1} + qa_{j-1} \\
\end{align*}
Given that $a_1 = 0$.

The text says to use the hint that $a_j = c(1-j)$, but where do we get that hint? If we plug in that hint, we get $a_j = \frac{1-j}{p-q} = \frac{1-j}{2p-1}$ which correctly satisfies the original equation. But how would I solve this without the given hint?
Is this matrix version of the original equation helpful in any way?
\begin{align*}
  \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ -\frac{1}{p} & \left(1 - \frac{1}{p}\right) & \frac{1}{p} \end{pmatrix} \begin{pmatrix} 1 \\ a_{j-1} \\ a_j \end{pmatrix} &= \begin{pmatrix} 1 \\ a_j \\ a_{j+1} \end{pmatrix} \\
\end{align*}
 [/INST] Let $b_j = a_{j+1} - a_j$, $b_j$ satisfies
$$-pb_{j} + qb_{j-1} = 1$$
Let $c_j = b_j - \frac{1}{q-p}$, $c_j$ satisfies
$$c_j = \frac{q}{p}c_{j-1}$$
So
$$c_{j} = c_1\left(\frac{q}{p}\right)^{j-1}$$
We deduce
$$a_{j} = a_1 + \frac{j-1}{q-p} + c_1\sum_{k=0}^{j-2}\left(\frac{q}{p}\right)^{k}$$
with the convention
$$\sum_{k=n}^m A_k = 0,\text{ if }  m < n$$
</s>