A sequence, in mathematics, is an enumerated list; the elements of this list are usually referred as to the terms. Sequences may be finite or infinite.
Formally, given any set X, an infinite sequence is a function (f, say) defined on the natural numbers , with values in X. Similarly, a finite sequence is a function f defined on with values in X. (We say that n is the length of the sequence).
In a natural way, the sequences are often represented as lists:
where, formally, , etc. Such a list is then denoted as , with the parentheses indicating the difference between the actual sequence and a single term .
Some simple examples of sequences of the natural, real, or complex numbers include (respectively)
Often, sequences are defined by a general formula for . For example, the sequence of odd naturals can be given as
There is an important difference between the finite sequences and the [[set]s. For sequences, by definition, the order is significant. For example the following two sequences
are different, while the sets of their terms are identical:
Moreover, due to indexing by natural numbers, a sequence can list the same term more than once. For example, the sequences
are different, while for the sets we have