freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-335-gathering-the-b...

66 lines
1.3 KiB
Markdown
Raw Normal View History

---
id: 5900f4bd1000cf542c50ffce
challengeType: 5
title: 'Problem 335: Gathering the beans'
forumTopicId: 301993
---
## Description
<section id='description'>
Whenever Peter feels bored, he places some bowls, containing one bean each, in a circle. After this, he takes all the beans out of a certain bowl and drops them one by one in the bowls going clockwise. He repeats this, starting from the bowl he dropped the last bean in, until the initial situation appears again. For example with 5 bowls he acts as follows:
So with 5 bowls it takes Peter 15 moves to return to the initial situation.
Let M(x) represent the number of moves required to return to the initial situation, starting with x bowls. Thus, M(5) = 15. It can also be verified that M(100) = 10920.
Find M(2k+1). Give your answer modulo 79.
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler335()</code> should return 5032316.
testString: assert.strictEqual(euler335(), 5032316);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler335() {
return true;
}
euler335();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>