* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
41 lines
1.2 KiB
Markdown
41 lines
1.2 KiB
Markdown
---
|
||
id: 5900f3ec1000cf542c50feff
|
||
title: 问题128:六边形瓷砖差异
|
||
challengeType: 5
|
||
videoUrl: ''
|
||
dashedName: problem-128-hexagonal-tile-differences
|
||
---
|
||
|
||
# --description--
|
||
|
||
编号为1的六边形瓷砖由六个六边形瓷砖环围绕,从“12点钟”开始,并以逆时针方向对瓷砖2至7进行编号。新环以相同的方式添加,下一个环编号为8至19,20至37,38至61,依此类推。下图显示了前三个环。
|
||
|
||
通过找到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个瓦片。
|
||
|
||
# --hints--
|
||
|
||
`euler128()`应该返回14516824220。
|
||
|
||
```js
|
||
assert.strictEqual(euler128(), 14516824220);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function euler128() {
|
||
|
||
return true;
|
||
}
|
||
|
||
euler128();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|