56 lines
1.5 KiB
Markdown
56 lines
1.5 KiB
Markdown
---
|
||
id: 5900f3ec1000cf542c50feff
|
||
challengeType: 5
|
||
title: 'Problem 128: Hexagonal tile differences'
|
||
videoUrl: ''
|
||
localeTitle: 问题128:六边形瓷砖差异
|
||
---
|
||
|
||
## Description
|
||
<section id="description">编号为1的六边形瓷砖由六个六边形瓷砖环围绕,从“12点钟”开始,并以逆时针方向对瓷砖2至7进行编号。新环以相同的方式添加,下一个环编号为8至19,20至37,38至61,依此类推。下图显示了前三个环。 <p>通过找到tile n与其六个邻居中的每一个之间的差异,我们将PD(n)定义为那些作为素数的差异的数量。例如,在瓦片8周围顺时针工作,差异是12,29,11,6,1和13.因此PD(8)= 3.以相同的方式,瓦片17周围的差异是1,17,16,1 ,11和10,因此PD(17)= 2.可以证明PD(n)的最大值是3.如果PD(n)= 3的所有瓦片按升序列出以形成一个序列,第10个瓦片将是271.按此顺序找到第2000个瓦片。 </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>euler128()</code>应该返回14516824220。
|
||
testString: 'assert.strictEqual(euler128(), 14516824220, "<code>euler128()</code> should return 14516824220.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function euler128() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
euler128();
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|