In using Mathematica
, you sometimes need to repeat an operation many times. There are many ways to do this. Often the most natural is in fact to set up a structure such as a list with many elements, and then apply your operation to each of the elements.
Another approach is to use the Mathematica
, which works much like the iteration constructs in languages such as C and Fortran. Do
uses the same Mathematica iterator notation
, described in "Sums and Products"