Electric potential energyWatch
Anyway, if you have the number of protons, you can get the charge density of the nucleus
If you have the charge density, and assume spherical symmetry, you can integrate over shells, something along the lines of
where you should put together a correct shell element for .
All that assumes a uniform charge density ofc- it also only returns the electrostatic potential energy in its purest form and isn't considering any other potentials involved.