Arrangements of $3n$ balls. 
Find the total number of arrangements of $n$ white balls, $n$ black
  and $n$ green in three different boxes. Every box must contains $n$
  balls. The balls of the same color are indistinguishable.

I'm trying do this for four hour and the only my intuition is using distribution of the number, for example for white balls: $n= box_1 + box_2 + box_3$
Thanks in advance
 A: As was noted by the ajotatxe there are $\binom{n+2}{2}^2$ ways to select where to put the balls of the first two colors. Clearly once the balls of the first two colors are placed there is at most one way to place the balls of the third color so that all boxes have exactly $n$ marbles.
However, there are some ways in which selecting the spots of  the marbles of the first two colours makes it impossible to use the third color to make all boxes have $n$ marbles.
This happens if and only if after placing the marbles of the first two colors one of the boxes already has more than $n$ marbles. Notice now that if this happens then it happens to exactly one of the boxes (There can only be one box with more than $n$ marbles after placing the  $2n$ marbles of the first two colors).
So lets count how many ways there are to place the marbles of the first two colors so that box $1$ has more than $n$ marbles. Classifying on the amount of red ball in box $1$:
How many have $k$ white balls in box $1$?
There are $n-k+1$ ways to distribute the remaining white balls between the other two boxes.
And there must be at least $n-k+1$ black balls in box $1$. Suppose you decide to put $r$ black balls in box $1$, then there are $n-r+1$ ways to place the remaining balls in the other two boxes.
So the answer is $(n-k+1)\sum\limits_{r=n-k+1}^{n}(n-r+1)=(n-k+1)\sum\limits_{r=n-k+1}^{n}(n+1-r)=(n-k+1)[(n+1)k-\sum\limits_{r=n-k+1}^{n}r]=(n-k+1)[(n+1)k-\frac{(2n-k+1)k}{2}]=(n-k+1)\binom{k+1}{2}$
So there are  $$\sum\limits_{k=1}^{n}[\binom{k+1}{2}(n-k+1)]$$
unwanted cases where box $1$ has too many balls.
meaning there are $$3\sum\limits_{k=1}^{n}[\binom{k+1}{2}(n-k+1)]$$ unwanted cases total.
Meaning the final answer is $$\binom{n+2}{2}^2-3\sum\limits_{k=1}^{n}[\binom{k+1}{2}(n-k+1)]$$
ways to do it.
