Teaser 3150: Pyramids of Wimbledon
From The Sunday Times, 5th February 2023 [link]
Edward, the sports shop owner, had an annual display of tennis balls. He arranged the balls in four identical pyramids, with a square base holding each in place (one ball on the top of each pyramid, four on the layer below, nine below that and so on).
However, this year he wanted to display the same number of balls but reduce the total footprint of the bases by at least 55 per cent, to allow for other stock. His son Fred suggested arranging all the balls in one large pyramid with an equilateral triangular base (one ball on the top, three on the layer below, six below that and so on). Edward realised that this would work, but if there were any fewer balls, it wouldn’t work.
How many balls did Edward display?
[teaser3150]


Jim Randell 5:21 pm on 3 February 2023 Permalink |
I took the footprint of the base to be the area of the enclosing polygon (so a square for the square based pyramids, and an equilateral triangle for the tetrahedral pyramids). And we are looking for a reduction of at least 55%, so the footprint of the tetrahedral pyramid must be not more than 45% that of the total footprint of the four square based pyramids.
This Python program finds the solution constructively. It runs in 53ms. (Internal runtime is 134µs).
Run: [ @replit ]
from enigma import (sqrt, sq, tri, fdiv, printf) r3 = sqrt(3) # generate pyramid numbers, base defined by <fn> def pyramid(fn): n = 0 # number of layers b = 0 # number of balls in base t = 0 # total number of balls while True: yield (n, b, t) n += 1 b = fn(n) t += b sq_pyr = pyramid(sq) # square pyramidal numbers tri_pyr = pyramid(tri) # tetrahedral numbers # find number of layers for a tetrahedral pyramid (cache, max_tt) = (dict(), -1) # consider number of balls in a square based pyramid for (sn, sb, st) in sq_pyr: # the puzzle text implies there are at least 3 layers if sn < 3: continue # total number of balls in the 4 square based pyramids t = 4 * st # can we find a tetrahedral number with t balls? while max_tt < t: (tn, tb, tt) = next(tri_pyr) cache[tt] = (tn, tb, tt) max_tt = tt rs = cache.get(t) if rs is None: continue (tn, tb, tt) = rs # calculate the ratio of the footprints (= enclosing polygons) f = fdiv(0.25 * r3 * sq(tn + r3 - 1), 4 * sq(sn)) if f > 0.45: continue # output solution printf("4x {sn}-layer SP = {t} balls -> 1x {tn}-layer tetra [f = {f:0.3f}]") breakSolution: The display consisted of 9880 balls.
Each square pyramid consisted of 19 layers, giving 2470 balls, and altogether the 4 pyramids use 9880 balls.
The single tetrahedral pyramid has 38 layers, which also uses 9880 balls.
Analytically:
The formulae for the square pyramidal numbers (SP[n]) and tetrahedral numbers (Te[n]) are:
And we see:
So we are looking for the smallest value where the footprint of Te[2n] is not more than 0.45 the footprint of 4× SP[n].
The footprints can be calculated as follows:
Hence:
For f = 0.45 we get n = 19.
So the answer occurs with 4 square based pyramids with 19 layers, or 1 tetrahedral pyramid with 38 layers.
Each display uses 9880 balls.
LikeLike