**From New Scientist #1513, 19th June 1986** [link]

“We Yorkshireman,” said my friend Triptolemus, “like a puzzle as a cure for insomnia, instead of counting sheep. Have you got a nice simple question, without a mass of figures to remember?”

So I said, “If a wrong-angled triangle has whole-number sides and an area equal to its perimeter, how long are its sides?”

He slept on the the problem and gave me the answer next morning.

Can you?

(A wrong-angled triangle is of course the opposite of a right-angled triangle. Instead of two of its angles adding up to 90°, it has two angles *differing* by 90°).

There are now 1000 *Enigma* puzzles on the site, with a full archive of puzzles from **Enigma 1** (February 1979) up to this puzzle, **Enigma 364** (June 1986) and also all puzzles from **Enigma 1148** (August 2001) up to the final puzzle **Enigma 1780** (December 2013). Altogether that is about 56% of all the *Enigma* puzzles ever published.

I have been able to get hold of most of the remaining puzzles up to the end of 1989 and from 2000 onwards, so I’m missing sources for most of the puzzles originally published in from 1990 to 1999. Any help in sourcing these is appreciated.

[enigma364]

### Like this:

Like Loading...

This program considers increasing values for the perimeter and then decomposes that into possible integer values that can form a triangle. We then use Heron’s Formula to check that the area is the same as the perimeter. Then we can determine the sine and cosine of each internal angle of the triangle, and look for angles that differ by 90°.

This Python 3 program runs in 72ms.

Solution:The sides of the triangle are: 7, 15, 20.The perimeter and area are both 42.

The internal angles of the triangle are (approximately): 16.26°, 36.87°, 126.87°, with the final two differing by 90°.

There are only 5 triangles with integer sides where the area and perimeter are equal:

So the solution is unique.

We can save the program a bit of work (and the need to use

Fractions) by just considering when the numerator of the expanded expression forcos(a1 − a2)is zero.Here’s an analytical derivation of the 5 integer sided

equabletriangles:If

a, b, care the sides of the triangle, then the perimeter and the area are the same when:where the terms in parentheses on the left hand side correspond to the triangle inequality for the permutations of the sides.

Writing:

we note that

x, y, zare all positive integers and that:So we can re-write the equation [1] above as:

a, b, ccan be recovered fromx, y, zas follows:from which we deduce that

x, y, zhave the same parity, and as their product is even, then they are all even.So we write:

The equation [2] then becomes:

For positive integers

p, q, r.We can suppose

p ≤ q ≤ r, hence:and given

p, qwe can determinerfrom:and as

ris positive it follows that:So we can consider possible values for

(p, q)where0 < p ≤ qand4 < pq ≤ 12:Computing the corresponding values for

r, we reduce the possible values for(p, q, r)to:We then use these

(p, q, r)values to determine(x, y, z)and finally(a, b, c):And these are the sides of the 5 integer sided

equabletriangles previously mentioned.If I change the last part of my code to : if abs(ang1 – ang2) – 90 < 0.0000001

then I get the five solutions you mention, but not sure why

Congratulations on your 1000, Jim. Keep up the good work!

I intend to have another session in the library soon, when I should be able to fill in some, at least, from your “gap years”.

Congratulations also on your 1,000 also. I get much enjoyment from solving/ attempting them from time to time.

Brilliant that you have done so much – my retirement is transformed by having access to 1000 Enigmas. I have done only a few hundred so far, so I hope to manage them for many more years and to begin to catch up with you eventually. Your programming is obviously very powerful but I can’t do that, I suspect like many others of your “customers” . However relying on pencil-and-paper obviously delivers solutions to most Enigmas and an occasional sortie into Excel helps with the rest. Just occasionally the foundations of the maths require a bit of research, but sometimes I feel quite chuffed that pencil-and-paper methods deliver results for the easy Enigmas in a fraction of the time that you must devote to your program.