Solution (source code)

= Solution

Keep the unequal masses: equal and opposite velocities are not equal and opposite momenta. Write the rest energies $r=m_ec^2$, $R=M_pc^2$, $S=r+R$, and let the incoming Lorentz factor of each particle be $\gamma$. Then
$$
E_{\rm tot}=\gamma S,\qquad cp_z=\gamma\beta(r-R),\qquad
E_{\rm tot}^2-c^2p_z^2=(R-r)^2+4rR\gamma^2.
$$
The transverse photon has energy $\varepsilon=hc/\lambda$ and no $z$ momentum. If the final composite has rest energy $Q$, squaring its four-momentum gives the exact constraint
$$
\boxed{Q^2=(R-r)^2+4rR\gamma^2-2\varepsilon\gamma S.}
$$
The mixed term contains no longitudinal momentum contribution because the photon is transverse. For a specified final rest energy, the physical positive root is
$$
\gamma=\frac{\varepsilon S+\sqrt{\varepsilon^2S^2+4rR[Q^2-(R-r)^2]}}{4rR},
$$
provided it is real and at least one.

The source does not specify the composite rest mass or its binding energy. With the usual approximation that the lowest final rest energy is $Q=S$, the minimum incoming energy occurs at that lowest mass and is
$$
\boxed{E_{{\rm tot},\min}=S\left[\chi+\sqrt{1+\chi^2}\right],\qquad
\chi=\frac{\varepsilon S}{4rR}=\frac{hc}{4\mu c^2\lambda},\quad
\mu=\frac{m_eM_p}{m_e+M_p}.}
$$
If a hydrogen bound state is intended at precision sensitive to its binding, replace $Q$ by its actual rest energy in the preceding equation; the mass cannot be inferred exactly from the phrase “single particle.” Higher composite excitation raises the required incoming energy on this branch. Setting initial total momentum to zero would give a different answer and contradict the stipulated equal-speed electron and proton.