Artificial intelligent assistant

Number of ways to arrange different poker chips. (Recursion) Assume there are poker chips in four different colors and one of the colors is blue. In how many ways can **n** amount of chips be piled on top of each other without two blue ones being next to one another?

Call a pile of chips with no consecutive blues **good.^^ Let $b_n$ be the number of good piles of $n$ chips with a blue as the top chip. Let $c_n$ be the number of good piles of $n$ with blue not the top chip.

Note that $$b_{n+1}=c_n.\tag{1}$$ This is because we get a good arrangement of $n+1$ chips with blue on top by putting a blue on top of a good arrangement of height $n$ with blue not on top. Also, $$c_{n+1}=3(b_n+c_n),\tag{2}$$ since we get a good pile of $n+1$ with blue not on top by putting a chip of one of the $3$ non-blue colours on top of any good pile of $n$.

Bump the index of Recurrence (2) up by $1$. We get $$c_{n+2}=3b_{n+1} +3c_{n+1}.$$ Using Recurrence (1), we get $$c_{n+2}=3c_{n+1}+3c_n.\tag{3}$$

Solve Recurrence, (3) by some standard method. Or else if you are comfortable with matrix manipulation, solve the system of recurrences (1), (2).

Now that we have $c_n$, we know $b_n$. The number of good piles of $n$ chips is $b_n+c_n$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 636523300fd95f7b480d1044d48e3e46