Arranging 30 balls of 3 colors such that no 2 balls of the same color are together

Let there be 30 balls: 10 red, 10 blue, 10 green. All balls are identical except their color.

What is the number of possibilities to arrange the balls in a line, such that there will be no consecutive balls of the same color?

My idea was to first choose the first ball (30 possibilities) and then choose from the other two colors to the end (20!). However, this counts two balls of the same color as they are different, so my idea (which is probably incorrect) was to divide by $10!^3$ to avoid duplicates.

Therefore, my final idea was $\frac{30\cdot20!}{10!^3}$, although I believe it isn't correct.

Any help will be appreciated.

• It will not be as simple as that. I think with $6$ balls - $2$ of each colour - your expression would give $\frac{6\cdot 4!}{2!^3}=18$ but I think I can see $30$ patterns – Henry Oct 29 '17 at 10:41
• My guess would be to use the inclusion-exclusion principle but I'm not sure how. – Infected Oct 29 '17 at 10:43
• It is A110706 in the OEIS – Michael Oct 29 '17 at 10:44
• @Michael: thanks for signalling the link to A110706 in OEIS, which provides a useful insight on this problem. – G Cab Oct 29 '17 at 11:57