Find an injection from $\mathbb{Z_+}^n \to \mathbb{Z_+}$
This is what I did. Define $f : \mathbb{Z_+}^n \to \mathbb{Z_+}$ such that
$$f\left(((x_i)_{i \in \mathbb{Z_+}}\right) = x_1$$
If I scrapped the notation, it would essentially be the following function $f((x_1, x_2, \ldots)) = x_1$
Would this function define an injection? Furthermore, I'm not sure if I've made correct use of notation?
Is there are better, cleaner way of finding an injective function mapping $\mathbb{Z_+}^n \to \mathbb{Z_+}$?
Hint: Let $p_1, p_2, \dots, p_n$ be distinct primes and consider $f((x_1,x_2, \dots, x_n)) = p_1^{x_1} p_2^{x_2} \cdots p_n^{x_n}$.