1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# the length of the sides of the gardens for a in range(1, 21): # the lengths of the two paths (see analysis above) p = (1 + 2 ** 0.5) * a q = 3 ** 0.5 * a # Eve squares Adam's answer, getting a perfect fifth # power with no repeated digits diffsum_sq = ((p - q) * (p + q)) ** 2 # check that Eve's answer is a perfect fifth power fr = round(diffsum_sq ** 0.2) if abs(diffsum_sq - fr ** 5) < 1e-10: # that has no repeated digits ss = str(fr ** 5) if len(ss) == len(set(ss)): print(f"Eve's answer is {ss} (a = {fr})") |

Finding the maximum areas and path lengths for the gardens on the left and right is straightforward, giving path lengths \(p = (1 +\sqrt{2})\;a\) and \(r=(1+\sqrt{3})\;a/\sqrt{2}\) respectively. For the centre garden, the maximum area occurs when the area of triangle EFG (and its symmetric partner) is as large as possible and, since the sides EF and FG are fixed in length, this maximum occurs when they are perpendicular, giving the length of the path DE as \(q=\sqrt{3}\;a\).

Now forming the product of the sum and difference of the path lengths \(p\) and \(q\) gives:\[(p-q)(p+q)=p^2-q^2= 2\sqrt{2}\:a^2\]which gives Eve’s answer as \(8a^4\), where we must choose \(a\) to make this a perfect fifth power. If we let \(a=2^e\) we obtain the equation:\[2^{4e+3}= (2^k)^5\] for some integer \(k\) from which we can deduce that \(e\) is equal to 3 mod 5, giving Eve’s value as\[(8.16^k)^5\]for any integer \(k\), leading to the sequence:\[32768, \;34359738368, \;36028797018963968\; …\]only the first of which is valid since all the others must contain duplicate digits.

Performing the the same procedure for the other two pairs of garden shapes fails because the results for Eve are irrational.

]]>