# Why is the upper bound of this statement always incremented by 1?

Why is "for j = 1 to n" translate to this? Why is the upper bound always incremented by 1?

$$\sum_{j=1}^{n+1}1$$

Why isn't it $$\sum_{j=1}^n1$$

"for j = 1 to n" is written in pseudo code btw for algorithm analysis. Or is there a + 1 because of the final condition check when using summations to count the frequency count of for loops?

-
It should be what you say it is. I'm not sure why you need to increment it by 1. Are you programming something, by any chance? –  Joe Z. Jan 2 '13 at 21:22
Can you provide the context? Where did you see this? Sometimes in programing 0 is the first number, which could cause the difference in notation. –  Calvin Lin Jan 2 '13 at 21:25
Saw it in a powerpoint, its written in pseudocode for algorithm analysis –  Bulbo Jan 2 '13 at 21:27

To be precise, the Python "for" command loops over the given list and nothing else. It's just that the command "range(a,b)", which is often used to generate the list, produces the numbers $a \le i < b$. –  Hans Lundmark Jan 3 '13 at 8:37