# 雙射記數

## 定義

• 零由空字符串表示。
• 由非空數字串表示的整數
anan−1 ... a1a0 = an kn + an−1 kn−1 + ... + a1 k1 + a0 k0.
• 表示整數的數字串m>0是anan−1 ... a1a0
{\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}}}
${\displaystyle f(x)=\lceil x\rceil -1,}$
${\displaystyle \lceil x\rceil }$是不小於的最小整數x上取整函数

${\displaystyle f(x)=\lfloor x\rfloor ,}$

### 擴展到整數

${\displaystyle k>1}$進制, the bijective base-${\displaystyle k}$ numeration system could be extended to negative integers in the same way as the standard base-${\displaystyle b}$ numeral system by use of an infinite number of the digit ${\displaystyle d_{k-1}}$, where ${\displaystyle f(d_{k-1})=k-1}$, represented as a left-infinite sequence of digits ${\displaystyle \ldots d_{k-1}d_{k-1}d_{k-1}={\overline {d_{k-1}}}}$. This is because the Euler summation

${\displaystyle g({\overline {d_{k-1}}})=\sum _{i=0}^{\infty }f(d_{k-1})k^{i}=-{\frac {k-1}{k-1}}=-1}$

meaning that

${\displaystyle g({\overline {d_{k-1}}}d_{k})=f(d_{k})\sum _{i=1}^{\infty }f(d_{k-1})k^{i}=1+\sum _{i=0}^{\infty }f(d_{k-1})k^{i}=0}$

and for every positive number ${\displaystyle n}$ with bijective numeration digit representation ${\displaystyle d}$ is represented by ${\displaystyle {\overline {d_{k-1}}}d_{k}d}$. For base ${\displaystyle k>2}$, negative numbers ${\displaystyle n<-1}$ are represented by ${\displaystyle {\overline {d_{k-1}}}d_{i}d}$ with ${\displaystyle i, while for base ${\displaystyle k=2}$, negative numbers ${\displaystyle n<-1}$ are represented by ${\displaystyle {\overline {d_{k}}}d}$. This is similar to how in signed-digit representations, all integers ${\displaystyle n}$ with digit representations ${\displaystyle d}$ are represented as ${\displaystyle {\overline {d_{0}}}d}$ where ${\displaystyle f(d_{0})=0}$. This representation is no longer bijective, as the entire set of left-infinite sequences of digits is used to represent the ${\displaystyle k}$-adic integers, of which the integers are only a subset.

## 性質

• 表示非負整數n的雙射k進位位數是${\displaystyle \lfloor \log _{k}((n+1)(k-1))\rfloor }$[1]，與${\displaystyle \lceil \log _{k}(n+1)\rceil }$相比，k進制如果是「1」，位數就是n
• 最小可表示為長度${\displaystyle l\geq 0}$的雙射k進制數字的非負整數是${\displaystyle min(l)={\frac {k^{l}-1}{k-1}}}$
• 最大可表示為長度${\displaystyle l\geq 0}$的雙射k進制數字的非負整數是${\displaystyle max(l)={\frac {k^{l+1}-k}{k-1}}}$，相當於${\displaystyle max(l)=k\times min(l)}$${\displaystyle max(l)=min(l+1)-1}$
• 非負整數n的雙射k進制可和普通進制k相同，當且僅當普通進制不含數字「0」，或者等效地，雙射進制既不是空字符串也不包含數字k

• 會有${\displaystyle k^{l}}$個雙射進制，長度為${\displaystyle l\geq 0}$k[2]
• 雙射進制k的列表.。用λ表示空串，1、2、3、8、10、12、16為底的數如下（這裡列出普通的表示方式以供比較）：
 雙射一進制 雙射二進制 二進制 雙射三進制 三進制 雙射八進制 八進制 雙射十進制 十進制 雙射十二進制 十二進制 雙射十六進制 十六進制 λ 1 11 111 1111 11111 111111 1111111 11111111 111111111 1111111111 11111111111 111111111111 1111111111111 11111111111111 111111111111111 1111111111111111 ... λ 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 ... λ 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 ... λ 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 ... λ 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 ... λ 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 ... λ 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 ...

## 例

• 雙射五進制的34152 = 3×54 + 4×53 + 1×52 + 5×51 + 2×1 = 2427（十進制）
• 雙射十進制119A（A代表數值10） = 1×103 + 1×102 + 9×101 + 10×1 = 1200（十進制）
• 雙射11進制B = 11（十進制）
• 雙射35進制Z = 35（十進制）

## 注釋

1. ^ How many digits are in the bijective base-k numeral for n?. Stackexchange. [22 September 2018].
2. ^
3. ^ Harvey, Greg, Excel 2013 For Dummies, John Wiley & Sons, 2013, ISBN 9781118550007.
4. ^ Hellier, Coel, Appendix D: Variable star nomenclature, Cataclysmic Variable Stars - How and Why They Vary, Praxis Books in Astronomy and Space, Springer: 197, 2001, ISBN 9781852332112.