This site is supported by donations to The OEIS Foundation.

# Variables

A variable is an element of a formula or group of formulas that changes value (such as by iterating from a start value to an end value) or may take any arbitrarily chosen value from a given range. Generally, single italicized letters of the Latin alphabet are used for this purpose.

For example, in the expression

${\displaystyle f(n)=\sum _{i=1}^{n}{\frac {1}{-1+i+{\sqrt {i}}}},\,}$

${\displaystyle \scriptstyle i\,}$ is an iterating variable that goes from 1 to ${\displaystyle \scriptstyle n\,}$, while ${\displaystyle \scriptstyle n\,}$ takes on any positive integer value passed to the function ${\displaystyle \scriptstyle f\,}$.

In the OEIS, ${\displaystyle \scriptstyle n\,}$ is usually an iterating variable that goes from the index of the first term in the sequence (designated as the offset of the sequence, e.g. 0 or 1) to the index of the largest term in the sequence (in the case of finite sequences) or to infinity (in the case of infinite sequences.)

Most computer programming languages, encouraging the use of longer variable names, allow the use of decimal digits (0 to 9) in such names, with the stipulation that the name must start with a letter or an underscore. Thus, Mileage2 is allowed but 2ndMileage is not. In a computer algebra system that takes over some computer programming conventions, this allows the use of the tacit multiplication operator, e.g., 2ndMileage would mean multiplying the variable ndMileage by 2.