Project Euler 312 - Cyclic paths on Sierpiński graphs

Official link: https://projecteuler.net/problem=312