2018-09-30 23:01:58 +01:00
---
id: 5900f5021000cf542c510014
title: 'Problem 405: A rectangular tiling'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302073
2021-01-13 03:31:00 +01:00
dashedName: problem-405-a-rectangular-tiling
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
We wish to tile a rectangle whose length is twice its width.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
Let $T(0)$ be the tiling consisting of a single rectangle.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
For $n > 0$, let $T(n)$ be obtained from $T( n- 1)$ by replacing all tiles in the following manner:
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
< img class = "img-responsive center-block" alt = "obtaining T(n) from T(n - 1)" src = "https://cdn.freecodecamp.org/curriculum/project-euler/a-rectangular-tiling-1.png" style = "background-color: white; padding: 10px;" >
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
The following animation demonstrates the tilings $T(n)$ for $n$ from 0 to 5:
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
< img class = "img-responsive center-block" alt = "animation with tilings T(n) for n from 0 to 5" src = "https://cdn.freecodecamp.org/curriculum/project-euler/a-rectangular-tiling-2.gif" style = "background-color: white; padding: 10px;" >
Let $f(n)$ be the number of points where four tiles meet in $T(n)$. For example, $f(1) = 0$, $f(4) = 82$ and $f({10}^9)\bmod {17}^7 = 126\\,897\\,180$.
Find $f({10}^k)$ for $k = {10}^{18}$, give your answer modulo ${17}^7$.
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
`rectangularTiling()` should return `237696125` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-29 19:48:24 +02:00
assert.strictEqual(rectangularTiling(), 237696125);
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --seed--
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
## --seed-contents--
2018-09-30 23:01:58 +01:00
```js
2021-07-29 19:48:24 +02:00
function rectangularTiling() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-29 19:48:24 +02:00
rectangularTiling();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```