# Ant on a rectangular box

An ant walks in constant steps from corner to corner over a rectangular box, always chosing the shortest path. From any given corner, the ant observes the shortest paths to the other seven corners all to equate to an integer number of ant steps. What are the ratios between the linear dimensions of the box?

• Can we think of it as all of the paths being integer distances or does this exclude potential solutions? – Quark Jan 31 '15 at 5:51
• @Quark - yes, this is to be approached as an integer distances (diophantine) problem for the corner-to-corner geodetics on a cuboid. – Johannes Jan 31 '15 at 6:19
• After reading the Euler brick link, I see that no-one knows if there is a solution when you replace the ant with a fly. – Callidus Feb 2 '15 at 13:19

Let the rectangular box sides be a,b and c. Call integers x,y a pythagorean double if $x^2 + y^2 = z^2$ for some integer z.

Clearly a,b and c must be integers; that's three paths. Also, any two of them must form a pythagorean double so that the ant can get from one corner of a face to the opposite corner. That means a,b and c must be distinct.

Finally $(a+b),c$ must form a pythagorean double (where c is the longest side), so that the ant can get from one corner to the opposite corner of the box. So far so good. This means c must form a pythagorean double with a, with b, and with a+b; and a,b must form a pythagorean double.

One such set of numbers is:

a = 44, b = 117, c = 240 - these are the ratios of the sides of the box.
These give pythagorean triples of 44,117,125; 44,240,244; 117,240,267; 161,240,289
So the other four path lengths are (some multiples of) 125, 244, 267 and 289.

There may be others.

• Your last part says that (a+b) and c must be Pythagorean doubles. But I'm confused. Shouldn't [(b+c) and a] and [(a+c) and b] also be Pythagorean doubles? – EFrog Feb 1 '15 at 13:14
• @Efrog that's the path from one corner of the box to the furthest corner. There are three such paths as you say, but a+b, c is the shortest and the question specifies shortest path. – Callidus Feb 1 '15 at 20:21
• "There may be others" - correct, but extensive searches reveal that if others exist, the number of steps required will go well beyond the capabilities of an average ant... – Johannes Feb 2 '15 at 19:56

What you are basically looking for is a Euler brick.

Some solutions listed there are:
(85, 132, 720) — (157, 725, 732)
(140, 480, 693) — (500, 707, 843)
(160, 231, 792) — (281, 808, 825)
(240, 252, 275) — (348, 365, 373)

Edit:

I would like to add that, as @Quark mentioned, only the first one actually works for the last diagonal (integer length for $\sqrt{(a+b)^2+c^2}$), which I forgot to take into account.

• None of these fit the furthest diagonal requirement. It's pretty cool though that only the first one on the wiki (and the smallest) is the one that works. – Quark Feb 1 '15 at 5:39
• @ghosts_in_the_code : the first one you list (85, 132, 720) does not work. The only one that works is the smaller one you didn't include (44, 117, 240). – Johannes Feb 2 '15 at 19:53