2018-10-10 18:03:03 -04:00
|
|
|
|
---
|
|
|
|
|
id: 5900f3ef1000cf542c50ff01
|
2021-11-17 03:53:39 -08:00
|
|
|
|
title: '问题 129:纯元数可分性'
|
2018-10-10 18:03:03 -04:00
|
|
|
|
challengeType: 5
|
2021-02-06 04:42:36 +00:00
|
|
|
|
forumTopicId: 301756
|
2021-01-13 03:31:00 +01:00
|
|
|
|
dashedName: problem-129-repunit-divisibility
|
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
|
|
|
|
完全由 1 组成的数字称为纯元数(repunit)。 我们定义 $R(k)$ 为长度为 $k$ 的纯元数;例如,$R(6) = 111111$。
|
2021-02-06 04:42:36 +00:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
定义正整数 $n$ 满足 $GCD(n, 10) = 1$,可以证明总是存在 $k$,使 $R(k)$ 可以被 $n$ 整除,记 $A(n)$ 为满足条件的 $k$ 的最小值;例如,$A(7) = 6$ 而 $A(41) = 5$。
|
2021-02-06 04:42:36 +00:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
使得 $A(n)$ 第一次超过 10 的 $n$ 的值是 17。
|
2021-02-06 04:42:36 +00:00
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
找到使得 $A(n)$ 第一次超过 100 万的 $n$ 的值。
|
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
|
|
|
|
`repunitDivisibility()` 应该返回 `1000023`。
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
|
|
```js
|
2021-11-17 03:53:39 -08:00
|
|
|
|
assert.strictEqual(repunitDivisibility(), 1000023);
|
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 repunitDivisibility() {
|
2021-01-13 03:31:00 +01:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-17 03:53:39 -08:00
|
|
|
|
repunitDivisibility();
|
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
|
|
|
|
|
```
|