How do I simplify this into a formula?
Note: $z,g,o,x,p,b,c,f,y$ - are all multiplicative constants
I have:
$$n(1)=z\left(gox^0+p\left(\frac{b}c\right)-fy^0\right)$$
$$n(3)=z\left(gox^2+p\left(\frac{b+n(1)+n(2)}c\right)-fy^2\right)$$
$$n(4)=z\left(gox^3+p\left(\frac{b+n(1)+n(2)+n(3)}c\right)-fy^3\right)$$
So I figure:
$$n(r)=z\left(gox^{r-1}+p\left(\frac{b+n(1)+n(2)+n(3)+\cdots+n(r-1)}c \right)-fy^{r-1}\right)$$
But I am having trouble simplifying this into a formula...
How would one go about simplifying this?
Any and all help would be highly appreciated.
Edit: $z,g,o,x,p,b,c,f,y$ - are all multiplicative constants
To the closed form... Following the comments, let $m_r = \displaystyle\sum_{i = 1}^{r}n(i)$. We have $m_0 = 0$ and, for $r > 0$, $$m_r = Am_{r - 1} + Bx^{r - 1} + Cy^{r - 1} + D, \quad\text{where}\quad A = 1 + \frac{zp}{c}, B = zgo, C = -zf, D = \frac{zpb}{c}.$$
For real $X, Y$ and integer $r > 0$, the function $T_r(X, Y) = \begin{cases}\displaystyle\frac{X^r - Y^r}{X - Y} & (X \neq Y) \\ \hfill r X^{r - 1} & (X = Y)\end{cases}$ satisfies $$T_0(X, Y) := 0\quad\text{and}\quad T_r(X, Y) = XT_{r - 1}(X, Y) + Y^{r - 1}\quad\text{for}\quad r > 0.$$ This allows to prove (using induction on $r$) that $m_r = BT_r(A, x) + CT_r(A, y) + DT_r(A, 1)$.
Finally, the answer is $n(r) = m_r - m_{r - 1}$.