Project Euler Problem 354

Consider a honey bee's honeycomb where each cell is a perfect regular hexagon with side length 1.

Project Euler Problem 354

Solution

Answer: 58065134

After reducing the geometry to the triangular (Eisenstein integer) lattice, the key identity is:

$$B(L)=r(n), \qquad n=L^2,$$

where $r(n)$ is the number of representations of $n$ by

$$x^2+xy+y^2=n.$$

For the hexagonal lattice this has the divisor-formula

$$r(n)=6\bigl(d_1(n)-d_2(n)\bigr),$$

which is equivalent to the multiplicative characterization:

If

$$n=3^a \prod p_i^{\alpha_i}\prod q_j^{2\beta_j},$$

where $p_i\equiv 1\pmod 3$ and $q_j\equiv 2\pmod 3$, then

$$B(L)=r(n)=6\prod_i (\alpha_i+1).$$

We require

$$B(L)=450 \quad\Longrightarrow\quad \prod_i (\alpha_i+1)=75.$$

The only exponent patterns are:

$$75=75,;25\cdot 3,;15\cdot 5,;5\cdot 5\cdot 3$$

giving exponent multisets

$${74},\quad {24,2},\quad {14,4},\quad {4,4,2}.$$

Counting all admissible norms $n=L^2\le (5\times 10^{11})^2$ with these patterns, while allowing arbitrary powers of $3$ and even exponents for primes $q\equiv2\pmod3$, yields the exact total.

Answer: 52410286