Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-351-hexagonal-orchards.md
2022-01-23 00:08:20 +09:00

1.5 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4cb1000cf542c50ffde 問題 351: 六角形果樹園 5 302011 problem-351-hexagonal-orchards

--description--

位数 n の六角形果樹園は、辺長 n の正六角形の中の点で構成された三角格子です。 下図は、位数 5 の六角形果樹園の例です。

位数 5 の六角形果樹園において、中心から見た場合に、より手前の点に隠れるために見えない点が緑色で強調表示されている

緑色で強調表示されているのは、中心から見た場合に、より手前の点に隠れるために見えない点です。 位数 5 の六角形果樹園では、30 個の点が中心から見えないことが分かります。

H(n) を、位数 n の六角形果樹園の中心から見えない点の数とします。

H(5) = 30, H(10) = 138, H(1\\,000) = 1\\,177\\,848 です。

H(100\\,000\\,000) を求めなさい。

--hints--

hexagonalOrchards()11762187201804552 を返す必要があります。

assert.strictEqual(hexagonalOrchards(), 11762187201804552);

--seed--

--seed-contents--

function hexagonalOrchards() {

  return true;
}

hexagonalOrchards();

--solutions--

// solution required