## Pythagorean circles

Here’s yet another Catriona Shearer problem:

But let’s start with a related picture, one with only two circles:

Again, the circles have unit radius. What are the dimensions of the rectangle?

The key to figuring this out is that if you have two lines through a point both tangent to a circle, then the line segments from the intersection point to the tangent points are congruent. We know the distance from the top right corner of the rectangle to the top tangent point on the yellow circle is 3. We don’t know the distance from the bottom right corner of the rectangle to the left tangent point on the yellow circle; call it x. Then the length of the diagonal is 3+x. By Pythagoras,

$(3+x)^2 = 4^2+(1+x)^2$

whose solution is x=2. So the height of the rectangle is 3, its width is 4, and its diagonal is 5: the diagonal and two sides make a 3:4:5 triangle, where 3:4:5 is a Pythagorean triple.

You can do the 3-circle problem the same way; here the length of the diagonal is 5+x, the equation is

$(5+x)^2 = 6^2+(1+x)^2$

whose solution is x=3/2. The rectangle then is 2.5 by 6 with diagonal 6.5. Those three numbers are in the proportion 5:12:13, another Pythagorean triple!

Coincidence? No. Of course if x is rational then the lengths of the sides and diagonal are in the proportion of a Pythagorean triple. But in general, with n circles, does x have to be rational? You might expect not. However, the solution for n circles is given by

$(2n-1+x)^2 = (2n)^2+(1+x)^2$

whose solution is

$x = \frac{n}{n-1}$

So the rectangle height:width:diagonal is

$1+\frac{n}{n-1}$ : $2n$ : $2n-1+\frac{n}{n-1}$

or

$\frac{2n-1}{n-1}$ : $\frac{2n(n-1)}{n-1}$ : $\frac{2n(n-1)+1}{n-1}$

which is the integer proportion $2n-1$ : $2n(n-1)$ : $2n(n-1)+1$, scaled by $n-1$. That’s a Pythagorean triple, and in particular it’s a triple in which the hypotenuse is one greater than the longer side. For four circles, for example, the triple is 7:24:25 and the rectangle’s dimensions are 7/3 by 8.

The Lego architecture photo blog Archbrick Daily recently featured this Micropolis City Swim Center by Little Brick Root:

Unusually for a Lego model (or for a real world building, for that matter) the structure is at an angle relative to the base. Of course you can do that sort of thing by covering the base with flat tiles, except for one single stud:

Then the structure can be at any angle, rotating around that stud. For that matter you could cover the entire base with flat tiles and just put the structure on top in any position or orientation, but that’s rather susceptible to jostling, isn’t it? So is the single stud connection, though less so.

(There also are Lego pieces with built in angles, such as this one:

But let’s just consider normal rectilinear bricks and plates for now.)

But maybe you want a rigid connection. If you happen to want an angle of, oh, I don’t know, let’s say 36.87°, you can do that, Make a base with two studs three rows and four columns apart:

The distance in stud units between the two studs is $\sqrt{3^2+4^2}=5$, an integer, so for instance a 1 by 6 brick can be placed on the two studs. If you want other angles you can look for other primitive Pythagorean triples to use. (Primitive meaning it’s not just another triple scaled up: (6, 8, 10), for instance, is a triple, but it’s just twice (3, 4, 5), and makes the same angle.)

The angles you get have rational values for their sine, cosine, and tangent. If you want 45°, you’re out of luck; sin(45°) is irrational. You can get pretty close, though, with for instance the triple (20, 21, 29). That gives an angle of 43.60°.

But if you want a small angle, like the Swim Center model, what do you do? Another way to think about it is, you want a triangle where the long side is nearly as long as the hypotenuse. With Pythagorean triples, the best you can get is a hypotenuse 1 unit longer than the long side.

A general formula for triples is $a=v^2-u^2, b=2uv, c=v^2+u^2$ where $u$ and $v>u$ are coprime and opposite parity (one even, one odd). Here obviously the smallest difference between $a$ and $c$ is 2, so we want $c-b = 1 = v^2+u^2-2uv = (v-u)^2$. So $v=u+1$ and $a=2u+1, b=2u^2+2u, c=2u^2+2u+1$. The first several of these are:

 u a b c angle 1 3 4 5 36.87° 2 5 12 13 22.62° 3 7 24 25 16.26° 4 9 40 41 12.68°

