In my math class, we are currently studying recursive formulas like the following:
Geometric sequence:
$U_0 =$ start
$U_n =$ ratio$ \cdot U_{n-1}$
Arithmetic sequence:
$U_0 =$ start
$U_n = U_{n-1} + $difference
Shifted Geometric sequence:
$U_0 =$ start
$U_n = $ratio$ \cdot U_{n-1} + $difference
I know that a Geometric sequence can be modeled by this:
$Y =$ start(ratio)$^X$
I know that a Arithmetic sequence can be modeled by this:
$Y =$ difference$\cdot X + $start
How do you model a Shifted Geometric sequence in the second listed format?
Let's look at the sequence with initial value $U_0$ and the rule $U_n = AU_{n-1}+B$. We can look at some example terms:
$$U_0 = U_0$$
$$U_1 = A(U_0 + B) + B = AU_0 + AB + B$$
$$U_2 = A(AU_0 + AB + B) + B = A^2U_0 + A^2B + AB + B$$
Now we can see that $U_n = A^nU_0 + B(1+A+A^2+...+A^n)$. The geometric series $1+A+A^2+...+A^n=n+1$ when $A=1$ and $1+A+A^2+...+A^n=\frac{1-A^{n+1}}{1-A}$ when $A\ne1$. Now, we can put it all together and say $U_n=U_0+B(n+1)$ when $A = 1$ and $U_n = A^nU_0+B\frac{1-A^{n+1}}{1-A}$ if $A\ne1$.