What is the maximum possible number of spectral lines when the hydrogen atom is in its second excited state?

The electron in hydrogen atom is initially in the third excited state. What is the maximum number of spectral lines which can be emitted when it finally moves to the ground state?

 In n is the quantum number of the highest energy level involved in the transitions, then the total number of possible spectral lines emitted is

`N = (n(n-1))/2`

Third excited state means fourth energy level i.e. n = 4. Here, electron makes transition from n = 4 to n = 1 so highest n is n = 4

Thus, possible spectral lines

`N = (4 (4 -1))/2`

   `=(4 xx 3)/2`

     = 6

6 is the maximum possible number of spectral lines.

Concept: Bohr’s Model for Hydrogen Atom

  Is there an error in this question or solution?

Since comments caused certain level of confusion, I guess I'll try to provide a further illustration. You should consider all possibilities for an electron "jumping" down the excited energy state $n$ to the ground state $n = 1$. Electron doesn't get stuck forever on any of the levels with $n > 1$.

Besides that, spectra is not a characteristic of a single excited atom, but an ensemble of many and many excited hydrogen atoms. In some atoms electrons jump directly from $n = 6$ to $n = 1$, whereas in some others electrons undergo a cascade of quantized steps of energy loss, say, $6 → 5 → 1$ or $6 → 4 → 2 → 1$. The goal is to achieve the low energy state, but there is a finite number of ways $N$ of doing this.

I put together a rough drawing in Inkscape to illustrate all possible transitions*:

What is the maximum possible number of spectral lines when the hydrogen atom is in its second excited state?

I suppose it's clear now that each energy level $E_i$ is responsible for $n_i - 1$ transitions (try counting the colored dots). To determine $N$, you need to sum the states, as Soumik Das rightfully commented:

$$N = \sum_{i = 1}^{n}(n_i - 1) = n - 1 + n - 2 + \ldots + 1 + 0 = \frac{n(n-1)}{2}$$

For $n = 6$:

$$N = \frac{6(6-1)}{2} = 15$$

Obviously the same result is obtained by taking the sum directly.

* Not to scale; colors don't correspond to either emission spectra wavelenghts or spectral series and solely used for distinction between electron cascades used for the derivation of the formula for $N$.