Simple linear recursion $x_n=\frac{x_{n-1}}{a}+\frac{b}{a}$ with $a>1, b>0$ and $x_0>0$
I tried to solve it using the generating function but it does not work because of $\frac{b}{a}$, so may you have an idea.
 A: Hint: Let $x_n=y_n+c$, where we will choose $c$ later. Then
$$y_n+c=\frac{y_{n-1}+c}{a}+\frac{b}{a}.$$
Now can you choose $c$ so that the recurrence for the $y$'s has no pesky constant term?
Remark: There is a fancier version of the above trick. Our recurrence (if $b\ne 0$) is not homogeneous. To solve it, we find the general solution of the homogeneous recurrence obtained by removing the $b/a$ term, and add to it some fixed particular solution of the non-homogeneous recurrence. In this case it is easy to find such a particular solution. Look for a constant solution.  
A: There are all sorts of ways to solve this. For instance, let $y_n=x_n-d$; then
$$y_n+d=\frac1a(y_{n-1}+d)+\frac{b}a=\frac{y_{n-1}}a+\frac{b+d}a\;,\tag{1}$$
so $$y_n=\frac{y_{n-1}}a+\frac{b+(1-a)d}a\;.$$ If we now set $d=\dfrac{b}{a-1}$, $(1)$ becomes $$y_n=\frac{y_{n-1}}a$$ with initial condition $y_0=x_0-d$. This is a simple exponential recurrence, so the solution is
$$y_n=\frac{y_0}{a^n}\;$$
and $$x_n=y_n+d=\frac{y_0}{a^n}+d=\frac{x_0-\frac{b}{a-1}}{a^n}+\frac{b}{a-1}=\frac{(a-1)x_0-b}{a^n(a-1)}+\frac{b}{a-1}\;.$$
A: Using generating functions here is easy. Write your recurrence as:
$\begin{equation*}
a x_{n + 1}
  = x_n + b
\end{equation*}$
Define the generating function $g(z) = \sum_{n \ge 0} x_n z^n$, multiply the recurrence by $z^n$, sum over $n \ge 0$ and recognize some sums:
$\begin{align*}
\sum_{n \ge 0} x_{n + 1} z^n
  &= \sum_{n \ge 0} x_n z^n + \sum_{n \ge 0} b z^n \\
\frac{g(z) - x_0}{z}
  &= g(z) + \frac{b}{1 - z}
\end{align*}$
Solve for $g(z)$, write as partial fractions if needed:
$\begin{equation*}
g(z)
  = \frac{x_0 - (x_0 - n) z}{(1 - z)^2}
\end{equation*}$
Now you want the coefficient of $z^n$ of the above:
$\begin{align*}
[z^n] g(z)
  &= [z^n] \frac{x_0 - (x_0 - n) z}{(1 - z)^2} \\
  &= x_0 [z^n] (1 - z)^{-2} - (x_0 - b) [z^{n - 1}] (1 - z)^{-2} \\
  &= x_0 (-1)^n \binom{-2}{n} - (x_0 - b) (-1)^{n - 1} \binom{-2}{n - 1} \\
  &= x_0 \binom{n + 2 - 1}{2 - 1} - (x_0 - b) \binom{n - 1 + 2 - 1}{2 - 1} \\
  &= 2 x_0 - b + b n
\end{align*}$
