78 lines
1.2 KiB
Markdown
78 lines
1.2 KiB
Markdown
---
|
||
id: 5900f3ba1000cf542c50fecd
|
||
challengeType: 5
|
||
title: 'Problem 78: Coin partitions'
|
||
forumTopicId: 302191
|
||
---
|
||
|
||
## Description
|
||
<section id='description'>
|
||
|
||
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7.
|
||
|
||
<div style='text-align: center;'>
|
||
|
||
|Coin piles|
|
||
|--- |
|
||
|OOOOO|
|
||
|OOOO O|
|
||
|OOO OO|
|
||
|OOO O O|
|
||
|OO OO O|
|
||
|OO O O O|
|
||
|O O O O O|
|
||
|
||
</div>
|
||
|
||
Find the least value of <var>n</var> for which p(<var>n</var>) is divisible by one million.
|
||
|
||
</section>
|
||
|
||
## Instructions
|
||
<section id='instructions'>
|
||
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>coinPartitions()</code> should return a number.
|
||
testString: assert(typeof coinPartitions() === 'number');
|
||
- text: <code>coinPartitions()</code> should return 55374.
|
||
testString: assert.strictEqual(coinPartitions(), 55374);
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function coinPartitions() {
|
||
|
||
return true;
|
||
}
|
||
|
||
coinPartitions();
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
|
||
</section>
|