the number of arrangements of N players around a round table, where each player can sit on one of 3 contiguous chairs Consider the fact that each player can either sit on their desired chair or on the neighbouring chair. Two configurations are distinct if at least one person is sitting in another chair.
My attempt
For example, if there are 4 players sitting around a  circular table there can be 9 distinct arrangements.

F1,F2,F3,F4
F2,F1,F3,F4
F2,F1,F4,F3
F4,F2,F3,F1
F1,F3,F2,F4
F1,F2,F4,F3
F4,F1,F2,F3
F2,F3,F4,F1
F4,F3,F2,F1

Now, I am stuck here. How can calculate this and what about larger values of N such as 50?
I tried using vectors and pushing back every element and do the reverse operators and swap elements but I am not sure whether this is correct or not.
Consider the variant of the problem in which the people are arranged in a segment instead of circle and let $S(n)$ be the number feasible arrangements for $n$ people.
Now lets go back to your original problem, and let's name $C(n)$ the number of feasible arrangements of $n$ people.
Clearly $C(0)=C(1)=1$ and $C(2)=2$, so we will henceforth suppose that $n \ge 3$.
Let's name the people $p_1, \dots, p_n$ where the assigned position of $p_i$ is $i$.
If $p_1$ is sitting in position 1 then the number of possible arrangements of $p_2, \dots, p_n$ is exactly $S(n-1)$.
Otherwise, $p_1$ is sitting either in position $2$ or in position $n \neq 2$. We will only consider the former case since the latter one is symmetric.
Clearly $p_2$ cannot sit in position $2$, so he/she must either sit in position $1$ or in position $3$. If $p_2$ is sitting in position $1$, then the number of possible arrangements of $p_3, \dots, p_n$ is exactly $S(n-2)$.
Otherwise, $p_2$ must be sitting in position $3$, which means that $p_3$ must be sitting in position $4$ (since position $2$ and $3$ are occupied) and, in general, $p_i$ must be sitting in position $(i \bmod n) + 1$. Since this completely determines everyone's position, this case only contributes $1$ to the total number of configurations.
To summarize, we have that:
$$
C(n) = S(n-1) + 2(S(n-2)+1) = S(n-1) + 2S(n-2) + 2.
$$
We are left with figuring out what $S(n)$ is. Clearly $S(0) = S(1) = 1$, so we consider $n \ge 2$.
In this case $p_1$ can only sit in position $1$ or $2$.
If $p_1$ is sitting in position $1$ then there are $S(n-1)$ possible arrangements of $p_2, \dots, p_n$. If $p_1$ is sitting in position $2$, then $p_2$ must be sitting in position $1$ (as it is the only other person that can sit there) and there are $S(n-2)$ possible arrangements for $p_3, \dots, p_n$.
We hence have:
$$S(n) = \begin{cases} 1 &amp; \mbox{if } n \in \{0,1\} \\ S(n-1) + S(n-2) &amp; \mbox{otherwise} \end{cases} = \mathcal{F}_{n+1},$$
where $\mathcal{F}_{i}$ denotes the $i$-th Fibonacci number. Substituting back, we obtain:
$$
C(n) =
\begin{cases}
1 &amp; \mbox{if } n \in \{0,1\} \\
2 &amp; \mbox{if } n = 2 \\ 
\mathcal{F}_n + 2 \mathcal{F}_{n-1} + 2 &amp; \mbox{otherwise}
\end{cases}.
$$