There are n seats in a row and we have to arrange people on these seats such that there must be at least two people in the row and no two people sits adjacent. For instance, if n=5 then there are following arrangements possible(dots represent seats and x represents person sitting on that seat).
x.x.x
..x.x
.x..x
.x.x.
x...x
x..x.
x.x..
So total 7 arrangements are possible hence answer is 7.
I tried some gap methods but I am not able to solve it.
Suppose that there are $k$ people and we have to seat them in $n$ places so that no two are adjacent. Consider the $n-k$ unoccupied seats. There are $n-k+1$ gaps between them and choosing $k$ out of these gaps, we can place the $k$ people and $n-k$ empty seats so that no two are adjacent. Thus this number is $\binom{n-k+1}{k}$. The maximum number of people so that no two are adjacently seated is $[\frac{n+1}{2}]$. Thus the required number is \begin{equation*} \sum_{k=2}^{[\frac{n+1}{2}]} \binom{n-k+1}{k} \end{equation*} For $n=5$, this number is \begin{equation*} \binom{4}{2} + \binom{3}{3} = 7 \end{equation*} In the above we have assumed that people are "indistinguishable". If you want to consider arrangements in which the arrangement of people must be taken into account (with no two looking alike), the number is \begin{equation*} \sum_{k=2}^{[\frac{n+1}{2}]} k!\binom{n-k+1}{k} \end{equation*}