2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f3b81000cf542c50fecb
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 76: Counting summations'
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 302189
|
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
|
|
|
It is possible to write five as a sum in exactly six different ways:
|
2020-02-28 21:39:47 +09:00
|
|
|
|
|
|
|
<div style='margin-left: 4em;'>
|
|
|
|
4 + 1<br>
|
|
|
|
3 + 2<br>
|
|
|
|
3 + 1 + 1<br>
|
|
|
|
2 + 2 + 1<br>
|
|
|
|
2 + 1 + 1 + 1<br>
|
|
|
|
1 + 1 + 1 + 1 + 1<br>
|
|
|
|
</div>
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
How many different ways can one hundred be written as a sum of at least two positive integers?
|
2020-02-28 21:39:47 +09:00
|
|
|
|
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>countingSummations()</code> should return a number.
|
|
|
|
testString: assert(typeof countingSummations() === 'number');
|
|
|
|
- text: <code>countingSummations()</code> should return 190569291.
|
|
|
|
testString: assert.strictEqual(countingSummations(), 190569291);
|
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 countingSummations() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-02-28 21:39:47 +09:00
|
|
|
countingSummations();
|
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>
|