Teaser 2513: [Golf ball stacking]
From The Sunday Times, 21st November 2010 [link] [link]
At the golf ball factory 10,000 balls are stored in a stack for some weeks to harden. The stack has several layers, the top layer being a single row of balls. The second layer has two rows, each with one ball more than the top row. The third layer has three rows each with two balls more than the top row, and so on.
Of the several shapes of stack possible, the one used takes up the smallest floor area.
How many balls are on the bottom layer?
This puzzle was originally published with no title.
[teaser2513]
Jim Randell 1:57 pm on 16 September 2025 Permalink |
If we consider a stack that is k layers deep and has a line of n balls along the top.
First we see that the number of balls in the base layer is: A = k(n + k − 1).
And we can chop a slice one ball thick from the end to get tri(k) balls, and we can do this n times (once for each ball on the top layer).
The the number of “extra” ball in each layer is: 1×0, 2×1, 3×2, 4×3, …, k×(k − 1).
So in an arrangement with k layers we can calculate a value of n that would give 10,000 balls in total, and if we get an integer out of the calculation, then this is a viable arrangement.
This Python program runs in 68ms. (Internal runtime is 56µs).
from enigma import (Accumulator, irange, inf, tri, printf) # total number of balls T = 10000 # collect minimal base sol = Accumulator(fn=min) # consider increasing numbers of layers, k x = 0 # extra balls to complete the pile for k in irange(1, inf): # add in the extra balls x += k * (k - 1) # how many repeats of tri(k) can we make? (n, r) = divmod(T - x, tri(k)) if n < 1: break if r != 0: continue # calculate area of base A = k * (n + k - 1) # output configuration printf("[{k} layers -> n={n} base={A}]") sol.accumulate(A) # output solution printf("minimal base = {sol.value}")Solution: There are 984 balls in the bottom layer.
There are 24 layers:
We can check the total number of balls is 10,000, by adding the number of balls in each layer:
We can determine a formula for the total number of balls T[n, k], starting with a line of n balls and constructing k layers:
LikeLike