Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com> Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
		
			
				
	
	
		
			79 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | ||
| id: 5900f3ba1000cf542c50fecd
 | ||
| challengeType: 5
 | ||
| isHidden: false
 | ||
| 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() {
 | ||
|   // Good luck!
 | ||
|   return true;
 | ||
| }
 | ||
| 
 | ||
| coinPartitions();
 | ||
| ```
 | ||
| 
 | ||
| </div>
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| </section>
 | ||
| 
 | ||
| ## Solution
 | ||
| <section id='solution'>
 | ||
| 
 | ||
| ```js
 | ||
| // solution required
 | ||
| ```
 | ||
| 
 | ||
| </section>
 |