How to solve this recursion relation? Suppose:
$$2k(n-k)a_k=n(n-1)+(n-k)(k+1)a_{k+1}+(n-k)(k-1)a_{k-1}$$
where $k=1, 2, ..., n-1$ and $a_n=0$,
how to derive $a_k$?
I tried to find pattern $a_1-a_2=n/2$; $a_2-a3=n(2n-1)/6(n-2)$, it become more and more complicated and I can't find the rule.
 A: Hint.
Making $b_k = k a_k$ we have
$$
-b_{k-1}+2 b_k - b_{k+1} = \frac{n(n+1)}{n-k}
$$
This can be simplified by making $c_k = b_k-b_{k-1}$ giving
$$
c_k-c_{k+1} = \frac{n(n+1)}{n-k}
$$
After solving for $c_k$ can be then solved for $b_k$
A: We can finish Cesareo’s solution as follows. For each $1\le k\le n$ we have $c_k=c_{n}+n(n+1)\sum_{i=1}^{n-k}\frac 1i$. Then for each $1\le l\le n$, 
$$b_{l-1}=-\sum_{k=l}^n c_k=-\sum_{k=l}^n c_{n}+n(n+1)\sum_{i=1}^{n-k}\frac 1i=$$
$$- (n-l+1)c_n- n(n+1)\sum_{k=l}^n\sum_{i=1}^{n-k}\frac 1i=$$
$$- (n-l+1)c_n- n(n+1)\sum_{i=1}^{n-l}\frac{n-i-l+1}i=$$
$$- (n-l+1)c_n- n(n+1)\left(l-n+(n-l+1)\sum_{i=1}^{n-l}\frac{1}i\right).$$
Remark that 
$$0=b_0=- nc_n- n(n+1)\left(1-n+n\sum_{i=1}^{n-1}\frac{1}i\right).$$
We assume that $n\ge 1$. Then 
$$c_n=-(n+1)\left(1-n+n\sum_{i=1}^{n-1}\frac{1}i\right),$$
so  for $2\le l\le n,$ 
$$a_{l-1}=\frac {b_{l-1}}{l-1}=\frac{n+1}{l-1}\left((n-l+1)\left(1-n+n\sum_{i=1}^{n-1}\frac{1}i\right)-n\left(l-n+(n-l+1)\sum_{i=1}^{n-l}\frac{1}i\right)\right)=$$
$$\frac{n+1}{l-1}\left(1-l+n(n-l+1) \sum_{i=n-l+1}^{n-1}\frac{1}i \right).$$
Finally, for $1\le k\le n-1,$ 
$$a_{k}=\frac{n+1}{k}\left(-k+n(n-k) \sum_{i=n-k}^{n-1}\frac{1}i \right).$$
