# Enigmatic Code

Programming Enigma Puzzles

From New Scientist #2691, 17th January 2009 [link]

I have eight rods. I can use three of them to make the sides of a right-angled triangle of area 10 square centimetres.

Alternatively, I can use all eight of them to make the sides of an octagon, all of whose angles are the same, and all of whose vertices lie on a circle.

What is the area of that octagon?

[enigma1528]

### 2 responses to “Enigma 1528: Ad hoctagon”

1. Jim Randell 17 July 2012 at 8:06 am

This one is solved without programming.

The octagon can be considered as a square with the corners cut off at 45°. So it is composed of two types of rod, of length a and b, where ab.

Three of the rods can be formed into a right-angled triangle with area of 10 sq cm, so the hypotenuse has length b and the other two sides are length a.

Hence: a² = 20, b² = 2a² = 40, so: a = √20, b = √40.

The corners cut off the octagon also form right-angled triangles with hypotenuse of length a and the other two sides have length c.

Hence: a² = 2c², so: c = √10.

The diagram, right, shows the octagon made up from the coloured areas, so has area: b² + 4bc + 2c² = 40 + 80 + 20 = 140 sq cm.

Solution: The area of the octagon is 140 sq cm.

• Jim Randell 17 July 2012 at 8:21 pm

Rotating the diagram through 45° gives an even more straightforward depiction of the solution, and directly includes the aab right-angled triangle of area 10 sq cm in the corners (and also as the removed corners).

Giving the area as: 5a² + 4a²/2 = 7a² = 140 sq cm.

Or considering the removed corners: 9a² – 4a²/2 = 7a² = 140 sq cm.