The atomic number of an element represents the number of protons in the nucleus of an atom. Protons carry a positive charge, and each element has a unique number of protons, which defines its atomic number. Atomic numbers are always whole numbers because they represent a count of discrete particles (protons) within the nucleus.
On the other hand, the atomic mass of an element takes into account the mass of all the particles in an atom, including protons, neutrons, and electrons. The masses of protons and neutrons are approximately 1 atomic mass unit (amu) each, while electrons have a much smaller mass relative to protons and neutrons. Since the number of neutrons in an atom can vary, the atomic mass is not constrained to whole numbers.
The atomic mass is typically reported as a decimal number because it is calculated as a weighted average of the masses of all the naturally occurring isotopes of an element, taking into account their relative abundances. Isotopes have different numbers of neutrons, which contributes to the slight variations in atomic mass. Thus, the atomic mass accounts for the average mass of the isotopes and is not limited to whole numbers.