Canonical: https://knowlpedia.com/shared-foundations/sequence/

# Sequence

A function from the natural numbers to a set.

A **sequence** in a [set](https://knowlpedia.com/shared-foundations/set/) \(X\) is a [function](https://knowlpedia.com/shared-foundations/function/) \(a:\mathbb{N}\to X\), where \(\mathbb{N}\) is the [natural numbers](https://knowlpedia.com/shared-foundations/natural-numbers/). One writes \(a_n\) for \(a(n)\), so the sequence is denoted \((a_n)_{n\in\mathbb{N}}\).

## Remarks

Thus a sequence is a function with [domain](https://knowlpedia.com/shared-foundations/domain/) \(\mathbb{N}\) and [codomain](https://knowlpedia.com/shared-foundations/codomain/) \(X\), and it can be manipulated using standard function constructions such as [restriction](https://knowlpedia.com/shared-foundations/restriction-of-a-function/) and [composition](https://knowlpedia.com/shared-foundations/composition/).

## Examples

- The rule \(a_n = 1/(n+1)\) defines a sequence of [rational numbers](https://knowlpedia.com/shared-foundations/rational-numbers/).
- The rule \(a_n=7\) for all \(n\in\mathbb{N}\) defines a constant sequence in \(\mathbb{Z}\) (the [integers](https://knowlpedia.com/shared-foundations/integers/)).
