2018-09-30 22:01:58 +00:00
---
id: 5900f3df1000cf542c50fef1
title: 'Problem 115: Counting block combinations II'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301741
2021-01-13 02:31:00 +00:00
dashedName: problem-115-counting-block-combinations-ii
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2021-06-30 12:25:46 +00:00
A row measuring `n` units in length has red blocks with a minimum length of `m` units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square.
2020-11-27 18:02:05 +00:00
2021-06-30 12:25:46 +00:00
Let the fill-count function, $F(m, n)$, represent the number of ways that a row can be filled.
2020-11-27 18:02:05 +00:00
2021-06-30 12:25:46 +00:00
For example, $F(3, 29) = 673135$ and $F(3, 30) = 1089155$.
2020-11-27 18:02:05 +00:00
2018-09-30 22:01:58 +00:00
That is, for m = 3, it can be seen that n = 30 is the smallest value for which the fill-count function first exceeds one million.
2021-06-30 12:25:46 +00:00
In the same way, for m = 10, it can be verified that $F(10, 56) = 880711$ and $F(10, 57) = 1148904$, so n = 57 is the least value for which the fill-count function first exceeds one million.
For m = 50, find the least value of `n` for which the fill-count function first exceeds one million.
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
**Note:** This is a more difficult version of Problem 114.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2021-06-30 12:25:46 +00:00
`countingBlockTwo()` should return `168` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-06-30 12:25:46 +00:00
assert.strictEqual(countingBlockTwo(), 168);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
2021-06-30 12:25:46 +00:00
function countingBlockTwo() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-06-30 12:25:46 +00:00
countingBlockTwo();
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```