The spectrum of protons produced in pp collisions at 31 GeV total energy