  We study the distribution of the energy of the protons that can produce an
astrophysical neutrino with a given observed energy, in the TeV--PeV range,
both through $pp$ or $p\gamma$ interactions. Due to the increasing multiplicity
of the pion production at high center of mass energies, the resulting average
proton energies can be much larger than the often used approximate value
$E_p\simeq 20E_\nu$. Also the threshold of the $p\gamma$ process can lead to a
pronounced increase in the values of $\langle E_p\rangle /E_\nu$ for decreasing
neutrino energies. The results depend sensitively on the assumed proton
spectrum, since steeper spectra give less weight to the lower energy neutrino
tail resulting from the decays of the abundant low-energy pions. In the
$p\gamma$ scenarios they also depend sensitively on the spectrum of the target
photons. The results are in particular relevant to relate possible
characteristics of the neutrino spectrum to those of the corresponding cosmic
rays that generated them. We also discuss the associated production of gamma
rays at the sources.
