Skip to content

BijectiveNumerals ​

Bijective base kk: digits 1,…,k1,\dots,k, with no zero digit at all — every positive integer has exactly one representation, and zero is the empty numeral. Bijective base 26 is how spreadsheet columns are lettered (A, …, Z, AA, …).

BijectiveNumerals(k)the system, digits 1,…,k1,\dots,k
Typed signatures
TypePackageApplies
(integer) -> valuenumeralsalways

Domain: Numeral systems

Examples

Basic #

2828 is "AB" in spreadsheet lettering: digits 1,21, 2

live ↗
InIntegerDigits(28,BijectiveNumerals(26))\mathrm{IntegerDigits}(28, \mathrm{BijectiveNumerals}(26))Out[1,2]\bigl\lbrack1, 2\bigr\rbrack

No zero digit: 10=1⋅4+2⋅2+2⋅110 = 1\cdot 4 + 2\cdot 2 + 2\cdot 1

live ↗
InIntegerDigits(10,BijectiveNumerals(2))\mathrm{IntegerDigits}(10, \mathrm{BijectiveNumerals}(2))Out[1,2,2]\bigl\lbrack1, 2, 2\bigr\rbrack
About
Examples2

See also: IntegerDigits, BijectiveRadix