In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. The notion of a sequence can be generalized to an indexed family, defined as a function from an arbitrary index set.
In computing and computer science, finite sequences are usually called strings, words or lists, with the specific technical term chosen depending on the type of object the sequence enumerates and the different ways to represent the sequence in computer memory. Infinite sequences are called streams.
A sequence can be thought of as a list of elements with a particular order. Sequences are useful in a number of mathematical disciplines for studying functions, spaces, and other mathematical structures using the convergence properties of sequences. In particular, sequences are the basis for series, which are important in differential equations and analysis. Sequences are also of interest in their own right, and can be studied as patterns or puzzles, such as in the study of prime numbers.
If, for some real m, an ≥ m for all n greater than some N, then the sequence is bounded from below and any such m is called a lower bound.
If the sequence of real numbers (an) is such that all the terms are less than some real number M, then the sequence is said to be bounded from above. In other words, this means that there exists M such that for all n, an ≤ M. Any such M is called an upper bound.
Likewise, If a sequence is both bounded from above and bounded from below, then the sequence is said to be bounded.
Normally, the term infinite sequence refers to a sequence that is infinite in one direction, and finite in the other—the sequence has a first element, but no final element. Such a sequence is called a singly infinite sequence or a one-sided infinite sequence when disambiguation is necessary. In contrast, a sequence that is infinite in both directions — i.e. that has neither a first nor a final element—is called a bi-infinite sequence, two-way infinite sequence, or doubly infinite sequence.
A subsequence of a given sequence is a sequence formed from the given sequence by deleting some of the elements without disturbing the relative positions of the remaining elements. For instance, the sequence of positive even integers (2, 4, 6, ...) is a subsequence of the positive integers (1, 2, 3, ...). The positions of some elements change when other elements are deleted. However, the relative positions are preserved.
An important property of a sequence is convergence. If a sequence converges, it converges to a particular value known as the limit. If a sequence converges to some limit, then it is convergent. A sequence that does not converge is divergent.
Sequences play an important role in topology, especially in the study of metric spaces. For instance: