Given $n_1$ number of a's, $n_2$ number of b's, $n_3$ number of c's.
They form a sequence using all these characters such that no two a's and no two b's are adjacent.
(a and b can be adjacent, but two a's or b's cannot be adjacent. c has no restrictions.)
for example : acbccab is valid for $n_1=2$, $n_2=2$, $n_3=3$
but,
cbcbcaa is not valid as two a's are adjacent.
I have tries lot of things but nothing worked.
Can somebody tell me how to solve this problem?
I would define coupled recurrences. Let $A(x,y,z)$ be the number of strings $x\ a$s, $y\ b$s, and $z\ c$s that ends in $a$ and similarly for $B$ and $C$. Then $$A(x,y,z)=B(x-1,y,z)+C(x-1,y,z)$$ and similar for $B$. The recurrence for $C$ is slightly different. A recursive computer program will make it easy. There might be a generating function approach.