Suppose you have a collection of large amount of Hydrogen atoms in $n$th state($n-1$th excited state). They have to go to their ground state($n$=1).
Going from $n_1$ to $n_2$ makes a unique spectral line. An atom cannot raise its $n$, it can only decrease it.What is the minimum number of $H$ atoms needed to view all spectral lines? Although changing of $n$ is random, we may assume that we are lucky.e.g. for $n=3$ :
We have to see $$3 \to 1,2\to 1, 3\to 2$$ Minimum number of atoms is $2$. One will go to $3 \to 2 \to 1$ and other will $3\to 1$.
When $n=4$,
We have to see $4\to 3,3\to 2,2\to 1,4\to 1, 4\to 2,3\to 1$ Minimum number is $4$ :
$$4\to 1, 4 \to 3 \to 1,4\to 2\to 1,4\to3\to2\to1$$
How can we generalize it for any $n$? Please add appropriate tags.
Consider the transitions $a\to b$, where $a>\frac{n}{2}$ and $b\le\frac{n}{2}$. The number of such transitions is $$\Bigl\lceil\frac{n}{2}\Bigr\rceil\Bigl\lfloor\frac{n}{2}\Bigr\rfloor\ .$$ Moreover, these transitions are mutually exclusive in the sense that a single decaying electron can only include at most one of these transitions, for if we have a decay $$a\to b\to\cdots\to a'\to b'$$ then $$\frac{n}{2}\ge b\ge a'>\frac{n}{2}$$ which is impossible. So at least $$\Bigl\lceil\frac{n}{2}\Bigr\rceil\Bigl\lfloor\frac{n}{2}\Bigr\rfloor$$ atoms are necessary. But by considering the cases of $n$ even and odd separately we find that this is equal to $$(n-1)+(n-3)+(n-5)+\cdots\ ,$$ and @Hagen von Eitzen shows in his answer that this number is sufficient.
To sum up, you cannot do better, and need not do worse, than this number of atoms.