5. Find the number of circular permutations of $1,2, \cdots, n$ that satisfy $|p(i)-i| \leqslant 1$ for any $i$, denoted as $b_{n}$.
5. We discuss in 5 cases:
(1) $p(n)=n$, the remaining $n-1$ numbers are in a line arrangement, there are $a_{n-1}=f_{n}$;
(2) $p(n)=1, p(1)=n$, there are $a_{n-2}=f_{n-1}$;
(3) $p(n)=n-1, p(n-1)=n$, there are $a_{n-2}=f_{n-1}$;
(4) $n \rightarrow 1 \rightarrow 2 \rightarrow 3 \rightarrow \cdots \rightarrow n-1 \rightarrow n, 1$;
(5) $n \rightarrow n-1 \rightarrow n-2 \rightarrow \cdots \rightarrow 2 \rightarrow 1 \rightarrow n, 1$.

Thus, $b_{n}=2+f_{n}+2 f_{n-1}$, i.e., $b_{1}=1, b_{2}=2, b_{n}=2+f_{n-1}+f_{n+1}, n \geqslant 3$. That is, $b_{n}=\alpha^{n}+\beta^{n}+2$. Here $f_{n}$ is the $n$-th term of the Fibonacci sequence, $\alpha=\frac{1+\sqrt{5}}{2}, \beta=\frac{1-\sqrt{5}}{2}$.