How many moles of atoms are there in 4.02 x 1023 atoms of Mg?
Did you mean 4,02* 10^23 atoms?
1 mol of something, Mg-atoms, water molecules or O3 molecules is about 6,022*10^23 particles.
So 4,02*10^23 atoms of Mg is about 1 mol of Mg-atoms.