Q:

Description of a discrete set including ranges

If there is a discrete set, example {1,2,3,14,15,16,21,22} how to write this mathematically?
A mathematical equations should satisfy if sets varies too. Kindly help me out, thanks in advance.
In this set 1-3 is of continuous, 14-16 is continuous and final is 21-22. It forms three ranges can it be written in expression with some notations.
For example if 1-3 is alone present we can write it as simple as 1:3 but here there are several ranges that exists. How to give notation for this scenario?

A:

What you already have is fine, and for small sets would be entirely normal.  You can also, in this case, write it as a union of integer intervals.  We can write $[m\ldots n]$ to denote $[m,n]\cap {\mathbb Z}$, i.e it is the set of all numbers between $n$ and $m$ inclusive that are integers.  So as an example, $[2\ldots5] = \{2,3,4,5 \}$.  Then your set becomes
$$ [1\ldots 3] \cup [14\ldots 16] \cup [21\dots 22]$$

