I am considering a combinatorial argument which involves the following quantity. We use the prime counting function $\pi(n)$ and to save on exponents we set $h=\pi(n/2)$. The quantity as a function of integer $n \gt 7$ is
$$(\pi(n)!)^{1/(n-h)}$$


Computations for small $n$ suggest this is always less than $4$, as do rough back-of-the-envelope asymptotic calculations. Is this bounded above for all $n \gt 7$? If so, what is the bound? (I'm hoping it is always less than 3.)


Gerhard "Researching Minds Want To Know" Paseman, 2020.05.30.



Is this number theoretic quantity bounded above?
Let $k:=\pi(n)$, so that $p\_k\le n<p\_{k+1}$, where $p\_k$ is the $k$th prime. By the last displayed formula in [this section](https://en.wikipedia.org/wiki/Prime_number_theorem#Approximations_for_the_nth_prime_number) of the Wikipedia article, 
\begin{equation\*}
 -1+\ln(k\ln k)<\frac{p\_k}k<\ln(k\ln k)
\end{equation\*}
if $k\ge6$, whence 
\begin{equation\*}
 n>-k+k\ln(k\ln k),\quad n/2<m\_k:=\frac{k+1}2\,\ln((k+1)\ln(k+1)).
\end{equation\*}
Therefore, letting 
\begin{equation\*}
 c\_1:=1.25506,\quad r(k):=\frac{\ln((k+1)\ln(k+1))}{\ln m\_k} 
\end{equation\*}
and using [this result](https://en.wikipedia.org/wiki/Prime-counting_function#Inequalities), we get
\begin{equation\*}
 h=\pi(n/2)\le\pi(m\_k)<c\_1\frac{m\_k}{\ln m\_k}=c\_1\frac{k+1}2\,r(k). 
\end{equation\*}
Next,
\begin{multline\*}
 r(k):=\frac{\ln(k+1)+\ln\ln(k+1)}{\ln(k+1)+\ln[\ln(k+1)+\ln\ln(k+1)]-\ln2} \\ 
 <\frac{\ln(k+1)+\ln\ln(k+1)}{\ln(k+1)+\ln\ln(k+1)-\ln2}<\frac{10}9
\end{multline\*}
if 
\begin{equation\*}
 k\ge195,
\end{equation\*}
which will be assumed henceforth.  

So,\begin{equation\*}
 h<c\_2(k+1),
\end{equation\*}
where 
\begin{equation\*}
 c\_2:=\frac7{10}>c\_1\frac{10}9\Big/2. 
\end{equation\*}
So, using the trivial inequality $k!\le k^k$, we have
\begin{equation\*}
\ln[(\pi(n)!)^{1/(n-h)}]=\frac{\ln(k!)}{n-h}
\le\frac{k\ln k}{-k+k\ln(k\ln k)-c\_2(k+1)}
<\frac{k\ln k}{k\ln k}=1
\end{equation\*}
and hence 
\begin{equation\*}
 (\pi(n)!)^{1/(n-h)}<e \tag{1}
\end{equation\*}
for $k\ge239$, that is, for $n\ge1499$. By direct calculation, (1) holds for $n\le1498$ as well. 
It is also easy to see that the upper bound $e$ on $(\pi(n)!)^{1/(n-h)}$ is exact. 


