Let's suppose I have Big Cube of x cm by y cm by z cm, simmilar to this one:
This big cube is made of tiny little cubes of t cm.
All of this little cubes are transparent, but some of them are red
How many arrangements of little red cubes is it possible to do?
I think this is a permutations with repetition problem, and so far, this is the equation I came with:
$$ a= ( \sum_{n=0}^{A} P_{A}^{A-n,n} )^Z $$
Where:
$ a= $ Number of possible arrangements
$ Z= $ Value of the number of layers equal to $z/t$
$ A= $ Area of each layer equal to $(x/t)(y/t)$
$ P_n^{n_1,...,n_r}=$ Notation for Permutations with Repetition
So, for example, if it is used the values of the example, it is obtained this:
$$ a = ( \sum_{n=1}^{64} P_{64}^{64-n,n} )^8 = (18,446,744,073,709,551,616)^8 $$
But my problem is: How many arragenments of little cubes can I do, so that the all the red cubes touch each other, so that there is no isolated geometries?
For example, this one is valid, it is only one geometry:
This one is not valid, there are two shapes separated:
I suppose that the orginal formula, must have a term that gets rid of the cases with Isolated Shapes
$$ ( \sum_{n=0}^{A} P_{A}^{A-n,n} ) ^Z - (IsolatedShapes) $$
What's the value of that "IsolatedShapes" Term?, Could you give some ideas of how to tackle this problem?