Formal notation related to a sequence or a set My question is quite naive...

I just want to represent a finite sequence of Natural number, is it the best way to write it like this?:

$\langle a_0, \ldots, a_n \rangle $, where $\forall i \in [ 0, n ], a_i \in \mathbb{N}$

I have also seen somewhere $\{ a_i \}$, does it mean a set (or a sequence) of variables? is it finite or infinite? where could i add the constraint like $\forall i \in [ 0, n ], a_i \in \mathbb{N}$?

Also, is there any difference between "tuple" and "sequence"?

Hope my question is clear, I just want to make sure what I write matches the convention...

Thank you very much
There are several usual notations:


Let $\bar a = \langle a_i\mid i&lt;n\rangle \in \mathbb N^{&lt;\mathbb N}$... (where $\mathbb N^{&lt;\mathbb N}$ means the collection of all finite sequences of natural numbers, and $\mathbb N^\mathbb N$ is the collection of all infinite sequences)
Let $\bar a = \langle a_i\mid i&lt;n\rangle$ be a finite sequence of natural numbers...


And you can always replace $\langle a_i\mid i&lt;n\rangle$ by $\langle a_0,\ldots,a_{n-1}\rangle$.

Note that $[0,n]$ can be read as the real numbers between $0$ and $n$. 

The important thing is to be clear in your intention, and consistent in your notation.

And lastly, the difference between a "tuple" and a "sequence" is the context, usually tuple is used for finite length, while sequence is for infinite ones. Also, tuples are usually for a constant length, while sequences are a variable length.

The notation $\{a_i\}$ means that this is a set whose elements are distinct. Naturally it says $i\in I$ for some index set $I$, which in turn might be that this is just a sequence (or a directed set). The meaning is usually clear from context, read more - a lot more - and things will slowly clarify.
Sometimes I see $a_1, a_2, ...$ without the brackets.