Skip to content

CombinatorialNumerals ​

The combinatorial number system of degree kk: n↔n \leftrightarrow the strictly decreasing tuple ck>⋯>c1≥0c_k > \dots > c_1 \ge 0 with n=(ckk)+⋯+(c11)n = \binom{c_k}{k} + \dots + \binom{c_1}{1} — the unranking of kk-subsets in colexicographic order.

CombinatorialNumerals(k)the system, width kk, strictly decreasing digits
Typed signatures
TypePackageApplies
(integer) -> valuenumeralsalways

Domain: Numeral systems

Examples

Basic #

3=(33)+(22)+(11)3 = \binom{3}{3} + \binom{2}{2} + \binom{1}{1}

live ↗
InIntegerDigits(3,CombinatorialNumerals(3))\mathrm{IntegerDigits}(3, \mathrm{CombinatorialNumerals}(3))Out[3,2,1]\bigl\lbrack3, 2, 1\bigr\rbrack

10=(52)+(01)10 = \binom{5}{2} + \binom{0}{1}

live ↗
InIntegerDigits(10,CombinatorialNumerals(2))\mathrm{IntegerDigits}(10, \mathrm{CombinatorialNumerals}(2))Out[5,0]\bigl\lbrack5, 0\bigr\rbrack
About
Examples2

See also: IntegerDigits, CombinatorialSystem