Atelier des rouesLab FR
Objects/Documentation

geometrie41.py

I provide the computation for “Internal paths and bridges at level 41”.

Download ↓
"""Verify suffix-reversal geometry of selected internal paths and bridge templates."""
from functools import lru_cache
from itertools import product
from pathlib import Path
from math import gcd,factorial
import json


@lru_cache(None)
def decode(n,rank):
    if not 0<=rank<factorial(n): raise ValueError("Rank out of range")
    digits=[]
    for base in range(2,n+1):
        rank,r=divmod(rank,base);digits.append(r)
    ring=list(range(n));word=[]
    for r in reversed(digits):

Read in context

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.