Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-312-cyclic-paths-on-sierpiski-graphs.md
gikf 32dbe23f5e fix(curriculum): clean-up Project Euler 301-320 (#42926)
* fix: clean-up Project Euler 301-320

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-07-21 17:59:56 +02:00

1.6 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4a51000cf542c50ffb7 Problem 312: Cyclic paths on Sierpiński graphs 5 301968 problem-312-cyclic-paths-on-sierpiski-graphs

--description--

  • A Sierpiński graph of order-1 (S_1) is an equilateral triangle.
  • S_{n + 1} is obtained from S_n by positioning three copies of S_n so that every pair of copies has one common corner.
Sierpinski graphs of order-1 to order-5

Let C(n) be the number of cycles that pass exactly once through all the vertices of S_n. For example, C(3) = 8 because eight such cycles can be drawn on S_3, as shown below:

eight cycles that pass exactly once through all vertices of S_3

It can also be verified that:

$$\begin{align} & C(1) = C(2) = 1 \\ & C(5) = 71\,328\,803\,586\,048 \\ & C(10 000)\bmod {10}^8 = 37\,652\,224 \\ & C(10 000)\bmod {13}^8 = 617\,720\,485 \\ \end{align}$$

Find C(C(C(10\\,000)))\bmod {13}^8.

--hints--

pathsOnSierpinskiGraphs() should return 324681947.

assert.strictEqual(pathsOnSierpinskiGraphs(), 324681947);

--seed--

--seed-contents--

function pathsOnSierpinskiGraphs() {

  return true;
}

pathsOnSierpinskiGraphs();

--solutions--

// solution required