cerium(IV) and europium(II)
If almost every lanthanide stubbornly insists on +3, two of them keep a side door open. Cerium can climb to +4, and europium can sink to +2 — and both do so for the same elegant reason: a 4f shell that is empty, half-full, or completely full carries a little extra stability, like a drawer that closes more neatly when it is empty or exactly packed.
Look at the electron counts. Cerium in Ce3+ has one 4f electron (4f-1); give that one up and you reach Ce4+ with an empty 4f shell (4f-0), the same closed-shell calm as xenon. So cerium(IV) is a real, usable state — it is a moderately strong oxidizing agent in acid, the basis of orange-yellow ceric salts and of cerium(IV) oxide (ceria). Europium runs the other way: Eu3+ has six 4f electrons, but by gaining one electron it becomes Eu2+ with a half-filled 4f-7 shell, the same half-full stability that makes gadolinium's chemistry tidy. So europium(II) is a real state too — it resembles the +2 ion of barium in size, forms EuSO4 much like BaSO4, and is a useful reducing agent.
These two exceptions matter because they are the levers chemists pull to separate the otherwise-identical lanthanides: oxidize a mixture and cerium alone goes to +4 and can be precipitated away; reduce a mixture and europium alone drops to +2 and can be pulled out. They also drive technology — cerium(IV) oxide is the workhorse oxide in catalytic converters and glass polishing, while europium ions (Eu3+ for red, Eu2+ for blue) are the classic phosphor dopants in lamps and old television screens. The honest caveat: even here, +3 is the resting state both elements return to; +4 cerium and +2 europium are accessible neighbors, not new defaults.
In analytical chemistry, ceric ammonium sulfate ((NH4)4Ce(SO4)4) is a classic oxidizing titrant: the orange Ce4+ ion is reduced to nearly colorless Ce3+ as it accepts an electron, so the color fade marks the endpoint. The reverse trick uses Eu2+ as a strong reductant in solution.
Ce4+ to Ce3+ fades from orange to colorless — a one-electron redox color change.
The 'empty / half-full / full shell is extra stable' idea is a helpful pattern, not a rigorous explanation; the true reason cerium(IV) and europium(II) exist comes from the full energy balance of ionization and bonding, in which the closed-shell bonus is only one contributor.