Gauss Summation

Gauss Summation

Adding total number of pairs is done with the help of this formula:

n(n+1)/2n(n+1)/2