Natural numbers to prime exponents I am currently teaching a class for middle school students who are interested in mathematics and we were talking about Hilbert's Hotel and how you could fit $\mathbb{N}\times\mathbb{N}$ guests into the Hotel, i.e. the goal is to show that $\mathbb{N}\times\mathbb{N}$ is countable.
One of the students came up with the idea of defining the following map:
$$ f: \mathbb{N}\times\mathbb{N}\to\mathbb{N},\; (n,m)\mapsto n^{p_m}$$
where $p_m$ is the m-th prime number. While this is not injective on the whole domain, I have the feeling that it should be injective when restricting to $\{n\in\mathbb{N}\;:\; n\ge2\}\times\mathbb{N}$, which with some extra work should be enough to prove countability.
Since I am not very good at number theory, I still failed to show this restricted injectivity.
It is easy to see that for pairs $(n,m)$ and $(k,m)$ the map is injective and the same holds for pairs $(n,m)$ and $(n,l)$ but for arbitrary pairs $(n,m),\; (k,l)$ one would have to show that
$$n^{p_m} = k^{p_l}\Rightarrow (n,m) = (k,l).$$ Is there an easy way to show this?
 A: Suppose $n^{p_m} = k^{p_l} \tag{1}$
If we assume there exists a prime number $q$ such that $q$ divides one of $n, k$ but not the other, then obviously (1) cannot be true.
So it follows that $n,k$ have the same prime factors $q_1, q_2, ... q_s$
Let their respective powers in $n,k$ be $a_1, a_2, ..., a_s$ and $b_1, b_2, ..., b_s$
$$n = q_1^{a_1}q_2^{a_2}...q_s^{a_s} \tag{2}$$
$$k = q_1^{b_1}q_2^{b_2}...q_s^{b_s} \tag{3}$$
Then from $(1)$ we get that $a_1 \cdot p_m = b_1 \cdot p_l \tag{4}$
But from here it does not follow that $a_1 = b_1$, we can take e.g. $a_1 = p_l$ and $b_1 = p_m$ and satisfy $(4)$.
So... counter example:
$n=2^{p_{15}} 3^{p_{15}}$
$k=2^{p_{20}} 3^{p_{20}}$
$m=20$
$l=15$
Now $(n, 20)$ and $(k, 15)$ map to the same number.
But these two pairs are not equal.
So... it seems to me this mapping that the student defined is not injective.
Please verify the logic of this proof because I came up with it and wrote it quite quickly. But yeah, I believe it's valid, I don't see a flaw in it.
