# iterator

An iterator is a variable that one by one takes on all the values (usually integers) in a given range. The letter $i$ is often used for iterators (though that letter is overloaded as the imaginary unit), $j$ is often used as a second iterator.

In mathematics iterators are most often used in sum and product notation. For example, in

 $\prod_{i=3}^{7}42i^{2}$

the iterator $i$ takes on values from 3 to 7.

In computer programming languages iterators are often associated with the ”for” reserved word, e.g., “FOR I = 1 TO 47” in BASIC, “for (i = 1; i < 48; i++)” in C++. In Mathematica, iterators are often given in curly braces together with an (omittable) initial value and a required finish value separated by commas, e.g., “Table[2^n - 1, {n, 2, 48}]”.

Title iterator Iterator 2013-03-22 16:25:16 2013-03-22 16:25:16 PrimeFan (13766) PrimeFan (13766) 6 PrimeFan (13766) Definition msc 68N15