Difficult Q: Show that every integer $n$ can be written in the form $n = a^2 b$….product of distinct primes I have a difficult two part question which has stumped me, the question is: Show that every positive integer $n$ can be written in the form $n = a^2 b$ for some integers $a$ and $b$ where $b$ is a (possibly empty) product of distinct primes, and how I could use the answer of this to prove that there are infinitely many primes. I understand a similar question was asked yesterday however that was for any product of primes not distinct primes
 A: Write the prime factorization of $n$ as $n = \prod_{p} p^{v_p(n)}$, where the product range over all primes and where, for every prime $p$, $v_p (n)$ is the largest integer $r$ for which $p^{r} \mid n$. Define the sets $E$ and $O$ as follows:
$$
E = \{ p \mid \text{$v_p (n)$ is even} \}, \qquad
O = \{ p \mid \text{$v_p (n)$ is odd} \}.
$$
For every prime $p$, there exists an integer $k_p(n)$ such that $v_p (n) = 2 k_p (n)$ if $p \in E$, while $v_p (n) = 2 k_p (n) + 1$ if $p \in O$. Then
$$
\begin{aligned}[t]
n = \prod_p p^{v_p(n)} 
&= \prod_{p \in E} p^{v_p (n)} \prod_{p \in O} p^{v_p (n)} \\
&= \prod_{p \in E} p^{2k_p (n)} \prod_{p \in O} p^{2 k_p (n)+1} \\
&= \Biggl(\prod_{p \in E} p^{k_p (n)}\Biggr)^2 
\Biggl(\prod_{p \in O} p^{k_p (n)} \Biggr)^2 \Biggl( \prod_{p \in O} p^1\Biggr)\\
&= \Biggl(\prod_{p \in E \cup O} p^{k_p (n)}\Biggr)^2 
\Biggl( \prod_{p \in O} p \Biggr)\\
&= a^2 b,
\end{aligned}
$$
where $a = \prod_{p \in E \cup O} p^{k_p(n)}$ and $b = \prod_p p$. Note that $b$ is a product of distinct primes, and this product could be empty. 
