2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f49d1000cf542c50ffaf
|
2020-12-16 07:37:30 +00:00
|
|
|
|
title: 问题304:Primonacci
|
2018-10-10 22:03:03 +00:00
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
2021-01-13 02:31:00 +00:00
|
|
|
|
dashedName: problem-304-primonacci
|
2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --description--
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
对于任何正整数n,函数next_prime(n)返回最小质数p,使得p> n。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
序列a(n)定义为: 对于n> 1,a(1)= next_prime(1014)和a(n)= next_prime(a(n-1))。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
斐波那契数列f(n)定义为: 对于n> 1,f(0)= 0,f(1)= 1和f(n)= f(n-1)+ f(n-2)。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
|
|
|
|
序列b(n)定义为f(a(n))。
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
求出∑b(n)为1≤n≤100000。 给出答案mod 1234567891011。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
`euler304()`应该返回283988410192。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```js
|
2020-12-16 07:37:30 +00:00
|
|
|
|
assert.strictEqual(euler304(), 283988410192);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler304() {
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler304();
|
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|