Back to Freecodecamp

Problem 354: Distances in a bee''s honeycomb

curriculum/challenges/english/blocks/project-euler-problems-301-to-400/5900f4cf1000cf542c50ffe1.md

latest1.1 KB
Original Source

--description--

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

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 center to center); 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$.

--hints--

distancesInHoneycomb() should return 58065134.

js
assert.strictEqual(distancesInHoneycomb(), 58065134);

--seed--

--seed-contents--

js
function distancesInHoneycomb() {

  return true;
}

distancesInHoneycomb();

--solutions--

js
// solution required