What is the proper mathematical notation for a loop structure such as the following?

FOR i=1 to 10 BEGIN
{Perform loop task}

I am a programmer, but prefer to work on paper and so I am slowly teaching myself notation as a shorthand way to do this.



For addition or multiplication (and therefore also subtraction and division), there exists two symbols; both $\sum$ and $\prod$, respectively.

For example, if you want to add the numbers from 1 to 100, you would put the following -

$\sum^{100}_{i = 1}i$

Or, if you wanted to multiply the square of numbers from 3 to 70, you would put the following -

$\prod_{2 < i < 71} i^2$

Hopefully these examples clarify one possibility for loop notation (there may be others I am not aware of).

  • $\begingroup$ Thanks. I'm familiar with sigma summation notation - but is there a similar way to declare that structure to perform a series of tasks rather than just summation? $\endgroup$ – Stackguest Apr 14 '13 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.