2018-09-30 23:01:58 +01:00
---
id: 5900f3ba1000cf542c50fecd
challengeType: 5
2020-05-21 17:31:25 +02:00
isHidden: false
2018-09-30 23:01:58 +01:00
title: 'Problem 78: Coin partitions'
2019-08-05 09:17:33 -07:00
forumTopicId: 302191
2018-09-30 23:01:58 +01:00
---
## Description
<section id='description'>
2020-02-28 21:39:47 +09:00
2018-09-30 23:01:58 +01:00
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.
2020-02-07 17:47:35 +09:00
<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.
2018-09-30 23:01:58 +01:00
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
2018-10-04 14:37:37 +01:00
tests:
2020-02-28 21:39:47 +09:00
- 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);
2018-09-30 23:01:58 +01:00
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
2020-02-28 21:39:47 +09:00
function coinPartitions() {
2018-09-30 23:01:58 +01:00
// Good luck!
return true;
}
2020-02-28 21:39:47 +09:00
coinPartitions();
2018-09-30 23:01:58 +01:00
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
2019-07-18 08:24:12 -07:00
2018-09-30 23:01:58 +01:00
</section>