Use the stability of empty ($$f^0$$), half-filled ($$f^7$$), and fully-filled ($$f^{14}$$) subshells to remember these exceptions:
Lanthanoids ($$4f$$Exceptions)
- Lanthanum ($$Z=57$$) (Precursor):$$[Xe]\ 4f^0\ 5d^1\ 6s^2$$
- Gadolinium ($$Z=64$$) ($$f^7$$stability): $$[Xe]\ 4f^7\ 5d^1\ 6s^2$$
- Lutetium ($$Z=71$$) ($$f^{14}$$stability):$$[Xe]\ 4f^{14}\ 5d^1\ 6s^2$$
Actinoids ($$5f$$Exceptions)
- Thorium ($$Z=90$$) (Zero $$f$$-electrons):$$[Rn]\ 5f^0\ 6d^2\ 7s^2$$
- Curium ($$Z=96$$) ($$f^7$$stability):$$[Rn]\ 5f^7\ 6d^1\ 7s^2$$
- Lawrencium ($$Z=103$$) ($$f^{14}$$stability):$$[Rn]\ 5f^{14}\ 7s^2\ 7p^1$$