The atomic number of an element remains the same whether it is in the neutral state or exists as an ion. The atomic number represents the number of protons in the nucleus of an atom and determines the element's identity.
In the case of an ion, the number of electrons differs from the neutral state, resulting in a charge. If an ion has 18 electrons, it means there are 18 negatively charged electrons surrounding the nucleus.
However, to determine the atomic number of the ion, we need additional information about the charge of the ion. The charge of an ion is denoted by a superscript written after the chemical symbol. For example, if the ion has a charge of +2, it is denoted as 2+.
Once we know the charge of the ion, we can determine the number of protons in the nucleus, which remains the same as the atomic number.