Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > List Manipulation > Constructing Lists >
Mathematica > Data Manipulation > Handling Arrays of Data > Constructing Lists >

Range

Range[imax]
generates the list {1, 2, ..., imax}.
Range[imin, imax]
generates the list {imin, ..., imax}.
Range[imin, imax, di]
uses step di.
  • The arguments to Range need not be integers.
  • Range starts from imin, and successively adds increments of di until the result is greater than imax.
  • Range uses the standard Mathematica iteration specification, as applied to a single variable.
Use a step of 2:
Use a negative step:
Use an exact numeric-valued step:
Use a machine-number step:
Use a precision-24 step:
Range of very large numbers:
Use a symbolic step:
Produce a geometric sequence:
Form a polynomial from coefficients:
Form a random permutation:
Find an inverse permutation:
Range[imin, imax, di] is equivalent to Table[i, {imin, imax, di}]:
Use Range or Span (;;) as Part specification:
For some step sizes, Range may not include the upper limit given:
Even though the lower limit was exact, the inexact step makes the first element inexact:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team