Example 8 A rectangular building consists of two rows of square rooms, with $n$ rooms in each row (like a $2 \times n$ chessboard). Each room has three doors leading to 1, 2, or 3 adjacent rooms (doors facing outside the building are not counted). If one can travel from any room to any other room through these doors. How many ways are there to design the doors of these rooms to meet the above conditions? ${ }^{[3]}$
Let $a_{n}$ be the number of ways to satisfy the conditions for a $2 \times n$ rectangular building.

Let $b_{n}$ be the number of ways where the building is not fully accessible when the middle wall of the $n$-th column has no door, but becomes fully accessible when the middle wall has a door.
Then for $a_{n}$, it can be divided into:
(1) When the first $2(n-1)$ rooms are fully accessible, the three doors in the $n$-th column can be set in four ways, all of which ensure that all rooms are fully accessible, so there are $4 a_{n-1}$ ways.
(2) When the first $2(n-1)$ rooms are not fully accessible, but become fully accessible with the addition of the $n$-th column, this implies:
(i) The $n$-th column has three doors;
(ii) Among the rooms that cannot be reached in the previous $n-1$ columns, there is a room in the $n-1$-th column.

In this case, the middle wall of the $n-1$-th column must have no door, and when a door is set in the middle wall of the $n-1$-th column, it can make the first $n-1$ columns fully accessible, so there are $b_{n-1}$ ways.
Thus, $a_{n}=4 a_{n-1}+b_{n-1}$.
For $b_{n}$, it can be divided into:
(1) When the first $2(n-1)$ rooms are fully accessible, the middle wall of the $n$-th column has no door, making it not fully accessible, so the two side walls of the $n$-th column must have exactly one door, so there are $2 a_{n-1}$ ways.
(2) When the first $2(n-1)$ rooms are not fully accessible, similarly, the middle wall of the $n-1$-th column has no door, so there are $b_{n-1}$ ways.
Thus, $b_{n}=2 a_{n-1}+b_{n-1}$.
Therefore, $a_{n}=5 a_{n-1}-2 a_{n-2}$, and $a_{1}=1, a_{2}=5$.
Hence, $a_{n}=\frac{1}{\sqrt{17}}\left[\left(\frac{5+\sqrt{17}}{2}\right)^{n}-\left(\frac{5-\sqrt{17}}{2}\right)^{n}\right]$.