Sequence (source code)

= Sequence
{title2=$(x_n)_{n=1}^{\infty}$}
{wiki}

A sequence assigns a value to each position in an ordered index list. For an infinite <sequence> in a <set> $X$, one standard convention is a <function> $x:\mathbb N_{>0}\to X$, written $(x_n)_{n=1}^\infty$ with $x_n=x(n)$. Some applications start the index at zero, and a finite <sequence> has only finitely many positions. Values may repeat; both order and repetition matter. <Basic Analysis: Introduction to Real Analysis, Volume I by Jiří Lebl/2.1 Sequences and limits>[Lebl, Basic Analysis I, §2.1: sequences as functions and their limits]{ref}.

For example, $a_n=(-1)^n$ begins $-1,1,-1,1,\ldots$, whereas $b_n=(-1)^{n+1}$ begins $1,-1,1,-1,\ldots$. Their <sets> of values are both $\{-1,1\}$, but these are different <sequences>. A <subsequence> keeps selected positions in increasing order; the <subsequence> of $a_n$ at its <even integers> is the constant <sequence> $1,1,1,\ldots$. A <tail of a sequence> retains all positions from one index onward.

<Sequences> express successive approximations, repeated observations, and the iterates of a <recurrence relation>. A <limit of a sequence> describes where its terms eventually concentrate. Finite observations alone cannot establish that behaviour: for any positive <integer> $K$, the all-zero <sequence> and the <sequence> with $u_n=0$ for $n\leq K$ and $u_n=1$ for $n>K$ agree through index $K$, yet have different <limits of sequences>. A formula or bound controlling the entire future, such as the <tail diameter of a sequence> in the <Cauchy sequence> condition, supplies information that a finite list cannot.