# Bijective numeration

Bijective numeration is any numeral system in which every non-negative integer can be represented in exactly one way using a finite string of digits. The name derives from this bijection (one-to-one correspondence) between the set of non-negative integers and the set of finite strings using a finite set of symbols (the "digits").

Most ordinary numeral systems, such as the common decimal system, are not bijective because more than one string of digits can represent the same positive integer. In particular, adding leading zeroes does not change the value represented, so "1", "01" and "001" all represent the number one. Even though only the first is usual, the fact that the others are possible means that decimal is not bijective. However, unary, with only one digit, is bijective.

A bijective base-k numeration is a bijective positional notation. It uses a string of digits from the set {1, 2, ..., k} (where k ≥ 1) to encode each positive integer; a digit's position in the string defines its value as a multiple of a power of k. Smullyan (1961) calls this notation k-adic, but it should not be confused with the p-adic numbers: bijective numerals are a system for representing ordinary integers by finite strings of nonzero digits, whereas the p-adic numbers are a system of mathematical values that contain the integers as a subset and may need infinite sequences of digits in any numerical representation.

## Definition

The base-k bijective numeration system uses the digit-set {1, 2, ..., k} (k ≥ 1) to uniquely represent every non-negative integer, as follows:

• The integer zero is represented by the empty string.
• The integer represented by the nonempty digit-string
anan−1 ... a1a0
is
an kn + an−1 kn−1 + ... + a1 k1 + a0 k0.
• The digit-string representing the integer m > 0 is
anan−1 ... a1a0
where
{\displaystyle {\begin{aligned}a_{0}&=&m-q_{0}k,&&q_{0}&=&f\left({\frac {m}{k}}\right)&\\a_{1}&=&q_{0}-q_{1}k,&&q_{1}&=&f\left({\frac {q_{0}}{k}}\right)&\\a_{2}&=&q_{1}-q_{2}k,&&q_{2}&=&f\left({\frac {q_{1}}{k}}\right)&\\&\vdots &&&&\vdots &&\\a_{n}&=&q_{n-1}-0k,&&q_{n}&=&f\left({\frac {q_{n-1}}{k}}\right)&=0\end{aligned}}}
and
${\displaystyle f(x)=\lceil x\rceil -1}$,
${\displaystyle \lceil x\rceil }$ being the least integer not less than x (the ceiling function).

## Properties of bijective base-k numerals

For a given base k ≥ 1,

 bijective base 1: bijective base 2: binary: bijective base 3: ternary: bijective base 8: octal: bijective base 10: decimal: bijective base 12: duodecimal: bijective base 16: hexadecimal: 0 1 11 111 1111 11111 111111 1111111 11111111 111111111 1111111111 11111111111 111111111111 1111111111111 11111111111111 111111111111111 1111111111111111 ... (unary numeral system) 0 1 2 11 12 21 22 111 112 121 122 211 212 221 222 1111 1112 ... 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000 ... 0 1 2 3 11 12 13 21 22 23 31 32 33 111 112 113 121 ... 0 1 2 10 11 12 20 21 22 100 101 102 110 111 112 120 121 ... 0 1 2 3 4 5 6 7 8 11 12 13 14 15 16 17 18 ... 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 ... 0 1 2 3 4 5 6 7 8 9 A 11 12 13 14 15 16 ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... 0 1 2 3 4 5 6 7 8 9 A B C 11 12 13 14 ... 0 1 2 3 4 5 6 7 8 9 A B 10 11 12 13 14 ... 0 1 2 3 4 5 6 7 8 9 A B C D E F G ... 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 ...

## Examples

34152 (in bijective base-5) = 3×54 + 4×53 + 1×52 + 5×51 + 2×1 = 2427 (in decimal).
119A (in bijective base-10, with "A" representing the digit value ten) = 1×103 + 1×102 + 9×101 + 10×1 = 1200 (in decimal).

## The bijective base-10 system

The bijective base-10 system is a base ten positional numeral system that does not use a digit to represent zero. It instead has a digit to represent ten, such as A.

As with conventional decimal, each digit position represents a power of ten, so for example 123 is "one hundred, plus two tens, plus three units." All positive integers that are represented solely with non-zero digits in conventional decimal (such as 123) have the same representation in decimal without a zero. Those that use a zero must be rewritten, so for example 10 becomes A, conventional 20 becomes 1A, conventional 100 becomes 9A, conventional 101 becomes A1, conventional 302 becomes 2A2, conventional 1000 becomes 99A, conventional 1110 becomes AAA, conventional 2010 becomes 19AA, and so on.

Addition and multiplication in decimal without a zero are essentially the same as with conventional decimal, except that carries occur when a position exceeds ten, rather than when it exceeds nine. So to calculate 643 + 759, there are twelve units (write 2 at the right and carry 1 to the tens), ten tens (write A with no need to carry to the hundreds), thirteen hundreds (write 3 and carry 1 to the thousands), and one thousand (write 1), to give the result 13A2 rather than the conventional 1402.

## The bijective base-26 system

In the bijective base-26 system one may use the Latin alphabet letters "A" to "Z" to represent the 26 digit values one to twenty-six.

With this choice of notation, the number sequence (starting from 1) begins A, B, C, ..., X, Y, Z, AA, AB, AC, ..., AX, AY, AZ, BA, BB, BC, ...

Each digit position represents a power of twenty-six, so for example, the numeral ABC represents the value 1 × 262 + 2 × 261 + 3 × 260 = 731 in base 10.

Many spreadsheets including Microsoft Excel use this system to assign labels to the columns of a spreadsheet, starting A, B, C, ..., Z, AA, AB, ..., AZ, BA, ..., ZZ, AAA, etc. For instance, in Excel 2013, there can be up to 16384 columns, labeled from A to XFD.[2] A variant of this system is used to name variable stars.[3] It can be applied to any problem where a systematic naming using letters is desired, while using the shortest possible strings.

## Historical notes

The fact that every non-negative integer has a unique representation in bijective base-k (k ≥ 1) is a "folk theorem" that has been rediscovered many times. Early instances are Foster (1947) for the case k = 10, and Smullyan (1961) and Böhm (1964) for all k ≥ 1. Smullyan uses this system to provide a Gödel numbering of the strings of symbols in a logical system; Böhm uses these representations to perform computations in the programming language P′′. Knuth (1969) mentions the special case of k = 10, and Salomaa (1973) discusses the cases k ≥ 2. Forslund (1995) appears to be another rediscovery, and hypothesizes that if ancient numeration systems used bijective base-k, they might not be recognized as such in archaeological documents, due to general unfamiliarity with this system.

## Notes

1. ^
2. ^ Harvey, Greg (2013), Excel 2013 For Dummies, John Wiley & Sons, ISBN 9781118550007.
3. ^ Hellier, Coel (2001), "Appendix D: Variable star nomenclature", Cataclysmic Variable Stars - How and Why They Vary, Praxis Books in Astronomy and Space, Springer, p. 197, ISBN 9781852332112.