TITLE: $\left \{ 0,1 \right \}^{\mathbb{N}}\sim \left \{ 0,1,2,3 \right \}^{\mathbb{N}}$ bijection function
QUESTION [6 upvotes]: Prove that $\left \{ 0,1 \right \}^{\mathbb{N}}\sim \left \{ 0,1,2,3 \right \}^{\mathbb{N}}$ and find a direct bijection function.
I got the first part by showing that $\left \{ 0,1 \right \}^{\mathbb{N}} \subseteq \left \{ 0,1,2,3 \right \}^{\mathbb{N}} \subseteq {\mathbb{N}}^{\mathbb{N}}$, which implies that $|\left \{ 0,1 \right \}^{\mathbb{N}}| \leq |\left \{ 0,1,2,3 \right \}^{\mathbb{N}}| \leq |{\mathbb{N}}^{\mathbb{N}}|$ and since $|{\mathbb{N}}^{\mathbb{N}}| = |\left \{ 0,1 \right \}^{\mathbb{N}} | = 2^{\aleph_0} $ and Cantor-Bernstein you get that $\left \{ 0,1 \right \}^{\mathbb{N}}\sim \left \{ 0,1,2,3 \right \}^{\mathbb{N}}$.
But I'm stuck with formulating a bijection function. More generally, what approach do you use when you need a formulate an exact function?

REPLY [3 votes]: $(b_1,b_2,b_3,b_4,\ldots)\mapsto(b_1+3^{b_2}-1,b_3+3^{b_4}-1,\ldots)$ answers the question.
@Andres: "As a slightly more challenging exercise, pick any two positive integers $n<m$, and build a "combinatorial" bijection between $\{0,1,…,n\}^{\mathbb N}$ and $\{0,1,…,m\}^{\mathbb N}$. Combinatorial meaning here something in the same spirit of the explicit bijection above."
Answer(partial). Assume that there exists two integers $p,q$ such that $l=(n+1)^p=(m+1)^q$. The bijection comes from a simple remark : there is a natural bijection between the words of length $p$ on the alphabet $\{0,1,…,n\}$ and the words of length $q$ on $\{0,1,…,m\}$. (one can think of two trees with the same leaves (with cardinalty $l$) to see this, look here). This yields an explicit bijection in the case $(n+1)^p=(m+1)^q$.