Imagine you have three blue, and three red cubes. The question now would be, how many ways are there to arrange these six cubes? One colour sequence is one way to arrange them.
The solution for three cubes each is 20. For four cubes 70. 5 cubes 252.
I calculated these basically by testing each possible combination, but I want a way to calculate this for n coloured cubes, since testing ways to arrange 40 cubes takes way too long with my method.
Summmary: How to calculate the number of ways two equal sized sets of n coloured cubes can be mixed up?
HINT
Equivalently, you are asking how many ways are there to form a string of length $2n$ from $n$ letters $R$ and $n$ letters $B$.
Can you compute how many ways are there to pick the positions of the $R$ letters in the string -- and the rest must be filled out by $B$s...