Teaser 2418: [Square park]
From The Sunday Times, 25th January 2009 [link]
Our park is square, with sides of length 104 metres. In the centre is a circular garden with a diameter of 38 metres.
When walking around the edge of the garden, I can reach a point that is a whole number of metres from the nearest corner of the park, and is also a whole number of metres from the furthest corner of the park.
What are those two distances?
This puzzle was originally published with no title.
[teaser2418]


Jim Randell 9:02 am on 20 May 2026 Permalink |
We place the corners of the park at (±52, ±52), and the circle is centred on (0, 0) with a radius of 19.
If the point on the circumference of the circle is (x, y), and the distance to the nearest corner (+52, +52) is a, and the distance to the furthest corner (−52, −52) is b, then we have the following equations:
And we can eliminate x and y to get:
So we can look for two squares that sum to give the required value.
The following Python program runs in 70ms. (Internal runtime is 51µs).
from enigma import ( sq, sum_of_squares, circle_intersect_circle, peek, point_dist, printf ) S = 4 * sq(52) + 2 * sq(19) for (a, b) in sum_of_squares(S, 2): printf("a={a} b={b} [S={S}]") # find one of the intersection points p = peek(circle_intersect_circle(((52, 52), a), ((-52, -52), b)), default=None) if p is None: continue printf("-> p={p}") # determine distance to the corners for q in [(52, 52), (-52, -52), (-52, 52), (52, -52)]: d = point_dist(p, q) printf("-> dist to {q} = {d:.6f}") printf()Solution: The distances are 63 m and 87 m.
However there is a problem with this answer.
If we look at the distances to each of the corners, we find that the integer distances are not the distances to the nearest and furthest corners (at least not the nearest and furthest from (x, y)).
(The integer distances are shown in red).
The distances are:
The shortest distance is DX and the longest distance is BX.
But the puzzle can be saved if the radius of the circle is changed from 19 m to 18 m, then the integer distances are 58 m and 90 m, and these are the nearest and furthest distances:
In this case the distances are:
In fact for N = 52 there are solutions when R = 18, 27, 48.
And there are solutions with integer distances that are not the nearest/furthest distances when R = 19, 26, 33, 39, 51.
LikeLike