Simplify $\sum_{i=0}^{n-1} \sum_{j=i}^{n-1}1$ Question:
Simplify $$\sum_{i=0}^{n-1} \sum_{j=i}^{n-1}1$$
My attempt:
$$\sum_{i=0}^{n-1} \sum_{j=i}^{n-1}1 =\sum_{i=0}^{n-1} (n-1-i) $$.
Would this now be the sum of the first $n-1$ integers?
 A: $$\begin{align}
\sum_{i=0}^{n-1} \sum_{j=i}^{n-1}1&=\sum_{j=0}^{n-1}\sum_{i=0}^{j}1
&&\scriptsize(0\le i\le j\le n-1)\\
&=\sum_{j=0}^{n-1}(j+1)\\
&=\sum_{j=1}^n j\\
&=\color{red}{\frac 12n(n+1)=\binom {n+1}2}\end{align} $$
A: The number of integers from $1$ to $m$ would be $m$. It can be computed by $m-1+\color{red}{1}$.
The number of integer from $i$ to $n-1$ would be $(n-1)-i+1=n-i$
$$\sum_{i=0}^{n-1} \sum_{j=i}^{n-1}1 =\sum_{i=0}^{n-1} (n-1-i+\color{red}{1})= \sum_{i=0}^{n-1} (n-i)$$
When $i=0$, $n-i=n$.
When $i=n-1$, $n-i=n-(n-1)=1$.
Hence we are adding from $1$ to $n$ in the backward direction.
There is a special formula for $\sum_{i=1}^n i$.
A: $\sum_{i=0}^{n-1}\sum_{j=i}^{n-1}1 $ counts the elements of $\{(i,j)\in\{0,..,n-1\}^2: i\leq j\}$
From the set $\{0,..,n-1\}$, there are $\underline{\phantom{\binom{n}2}}$ ways to select two distinct elements ($i<j$), and $\underline{\phantom{\binom n1}}$ ways to select two identical indices ($i=j$).
$$\therefore\qquad\sum\limits_{i=0}^{n-1}\sum\limits_{j=i}^{n-1}1 ~= \dbinom{n+1}2$$
A: Put the sequence in a matrix, you have a $n\times n$ matrix, the first row is full of 1's the second row 1's except the first position, and so on... if you sum through columns you should have the sequence of the first $n$ integers.
