How do I do this summation? $$\sum_{i=0}^{N-2}\frac{(N-2)!(i+1)(i+2)(i+4)}{2(N-2-i)!N^{i+1}}$$
The answer is N.
 A: This sum is solvable using Gosper's algorithm.
Let $g(i)$ denote the summand
$$
    g(i) = \frac{(n-2)!}{2(n-2-i)!} \frac{1}{n^{i+1}} (i+1)(i+2)(i+4)
$$
Gosper's algorithm makes an ansatz for $S(i)$ such that $S(i+1)-S(i) = g(i)$. Specifically it seeks the solution as
$$
    S(i) = \frac{(n-2)!}{2(n-2-i)!} \frac{1}{n^i} p(i)
$$
for some polynomial $p(i)$.  Should such a polynomial exist, the sum telescopes:
$$
   \sum_{i=0}^{n-2} g(i) = S(1)-S(0) + S(2)-S(1) + \cdots + S(n-1)-S(n-2) = S(n-1)-S(0)
$$
It works because:
$$\begin{eqnarray}
    S(i+1)-S(i) &=& \frac{(n-2)!}{2(n-3-i)!} \frac{1}{n^{i+1}} p(i+1) - \frac{(n-2)!}{2(n-2-i)!} \frac{1}{n^i} p(i) \\ &=& \frac{(n-2)!}{2(n-2-i)!} \frac{1}{n^{i+1}}\left\{ (n-2-i)p(i+1) - n p(i)\right\} \\ &=& 
\frac{(n-2)!}{2(n-2-i)!} \frac{1}{n^{i+1}} (i+1)(i+2)(i+4)
\end{eqnarray}
$$
Hence the equation reduces to 
$$
   (n-2-i) p(i+1)-n p(i) = (i+1)(i+2)(i+4)
$$
It is not hard to see that if a polynomial solution exists, the polynomial has degree at most 2. Hence letting $p(k) = a_0 + a_1 k + a_2 k^2$ we end up the following solution:
In[35]:= Solve[
 CoefficientList[(n - 2 - i) p[i + 1] - 
     n p[i] - (i + 1) (i + 2) (i + 4) /. {p[k_] :> 
      a0 + a1 k + a2 k^2}, i] == 0, {a0, a1, a2}]

Out[35]= {{a0 -> -2 n, a1 -> -3, a2 -> -1}}

Hence
$$
    S(i) = - \frac{(n-2)!}{2(n-2-i)!} \frac{1}{n^i} \left\{ i^2 + 3 i + 2n \right\}
$$
and the sum equals
$$
   \sum_{i=0}^{n-2} g(i) = S(n-1)-S(0) = 0 - \left( -n \right) = n
$$
