Recurring Sequence with Exponent Working with recurring sequences and generating functions, I'm generally lost on solving a general expression of $a_n$ for any $n$ when the next part of the sequence, that is $a_{n+1}$, is in the form of an exponent, such that $a_n = a_{n-1} +k^{n-1}$, where k is some constant. I have  no clue on how to approach this problem.
I've solved the Fibonacci sequence by subtracting the two pervious terms and shifting the sequence, but it does not seem to work here.
I'm particularly working with $a_n = 2a_{n-1} + 5^{n-1}$, but the sequence expands extremely fast. The base case, $a_{0} = 1$.
Any help would be appreciated!
 A: Because the one with which you’re now working is first-order, you can simply ‘unwind’ it:
$$\begin{align*}
a_n&=2a_{n-1}+5^{n-1}\\
&=2\left(2a_{n-2}+5^{n-2}\right)+5^{n-1}\\
&=2^2a_{n-2}+2\cdot5^{n-2}+5^{n-1}\\
&=2^2\left(2a_{n-3}+5^{n-3}\right)+2\cdot5^{n-2}+5^{n-1}\\
&=2^3a_{n-3}+2^2\cdot5^{n-3}+2\cdot5^{n-2}+5^{n-1}\\
&\;\;\vdots\\
&=2^ka_{n-k}+\sum_{i=0}^{k-1}2^i5^{n-1-i}\\
&\;\;\vdots\\
&=2^na_0+\sum_{i=0}^{n-1}2^i5^{n-1-i}\\
&=2^na_0+5^{n-1}\sum_{i=0}^{n-1}\left(\frac25\right)^i\\
&=2^na_0+5^{n-1}\cdot\frac{1-\left(\frac25\right)^n}{1-\frac25}\\
&=2^na_0+\frac{5^n-2^n}3
\end{align*}$$
A: I love to telescope.
If
$a_n = ua_{n-1} + vc^{n}
$,
then
$\dfrac{a_n}{u^n}
= \dfrac{a_{n-1}}{u^{n-1}} + v(c/u)^{n}
$.
Let
$b_n = \dfrac{a_n}{u^n}$.
Then
$b_n
=b_{n-1}+vd^n
$
where
$d = c/u$.
Then
$b_n-b_{n-1}
=vd^n
$.
Summing,
$\begin{array}\\
b_m-b_0
&=\sum_{n=1}^m (b_n-b_{n-1})\\
&=\sum_{n=1}^m vd^n\\
&=v\dfrac{d-d^{m+1}}{1-d}\\
&=vd\dfrac{1-d^{m}}{1-d}\\
\end{array}
$
so
$\begin{array}\\
\dfrac{a_m}{u^m}
&=a_0+vd\dfrac{1-d^m}{1-d}\\
\text{or}\\
a_m
&=a_0u^m+\dfrac{vc}{u}u^m\dfrac{1-(c/u)^m}{1-c/u}\\
&=a_0u^m+vc\dfrac{u^m-c^m}{u-c}\\
&=a_0u^m+vc\dfrac{u^m-c^m}{u-c}\\
\end{array}
$
In  this case,
$u=2, c=5, v = \frac15, a_0 = 1
$
so
$a_m
= 2^m + \dfrac{2^m-5^m}{2-5}
= 2^m + \dfrac{5^m-2^m}{3}
$.
This can be rewritten as
$\begin{array}\\
a_m
&=a_0u^m+vc\dfrac{u^m-c^m}{u-c}\\
&=\dfrac{(u-c)a_0u^m+vc(u^m-c^m)}{u-c}\\
&=\dfrac{(a_0(u-c)+vc)u^m-vc^{m+1}}{u-c}\\
\end{array}
$
Again, we get
$=\dfrac{(a_0(u-c)+vc)u^m-vc^{m+1}}{u-c}
=\dfrac{(-3+1)2^m-5^{m}}{-3}
=\dfrac{2\cdot 2^m+5^{m}}{3}
$.
A: We use ordinary generating functions. Let $A(x) = \sum_{i=0}^n a_n x^n$. Then we have (summing from $n=1$)
\begin{align}
a_n &= 2a_{n-1} + 5^{n-1},\\
\sum_{n=1}^\infty a_nx^n &= \sum_{n=1}^\infty 2a_{n-1} x^n + \sum_{n=1}^\infty 5^{n-1} x^n,\\
A(x) - a_0 &= 2x\sum_{n=1}^\infty a_{n-1} x^{n-1} + x\sum_{n=1}^\infty 5^{n-1} x^{n-1},\\
A(x) - 1 &= 2x\sum_{n=0}^\infty a_{n} x^{n} + x\sum_{n=0}^\infty 5^{n} x^{n},\\
A(x) - 1 &= 2xA(x) + \frac{x}{1-5x},\\
A(x) - 2xA(x) &= \frac{x}{1-5x} + 1,\\
A(x) &= \frac{x}{(1-2x)(1-5x)} + \frac{1}{1-2x}.\\
\end{align}
Now we use partial fraction decomposition and a bit of algebra to obtain
\begin{align}
A(x) &= \frac{1}{3(1-5x)} - \frac{1}{3(1-2x)} + \frac{1}{1-2x}\\
&= \frac{1}{3} \left(\frac{1}{(1-5x)} + \frac{2}{(1-2x)}\right)\\
&= \frac{1}{3} \left(\sum_{n=0}^{\infty} 5^nx^n + 2\sum_{n=0}^{\infty}2^nx^n \right).
\end{align}
From here we see $$a_n = \frac{5^n + 2^{n+1}}{3}.$$
A: First make it homogeneous.
$$a_n-2a_{n-1} = 5^{n-1} $$
$$a_{n+1}-2a_n = 5^n $$
$$\Rightarrow a_{n+1}-2a_n=5(a_n-2a_{n-1}) \tag 1$$
$$\Rightarrow a_{n+1}-5a_n=2(a_n-5a_{n-1}) \tag 2$$
Both (1) and (2) are geometric sequences, so
$$
a_{n+1}-2a_n = 5^n (a_1-2a_0) = 5^n (3-2)= 5^n \tag 3
$$
$$
a_{n+1}-5a_n = 2^n (a_1-5a_0) = 2^n (3-5)= -2^{n+1} \tag 4
$$
(3)-(4)
$$
a_n = \frac{1}{3} (5^n + 2^{n+1}). \blacksquare
$$
(Please see my post Show that for every positive integer $ f_n=\frac{\left ( \frac{1+\sqrt5}{2} \right )^n-\left ( \frac{1-\sqrt5}{2} \right )^n}{\sqrt5}$)
