How to evaluate a summation when index of inner sum cannot be equal to outer sum I am looking at a summation that resembles the summation below:
$$\sum_{i=1}^n\sum_{\matrix{j=1\\j \not= i}}^n 1$$
What is the best way to think about this summation and thus get the result? Can the sum be broken apart into a more intuitive form?
 A: I would rewrite it this way.
$\sum_{i=1}^{n}\bigg[\underbrace{\sum_{j=1}^{i-1}1}_{(i-1)\text{-terms}}+\underbrace{\sum_{j=i+1}^{n}1}_{(n-i)\text{-terms}}\bigg]=\sum_{i=1}^{n}[(i-1)+(n-i)]=\sum_{i=1}^{n}(n-1)$
$\phantom{\sum_{i=1}^{n}\bigg[\underbrace{\sum_{j=1}^{i-1}1}_{(i-1)\text{-terms}}+\underbrace{\sum_{j=i+1}^{n}1}_{(n-i)\text{-terms}}\bigg]}=(n-1)\underbrace{\sum_{i=1}^{n}1}_{n\text{-terms}}=(n-1)n$.
A: I would add and remove
the deleted term
from the inside summation:
$\begin{array}\\
\sum_{i=1}^n\sum_{j \not= i} 1
&=\sum_{i=1}^n((\sum_{j=1}^n 1)- 1)\\
&=\sum_{i=1}^n((n)- 1)\\
&=n(n-1)
\end{array}
$
Fortunately,
my answer agrees with
that if bkarpuz.
More generally,
if
$F = \sum_{j=1}^n f(j)$,
$\begin{array}\\
\sum_{i=1}^n\sum_{j \not= i} f(j)
&=\sum_{i=1}^n((\sum_{j=1}^n f(j))- f(i))\\
&=\sum_{i=1}^n\sum_{j=1}^n f(j)-\sum_{i=1}^n f(i)\\
&=\sum_{i=1}^n F-F\\
&=nF-F\\
&=(n-1)F\\
\end{array}
$
Even more generally,
if
$F(i) = \sum_{j=1}^n f(i, j)$,
$G = \sum_{i=1}^n F(i)$,
and
$D = \sum_{i=1}^n f(i, i)$
,
$\begin{array}\\
\sum_{i=1}^n\sum_{j \not= i} f(i,j)
&=\sum_{i=1}^n((\sum_{j=1}^n f(i,j))- f(i,i))\\
&=\sum_{i=1}^n\sum_{j=1}^n f(i,j)-\sum_{i=1}^n f(i,i)\\
&=\sum_{i=1}^n F(i)-D\\
&=G-D\\
\end{array}
$
A: Since the summand is $1$, the summation is just the count of the number of elements to be summed. Hence 
$$\begin{align}
&\overbrace{\sum_{1\leqslant i\leqslant n}}^n\;
\overbrace{\sum_{\matrix{1\leqslant j\leqslant n,\\ j\neq i}}1}^{n-1}\\
&=n(n-1)\qquad\blacksquare
\end{align}$$
