We construct an encoding of finite strings over a fixed finite alphabet as natural numbers, based on a block partition of the Fibonacci sequence. Each position in the string selects one Fibonacci number from a dedicated block, with unused indices between blocks guaranteeing non-adjacency. The encoded number is the sum of the selected Fibonacci numbers, and Zeckendorf's theorem guarantees that this sum uniquely determines the selection. The encoding is injective, the string length is recoverable from the code, and the worst-case digit count of the encoded number grows as $Θ(m)$ for strings of length $m$, matching the information-theoretic lower bound up to a constant factor. We also prove that the natural right-nested use of Rosko's (2025) binary carryless pairing for sequence encoding has worst-case $Θ(2^m)$ digit growth, an exponential blowup that the block-partition construction avoids entirely.
翻译:我们基于斐波那契序列的分块构造,将固定有限字母表上的有限字符串编码为自然数。字符串中的每个位置从专用块中选择一个斐波那契数,块间的未用索引保证了非相邻性。编码数为所选斐波那契数之和,且齐肯多夫定理保证了该和唯一确定选择。该编码是单射的,字符串长度可从编码中恢复,对于长度为m的字符串,编码数的最坏情况数字位数按Θ(m)增长,在常数因子内匹配信息论下界。我们还证明,Rosko (2025) 提出的二进制无进位配对自然右嵌套序列编码在最坏情况下具有Θ(2^m)的数字位数增长,这种指数爆炸被分块构造完全避免。