The effect of Mg doping on the growth behavior and the electronic properties of aluminum clusters has been investigated theoretically using the CALYPSO (Crystal structure AnaLYsis by Particle Swarm Optimization) method in combination with density functional theory calculations. Compared to pure aluminum clusters, the structure of Mg-doped clusters shows the charming transformation with increasing atomic number. The photoelectron spectra (PES) of the global minima of anionic Aln and AlnMg (n = 3-20) clusters have been calculated based on the time-dependent density functional theory (TD-DFT) method. The reliability of our theoretical methodology is easily corroborated by the good agreement between the experimental PES and the simulated spectra. Our findings bring forth an ionic bonding with enhanced stability for the Al6Mg cluster, paired with a surprisingly large HOMO-LUMO gap, as would be expected from the magic number of 20 valence electrons.