enter image description here

The diagram shows 12 small circles of radius 1 and a large circle, inside a square.

Each side of the square is a tangent to the large circle and four of the small circles.

Each small circle touches two other circles.

What is the length of each side of the square?

The answer is 18


This question came up in a Team Maths Challenge I did back in November. No one on our team knew how to do it and we ended up guessing the answer (please understand that time was scarce and we did several other questions without guessing!) I just remembered this question and thought I'd have a go but I am still struggling with it.

There are no worked solutions online (only the answer) so I reaching out to this website as a final resort. Any help would be greatly appreciated. Thank you!

  • 1,277
  • 13
  • 23
  • 701
  • 4
  • 9
  • 2
    Here's a related 3D puzzle. https://math.stackexchange.com/q/1258952/207316 – PM 2Ring May 27 '20 at 14:30
  • 4
    If you like this kind of problem then I strongly suggest you find a copy of [Japanese Temple Geometry Problems - San Gaku by Fukagawa and Pedoe](https://www.amazon.com/Japanese-Temple-Geometry-Problems-Sangaku/dp/0919611214) which in addition to ~160 pages of wonderful Sangaku problems has an appendix with 100 diagrams - each of which is a problem in the exact same genre as this one ("100 problems on a square of side _a_ each involving at least one circle of radius _a_ /16") - they are excellent (and devious)! – davidbak May 27 '20 at 18:13

4 Answers4


enter image description here

Join the center of the bigger circle (radius assumed to be $r$) to the mid-points of the square. It’s easy to see that $ABCD$ is a square as well. Now, join the center of the big circle to the center of one of the smaller circles ($P$). Then $BP=r+1$. Further, if we draw a vertical line through $P$, it intersects $AB$ at a point distant $r-1$ from $B$. Lastly, the perpendicular distance from $E$ to the bottom side of the square is equal to $AD=r$. Take away three radii to obtain $EP=r-3$. Using Pythagoras’ Theorem, $$(r-1)^2 +(r-3)^2 =(r+1)^2 \\ r^2-10r+9=0 \implies r=9,1$$, but clearly $r\ne 1$, and so the side of the square is $2r=18$.

  • 14,079
  • 2
  • 14
  • 41
  • 5
    Presumably the $ r = 1 $ case corresponds to the corner circle, which is also tangent to the corner and the circle with centre $ P $. – Neil May 26 '20 at 15:41
  • 4
    I'm an Engineer, not a Mathematician and this was the clearest solution to me. However AB being r-1 and BP being r+1 were clear, but I had to sit & puzzle for a while why AP = r-3. It might be worth showing or explaining. – Dragonel May 26 '20 at 18:14
  • 4
    @Neil $r=1$ would correspond to a square of side length 6 filled with nine equal sized circles. – Kai May 26 '20 at 20:26
  • @Tavish - yes, that's clearer. Thx – Dragonel May 26 '20 at 21:42
  • 2
    @Kai That's incorrect, no? The circle with radius r is supposed to be tangent to the square and the small circles. I think Neil is right here. – justhalf May 27 '20 at 09:41
  • @justhalf yeah I think you are correct actually, my mistake – Kai May 27 '20 at 13:40
  • 1
    It's not actually $AP$ which is $r-3$, but $EP$, where $E$ is the intersection of $AB$ with the vertical line through $P$. – Nick Matteo May 27 '20 at 21:09

It is instructive to consider the general case. Suppose we have a circle of radius $r$ that is inscribed in a square of side length $2r$. Suppose $n$ tangent circles of unit radius can be drawn along the inside "corner" of the square. What is the relationship between $r$ and $n$? Your question is the case $n = 2$, the third circle drawn in the corner being redundant. The figure below illustrates the case $n = 5$:

enter image description here

The solution is straightforward. The right triangle shown in the diagram has legs $r-1$ and $r-(2n-1)$, and hypotenuse $r+1$. Therefore, $$(r-1)^2 + (r-2n+1)^2 = (r+1)^2,$$ from which it follows that $$r = (1 + \sqrt{2n})^2.$$ For $n = 2$, this gives $r = 9$ and the side length of the square is $18$. For $n = 5$, we have $r = 11 + 2 \sqrt{10}$. Whenever $n$ is twice a square, i.e. $n = 2m^2$ for a positive integer $m$, then $r = (1 + 2m)^2$ is also an integer and the circumscribing square has integer sides.

As a related but different question, given $n$ such circles, what is the total number of externally tangent unit circles that can be placed in the corner such that their centers form a square lattice and do not intersect the large circle? So for $n = 2$, this number is $f(n) = 3$ as shown in your figure. For $n = 5$, it is $f(5) = 12$.

  • 112,408
  • 12
  • 89
  • 159
  • 2
    This generalization is brilliant! – Dávid Laczkó May 26 '20 at 09:14
  • "Whenever n is twice a square" - Should be .. "Whenever n is half a square" 2 is half a square .. next one would be 8 - giving r of 25 and the square a side length of 50, then 18 for r=49 and thus the square side length of 98 and so forth – eagle275 May 26 '20 at 12:23
  • 2
    @eagle275 No. $n = 2m^2$ is correct as written because $2 = 2(1^2)$, $8 = 2(2^2)$, and the next is $18 = 2(3^2)$. The flaw in saying $n = m^2/2$ is that $m$ must be *even* or else $n$ is not an integer. – heropup May 26 '20 at 14:19
  • think you misunderstood me - there IS already a "multiply by 2" under the root which only makes sense if you add a "divide by 2" .. – eagle275 May 26 '20 at 14:50
  • 2
    @eagle275 So you are suggesting that $n = 3^2/2 = 9/2$ is a valid choice for $n$? That is a permissible choice for "half a square." $r$ may be an integer for such a choice, but not $n$. – heropup May 26 '20 at 16:14
  • And again you turned my words around ... the premisse was that n is integer .. so 9/2 is not considered - but "coincidentally" those values that fit your AND my line suit both equations .. neat, don't you think – eagle275 May 27 '20 at 08:19
  • @eagle275 The great thing is that every integer that is half a square is also twice a square and vice versa so it doesn't matter which description we take, we are talking about the same integers – Vincent May 27 '20 at 08:21
  • 4
    @eagle275 Your characterization is mathematically imprecise. You claim that $n$ is half a square, i.e. $n = m^2/2$ for some integer $m$. And I gave a counterexample that satisfies your criterion but is not valid because you imposed an additional condition that was unstated, namely that $n$ must be an integer. When you combine the two conditions, $n = m^2/2$ and $n \in \mathbb Z$, you must have $m$ even, in which case $m = 2k$ and your condition becomes $n = m^2/2 = (2k)^2/2 = 2k^2$ which is my condition. – heropup May 27 '20 at 08:42
  • This discussion about elementary number theory at a middle school level is tedious and not worth my time. Perhaps someone else may care to illustrate this commenter's error because I've been abundantly clear yet am still getting nowhere. – heropup May 27 '20 at 08:49

In the diagram below point $D$ is at $(3,1)$ and $E$ is at $(1,3)$ We have a right triangle using $G, D$ and the intersection of $GI$ and $DE$. Let the radius of the large circle be $r$, which is half the side of the square. Then $GD=r+1$, $D$ to the intersection is $\sqrt 2$ and $G$ to the intersection is $(r-2)\sqrt 2$ $$(r+1)^2=(\sqrt 2)^2+((r-2)\sqrt 2)^2\\ r^2+2r+1=2+2(r^2-4r+4)\\ 0=r^2-10r+9\\ r=1,9$$ and clearly $9$ is the root we want. The side of the square is $18$

enter image description here

Ross Millikan
  • 362,355
  • 27
  • 241
  • 432

Let $a$ be the side of square. Join the center $O$ of largest circle to the center $A$ of small circle of radius $1$ (as shown in figure below)

enter image description here

$$AO=\frac{a}{2}+1, \ \ OB=\frac{a}{2}-1, \ \ AB=\frac{a}{2}-3$$ Using Pythagorean theorem in right $\Delta ABO$ $$\left(\frac{a}{2}+1\right)^2=\left(\frac{a}{2}-1\right)^2+\left(\frac{a}{2}-3\right)^2$$

$$a^2-20a+36=0$$ $$a=2,18$$ Since $a> 2$ hence, the side of square is $18$

Harish Chandra Rajpoot
  • 36,524
  • 70
  • 73
  • 111