In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called "elements", or "terms"). The number of elements (possibly infinite) is called the "length" of the sequence. Unlike a set, the same elements can appear multiple times at different positions in a sequence, and unlike a set, the order does matter. Formally, a sequence can be defined as a function whose domain is either the set of the natural numbers (for infinite sequences), or the set of the first "n" natural numbers (for a sequence of finite length "n").