If you have five blue, five red and five black pens (which show the differences by the colors), in how many ways you can put the pens in a row where there is never same color next to each other?
I've made a solution but I'm not sure it's the correct answer. Here is my solution: $$3\binom{10}5=756$$ $$756756 - 756 = 756000$$
Here is an approach in terms of generating functions:
Write $x$ for a blue, $y$ for a red, and $z$ for a black pen. An admissible arrangement looks as follows: $$\underline{\quad}\ z\ \underline{\quad}\ z\ \underline{\quad}\ z\ \underline{\quad}\ z\ \underline{\quad}\ z\ \underline{\quad}\ ,$$ whereby the six slots have to filled in with ixes and ypsilons. A single slot can be filled with $$1\ ,\ x,\ y ,\ xy,\ yx,\ xyx,\ yxy,\ xyxy,\ yxyx,\ xyxyx,\ \ldots\ ,\tag{1}$$ whereby the empty filling $1$ is excluded in the four central slots. The sum of all the terms appearing in $(1)$ computes to $${(1+x)(1+y)\over1-xy},\quad{\rm resp.}\quad{x+y+2xy\over1-xy}\ ,$$ whereby the second expression results if $1$ is excluded. If we now compute $$p(x,y):=\left({(1+x)(1+y)\over1-xy}\right)^2\left({x+y+2xy\over1-xy}\right)^4$$ then we obtain a term $x^r y^s$ with coefficient $1$ for each arrangement of pens containing $r$ ixes, $s$ ypsilons, and exactly five zeds, no adjacent letters being equal. We need the coefficient of the term $x^5y^5$ in $p$. To this end we write $$p(x,y)=(1+x)^2(1+y)^2(x+y+2xy)^4\sum_{k=0}^3{5+k\choose k}(xy)^k\ +{\rm terms\ of\ degree}>10\ .$$ Mathematica computed for me the coefficient of $t^{10}$ of the function $$f(t)=p_*(t x,t y)$$ (the star reflects the truncation of the higher terms). The result was $$21 x^8 y^2 + 806 x^7 y^3 + 4315 x^6 y^4 + 7188 x^5 y^5 + 4315 x^4 y^6 + 806 x^3 y^7 + 21 x^2 y^8\ ,$$ giving $7188$ as answer to the original question.