I have the book saying that
and says that this is equivalent to saying
If you don't understand C code, it is because of mistakes in it.
It must be 1 instead of i in first case:
for(i = 1; i <= N; i++)
Sum += 1;
It must be i instead of 1 and 1 instead of k there in the second case:
for(k = j; k <= i; k++)
Sum += 1;
P.S. Also you have mistypo in the formula itself. 1 is skipped after Sigma by some reason. and j and i are swaped...
What is this book you are talking about?