I ran into this question, it is not homework. :)
I have a simple circle with $n$ dots, $n\geqslant 3$. the dots are numbered from $1\ldots n$.
Each dot needs to be coloured red, blue or green. No dot can be couloured the same as his neighbors. How many options are there to organize the colours?
Hint: we need to use recurrence relation.
Let $a_n$ be the number of ways of coloring a ring of $n$ dots. Now consider a ring of $n+1$ dots that have been properly colored. There are two possibilities: either dots $1$ and $n$ have the same color, or they do not.
If they do not have the same color, then removing dot $n+1$ leaves one of the $a_n$ properly colored rings of $n$ dots. Conversely, if we insert a dot $n+1$ into a properly colored ring of $n$ dots, we must give it the third color in order to have a properly colored ring of $n+1$ dots. Thus, there are $a_n$ properly colored rings of $n+1$ dots in which dots $1$ and $n$ have different colors.
If dots $1$ and $n$ have the same color, imagine removing dot $n+1$ and merging dots $1$ and $n$ into a single dot; you now have a properly colored ring of $n-1$ dots. Conversely, if you start with a properly colored ring of $n-1$ dots, you can split dot $1$ into two dots of the same color, one adjacent to dot $2$ and one adjacent to dot $n-1$; call the former dot $1$ and the latter dot $n$. Now insert dot $n+1$ between the new dots $1$ and $n$; this time you have two choices for its color, so there are $2a_{n-1}$ properly colored rings of $n+1$ dots in which dots $1$ and $n$ have the same color.
The recurrence is therefore $a_{n+1}=a_n+2a_{n-1}$, and I’ll leave it to you to work out the initial conditions.