Let k be a positive integer. Each cell of the infinite hexagonal grid contains a non-negative integer number of grains of sand, so that the numbers in any two cells sharing an edge differ by at most 1. Exactly 3k2−3k+1 cells contain sand, and all other cells are empty.
Prove that there are at most k3 grains of sand in total.
Equality. The bound is attained by the hexagonal cone: fix a cell O and put k−d grains on every cell at distance d<k from O. We show at the end that this is the only extremal pile up to translation.
Coordinates. Identify the cells with Z2 so that the six neighbours of (x,y) are
(x±1,y),(x,y+1),(x+1,y+1),(x,y−1),(x−1,y−1).
The rowy is the set of cells with second coordinate y. For a finite set B of cells, N[B] denotes B together with all neighbours of its cells. Put H(r)=3r2+3r+1; this is the number of cells at distance at most r from a given cell, and ∑r=0k−1H(r)=k3.
Step 1 (layers). For t≥1 let Lt be the set of cells holding at least t grains. Then
N[Lt+1]⊆Lt(t≥1).(1)
Proof. The total amount of sand is ∑t≥1∣Lt∣, and ∣L1∣=3k2−3k+1=H(k−1). If a cell holds at least t+1 grains, each neighbour holds at least t, which is (1).
Step 2 (the key inequality). Every finite nonempty set B of cells satisfies
∣N[B]∣≥∣B∣+12∣B∣−3+3.(⋆)
Note that for the hexagon of radius r both sides equal H(r+1), since 12H(r)−3=6r+3. We prove (⋆) in Step 4.
Step 3 ((⋆) finishes the problem).∣Lt∣≤H(k−t) for 1≤t≤k, and the total is at most k3.
Proof. Induction on t; the case t=1 is given. Suppose ∣Lt∣≤H(r) with r=k−t≥1, but m=∣Lt+1∣≥H(r−1)+1. Then 12m−3>12H(r−1)−3=(6r−3)2, and by (1) and (⋆),
H(r)≥∣Lt∣≥∣N[Lt+1]∣>m+(6r−3)+3≥H(r−1)+1+6r=H(r)+1,
a contradiction. Hence ∣Lk∣≤H(0)=1. Moreover Lk+1=∅: a cell of Lk+1 together with its six neighbours would lie in Lk by (1). Therefore the total is
t=1∑k∣Lt∣≤t=1∑kH(k−t)=k3.
Step 4 (proof of (⋆) by counting rows).
Let ay be the number of cells of B in row y, and by the number of cells of N[B] in row y. Write By for the set of x with (x,y)∈B.
Row y of N[B] contains By+{−1,0,1}, the set By−1+{0,1} (upper neighbours of row y−1) and By+1+{−1,0} (lower neighbours of row y+1). For a finite nonempty X⊂Z we have ∣X+{−1,0,1}∣≥∣X∣+2 and ∣X+{0,1}∣≥∣X∣+1 (look at maxX and minX). Hence, with f(a)=a+2, g(a)=a+1 for a>0 and f(0)=g(0)=0,
by−ay≥cy:=max(f(ay),g(ay−1),g(ay+1))−ay≥0,
and so ∣N[B]∣−∣B∣≥Φ:=∑ycy. The quantity Φ depends only on the finite sequence (ay).
Removing empty rows. Suppose aj=0 while B has cells both below and above row j. Deleting the entry aj from the sequence (closing the gap) does not change ∣B∣=∑ay and does not increase Φ:
If aj+1=0 too, only the term cj+1 can grow, by at most g(aj−1), which is exactly the deleted term cj (similarly if aj−1=0).
If aj−1,aj+1>0, the deleted term is cj=max(aj−1,aj+1)+1. The term cj−1 can grow only if aj+1+1>aj−1+2, and then by less than aj+1; in that case cj+1 does not grow. The situation is symmetric, so the total growth is less than cj.
So we may assume the nonempty rows are 1,2,…,m, with a0=am+1=0. Then
c0=a1+1,cm+1=am+1,cy=max(2,ay−1−ay+1,ay+1−ay+1)(1≤y≤m).
Two lines of slope ±1. Let ap=M be a longest row. Put
L=y=0∑p−1cy,R=y=p+1∑m+1cy,λ=L−2p,ρ=R−2(m+1−p).
For 0≤z≤p−1 we have az+1−az≤cz−1, and cz≥2. So for 1≤y≤p,
ay=z=0∑y−1(az+1−az)≤z=0∑y−1cz−y≤L−2(p−y)−y=λ+y.
For y>p, ay≤M=ap≤λ+p<λ+y. Hence ay≤λ+y for every y, and symmetrically ay≤ρ+(m+1−y) for every y. Also λ≥a1−1≥0 and ρ≥0. Since cp≥2,
Φ≥L+R+2=λ+ρ+2m+4.(2)
Optimising. Put T=λ+ρ+m+1 and δ=λ−ρ. Using min(u,v)=21(u+v−∣u−v∣),
∣B∣=y=1∑may≤y=1∑mmin(λ+y,ρ+m+1−y)=21(mT−y=1∑m2y−m−1+δ).
The numbers 2y−m−1(1≤y≤m) are symmetric about 0, so the convex even function δ↦∑y∣2y−m−1+δ∣ is smallest at δ=0, where it equals ⌊m2/2⌋≥2m2−1. With D=λ+ρ+2m, so that T=D−m+1, we get
∣B∣≤21(m(D+1)−23m2+21)≤21(6(D+1)2+21),
by maximising the quadratic in m. Thus 12∣B∣−3≤(D+1)2, and by (2), Φ−3≥D+1≥0. Therefore
∣N[B]∣−∣B∣≥Φ≥12∣B∣−3+3,
which is (⋆).
Equality case. If the total is k3, then ∣Lt∣=H(k−t) for 1≤t≤k. For t<k, (⋆) gives ∣N[Lt+1]∣≥H(k−t)=∣Lt∣, so (1) forces Lt=N[Lt+1]. As Lk is a single cell, Lt is the ball of radius k−t around it, and the pile is the hexagonal cone. Conversely the cone is admissible, since the distances to O of adjacent cells differ by at most 1, and it holds ∑d<k(k−d)⋅#{cells at distance d}=∑t=1kH(k−t)=k3 grains. ■
Solved it another way? Send a written solution to [email protected]. The most interesting solution, with the solver's name, will be posted.