A Brain Teaser: Rose beds
From The Sunday Times, 25th December 1955 [link]
In my garden I had, until recently, two square rose beds of different sizes. At my wife’s suggestion I modified the layout, making two square plots of equal size but leaving the area devoted to roses unchanged.
My two next-door neighbours, as it happened, were also the possessors of square rose beds — each had three, one of a certain size with two equal beds of another size, the dimensions being different for the two neighbours. They, admiring the change in my garden, decided to follow suit. Each now has three square beds of equal size, but each has kept the same area as before devoted to roses. We have discovered that all our eight rose beds are now the same size, also that the side of every rose bed was and is an integral number of feet.
Given that the final beds are of the smallest possible size fulfilling the conditions, how large were our original beds?
This is one of the occasional Holiday Brain Teasers published in The Sunday Times prior to the start of numbered Teasers in 1961. Three 1 guinea book tokens were offered for the first 3 correct solutions.
[teaser-1955-12-25] [teaser-unnumbered]
Jim Randell 10:13 am on 19 December 2021 Permalink |
I’m assuming “leaving the area devoted to roses unchanged”, means the total area of the plots after the change is the same as it was before.
So equating the setters before and after areas we get:
And using the same value of x for the neighbours we have:
This program finds the smallest possible shared value of x, and the corresponding (a, b) values. It runs in 49ms.
Run: [ @replit ]
from enigma import (irange, inf, sq, is_square, printf) # find solutions for a^2 + k.b^2 = n def solve(k, n): for b in irange(1, inf): a2 = n - k * sq(b) if not (a2 > 0): break a = is_square(a2) if a is None: continue yield (a, b) # consider the final size for x in irange(1, inf): # find: a^2 + b^2 = 2x^2 ss1 = list((a, b) for (a, b) in solve(1, 2 * sq(x)) if a < b) if not ss1: continue # find: a^2 + 2b^2 = 3x^2 ss2 = list((a, b) for (a, b) in solve(2, 3 * sq(x)) if a != b) if not (len(ss2) > 1): continue # output solution printf("x={x}; ss1={ss1} ss2={ss2}") breakSolution: The original beds were: setter = 7×7 + 23×23; neighbours = 25×25 + 2(11×11), 23×23 + 2(13×13).
The size of the final beds is: 17×17 (the setter has 2, and each of the neighbours has 3).
LikeLike