How to calculate
For a given n, ℓ runs from zero through n minus one. For each ℓ, magnetic quantum numbers span −ℓ through +ℓ and spin has two allowed projections.
Worked example
Use Principal quantum number n 3. The result is ≈ 18 electrons.
Input and result notes
The shell capacity is 2n². The table does not predict shell filling order in a multi-electron atom.