Before electron-positron annihilation in cosmology, the pair has two spin states, just as photons do, and the fermionic number integral gives at equal temperature. The factor follows by expanding into an alternating exponential series: its integral is of the bosonic one.
After neutrino decoupling, cosmological entropy conservation in the photon-electron plasma changes its relativistic entropy count from to . The decoupled neutrinos do not share this heating. Hence
These counts include both the new neutrino and its antineutrino; another factor of two would double count them. This is the number density of a relativistic neutrino relative to photons, evaluated after photon heating.
They are nonrelativistic today, so the relic-neutrino energy density is dominated by rest mass:
The number follows from the supplied critical density, without a Hubble-unit convention. It is conditional on the thermal history stated above; a sterile, colder or nonthermally produced state need not have this abundance.