# Occurrence (parity) of primes in $n!$

It is known that $n!$ can not be a perfect square for $n\geq 1$. This means that in the prime decomposition of $n!$, one of the prime occurs odd number of times. This leads to following two questions:

1. Consider largest prime $p$, which is $\leq n$. Then in $n!$ does $p$ occurs odd number of times?

In $5!=2^3.3.5$, each prime occurs odd number of times.

2. Are there infinitely many integers $n$ such that each prime in $n!$ occurs odd number of times?

1. Yes. By Bertrand's postulate, there is always a prime $p$ between $\frac{n}{2}$ and $n$, so $p$ occurs exactly one time in the decomposition of $n!$.
2. No. By prime number theorem we can prove that for any (strictly) positive real number $\epsilon$, there exists $n_0$ such that $\forall n > n_0$, there is prime $p$ such that $n < p < (1+\epsilon )n$.
Consider $m = \frac{n}{3}$ and $\epsilon = 0.5$, there is $n_0$ such that $\forall m > n_0$, there is prime $p$ such that $\frac{n}{3} = m < p < (1+\epsilon )m = \frac{n}{2}$. So the prime $p$ occurs exactly $2$ times in the decomposition of $n!$.
EDIT: In fact $n = 5$ is the only number such that every prime factor of $n!$ occurs an odd number of times. For all $n \geqslant 22$ there is always a prime $p$ between $\frac{n}{3}$ and $\frac{n}{2}$ ($\frac{n}{3} < p <\frac{n}{2}$) so that $p$ occurs exactly $2$ times in the decomposition of $n!$. And we can verify that no number smaller than $22$ has the property.
part 2, no, take $n$ large, by estimates on prime gaps that have actually been proved there is a prime $p > 3$ with $$\frac{n}{3} < p < \frac{n}{2}.$$ Then $$2 < \frac{n}{p} < 3$$ and $$\frac{n}{p^2} < 1.$$ By Legendre's theorem, $\nu_p n! = 2.$