2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
id: 5900f3f21000cf542c50ff05
|
2021-11-17 03:53:39 -08:00
|
|
|
|
title: '问题 134:素数对连接'
|
2018-10-10 18:03:03 -04:00
|
|
|
|
challengeType: 5
|
2021-02-06 04:42:36 +00:00
|
|
|
|
forumTopicId: 301762
|
2021-01-13 03:31:00 +01:00
|
|
|
|
dashedName: problem-134-prime-pair-connection
|
2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
|
# --description--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
考虑连续的素数 $p_1 = 19$ 和 $p_2 = 23$。 可以验证 1219 是最小的以数字 $p_1$ 形成低位部分,而又能够被 $p_2$ 整除的数字。
|
2021-02-06 04:42:36 +00:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
事实上,除了 $p_1 = 3$ 和 $p_2 = 5$ 之外,对于每对连续的素数,$p_2 > p_1$,都存在 $n$ 的值,其最后一位数字由 $p_1$ 组成而 $n$ 可以被 $p_2$ 整除。 记 $S$ 为这种 $n$ 中的最小值。
|
2021-02-06 04:42:36 +00:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
对连续素数对 $5 ≤ p_1 ≤ 1000000$ 求 $\sum{S}$。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
|
# --hints--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
`primePairConnection()` 应得 `18613426663617120`。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
```js
|
2021-11-17 03:53:39 -08:00
|
|
|
|
assert.strictEqual(primePairConnection(), 18613426663617120);
|
2018-10-10 18:03:03 -04:00
|
|
|
|
```
|
|
|
|
|
|
2021-01-13 03:31:00 +01:00
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```js
|
2021-11-17 03:53:39 -08:00
|
|
|
|
function primePairConnection() {
|
2021-01-13 03:31:00 +01:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
primePairConnection();
|
2021-01-13 03:31:00 +01:00
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
|
# --solutions--
|
2020-08-13 17:24:35 +02:00
|
|
|
|
|
2021-01-13 03:31:00 +01:00
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|