Teaser 2422: [Water tank]
From The Sunday Times, 22nd February 2009 [link]
Farmer Barfoot is building a concrete tank to conserve rain water. The tank has a horizontal rectangular base, vertical walls and an open top, the internal dimensions being whole numbers or feet. The contract price is £1 per sq ft of inside wall area, £2 per sq ft of inside floor area.
For the volume required he choose dimensions that give the lowest possible overall cost. This cost will be a number of pounds whose digits are consecutive and in order (I do not know whether they are in increasing or decreasing order).
What is the volume of the tank in cubic feet?
This puzzle was originally published with no title.
There are now 4000 puzzles posted between Enigmatic Code and S2T2.
[teaser2422]





Jim Randell 7:03 am on 22 July 2026 Permalink |
I think the wording of this puzzle is poorly chosen.
But if we ignore the condition that the dimensions of the tank must be an integer number of feet until we get to the end, then we can solve it in the way I think the setter intended.
We start by considering tanks that have a minimal cost for a given volume:
For a tank with base x by y and a height z the cost for the tank is given by:
(This assumes the price is continuous, so fractional square feet of wall/floor are charged proportionally).
Applying the AM-GM inequality [ @wikipedia ] we get:
with equality when x = y = z.
The total cost of the tank is therefore:
with equality when x = y = z.
If the volume of the tank is fixed at a value V:
we see the cost of the tank is:
and we achieve the minimum cost when x = y = z, i.e. when the tank is a perfect cube.
And the cost is then:
(This is the same as showing for cuboids of a given volume the minimum surface area possible is achieved with a cube).
We now introduce the fact that the sides of the tank are all whole numbers.
The problem then is to find a positive integer x (which gives a volume of x³) where 6x² is a sequence of consecutive digits (in ascending or descending order). (We ignore the trivial case where the cost is a single digit).
The following Python program runs in 66ms. (Internal runtime is 345µs).
from enigma import (irange, tuples, nconcat, rev, div, is_square, cb, printf) # solve for a cost of S def solve(S): x = is_square(div(S, 6)) if x is not None: V = cb(x) dims = (x,) * 3 printf("vol = {V}; cost = {S}; dims = {dims}") digits = list(irange(0, 9)) # choose 2-10 digits for k in irange(2, 10): for ds in tuples(digits, k): if ds[0] != 0: solve(nconcat(ds)) if ds[-1] != 0: solve(nconcat(rev(ds)))Unfortunately there are two possible solutions:
So, even solving the puzzle in the intended way gives 2 viable answers (a quite small tank, and a very large tank). Although one of these could have been eliminated by placing restrictions on the size or cost of the tank.
The published answer is the larger one (which has a longer run of consecutive digits in the cost):
Solution: The volume of the tank is 13824 cu ft.
However, this is not how I originally read the puzzle.
As the constraint that the dimensions of the tank are whole numbers is introduced first I considered that we are only dealing with tanks that have integer dimensions, and this means that the lowest possible cost for a given tank is not necessarily when the tank is a cube. (And also we don’t have to assume the cost of fractional areas is charged proportionally).
For example, if we suppose Farmer Barfoot is looking for a tank to hold 1175 cu ft, then there are the following possible integer dimensioned tanks:
So, for a tank holding exactly 1175 cu ft, the best price we can manage is £ 990.
But an 9 ft × 11 ft × 12 ft tank would cost £ 678 (a sequence of consecutive digits) and hold 1188 cu ft, so be cheaper and slightly larger (and is a reasonable size).
And it is not possible to build a tank costing less, with a capacity of at least 1175 cu ft.
So this seems like 1188 cu ft would be a satisfactory solution to the puzzle.
I checked volumes up to 500,000 cu ft, and found the following solutions where the cost is at least 2 digits and consists of consecutive digits in order:
So, my initial reading of the puzzle throws up even more candidate solutions. Although a restriction on the cost or size of the tank could narrow these down to a single solution.
LikeLike