"""Exact three-level certificates. Powers of multiplicities are converted to falling factorials using Stirling numbers of the second kind. """ import json,time from collections import defaultdict from functools import lru_cache from pathlib import Path from hashlib import sha256 from flint import fmpz_mpoly_ctx,Ordering @lru_cache(None) def stirling(n): if n==0:return (1,) old=stirling(n-1) return tuple((old[k-1] if k else 0)+(k*old[k] if k