---
id: 5900f3ba1000cf542c50fecd
challengeType: 5
title: 'Problem 78: Coin partitions'
forumTopicId: 302191
---
## 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.
|Coin piles|
|--- |
|OOOOO|
|OOOO O|
|OOO OO|
|OOO O O|
|OO OO O|
|OO O O O|
|O O O O O|
Find the least value of n for which p(n) is divisible by one million.
## Instructions
## Tests
```yml
tests:
- text: coinPartitions() should return a number.
testString: assert(typeof coinPartitions() === 'number');
- text: coinPartitions() should return 55374.
testString: assert.strictEqual(coinPartitions(), 55374);
```
## Challenge Seed
```js
function coinPartitions() {
return true;
}
coinPartitions();
```