This solution came from Sue Liu of Madras College, St Andrew's,
Scotland.
The limerick gives three equations
From (1)
and from (2)
Using the identity (x+y)2=x2+y2−2xy equation (3) can be written as
Hence
Simplifying this equation gives
which gives the solutions z=1 and z=2.
Using equations (4) and (5) to find x and y,
when z=1 we get x = 1 and y = 2 or x = 2 and y = 1
and when z = 2 we get x = 1 and y = 1.
The solutions are
(x, y, z) = (1,1,2) and (1,2,1) and (2,1,1).
Nobody has commented on the title of this question. What does it suggest to you?