The associated homogeneous recurrence relation is $a_n = 2a_{n-1}$.
We easily solve it to obtain $a_n^{(h)} = \alpha2^n$.
Next we need a particular solution to the given recurrence relation.
By Theorem 6 we want to look for a function of the form $a_n = cn \cdot 2^n$.
We plug this into our recurrence relation and obtain $cn \cdot 2^n = 2c(n - 1)2^{n-1} + 3 \cdot 2^n$.
We divide through by $2^{n-1}$, obtaining $2cn = 2c(n - 1) + 6$, whence with a little simple algebra $c = 3$.
Therefore the particular solution we seek is $a_n^{(p)} = 3n\cdot2^n$.
So the general solution is the sum of the homogeneous solution and this particular solution,
namely $a_n = \underline{\alpha2^n + 3n \cdot 2^n = (3n + \alpha)2^n}$.
The factors in the generating function for choosing the egg and plain bagels are both $x^2 + x^3 + x^4 + ...$.
The factor for choosing the salty bagels is $x^2 + x^3$.
Therefore the generating function for this problem is $(x^2 + x^ + x^4 + ...)^2(x^2 + x^3)$.
We want to find the coefficient of $x^{12}$, since we want 12 bagels.
This is equivalent to finding the coefficient of $x^6$ in $(1 + x + x^2 + ...)^2(1 + x)$.
This function is $(1 + x)/(1 - x)^2$, so we want the coefficient of $x^6$ in $1/(1 - x)^2$,
which is $\underline{7}$, plus the coefficient of $x^5$ in $1/(1 - x)^2$ , which is $\underline{6}$.
Thus the answer is $\underline{13}$.
Without changing the answer, we can assume that the jar has
an infinite number of balls of each color; this will make the algebra easier.
For the red and green balls the generating function is $1 + x + x^2 + ...$,
but for the blue balls the generating function is $x^3 + x^4 + ...+ x^{10}$,
so the generating function for the whole problem is $(1 + x + x^2 + ...)^2(x^3 + x^4 + ...+ x^{10})$.
We seek the coefficient of $x^{14}$. This is the same as the coefficient of $x^{11}$ in
\begin{eqnarray*}
(1 + x + x^2 + ...)^2(1 + x + ...+ x^7) = \frac{1 - x^8}{(1-x)^3}
\end{eqnarray*}
Since the coefficient of $x^n$ in $1/(1 - x)^3$ is $C(n + 2, 2)$,
and we have two contributing terms determined by the numerator,
our answer is $\underline{C(11 + 2, 2) - C(3 + 2, 2) = 68}$.
This problem is like Example 16. First let $G(x) = \sum\limits_{k=0}^\infty a_kx^k$.
Then $xG(x) = \sum\limits_{k=0}^\infty a_kx^{k+1} = \sum\limits_{k=1}^\infty a_{k-1}x^k$
(by changing the name of the variable from k to k + 1 ). Thus
\begin{eqnarray*}
G(x) - 7xG(x)
& = & \sum\limits_{k=0}^\infty a_kx^k - \sum\limits_{k=1}^\infty 7a_{k-1}x^k \\
~ & = & a_0 + \sum\limits_{k=1}^\infty (a_k - 7a_{k-1})x^k \\
~ & = & a_0 + 0 \\
~ & = & 5,
\end{eqnarray*}
because of the given recurrence relation and initial condition.
Thus $G(x)(1 - 7x) = 5$, so $G(x) = \underline{5/(1-7x)}$.
From Table 1 we know then that $a_k = \underline{5 \cdot 7^k}$.
Let $G(x) = \sum\limits_{k=0}^\infty a_kx^k$.
Then $xG(x) = \sum\limits_{k=0}^\infty a_kx^{k+1} = \sum\limits_{k=1}^\infty a_{k-1}x^k$
(by changing the name of the variable from k to k + 1 ). Thus
\begin{eqnarray*}
G(x) - 3xG(x)
& = & \sum\limits_{k=0}^\infty a_kx^k - \sum\limits_{k=1}^\infty 3a_{k-1}x^k \\
~ & = & a_0 + \sum\limits_{k=1}^\infty (a_k - 3a_{k-1})x^k \\
~ & = & 1 + \sum\limits_{k=1}^\infty 4^{k-1}x^k \\
~ & = & 1 + x\sum\limits_{k=1}^\infty 4^{k-1}x^{k-1} \\
~ & = & 1 + x\sum\limits_{k=0}^\infty 4^kx^k \\
~ & = & 1 + x \cdot \frac{1}{1-4x} \\
~ & = & \frac{1-3x}{1-4x}.
\end{eqnarray*}
Thus $G(x)(1 - 3x) = (1 - 3x)/(1 - 4x)$, so $G(x) = \underline{1/(1-4x)}$.
Therefore $a_k = \underline{4^k}$, from Table 1.