Solution 5.1.4.1.

Call the generating function for the sequence \(A\text{.}\) We have

\begin{align*} A \amp = 1 + 3x + 7x^2 + 15x^3 + 31x^4 + \cdots + a_nx^n + \cdots\\ -3xA \amp = 0 - 3x - 9x^2 - 21x^3 - 45x^4 - \cdots - 3a_{n-1}x^n - \cdots\\ \underline{+~~~2x^2A_{~}^{~^{~}}} \amp \underline{\,\, = 0 + 0x + 2x^2 + 6x^3 + 14x^4 + \cdots + 2a_{n-2}x^n + \cdots}\\ (1-3x+2x^2)A \amp = 1 \end{align*}

We multiplied \(A\) by \(-3x\) which shifts every term over one spot and multiplies them by \(-3\text{.}\) On the third line, we multiplied \(A\) by \(2x^2\text{,}\) which shifted every term over two spots and multiplied them by 2. When we add up the corresponding terms, we are taking each term, subtracting 3 times the previous term, and adding 2 times the term before that. This will happen for each term after \(a_1\) because \(a_n - 3a_{n-1} + 2a_{n-2} = 0\text{.}\) In general, we might have two terms from the beginning of the generating series, although in this case the second term happens to be 0 as well.

Now we just need to solve for \(A\text{:}\)

\begin{equation*} A = \frac{1}{1 - 3x + 2x^2}\text{.} \end{equation*}
in-context