[Math] How to prove this set is denumerable

elementary-set-theory

I'm studying for an exam tomorrow and I've encountered a practice question that asks for me to explain why the set $$ \mathbb{N} – \left\{n^2 \:|\: n \in \mathbb{N} \right\} $$ is denumerable. I understand that I'm supposed to find a surjective function from $\mathbb{N}$ to this set, but I can't think of what it would be.

Any help or hints would be appreciated. Thank you!

Edit: I also realize that since $\mathbb{N}$ is countably infinite and $\left\{n^2 \:|\: n \in \mathbb{N} \right\}$ is countably infinite, their difference should be countable — however, I'm still not sure how to show that it's infinite.

Best Answer

Consider the set $\mathbb{N}_p = \{p\in\mathbb{N}: p\ is\ prime\}$. We know that $\mathbb{N}_p$ is countably infinite. So, we now notice that $x \in \{ n^2 : n \in\mathbb{N}\} \implies x \not\in \mathbb{N}_p$.

Hence, $\mathbb{N}_p \subset \mathbb{N} \setminus \{ n^2 : n \in \mathbb{N}\}$. So, we must conclude our set has infinite cardinality.

Related Question