To find the number of neutrons, follow these steps:
The mass number AA of the atom is given as 31.
The M shell contains 5 electrons. This means the total number of electrons (and hence protons, since atom is neutral) is calculated considering:
Number of protons ZZ = Number of electrons = 15
Number of neutrons N=A−Z=31−15=16N=A−Z=31−15=16
So, the atom has 16 neutrons.