How to get the sum of the values in a $N \times N$ table? How to get the sum of the values in a $N \times N$ table (without adding repeating products such as $6 \times 7$ and $7 \times 6$ twice and without counting perfect squares)?
Figured out that
$1 \cdot 0+2 \cdot 1+3 \cdot (1+2)+4 \cdot (1+2+3)+\dots+n\cdot (1+2+3+\dots+(n-1))=1\dbinom{1}{2}+2\dbinom{2}{2}+3\dbinom{3}{2}+4\dbinom{4}{2}+\dots+n\dbinom{n}{2}$
At this point I'm completely stuck. What do I do to get an exact number e. g. for $n=50$, $n=100$ etc.?
 A: If I understand correctly, you want 
$$\begin{align*}
\sum_{i=1}^{N-1}\sum_{k=i+1}^Nik&=\sum_{k=2}^N\sum_{i=1}^{k-1}ik\\
&=\sum_{k=2}^Nk\sum_{i=1}^{k-1}i\\
&=\sum_{k=2}^Nk\left(\frac{k(k-1)}2\right)\\
&=\frac12\sum_{k=2}^N\left(k^3-k^2\right)\\
&=\frac12\sum_{k=2}^Nk^3-\frac12\sum_{k=2}^Nk^2\\
&=\frac12\left(\frac14N^2(N+1)^2-1\right)-\frac12\left(\frac16N(N+1)(2N+1)-1\right)\\
&=\frac18N^2(N+1)^2-\frac1{12}N(N+1)(2N+1)\\
&=\frac{N(N+1)}{24}\Big(3N(N+1)-2(2N+1)\Big)\\
&=\frac1{24}N(N-1)(N+1)(3N+2)\;,
\end{align*}$$
if I made no careless algebraic errors. This is the sum of all products of unordered pairs of integers from the set $\{1,\dots,N\}$.
A: Its almost either upper diagonal or lower diagonal matrix entries.
Lets check this in C programming.
:
A[N][N] be the NxN table(A[2][3] gives the value of the cel (2,3) in NxN table)
$for(i=1;i<N;i++)$
{
 $for(j=i+1;j<=N;j++)$
 {
  Sum=Sum+A[i][j];
  }
 }
get the value of Sum. 
actual code
#include stdio.h
#include conio.h
void main()
{
 int n,i,j;
 float A[100][100],Sum=0.0;
 clrscr();
 printf("Enter the order of matrix\n");
 scanf("%d",&n);
 printf("Enter the value of the matrix one by one\n");
 for(i=1;i<=n;i++)
 {
  for(j=1;j<=n;j++)
  {
   scanf("%f",&A[i][j]);
   }
  }
 printf("Entered matrix\n");
 for(i=1;i<=n;i++)
 {
  for(j=1;j<=n;j++)
  {
   printf("%f\t",A[i][j]);
   }
   printf("\n");
  }
 $for(i=1;i<n;i++)$
 {
 $ for(j=i+1;j<=n;j++)$
  {
   Sum=Sum+A[i][j];
   }
  }
 printf("Sum=%f\n",Sum);
 getch();
 }