You can see you have to make a fairly large model if you want a rigid angle of less than 10° — more than 40 studs wide, if you use conventional plates and bricks. There are “jumper” plates, though, that give access to half integer spacing, meaning you’d need only half the width.

You can get smaller angles by stacking triples. For instance, you can mount a plate at 36.87° to the base using (3, 4, 5), then mount a plate to that at -16.26° using (7, 24, 25), then mount a plate on top of that also at -16.26° giving a net angle of 4.35°. The stacked plates can hide inside the structure so all you see is the base and the structure rotated 4.35°.

The ground floor of the Swim Center is 24 studs wide, meaning the largest distance between stud receivers is 46 half studs, accommodating no triples with angles smaller than 12.68°. The actual angle of the model is about 5°. So maybe Little Brick Root used angled Lego pieces (I don’t know of any with that small an angle, but maybe) or stacked triples, or maybe (mostly likely is my guess) only a single stud connection to the base. But not a rigid connection based on a single triple, that’s for sure.

## Enigma 1773

Spoiler for New Scientist Enigma 1773 “Cutting Corners”  (Follow the link to see the puzzle.)

We need a triangle with one side 65 mm (we’ll work in millimeters to make everything an integer), another side a+b, and another side c+d such that the following are Pythagorean triples:

• 56, ac+d
• 56, b, 65
• 60, ca+b
• 60, d, 65

So immediately we have b = 33 and d = 25. Now we just scan a table of Pythagorean triples for ones with 56 as one leg and a as the other, where a+33 is the hypotenuse of a Pythagorean triple which has 60 as a leg. We find 56, 42, 70; 42+33 = 75 is the hypotenuse of the triple 45, 60, 75. So the triangle’s other two sides (in cm) are 7.0 and 7.5.

Is that all there is to it? Seems too easy.

## Enigma 1759

Spoiler for New Scientist Enigma 1759: “Cell count” (Follow the link to see the puzzle.)

I can’t see an easy way to do this by hand, but it can be done in a spreadsheet; the key is to figure out the needed formula.

Consider just the upper right quadrant; of course the number of cells crossed for the whole circle will be 4 times the number for the quadrant. Now consider each increment along the x axis from 0 to 1 to 2 to … to r, the radius. When x goes to (x+1), y goes from √(r2x2) to √(r2–(x+1)2). The number of cells passed through in this column is 1 greater than the number of times the circle crosses a horizontal line (not counting lines started or ended on). Think about it hard enough and you realize the number of cells crossed in the file starting at x is:

√(r2x2)√(r2–(x+1)2)

where xand xare respectively the ceiling and floor functions. Multiply that by 4 and sum over all x from 0 to r–1 and you have the number of cells crossed.

So put that into a spreadsheet and graph the result:

For a radius of less than 50, the only place the number of cells decreases when the radius increases is in going from radius 24 (188 cells) to 25 (180 cells).

## Enigma 1758

Spoiler for New Scientist Enigma 1758: “Path-o-logical” (Follow the link to see the puzzle.)

If a is a north-south side of the park and b is the length of a path then a and b are a side and hypotenuse of a right triangle. Call its other side x. Likewise b and c, where c is an east-west side of the park, must be a side and hypotenuse of another right triangle. Now, if you draw a perpendicular to the south side of the park through the path intersection, then the second of these triangles is split into two. All these triangles are similar and in fact the one in the southeast corner is congruent to the one in the northwest, so that perpendicular line segment must also be and c, not a, is the long side of the park: ca + 25. Then the southwest triangle has sides x and 25. Call its hypotenuse (the distance from the southwest corner to the path intersection) y.

Summarizing, the sides of these three similar triangles are:

• a : x : b
• x : 25 : y
• b : y : a+25

a and b must be integers (but nothing says x or y must be).

From similarity of the first two triangles we get x2 = 25a. From the Pythagorean Theorem applied to the first triangle, b2 – a2 = x2 = 25a. If we write ba + δ then 2δ+δ2/a = 25. δ then must be an integer in the range [1, 12] and of these only 12 and 10 give integer values for a in that equation, namely 144 and 20, with corresponding values for b of 156 and 30.

