0
$\begingroup$

Hello i have this sum:

$\sum_{j=0}^{n-2}(n-j)$

i try solve of this mode:

$\sum_{j=0}^{n-2}n - \sum_{j=0}^{n-2}j$ or $\sum_{j=0}^{n-2}n + \sum_{j=0}^{n-2}-j$

but in wolfram alpha it not same, and the expected result is n²

This sum is obtained from the following recurrence:

$f(n)= 1 if n<= 1\\ f(n)= n+f(n-1) n>1$

but it not same

  • 2
    The sums are all the same, but none is $n^2\,$. Try $n=2$ or $n=3$ to see why. – 2017-02-23

3 Answers 3

0

Hint:

Set $k=n-j$ and express this sum in function of $k$. What are the bounds for $k$?

  • 0
    i dont understand why can set $k = n - j$ – 2017-02-23
  • 0
    Why couldn't you? It is a simple substitution, and it leads to another expression which comes down to a well-known formula – 2017-02-23
0

Using your way $$S_n=\sum_{j=0}^{n-2}(n-j)=\sum_{j=0}^{n-2}n - \sum_{j=0}^{n-2}j=n\sum_{j=0}^{n-2}1 - \sum_{j=0}^{n-2}j=n(n-1)-\frac{1}{2} (n-2) (n-1)$$ which makes $$S_n=\frac{1}{2} (n-1) (n+2)$$ which is what Wolfram Alpha gives as a result typing

  sum (n-j) from j=0 to j=n-2
0

Putting $r=n-j$: $$\sum_{j=0}^{n-2} (n-j)=\sum_{r=2}^n r=\frac {n(n+1)}2-1=\frac {n^2+n-2}2=\frac 12 (n-1)(n+2)$$