The structure of the nucleus emerged after Rutherford discovered that nuclear matter is contained within a very small part of the atom.
The nuclear radius was discovered to be of the order of 1 to 2 fermi.
The discovery of the neutron by Chadwick gave us the familiar three particle model of the atom.
But it immediately posed a challenge as the nucleus should in theory not be possible as the electrostatic forces between protons should rip it apart.
Also the structure of the fundamental particles was problematic due to the behaviour of unstable and radioactive isotopes which decayed producing radioactivity.
The nucleus consists of protons and neutrons.
A is the nucleon number of a particular isotope. This is the sum of protons and neutrons together.
Z is the proton number which is the number of protons and/or the number of electrons in a neutral atom.
So for element with chemical symbol X we write
$$ ^A_Z\text{X} $$
So for the common isotopes of hydrogen and helium
$$ ^1_1\text{H} \text{ and }^4_2\text{He} $$
The properties of the nucleons are
$$\begin{array}{|c|c|} \hline \text{nucleon} & \text{mass (kg)} & \text{charge (C)} & \text{life time (s)} \\ \hline \text{proton} & 1.6726 \times 10^{-27} & 1.6 \times 10^{-19} & 10^{41} \\ \hline \text{neutron} & 1.6749 \times 10^{-27} & 0 & 880 \\ \hline \end{array}$$
It is important to note that free neutrons decay in about 15 minutes whilst the proton has a life time much longer than the lifetime of the universe.
Isotopes have different nucleon number, A but the same proton number, Z.
Hydrogen has three well known isotopes
$$ ^1_1\text{H} \text{ and } ^2_1\text{H} \text{ and } ^3_1\text{H}$$
Each isotope has exactly the same chemical properties but different mass and radioactive properties.
There is usually one stable isotope and the rest are radiaoctive.
Nuclear stability depends on the structure of the nucleus.
The largest naturally occuring isotope is
$$ ^{238}_{92}U $$
Above uranium all possible nuclei are unstable and do not occur naturally.