Number of arrangement of six LEGO bricks I came across a very interesting question on how many different combinations there are when you have six eight-stud LEGO bricks (with the same color).
I found this article saying that there are 915 million combinations. Now my two questions are:


*

*How can one calculate the full number of combinations? (I dont even know how to start)

*How can one quickly estimate the number (let's say, to the same order of magnitude)?
(The question was asked in a pub-quiz, and I embarrasingly I was not even able to estimate the number).
Some rules


*

*Rotations of the structures does not count as a new combination.

*There are two possibilities for connections of the LEGO bricks: First, all have to be connected (a subset of this is "All bricks on top of each other"). Second, they don't have to be connected. Both cases are interesting, and the first one is a subset of the second one, so each solution would be useful. 

 A: I read the article, but it didn't define what counts as a configuration for either number except by saying that the $102,981,500$ number assumed the blocks were stacked in six layers.  If I have to connect at least one stud on pairs of blocks, the second block can go on the first in $21$ different ways if the long axes are parallel and $25$ ways if the axes are perpendicular.  Each layer gives another factor $46.$  This would give $46^5=205,962,976$ ways to build towers of six bricks.  If we then say that towers equivalent by rotation are the same, we note that there are $32$ towers invariant under the rotation (all the center points have to line up, but the upper blocks have two orientations relative to the base one), so this would give $46^5/2+16=102,981,504$, very close to the factory number quoted.  
I am surprised that the freedom to put different numbers of blocks on a layer only raises this by a factor of $9$.  Calculating that version looks much harder.
A: Here's a clean mathematical definition of what we are counting. Think of a $2\times 4$ LEGO brick as $(0,4)\times(0,2)\times [0,1]$ or $(0,2)\times (0,4)\times [0,1]$ (open $\times$ open $\times$ closed intervals). A configuration is a collection of 6 translates of these two boxes so that 


*

*the corners are all in $\mathbb Z^3$;

*the interiors of the translates are pairwise disjoint; and

*the union is connected.


We identify two such configurations if they agree after translation in all of $\mathbb R^3$ and rotation in the XY-plane. The count is the number of equivalence classes, and when the configuration has full height (i.e. height 6) we exactly get the factory number $(46^5+2^5)/2$. The number of buildings not of full height is hard to efficiently compute, we essentially use a computer to find them all. Please see
https://arxiv.org/abs/math/0504039
https://www.jstor.org/stable/10.4169/amer.math.monthly.123.5.415?seq=1#page_scan_tab_contents
for further details and references.
