Answer
Please see the work below.
Work Step by Step
The total number of electrons in each shell having principal quanyum number n can be calculated using the formula $2n^{2}$.
For example,
If n =1
The total number of electrons = $2\times1^{2}$ = $2\times1$ = 2
If n =2
The total number of electrons = $2\times2^{2}$ = $2\times4$ = 8