A sequence where the nth term is the cumulative sum over n-1 Consider the following sequence:
$u_{n}=-\frac{u_{1}}{n}-\frac{\beta\gamma}{n}(u_{1}+...+u_{n-1})$, where $u_1$, $\beta$ and $\gamma$ are some none zero constant.
In this sequence, can I obtain the expression for $u_{n}$ as a function of $u_{1}$? If I can, what would it be? At first, it seems pretty straightforward but I couldn't get a nice closed form.
 A: Clearly your recurrence relation holds for only for $n\gt1.$ Otherwise at $n=1,$ we get $u_1=-u_1$ and consequently $u_n=0$ for all $n\in\mathbb{N}.$  In particular at $n=2,$ we have $u_2=-\dfrac{u_1}{2}(1+\beta\gamma).$ Thanks for Achille hui to pointing this in comments.
There are few different ways that you can look at this question. One way is note that the quantity $$nu_n+\beta\gamma(u_1+\cdots+u_{n-1})=-u_1$$ is a constant. By rewriting the same equation for $n+1,$ we get $(n+1)u_{n+1}+\beta\gamma(u_1+\cdots+u_{n-1}+u_{n})=nu_n+\beta\gamma(u_1+\cdots+u_{n-1}),$ which simplifies to $$u_{n+1}=\left(\dfrac{n-\beta\gamma}{n+1}\right)u_n\qquad \forall n\ge2.$$ Clearly

*

*if $u_1=0$ then the sequence is trivial.

*if $\beta\gamma$ is an integer other than $1,$ then all $u_{\beta\gamma+1}=u_{\beta\gamma+2}=\cdots=0.$
Otherwise $$u_{n+1}=u_2\dfrac{u_3}{u_2}\cdots\dfrac{u_n}{u_{n-1}}\dfrac{u_{n+1}}{u_n}=u_2\prod_{k=2}^{n}\left(\dfrac{k-\beta\gamma}{k+1}\right)=-u_1(1+\beta\gamma)\dfrac{(2-\beta\gamma)\cdots(n-\beta\gamma)}{(n+1)!}$$ for all $n\ge 2.$ In fact, this last formula contain above two remarks as special cases.
Another way to solve this recurrence is compute first few terms of the sequence by hand and identify a pattern among them. Then we can use mathematical induction to justify our pattern.
A: Here is an approach via generating functions (though it mostly proves that this method is not always the best one!). We define $U(x):=\sum_{n=1}^\infty u_n x^n$, and for convenience I'll introduce $r:=\beta\gamma$ as well. To obtain a relation on this GF, we first rearrange the recurrence as $$u_n+u_1+r (u_1+\cdots+u_{n-1})=0.$$
We now multiply both sides of the recurrence by $x^{n-1}$ and sum from $n=2$ to infinity to obtain
$$\sum_{n=2}^\infty n u_n x^{n-1} + u_1\sum_{n=2}^\infty x^{n-1}+\sum_{n=2}^\infty r(u_1+\cdots +u_{n-1})x^{n-1}=0.$$
We deal with these sums one-by-one. For the first, we use the power rule for derivatives to write
$$\sum_{n=2}^\infty n u_n x^{n-1}=\frac{d}{dx}\sum_{n=2}^\infty n u_n x^n=\frac{d}{dx}[U(x)-u_1 x]=U'(x)-u_1.$$
For the second, we have the geometric sum
$$u_1\sum_{n=2}^\infty x^{n-1}=\frac{u_1 x}{1-x}.$$
For the third, we may rewrite the series as
\begin{align}
\sum_{n=2}^\infty r(u_1+\cdots +u_{n-1})x^{n-1}
&=\sum_{n=1}^\infty r(u_1+\cdots +u_n)x^{n}\\
&=\sum_{n=1}^\infty \sum_{k=1}^n r u_k x^n \\
&=\sum_{1\leq k \leq n\leq \infty} r u_k x^n \\
&=\sum_{k=1}^\infty \sum_{n=k}^\infty r u_k x^n \\
&=\sum_{k=1}^\infty r u_k \frac{x^k}{1-x} \\
&= \frac{r}{1-x}U(x)
\end{align}
Therefore we have the differential equation
$$U'(x)-u_1+\frac{u_1 x}{1-x}+\frac{r}{1-x}U(x)=0.$$
This may be solved by seeking an appropriate integrating factor. Indeed, we have
\begin{align}
(1-x)^{-r}\frac{d}{dx}[(1-x)^r U(x)]
&=U'(x)+\frac{r}{1-x}U(x)\\
&=u_1-\frac{u_1 x}{1-x}\\
&=u_1\frac{1-2x}{1-x}
\end{align}
We move $(1-x)^{-r}$ over, integrate both sides with base point $x=0$, and move $(1-x)^r$ over. (Note that $U(0)=0$.) We obtain
$$U(x) = (1-x)^{-r}u_1 \int_0 (1-2x)(1-x)^{r-1}\,dx=u_1\frac{(1+r)-2rx -(1+r)(1-x)^r}{r(r-1)}.$$
If we fearlessly expand this using the binomial expansion, we obtain
\begin{align}
U(x)
&=\frac{u_1}{r(r-1)}\left[(1+r)-2rx-(1+r)\sum_{k=0}^\infty \binom{r}{k}(-x)^k\right]\\
&=u_1\left[x+\sum_{k=2}^\infty \binom{r}{k}(-x)^k\right]
\end{align}
Hence we finally conclude that, for $n\geq 2$, we have $$u_n=u_1 (-1)^n \binom{r}{n}=u_1 (-1)^n \frac{r(r-1)\cdots(r-n+1)}{n!}=-u_1 \frac{r(1-r)\cdots(n-1-r)}{n!}$$
which agrees with the (much shorter) deduction by Bumblebee.
