Q:

Is this number theoretic quantity bounded above?

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.

A:

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 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, 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. 

