Solution (source code)

= Solution

<Chemical equilibrium> for $e^-+p\leftrightarrow H+\gamma$ requires $\mu_e+\mu_p=\mu_H$, since the photon chemical potential vanishes. Inserting the nonrelativistic <Maxwell-Boltzmann distribution> and using charge neutrality $n_p=n_e$ gives
$$
\frac{n_H}{n_e^2}
=\left(\frac{2\pi}{m_eT}\right)^{3/2}
\exp\!\left(\frac{m_e+m_p-m_H}{T}\right),
$$
where the proton-to-hydrogen mass ratio and the stated degeneracy factors have been approximated by one. Thus
$$
\boxed{\left(\frac{n_H}{n_e^2}\right)_{\rm eq}
=\left(\frac{2\pi}{m_eT}\right)^{3/2}e^{B_H/T}}.
$$