The smallest regular hexagon that can hold five unit circles has a side length $s$ .

Enter the first 4 non-zero digits of $|s-3|$ .

If $s$ is exactly 3, enter 0.

The answer is 6446.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

We seek the length $AB=NK etc.$ Call this length $x$ . The plan: find the lengths of the legs in terms of $x$ of right $\triangle CGF$ which has hypotenuse $2$ . The Pythagorean Theorem will give an equation we can solve for $x$ .

There are many 30-60-90 right triangles. I can use the ratios to find many of the lengths in the picture.

$DI=HJ=EC=MF=1, IB=\sqrt{3}, KJ=KL=\sqrt{3}/3, RC=PO=2\sqrt{3}/3, FD=2, PO=OM=x/2$ .

$GM=\sqrt{3}x/2$ so $GF=\frac{\sqrt{3}x}{2}-1$

$JI=HD=x-4\sqrt{3}/3$ , $\angle FHD=120$ , $\angle HFD=\theta$ , $\angle FDH=60-\theta$ .

Solving $\triangle FHD$ as it is $SsA$ is a bear. I'll leave out most of the details. Using the law of sines to find $\theta$ and then again will allow us to find an expression for $FH$ : Simplified as much as possible $FH=2\sqrt{\frac{-3x^{2}}{16}+\frac{\sqrt{3}x}{2}}-\frac{x}{2}+\frac{2\sqrt{3}}{3}$

$ON= x/2-2\sqrt{3}/3$

$OM=CG=2x-\frac{5\sqrt{3}}{3}-2\sqrt{\frac{-3x^{2}}{16}+\frac{\sqrt{3}x}{2}}$

Now for that Pythagorean theorem! I'll spare some more gory details. $CG^{2}+FG^{2}=2^{2}$ simplifies to

$0=4x^2-\frac{17\sqrt{3}x}{3}+\frac{16}{3}+(-8x+\frac{20\sqrt{3}}{3})\sqrt{\frac{-3x^{2}}{16}+\frac{\sqrt{3}x}{2}}$ You can solve this numerically, but to try for an exact form let's get this to a polynomial.

Move the square root term to one side, square both sides, then simplify to the quartic polynomial equation:

$63x^{4}-219\sqrt{3}x^{3}+729x^{2}-286\sqrt{3}x+64=0$

$s$ is the greatest of the four real solutions to this equation. Wolfram|Alpha can give the exact form, but they aren't pretty.

$s \approx 2.999355399$ so $|s-3| \approx 0.000644601$ and the first 4 non-zero digits are $\boxed{6446}$