The electron configuration of ""_15P15P is:
""_15P: 1s^(2)2s^(2)2p^(6)3s^(2)3p^(3)15P:1s22s22p63s23p3
When phosphorous gains 33 electrons to form the ion P^(3-)P3− the electron configuration becomes:
""_15P^(3-): 1s^(2)2s^(2)2p^(6)3s^(2)3p^(6)15P3−:1s22s22p63s23p6
The electron configuration of ""_42Mo42Mo is:
""_42Mo: 1s^(2)2s^(2)2p^(6)3s^(2)3p^(6)4s^(2)3d^(10)4p^(6)5s^(color(green)(2))4d^(color(green)(4))42Mo:1s22s22p63s23p64s23d104p65s24d4
When Molybdenum loses 33 electrons to form the ion Mo^(3+)Mo3+ the electron configuration becomes:
""_42Mo^(3+): 1s^(2)2s^(2)2p^(6)3s^(2)3p^(6)4s^(2)3d^(10)4p^(6)5s^(color(red)(0))4d^(color(red)(3))42Mo3+:1s22s22p63s23p64s23d104p65s04d3
Some people they get confused and remove the 33 electrons from 4d^(4)4d4 first, however, the electrons will be removed from 5s^(2)5s2 first and the remaining 11 electron will be removed from 4d^(4)4d4.
You should keep in mind that the 5s5s orbital gets filled before the 4d4d orbital, however, when removing electrons; the electrons will be removed from 5s5s first.