How can we make a circular loop out of lego bricks? For simplicity, we’ll use 2×1 bricks. The dimensions of a 2×1 brick are shown below in millimetres.

We’ll define some variables using these dimensions:

Clearance per brick end: mm

Distance between pegs: mm

Width: mm

Length: mm

If bricks are assembled in a “running bond” style, two adjacent bricks can rotate maximally by using all the available clearance space. This means that if we build a wall long enough, it can be wrapped around into a loop. The question now is, what is the minimum number of bricks we need to do this? (The figure below exaggerates this rotation.)

For any regular polygon with sides, angles and are already known (see next figure below).

Center angle is just a circle () divided by the number of sides.

Any triangle’s angles add up to .

Combining these equations, inner angle is then defined in terms of the number of sides:

Angle is related to angle (shown in the figure below) by:

(The space between and is since the peg is centered such that it’s equidistant from the lengthwise edges and the nearest width-wise edge of the brick.)

Angle can be expressed in terms of brick width and clearance .

In the figure below, the distance between the red point and blue point is , and the shortest distance from the blue point to the dashed line of symmetry is . So the angle can be expressed as:

or

Angle is then:

Plugging the earlier polygon formula into this equation gives a formula for in terms of brick width and clearance:

Plugging in the dimensions, we get a minimum number of sides to make a loop:

and since at least 3 layers are needed to create a secure running bond, the minimum number of bricks needed is 363.

This has a corresponding angle:

and acute angle between bricks:

Trying this in real life, I was able to get a loop with 110 sides (330 bricks).

The theoretical calculation done above only assumes a perfectly rigid lego brick.

So the difference in may be accounted for by tolerances on the lego brick (stretching and squashing) and asymmetric angles, allowing for tighter inner angles.