You're welcome! I'm glad I could help explain why the magnesium atom is smaller than the atoms of sodium and calcium. The key reason behind this is the location of the outer electrons and the effective nuclear charge experienced by those electrons.
In the case of sodium (Na), it has an atomic number of 11. Its electron configuration is 1s2, 2s2, 2p6, 3s1, meaning it has one electron in its outermost energy level (3s). These outer electrons "see" a charge of +1, which means they are attracted to the nucleus and determine the atomic size.
Magnesium (Mg) has an atomic number of 12 and an electron configuration of 1s2, 2s2, 2p6, 3s2. In the case of magnesium, its outer electrons "see" a charge of +2 due to the increased number of protons in the nucleus compared to sodium. This stronger positive charge pulls the outer electrons closer to the nucleus, resulting in a smaller atomic size compared to sodium.
Calcium (Ca) has an atomic number of 20 and an electron configuration of 1s2, 2s2, 2p6, 3s2, 3p6, 4s2. Like magnesium, the outer electrons of calcium also "see" a charge of +2 due to the number of protons in the nucleus. However, the difference lies in the fact that calcium's outer electrons are in the 4s orbital, which is further from the nucleus compared to the 3s orbital in magnesium. The increased distance reduces the attraction between the outer electrons and the nucleus, causing calcium to have a larger atomic size compared to magnesium.
So, the combination of the increased effective nuclear charge and the closer location of the outer electrons in magnesium makes its atomic size smaller than both sodium and calcium.