Prove that $C\times\{1,2,\dots,n\}$ is homeomorphic to $C$, the Cantor Set. I've been asked to prove the following:

Prove that $C\times\{1,2,\dots,n\}$ is homeomorphic to $C$, where $C$ is the Cantor Set.

For convenience we can take the product metric to be $d_{\infty}((a,b),(c,d)) = \max\{d(a,b), d'(c,d)\}$.
I know that since $C\times\{1,2,\dots,n\}$ is compact, we need to only find a continuous bijection (the homeomorphism follows from the fact that $C$ is Hausdorff). Furthermore, it is clear that $C$ is the set of all reals in $[0,1]$ with a ternary expansion which only contains the numbers $0$ and $2$.
I think I've found a homeomorphism in the case that $n = 2^m$ for some natural $m$, where we write each number as its binary expansion, convert it to $0$s and $2$s and then attach it to the front of the ternary expansion. As an example, if $n=8$, then
$$f\bigg(\frac{1}{4},5\bigg) \implies f(0.0202\dots_3,101_2) = 0.2020202\dots$$
Since the binary expansion is unique, each number will have a unique inverse based on its first digits.
What is the homeomorphism if $n \neq 2^m$? Furthermore, can a homeomorphism also be drawn from the space $C\times\{\frac{1}{n}:n\in\mathbb N\}$ to $C$?
 A: If $X$ is any zero-dimensional compact metric space without isolated points, $X \simeq C$ (a classical theorem due to Brouwer).
It follows that $C \simeq C^n$ for all $n$ and also $C \oplus C \simeq C$ (disjoint sum, any finite disjoint sum will do). Your fact is a direct consequence.
A: HINT:
Let's find a homeomorphism from $C \to C\times \{1,2,3\}$.
For this, you need to find three disjoint subsets of $C$ homeomorphic to $C$. Take $C_1= \{(0,\ldots, \}$, $C_2 = \{(1,0, \ldots, )\}$, $C_3= \{(1,1, \ldots)\}$.  You can generalize it to $n$ sets.  For this you need to find such sequences like $0$, $10$, $11$.  There is a little theory behind such sequences, see if you can figure it out.
$\bf{Added:}$ It is easy to see that $C\sqcup C \simeq C$. But once we know that, we get $C\sqcup C\sqcup C \simeq C$, and by induction, for all $n$. The concrete isomorphism above in fact follows this idea. The answer of @Henno Brandsma: clarified  that for me.
The sequences $0$, $10$, $11$ can provide an explicit homeomorphism from $\{0,1,2\}^{\mathbb N}$ to $C = \{0,1\}^{\mathbb N}$, see Huffman coding.
