66 lines
1.1 KiB
Markdown
66 lines
1.1 KiB
Markdown
|
---
|
||
|
id: 5
|
||
|
localeTitle: 5900f4be1000cf542c50ffd0
|
||
|
challengeType: 5
|
||
|
title: 'Problem 337: Totient Stairstep Sequences'
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
<section id='description'>
|
||
|
Sea {a1, a2, ..., an} una secuencia entera de longitud n tal que:
|
||
|
a1 = 6
|
||
|
para todos 1 ≤ i <n: φ (ai) <φ (ai + 1) <ai < ai + 11
|
||
|
Sea S (N) el número de tales secuencias con un ≤ N.
|
||
|
Por ejemplo, S (10) = 4: {6}, {6, 8}, {6, 8, 9} y { 6, 10}.
|
||
|
Podemos verificar que S (100) = 482073668 y S (10 000) mod 108 = 73808307.
|
||
|
|
||
|
Encuentre S (20 000 000) mod 108.
|
||
|
|
||
|
1 φ denota la función total de Euler.
|
||
|
</section>
|
||
|
|
||
|
## Instructions
|
||
|
<section id='instructions'>
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: <code>euler337()</code> debe devolver 85068035.
|
||
|
testString: 'assert.strictEqual(euler337(), 85068035, "<code>euler337()</code> should return 85068035.");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
function euler337() {
|
||
|
// Good luck!
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
euler337();
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|