2018-09-30 22:01:58 +00:00
---
id: 5900f4a51000cf542c50ffb7
title: 'Problem 312: Cyclic paths on Sierpiński graphs'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301968
2021-01-13 02:31:00 +00:00
dashedName: problem-312-cyclic-paths-on-sierpiski-graphs
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
\- A Sierpiński graph of order-1 (S1) is an equilateral triangle.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
\- Sn+1 is obtained from Sn by positioning three copies of Sn so that every pair of copies has one common corner.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
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:
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
It can also be verified that : C(1) = C(2) = 1 C(5) = 71328803586048 C(10 000) mod 108 = 37652224 C(10 000) mod 138 = 617720485
2018-09-30 22:01:58 +00:00
Find C(C(C(10 000))) mod 138.
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
`euler312()` should return 324681947.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
assert.strictEqual(euler312(), 324681947);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
function euler312() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
euler312();
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```