56 lines
1.9 KiB
Markdown
56 lines
1.9 KiB
Markdown
---
|
||
id: 5900f4bd1000cf542c50ffce
|
||
challengeType: 5
|
||
title: 'Problem 335: Gathering the beans'
|
||
videoUrl: ''
|
||
localeTitle: ''
|
||
---
|
||
|
||
## Description
|
||
<section id="description"> Всякий раз, когда Питер испытывает скуку, он кладет чаши, содержащие по одному бобу, по кругу. После этого он вынимает все бобы из определенной чаши и бросает их один за другим в чаши, идущие по часовой стрелке. Он повторяет это, начиная с чаши, в которую он уронил последний боб, пока не появится первоначальная ситуация. Например, с 5 чашами он действует следующим образом: <p> Таким образом, с 5 чашами, для возврата к исходной ситуации требуется переход от Peter 15. </p><p> Пусть M (x) представляет количество ходов, необходимых для возврата к исходной ситуации, начиная с шаров x. Таким образом, M (5) = 15. Также можно проверить, что M (100) = 10920. </p><p> Найти M (2k + 1). Дайте свой ответ по модулю 79. </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>euler335()</code> должен вернуть 5032316.
|
||
testString: 'assert.strictEqual(euler335(), 5032316, "<code>euler335()</code> should return 5032316.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function euler335() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
euler335();
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|