A metallic ion X2+ with an inert gas structure contains 18 electrons. How many protons…