2022-01-21 01:00:18 +05:30
|
|
|
---
|
|
|
|
id: 5900f4be1000cf542c50ffd0
|
2022-01-22 20:38:20 +05:30
|
|
|
title: '問題 337: トーティエント階段型数列 (Stairstep Sequence)'
|
2022-01-21 01:00:18 +05:30
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 301995
|
|
|
|
dashedName: problem-337-totient-stairstep-sequences
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
次の条件を満たす長さ $n$ の整数数列を $\\{a_1, a_2, \ldots, a_n\\}$ とします。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
|
|
|
- $a_1 = 6$
|
2022-01-22 20:38:20 +05:30
|
|
|
- すべての $1 ≤ i < n$ について、$φ(a_i) < φ(a_{i + 1}) < a_i < a_{i + 1}$
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$φ$ はオイラーのトーティエント関数を表します。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
そのような数列のうち $a_n ≤ N$ を満たすものの数を $S(N)$ とします。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
例: $S(10) = 4$: {6}, {6, 8}, {6, 8, 9}, {6, 10}
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$S(100) = 482\\,073\\,668$, $S(10\\,000)\bmod {10}^8 = 73\\,808\\,307$ であることを確認できます。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
$S(20\\,000\\,000)\bmod {10}^8$ を求めなさい。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2022-01-22 20:38:20 +05:30
|
|
|
`totientStairstepSequences()` は `85068035` を返す必要があります。
|
2022-01-21 01:00:18 +05:30
|
|
|
|
|
|
|
```js
|
|
|
|
assert.strictEqual(totientStairstepSequences(), 85068035);
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function totientStairstepSequences() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
totientStairstepSequences();
|
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|