# Determine the number of ways to color a 1-by-n chessboard with the colors red, blue, green and orange.

Determine the number of ways to color a 1-by-n chessboard, using the colors red, blue, green and orange if an even number of squares is to be colored red and an even number is to be colored green.

Current result:

I will use exponential generating functions. \begin{align*} g^{(e)}(x)&= \left(1+\frac{x^{2}}{2!}+\frac{x^{4}}{4!}+\dots\right)^2\left(1+\frac{x^{1}}{1!}+\frac{x^{2}}{2!}+\dots\right)^2\\ &=\left(\frac{e^x+e^{-x}}{2}\right)^2e^{2x} \\&=\frac{1}{4}\left(e^{2x}+2e^xe^{-x}+e^{-2x}\right)e^{2x}\\ &=\frac{1}{4}(e^{4x}+2e^{2x}+1)\\ &=\frac{1}{4}\left(\sum_{n=0}^{\infty}4^n\frac{x^n}{n!}+2\sum_{n=0}^{\infty}2^n\frac{x^n}{n!}+1\right)\\ &=\sum_{n=0}^{\infty}\left(\frac{4^n+2\times 2^n}{4}\right)\frac{x^n}{n!}+\frac{1}{4} \end{align*}

I'm wondering how I can move $$1$$ into the sum? I've been suggested to use $$x^0$$ but I'm not certain how to incorporate that as a sum since I want to find $$h_n$$ which will be the coefficient of $$\frac{x^n}{n!}$$.

You can simply read off the coefficients $$h_n$$ from the sum

$$\sum_{n=0}^\infty\left(\frac{4^n+2\cdot 2^n}4\right)\frac{x^n}{n!}+\frac14\;:$$

$$h_0=\frac{1+2}4+\frac14=1$$, and

$$h_n=\frac{4^n+2\cdot 2^n}4=4^{n-1}+2^{n-1}=2^{n-1}\left(2^{n-1}-1\right)$$

for $$n\ge 1$$.

• Thank you @Brian M. Scott Could you explain why we don't need to count the $\frac{1}{4}$ for $n\geq 1$ please? – cheeseboardqueen Aug 2 '20 at 2:32
• @cheeseboardqueen: Because it really is just a constant. If you write out your series ‘longhand’, you get $$\frac14+\frac34+\frac{2x}{1!}+\frac{6x^2}{2!}+\ldots\;,$$ and you can simply combine the two constant terms into one. – Brian M. Scott Aug 2 '20 at 2:36
• This helps a lot! Appreciate it :) @Brian M. Scott – cheeseboardqueen Aug 2 '20 at 2:37
• @cheeseboardqueen: You’re welcome! – Brian M. Scott Aug 2 '20 at 2:38