First consider the case when ycoordinate is less than xcoordinate. In that case ji = ij. Next, Consider the case when ycoordinate is more than ycoordinate. In that case ji = ji. Finally, consider the case when ycoordinate is equal to xcoordinate. In that case ji = 0. The first 2 cases are equivalent. Hence the factor of 2 comes. For the last case Combination part i.e. nCr (with n = k and r = k) gave 1, which summed upto n. Since 2 was multiplied, so they subtracted 'n' (Similar to n = 2n  n). Hope it is clear. answered 27 Mar '16, 21:29

Here is the expression you are talking about. $S = \sum_{i=1}^n \sum_{j=1}^n {ji+k \choose k}$ Now, from the definition of absolute value, Now, as the mod function is symmetric, the expression can be modified as shown below. $S = \sum_{i=1}^n \sum_{j=1}^n {ji+k \choose k} \\= 2\sum_{i=1}^n \sum_{j=i+1}^n {ji+k \choose k} + \sum_{i=1}^n {k \choose k} \\= 2\sum_{i=1}^n \sum_{j=i+1}^n {ji+k \choose k} + n \\= 2\sum_{i=1}^n \sum_{j=i}^n {ji+k \choose k}  n$ Hope this helps. answered 30 Mar '16, 18:46
