General Iteration rule
As all of the previous symbols follow the same rules as the sum and product, we will write down a general rule (sometimes people might even define other symbols that work the same way!) and then tell you how these new symbols work.
For each iteration symbol we define an initial value and an operation that combines that value with a term in the iteration to produce the new value. Here is a list of the so far discussed symbols:
- : ,
- : ,
- : (empty set),
- : (set of all elements),
- Note: For this operation you would probably just start with the first element and handle no elements as a special case
Then the general code will look like this:
let v = ...
for(let i = 0; i <= n; i++){
v = op(v,f(i));
}