2018-09-30 23:01:58 +01:00
---
id: 5900f5081000cf542c51001a
title: 'Problem 412: Gnomon numbering'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302081
2021-01-13 03:31:00 +01:00
dashedName: problem-412-gnomon-numbering
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
2021-07-29 19:48:24 +02:00
For integers $m$, $n$ ($0 ≤ n < m$), let $L(m, n)$ be an $m× m$ grid with the top-right $n× n$ grid removed.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
For example, $L(5, 3)$ looks like this:
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
<img class="img-responsive center-block" alt="5x5 grid, with removed 3x3 grid from the top-right" src="https://cdn.freecodecamp.org/curriculum/project-euler/gnomon-numbering-1.png" style="background-color: white; padding: 10px;">
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
We want to number each cell of $L(m, n)$ with consecutive integers 1, 2, 3, ... such that the number in every cell is smaller than the number below it and to the left of it.
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
For example, here are two valid numberings of $L(5, 3)$:
2018-09-30 23:01:58 +01:00
2021-07-29 19:48:24 +02:00
<img class="img-responsive center-block" alt="two valid numberings of L(5, 3)" src="https://cdn.freecodecamp.org/curriculum/project-euler/gnomon-numbering-2.png" style="background-color: white; padding: 10px;">
Let $LC(m, n)$ be the number of valid numberings of $L(m, n)$. It can be verified that $LC(3, 0) = 42$, $LC(5, 3) = 250\\,250$, $LC(6, 3) = 406\\,029\\,023\\,400$ and $LC(10, 5)\bmod 76\\,543\\,217 = 61\\,251\\,715$.
Find $LC(10\\,000, 5\\,000)\bmod 76\\,543\\,217$.
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
`gnomonNumbering()` should return `38788800` .
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(gnomonNumbering(), 38788800);
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 gnomonNumbering() {
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
gnomonNumbering();
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
```