Although that formula gives the maximum in principle, in fact that maximum is only achieved (in known elements) for the first four shells (K, L, M, N). No known element has more than 32 electrons in any one shell. This is because the subshells are filled according to the Aufbau principle. The first elements to have more than 32 electrons in one shell would belong to the g-block of period 8 of the periodic table. These elements would have some electrons in their 5g subshell and thus have more than 32 electrons in the O shell (fifth principal shell).