Calculating time to 0? Quick question format:
Let $a_n$ be the sequence given by the rule: $$a_0=k,a_{n+1}=\alpha a_n−\beta$$
Find a closed form for $a_n$.
Long question format:
If I have a starting value $x=100000$ then first multiply $x$ by $i=1.05$, then subtract $e=9000$.  Let's say $y$ is how many times you do it.
Anyone know of a formula to get $e$ given $y,x,i$ and given the total must be $0$ after $y$ "turns"?
Example:
$$y=1: xi-e=0$$
$$y=2: ((xi-e)i-e)=0$$
and so on...

Let's $u_0 = x$, and $u_{n+1} = iu_n - e$.
To solve this equation, let's $l= il-e$, and $v_n = u_n - l$.
Then $v_{n+1}= i v_n$ ans $v_n = i^n v_0$, so $u_n = l + i^n v_0 = l + i^n (x - l)$.
But $l = e/(i-1) = 180 000$. So $u_n = 180 000 - 80000*1.05^n$. So $u_n \leq 0$ is equivalent to
$$180 000 - 80000*1.05^n \leq 0$$
$$1.05^n \geq 180000/80000 = 2.25$$
$$n \geq 17$$
(And $u_{17} \neq 0$ !)
General case :
Let's $l = e/(i-1)$. If $i > 1$ and $x > l$, $u_n \leq 0$ is equivalent to
$$l + i^n(x-l) \leq 0$$
$$i^n \geq l/(x-l)$$
$$n \geq \frac{log(i)}{log(l) - log(x-l)}$$
So $$y = E(\frac{log(i)}{log(l) - log(x-l)}) + 1$$
