2018-09-30 23:01:58 +01:00
---
id: 5900f4cf1000cf542c50ffe1
2018-10-20 21:02:47 +03:00
title: 'Problem 354: Distances in a bee''s honeycomb'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302014
2021-01-13 03:31:00 +01:00
dashedName: problem-354-distances-in-a-bees-honeycomb
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
Consider a honey bee's honeycomb where each cell is a perfect regular hexagon with side length 1.
2018-09-30 23:01:58 +01:00
2021-07-29 19:14:22 +02:00
< img class = "img-responsive center-block" alt = "honeycomb with hexagon sides of length 1" src = "https://cdn.freecodecamp.org/curriculum/project-euler/distances-in-a-bees-honeycomb.png" style = "background-color: white; padding: 10px;" >
2018-09-30 23:01:58 +01:00
2021-07-29 19:14:22 +02:00
One particular cell is occupied by the queen bee. For a positive real number $L$, let $B(L)$ count the cells with distance $L$ from the queen bee cell (all distances are measured from centre to centre); you may assume that the honeycomb is large enough to accommodate for any distance we wish to consider.
For example, $B(\sqrt{3}) = 6$, $B(\sqrt{21}) = 12$ and $B(111\\,111\\,111) = 54$.
Find the number of $L ≤ 5 \times {10}^{11}$ such that $B(L) = 450$.
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-29 19:14:22 +02:00
`distancesInHoneycomb()` should return `58065134` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-29 19:14:22 +02:00
assert.strictEqual(distancesInHoneycomb(), 58065134);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
2021-07-29 19:14:22 +02:00
function distancesInHoneycomb() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-29 19:14:22 +02:00
distancesInHoneycomb();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```