**From New Scientist #2569, 16th September 2006**

At the initial stage the soldiers Ike, Jay and Kay were at three different points equidistant from their target. At that stage Ike was 4 kilometres from Jay and also 4 kilometres from Kay. Then Jay inched forward towards the target but stopped short at another point also 4 kilometres from Ike. At this second stage the distances between any two of Ike, Jay, Kay and the target were all whole numbers of kilometres.

At the second stage how far apart were Jay and Kay?

[enigma1409]

### Like this:

Like Loading...

*Related*

I originally solved this when it was published in the magazine using Perl that uses code to check two possible cases (determined by analysis). Here’s a similar approach in Python, it runs in 52ms.

Solution:Jay and Kay were 7km apart.This diagram shows where the derivation of the equations used in the program.

By considering the similar triangles JIJ’ and ITJ (or ITK) it follows that:

Hence a and t are integer factors of 16 and a < t, so: (a, t) is (1, 16) or (2, 8).

And we can eliminate one of these possibilities to give a unique solution by further analysis.

Considering the quadrilateral IJ’TK we see that:

Hence IJ’TK is a cyclic quadrilateral, so by applying Ptolomy’s Theorem to it we get:

so:

But x is an integer so t divides 4a, leaving (a, t) = (2, 8) as the only possible solution.

Hence x = 7.