# How to derive the number of spectral lines?

Recently, I found that when electrons in an atomic sample de-excite from a higher energy level ($$n_2$$) to a lower energy level ($$n_1$$), the number of spectral lines observed in the spectrum is

$$\frac{(n_2 - n_1)(n_2 - n_1 + 1)}{2}$$

Can anyone please tell me how to derive this?

When you move from level $$n_1$$ to level $$n_2$$, the total number of energy levels are $$n_2-n_1+1$$ (including $$n_1$$ and $$n_2$$).
Note that if you chose any two energy levels (say $$n_i$$ and $$n_j$$), you will get a unique spectral line corresponding to those energy levels.
So, the total number of spectral lines possible are $$\binom{n_2-n_1+1}{2}=\dfrac{(n_2-n_1+1)(n_2-n_1)}{2}$$
• Great answer and is the number of combinations of $n_2-n_1+1$ objects taken 2 at a time. Just for completeness, the brackets mean $\displaystyle \binom{a}{b}=\frac{a!}{b!(a-b)!}$ Jul 4, 2021 at 8:09
• This expression is also equivalent to $\Sigma(n_2-n_1)=\Sigma{\Delta n}=n+(n-1)+(n-2)+...+1$ Jul 5, 2021 at 5:12