Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-408-admissible-paths-through-a-grid.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1019 B

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f5091000cf542c51001b Problem 408: Admissible paths through a grid 5 302076 problem-408-admissible-paths-through-a-grid

--description--

Let's call a lattice point (x, y) inadmissible if x, y and x + y are all positive perfect squares.

For example, (9, 16) is inadmissible, while (0, 4), (3, 1) and (9, 4) are not.

Consider a path from point (x1, y1) to point (x2, y2) using only unit steps north or east. Let's call such a path admissible if none of its intermediate points are inadmissible.

Let P(n) be the number of admissible paths from (0, 0) to (n, n). It can be verified that P(5) = 252, P(16) = 596994440 and P(1000) mod 1 000 000 007 = 341920854.

Find P(10 000 000) mod 1 000 000 007.

--hints--

euler408() should return 299742733.

assert.strictEqual(euler408(), 299742733);

--seed--

--seed-contents--

function euler408() {

  return true;
}

euler408();

--solutions--

// solution required