With how few straight lines can you make exactly 101 squares? The squares don’t necessarily have be the same size.

Clarification 1: By lines, I mean you can use mathematical line segments and/or mathematical rays and/or mathematical lines. In all cases, they have to be straight.

Clarification 2: A two-by-two grid with three horizontal lines and three vertical lines yields five squares (4 small and 1 big).

This puzzle was inspired by a puzzle by Henry Dudeney. In his puzzle the goal was to make exactly 100 squares.


3 Answers 3


I can do it in



101 squares
First the 6x6 square contains 6x6 + 5x5 + 4x4 + 3x3 + 2x2 + 1x1 = 91 squares. That means we need to add 10 squares.
The 4 squares to the right create additionally one 4x4, two 3x3's, three 2x2's and four 1x1's, that is 10 in total. Total is 101.

  • $\begingroup$ I might misunderstand, but surely shouldn't the 6x6 square result in (6x6)x1 + (5x5)x4 + (4x4)x9 + (3x3)x16 + (2x2)x25 + (1x1)x36 so 560 squares within the 6x6 alone? $\endgroup$
    – Tanenthor
    Commented May 30 at 5:14
  • $\begingroup$ @Tanenthor, you're counting the number of unit squares in each larger square, and therefore you're counting the unit squares over and over again. For example, the 6x6 square contains only four squares with area 5x5, and one 5x5 square counts as one square: size of the square doesn't matter. $\endgroup$
    – Lezzup
    Commented May 30 at 7:18
  • $\begingroup$ I don't know why that went over my head... I should trust that the people giving top accepted answers in a puzzling forum are better at puzzling than I! $\endgroup$
    – Tanenthor
    Commented May 30 at 23:18

I'm hoping it's within the rules, but if so:


It works for any number of squares! I'm unfortunately not familiar with any tools to generate an image for this, but the approach is:

Take a cylinder with circumference of say 10*N*pi (added *pi as a randomly chosen non-integer to prevent extra squares, thanks Hearth). Draw one line so that it wraps around the cylinder, coming to the front with an interval of N. Now draw two lines on the cylinder, perpendicular to the first, N-space apart. Make the cylinder length of 102.5N. You should now have 101 squares.

For a better explanation, see Daniel Wagner's excellent visualization in the comments down below, and leave an upvote while you're at it ;)

  • $\begingroup$ In my puzzle, I did not say that the solution had to be 2-dimensional so I will allow a 3-dimensional solution. I can’t quite visualize your solution. Your first line that wraps around the cylinder might be a problem. I suspect that it is not a straight line in 3-dimensional space. I required lines to be straight. Also squares in 2-dimensional and 3-dimensional space consist of perfectly straight line segments. $\endgroup$ Commented May 28 at 18:27
  • $\begingroup$ Regardless of whether your solution is valid or not, it is interesting. I hope you or someone else posts an image of it. $\endgroup$ Commented May 28 at 18:29
  • 10
    $\begingroup$ @WillOctagonGibson I can't draw, so I made a model out of string and scotch tape. Although these lines aren't straight in traditional Euclidean 3-space, there is a well-defined vector space where they are indeed exactly straight (and exactly orthogonal, unlike my quick+sloppy model)! I think there's one detail that needs attention and is glossed over in the answer, but it should be easily handled, namely, you have to be careful that you don't make large squares that wrap around the cylinder the "long" way! $\endgroup$ Commented May 28 at 19:35
  • 1
    $\begingroup$ This is 2-dimensional anyway--it's just that one of the dimensions loops. $\endgroup$
    – Hearth
    Commented May 29 at 1:39
  • 2
    $\begingroup$ @DanielWagner Sorry, but this isn't a vector space - a vector space over the reals can't wrap around. It is, at best, a manifold... but if you're fine with lines on any manifold, why not just cut 'wormholes' in the plane to make it one line? $\endgroup$
    – Deusovi
    Commented May 29 at 17:12

I can match Lezzup's record of

15 lines

using only infinite straight lines:

Similarly to Lezzup's answer, the construction starts with a 6x6 square. The 15th line at the far right adds four 3x3, three 4x4, two 5x5, and one 6x6 squares, giving the same total number of squares.

I'm pretty sure this is the minimum attainable, since

with 14 lines, the optimum placement should use 7 horizontal and 7 vertical lines, and the maximum number of squares are formed by a 6x6 grid, giving only 91 squares. (This argument relies on intuition; I can't think of a more rigorous proof at the moment.)

For the record, Dudeney's version can be also solved with the same number of infinite straight lines:

This forms a 5x8 grid. There are $5\times 8$ 1x1, $4\times 7$ 2x2, $3\times 6$ 3x3, $2\times 5$ 4x4, and $1\times 4$ 5x5 squares, which sum up to exactly 100 squares.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.