49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| id: 5900f4cb1000cf542c50ffde
 | |
| title: '問題 351: 六角形果樹園'
 | |
| challengeType: 5
 | |
| forumTopicId: 302011
 | |
| dashedName: problem-351-hexagonal-orchards
 | |
| ---
 | |
| 
 | |
| # --description--
 | |
| 
 | |
| 位数 $n$ の六角形果樹園は、辺長 $n$ の正六角形の中の点で構成された三角格子です。 下図は、位数 5 の六角形果樹園の例です。
 | |
| 
 | |
| <img class="img-responsive center-block" alt="位数 5 の六角形果樹園において、中心から見た場合に、より手前の点に隠れるために見えない点が緑色で強調表示されている" src="https://cdn.freecodecamp.org/curriculum/project-euler/hexagonal-orchards.png" style="background-color: white; padding: 10px;" />
 | |
| 
 | |
| 緑色で強調表示されているのは、中心から見た場合に、より手前の点に隠れるために見えない点です。 位数 5 の六角形果樹園では、30 個の点が中心から見えないことが分かります。
 | |
| 
 | |
| $H(n)$ を、位数 $n$ の六角形果樹園の中心から見えない点の数とします。
 | |
| 
 | |
| $H(5) = 30$, $H(10) = 138$, $H(1\\,000)$ = $1\\,177\\,848$ です。
 | |
| 
 | |
| $H(100\\,000\\,000)$ を求めなさい。
 | |
| 
 | |
| # --hints--
 | |
| 
 | |
| `hexagonalOrchards()` は `11762187201804552` を返す必要があります。
 | |
| 
 | |
| ```js
 | |
| assert.strictEqual(hexagonalOrchards(), 11762187201804552);
 | |
| ```
 | |
| 
 | |
| # --seed--
 | |
| 
 | |
| ## --seed-contents--
 | |
| 
 | |
| ```js
 | |
| function hexagonalOrchards() {
 | |
| 
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| hexagonalOrchards();
 | |
| ```
 | |
| 
 | |
| # --solutions--
 | |
| 
 | |
| ```js
 | |
| // solution required
 | |
| ```
 |