Then x = 60 or 10√5 respectively. Using the Pythagorean Theorem for the second triangle, y = 65 or 15√5 ~ 33.54 respectively. But for the path intersection to be inside the park we need yb. So the only solution that works is: a = 144, b = 156:

## Enigma 1709

Spoiler for New Scientist Enigma 1709:

Joe remembered a puzzle he solved years ago. In an alley, two ladders, each with their feet against the base of a wall, were leaning against the opposite wall. The distances (whole numbers of centimetres) above the ground where they touched the walls were given, and Joe had to calculate how high above the ground the ladders crossed. He also calculated that the ladders could have been 315 centimetres and 261 centimetres long. What was the width of the alley?

They’re on a real Pythagorean triples kick lately. At least I think the width of the alley is supposed to be a whole number of centimeters, otherwise the problem has no unique solution, does it?

But if the alley is required to be a whole number of centimeters wide then what we have are two Pythagorean triangles, one with hypotenuse 315 and one with hypotenuse 261, and both having one side the same.

Well, this is easy, if you remember the hypotenuse of a Pythagorean triangle has length a(u2+v2) with u>v. The prime factors of 315 are 5, 7, and 9, so a can be 1, 5, 7, 9, 35, 45, 63, or 315. Testing these we find a=63, u=2, v=1 or equivalently a=7, u=6, v=3 and no other possibilities. Then the other two sides of the triangle are a(u2v2) and 2auv which are 189 and 252. One of these must be the width of the alley. Now testing 2612–1892 and 2612–2522, the first gives 1802 while the other doesn’t give us an integer root. So the two triangles are 189, 252, 315 and 189, 180, 261, with 189 the width of the alley.

## Enigma 1708

Spoiler for New Scientist Enigma 1708:

From a point on one side of a rectangular sheet of paper I drew two straight lines, one of them to a point on one adjacent side and the other to a point on the other adjacent side. My sheet of paper was now divided into two triangles and a pentagon. The lengths of the sides of the triangles were all integers, the lengths of the sides of the pentagon were, in some order, five consecutive integers, each less than 50.

What were the dimensions of the sheet of paper?

Another Pythagorean triples problem. There may be some way to cut down the solution space more easily than I did, but I still got this fairly quickly.

You can look at a list of Pythagorean triples, or just generate all the ones with numbers less than 50 if you remember the formula for doing so. (I did the latter and then checked it with the former.) From that you can find all the possible pairs of hypotenuses which differ by no more than 4. I found 21 such pairs,or 23 if you count length 25 twice, since it is the hypotenuse of two triples: 15, 20, 25 and 7, 24, 25.

Then look through the possible triples and pick out the ones where a side of one triangle plus a side of the other differs by no more than 4 (but more than 0) from both the hypotenuses. For instance the pair 5, 12, 13 and 8, 15, 17 is eliminated because 5+8=17 is equal to one of the hypotenuses, while 5+15, 12+8, and 12+15 all differ from 13 by more than 4. Then look at the remaining two sides; they have to differ by no more than 4 (but more than 0).

I found four pairs of triples that meet those requirements:

• 7, 24, 25 and 20, 21, 29
• 10, 24, 26 and 20, 21, 29
• 16, 30, 34 and 21, 28, 35
• 12, 35, 37 and 24, 32, 40

Try the first of these:

The two unlabelled line segments would have to be 26 and 28, but these differ by 2 while 24 and 21 differ by 3, so the two rectangle sides come out unequal. So this doesn’t work. The only pair that does is 16, 30, 34 and 21, 28, 35. The right side of the rectangle is 16+21=37 so one of the remaining line segments must be 36 while the other is either 33 or 38. Since 28 and 30 differ by 2 the remaining line segments must differ by 2 as well, so must be 36 and 38. The rectangle is

and the dimensions are 37 by 66.

## Enigma 1704

Spoiler for New Scientist Enigma 1704:

Joe drew a right-angled triangle on an A6 file card. He asked Penny to cut it out and then cut it in two to make two right-angled triangles. Then he asked her to cut each triangle in two to make four right-angled triangles in total. Now Joe’s triangle was very special. Penny found that the lengths of all the sides of all the triangles were a whole number of millimetres.

What was the area of the smallest triangle?