non-recursive nth term in this sequence What is the nth term for the following sequence in non-recursive form (i.e. in terms of $x_{0}$), for some constants a and b?
$x_{0} = a$
$x_{1} = x_{0} + \frac{1}{1}(x_{0} + x_{0}(b - 1))$
$x_{2} = x_{1} + \frac{1}{2}(x_{0} + x_{1}(b - 1))$
...
$x_{n} = x_{n-1} + \frac{1}{n}(x_{0} + x_{n-1}(b - 1))$
 A: One way to do this (possibly not the easiest, but definitely the most fun :) ) is using generating functions (note that the variable $z$ is assumed throughout to be within the radius of convergence of everything in town):
Set $f(z):=x_0 + x_1z + x_2z^2 + \cdots$. Multiplying everything in your recurrence relation by $z^n$ gives
$$x_nz^n = x_{n-1}z^n + \frac{b-1}{n}x_{n-1}z^n + \frac{x_0}{n}z^n.$$
What we'd like to do now is take the sum of this equation from $n=0$ to $\infty$. But we've got that $1/n$ lurking around. So, instead, we'll just have to sum from $n=1$ to $\infty$. Then
$$\sum_{n=1}^\infty x_nz^n = \sum_{n=1}^\infty x_{n-1}z^n + \sum_{n=1}^\infty\frac{b-1}{n}x_{n-1}z^n + \sum_{n=1}^\infty \frac{x_0}{n}z^n.$$
The sum on the LHS is $f(z)-x_0$. The first sum on the RHS is $zf(z)$, and the last sum on the RHS is $-x_0\log(1-z)$ (you can show this by integrating the series expansion of $1/(1-z)$). The middle sum on the RHS is a bit trickier, but it's not intractable: Writing out the terms, we get
$$\frac{x_0}{1}z + \frac{x_1}{2}z^2 + \cdots = \int_0^z (x_0 + x_1w + x_2w^2 + \cdots)\,dw = \int_0^z f(w)\,dw.$$
Thus, we're left with the integral equation
$$f(z)-x_0 = zf(z) + (b-1)\int_0^z f(w)\,dw -x_0\log(1-z),$$
which after differentiating becomes the first-order linear ODE
$$f'(z) = zf'(z) + f(z)+(b-1)f(z) + \frac{x_0}{1-z},$$
i.e.
$$(1-z)f'(z)=bf(z) + \frac{x_0}{1-z}. $$
Using standard techniques such as an integrating factor, this can be solved quite readily to give
$$f(z)=\frac{-x_0}{(b-1)(1-z)} + c_1(1-z)^{-b},$$
where $c_1$ is some constant. But we can get rid of this constant by using the fact that $f(0)=x_0$ by definition---this gives $c_1=bx_0/(b-1)$. Thus,
$$ f(z)=\frac{x_0}{b-1}\left(\frac{-1}{1-z}+b(1-z)^{-b}\right).$$
Now, to get the series expansion, we use the generalized binomial theorem:
$$(1+z)^\alpha=\sum_{n=0}^\infty \binom{\alpha}{n}z^n.$$
Then
\begin{align}
f(z) &= \frac{x_0}{b-1}\left(\sum_{n=0}^\infty -z^n + \sum_{n=0}^\infty (-1)^n b\binom{-b}{n}z^n\right)\\
&= \sum_{n=0}^\infty \frac{x_0}{b-1}\left(-1+(-1)^n b\binom{-b}{n}\right)z^n.
\end{align}
Thus, 
$$x_n = \frac{x_0}{b-1}\left((-1)^n b\binom{-b}{n}-1\right).$$
