You will first need to determine electronic configuration of neutral atom. Now arrange this configuration according to ascending value of n.
Now according to your need start subtracting electrons from highest value of n, like for Gd+3, the configuration is [Xe]4f7