We all know what it is the Cantor set. The Cantor set is created by repeatedly deleting the open middle thirds of a set of line segments. One starts by deleting the open middle third $(\frac{1}{3}, \frac{2}{3})$ from the interval $[0, 1]$, leaving two line segments: $[0, \frac{1}{3}] ∪ [\frac{2}{3}, 1]$. Next, the open middle third of each of these remaining segments is deleted, leaving four line segments: $[0, \frac{1}{9}] ∪ [\frac{2}{9}, \frac{1}{3}] ∪ [\frac{2}{3}, \frac{7}{9}] ∪ [\frac{8}{9}, 1]$. This process is continued ad infinitum, where the nth set. The Cantor ternary set contains all points in the interval $[0, 1]$ that are not deleted at any step in this infinite process. An explicit formula for the Cantor set is $C=[0,1]\bigcup_{m=1}^{\infty}\bigcup_{k=0}^{3^{m-1}-1}(\frac{3k+1}{3^m},\frac{3k+2}{3^m})$
I know Maple just for doing some calculus and some basic modeling. I am asking if someone can note me a program in which we visualize the Cantor set. As I don't know if this job can be done in Maple, I added Mathematica in the title. Maybe its environment is more powerful than Maple in this question. Thanks.