---
id: 5900f3e01000cf542c50fef3
title: 'Problem 116: Red, green or blue tiles'
challengeType: 1
forumTopicId: 301742
dashedName: problem-116-red-green-or-blue-tiles
---

# --description--

A row of five black square tiles is to have a number of its tiles replaced with coloured oblong tiles chosen from red (length two), green (length three), or blue (length four).

If red tiles are chosen there are exactly seven ways this can be done.

<img class="img-responsive center-block" alt="将红色块放在长度为 5 个单元的一行中的可能方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-1.png" style="background-color: white; padding: 10px;" />

If green tiles are chosen there are three ways.

<img class="img-responsive center-block" alt="将绿色块放在长度为 5 个单位的一行中的可能方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-2.png" style="background-color: white; padding: 10px;" />

And if blue tiles are chosen there are two ways.

<img class="img-responsive center-block" alt="将蓝色块放在长度为 5 个单位的一行中的可能方法" src="https://cdn.freecodecamp.org/curriculum/project-euler/red-green-or-blue-tiles-3.png" style="background-color: white; padding: 10px;" />

假定颜色不能混合，则有 7 + 3 + 2 = 12 种方法来替换长度为 5 个单位的黑色瓷砖。 如果颜色不能混合且至少必须使用一个彩色瓷块，那么一行长度为50个单位的黑色瓷块可以有多少种不同的更换方式？

**注意：** 这与问题 117 有关。

# --hints--

`redGreenBlueOne()` 应该返回 `20492570929`。

```js
assert.strictEqual(redGreenBlueOne(), 20492570929);
```

# --seed--

## --seed-contents--

```js
function redGreenBlueOne() {

  return true;
}

redGreenBlueOne();
```

# --solutions--

```js
// solution required
```
