Recurrence General formulas In this post I will share general formulas for recurrences I have worked out, just for fun.
And you are more than welcome to share yours.
I will also include a table for a quick check.
 A: *

*

$$u_{n} = au_{n-1} + b$$
$$\Downarrow$$
i: $$u_n = u_0a^n + \frac {b(a^n-1)} {a-1} $$
or ii: $$u_n = u_0a^n + Σ_{m=1}^{n} ba^m$$

Proof:
Introduce another recurrence $v$, define $v_n = u_n + \frac b {a-1}$
$\therefore u_n = v_n - \frac b {a-1}$
$v_n = u_n + \frac b {a-1} = (au_{n-1} + b) + \frac b {a-1} = au_{n-1} + \frac {ab}{a-1} = a(u_{n-1} + \frac b {a-1}) = av_{n-1}$
$\therefore v_n = av_{n-1}$ (definition of $v$ in terms of $v$)
$v_n = a^rv_{n-r} = a^nv_0$ (general formula for $v$)
$\because u_n = v_n - \frac b {a-1}$ (definition of $v$ in terms of $u$)
$\therefore u_n = a^nv_0 - \frac b {a-1} = a^n(u_0 + \frac b {a-1}) - \frac b{a-1}$ (substitute $v$ s with $u$ s)
$u_n = a^nu_0 + \frac {a^nb} {a-1} - \frac b {a-1} = a^nu_0 + \frac {a^nb-b} {a-1} = a^nu_0 + \frac {b(a^n-1)} {a-1}$
$\therefore$
$$u_n = a^nu_0 + \frac {b(a^n-1)} {a-1}$$
Notice that the second term is the formula for a geometric series (Kadry, 2014) $ba^{n-1}$
Therefore the expression above equals to:
$$u_n = u_0a^n + Σ^n_{m=1} ba^m$$

Reference:
Seifedine Kadry,
Mathematical Formulas for Industrial and Mechanical Engineering,
Elsevier,
2014,
Pages 65-111,
ISBN 9780124201316,
https://doi.org/10.1016/B978-0-12-420131-6.00005-1.
(https://www.sciencedirect.com/science/article/pii/B9780124201316000051)
