← Complete problem index

PROJECT EULER · #0312

Cyclic Paths on Sierpiński Graphs

Statement only · UnsolvedOriginal problem ↗

- A Sierpiński graph of order-1 (S1) is an equilateral triangle.
- Sn+1 is obtained from Sn by positioning three copies of Sn so that every pair of copies has one common corner.

0312_sierpinskyAt.gif

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

0312_sierpinsky8t.gif

It can also be verified that :
C(1)=C(2)=1
C(5)=71328803586048
C(10000)mod108=37652224
C(10000)mod138=617720485

Find C(C(C(10000)))mod138.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.