2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4ab1000cf542c50ffbe
|
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
2020-10-01 17:54:21 +02:00
|
|
|
|
title: 问题319:有界序列
|
2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
2020-02-18 01:40:55 +09:00
|
|
|
|
<section id="description">
|
|
|
|
|
令x1,x2,...,xn为长度为n的序列,使得:
|
|
|
|
|
x1 = 2
|
|
|
|
|
对于所有1 <i≤n:xi-1 <xi
|
|
|
|
|
对于所有1≤i,j≤n的i和j:(xi)j <(xj + 1)i
|
|
|
|
|
|
|
|
|
|
这样的长度为2的序列只有五个,即:
|
|
|
|
|
{2,4},{2,5},{2,6},{2,7}和{2,8}。
|
|
|
|
|
有293个这样的长度为5的序列。 以下是三个示例:
|
|
|
|
|
{2,5,11,25,55},{2,6,14,36,88},{2,8,22,64,181}。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
令t(n)表示长度为n的此类序列的数量。
|
|
|
|
|
给出t(10)= 86195和t(20)= 5227991891。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
找出t(1010)并给出答案模块109。
|
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
## Instructions
|
2020-02-18 01:40:55 +09:00
|
|
|
|
<section id="instructions">
|
|
|
|
|
</section>
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
tests:
|
2020-02-18 01:40:55 +09:00
|
|
|
|
- text: <code>euler319()</code>应该返回268457129。
|
|
|
|
|
testString: assert.strictEqual(euler319(), 268457129);
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler319() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler319();
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
2020-08-13 17:24:35 +02:00
|
|
|
|
|
|
|
|
|
/section>
|