This article is from the Puzzles FAQ, by Chris Cole firstname.lastname@example.org and Matthew Daly email@example.com with numerous contributions by others.
Can six 1x2x4 blocks be arranged so that each block touches n others, for all n?
n=0: 6 separate blocks
n=1: 3 pairs
n=2: 2 threesomes
n=3: a 3x3 grid
n=4: a box (each sides touches the four adjoining sides, but not the opposite)
Front view: Side view:
To show this happens in general: because the width of the rectangle is a
non-multiple of b, it is possible to position it on the pattern so that the
leftmost column in the rectangle is white and the column just right of the
right edge of the rectangle is black. Suppose N columns are black with this
positioning. Then the rectangle contains N*H black cells, where H is the
height of the rectangle.
If we then shift the rectangle right by one, the number of black columns
increases by 1 and it contains (N+1)*H black cells. The difference between
these two numbers of black cells is H, which is not a multiple of a.
Therefore N*H and (N+1)*H cannot both be multiples of a, and so one of these
two positionings of the pattern will suit your purposes.