Problem 312

Cyclic paths on Sierpiński graphs

- 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.

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:

It can also be verified that :

C(1) = C(2) = 1

C(5) = 71328803586048

C(10 000) mod 10^{8} = 37652224

C(10 000) mod 13^{8} = 617720485

Find C(C(C(10 000))) mod 13^{8}.

**
These problems are part of
Project Euler
and are licensed under
CC BY-NC-SA 2.0 UK
**