Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-312-cyclic-paths-on-sierpiski-graphs.md
2022-01-20 20:30:18 +01: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