The correct option is D Mg2+
The emission of radiation in the visible region is the reason for cations to show flame test. Cations such as Na+, K+ and Ba2+ give flame test as the loosely bound electrons can excite to higher energy levels and on returning to the ground state emit the characteristic colour. The characteristic colour depend on the energy gap between the ground and excited levels.
In case of Mg2+, the atomic size is abnormally small and the electron is tightly bound and so cannot excite.
Thus, we cannot identify Mg2+ with a flame test.