[Math] Correct Notation for Loop

notation

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

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

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.

Thanks.

Best Answer

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).

Related Question