2018-10-10 18:03:03 -04:00
---
id: 5900f3ba1000cf542c50fecd
2021-02-06 04:42:36 +00:00
title: 'Problem 78: Coin partitions'
2018-10-10 18:03:03 -04:00
challengeType: 5
2021-02-06 04:42:36 +00:00
forumTopicId: 302191
2021-01-13 03:31:00 +01:00
dashedName: problem-78-coin-partitions
2018-10-10 18:03:03 -04:00
---
2020-12-16 00:37:30 -07:00
# --description--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00: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.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
< div style = 'text-align: center;' >
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
| 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 `n` for which p(`n` ) is divisible by one million.
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
# --hints--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
`coinPartitions()` should return a number.
```js
assert(typeof coinPartitions() === 'number');
```
`coinPartitions()` should return 55374.
2018-10-10 18:03:03 -04:00
```js
2021-02-06 04:42:36 +00:00
assert.strictEqual(coinPartitions(), 55374);
2018-10-10 18:03:03 -04:00
```
2021-01-13 03:31:00 +01:00
# --seed--
## --seed-contents--
```js
function coinPartitions() {
return true;
}
coinPartitions();
```
2020-12-16 00:37:30 -07:00
# --solutions--
2020-08-13 17:24:35 +02:00
2021-01-13 03:31:00 +01:00
```js
// solution required
```