Hubbry Logo
Negative baseNegative baseMain
Open search
Negative base
Community hub
Negative base
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Negative base
Negative base
from Wikipedia

A negative base (or negative radix) may be used to construct a non-standard positional numeral system. Like other place-value systems, each position holds multiples of the appropriate power of the system's base; but that base is negative—that is to say, the base b is equal to r for some natural number r (r ≥ 2).

Negative-base systems can accommodate all the same numbers as standard place-value systems, but both positive and negative numbers are represented without the use of a minus sign (or, in computer representation, a sign bit); this advantage is countered by an increased complexity of arithmetic operations. The need to store the information normally contained by a negative sign often results in a negative-base number being one digit longer than its positive-base equivalent.

The common names for negative-base positional numeral systems are formed by prefixing nega- to the name of the corresponding positive-base system; for example, negadecimal (base −10) corresponds to decimal (base 10), negabinary (base −2) to binary (base 2), negaternary (base −3) to ternary (base 3), and negaquaternary (base −4) to quaternary (base 4).[1][2]

Example

[edit]

Consider what is meant by the representation 12243 in the negadecimal system, whose base b is −10:

Multiples of
(−10)4 = 10000 (−10)3 = −1000 (−10)2 = 100 (−10)1 = −10 (−10)0 = 1
1 2 2 4 3

The representation 12243−10 (which is intended to be negadecimal notation) is equivalent to 8,16310 in decimal notation, because 10,000 + (−2,000) + 200 + (−40) + 3 = 8163.

Remark

On the other hand, −816310 in decimal would be written 9977−10 in negadecimal.

History

[edit]

Negative numerical bases were first considered by Vittorio Grünwald in an 1885 monograph published in Giornale di Matematiche di Battaglini.[3] Grünwald gave algorithms for performing addition, subtraction, multiplication, division, root extraction, divisibility tests, and radix conversion. Negative bases were later mentioned in passing by A. J. Kempner in 1936[4] and studied in more detail by Zdzisław Pawlak and A. Wakulicz in 1957.[5]

Negabinary was implemented in the early Polish computer BINEG (and UMC), built 1957–59, based on ideas by Z. Pawlak and A. Lazarkiewicz from the Mathematical Institute in Warsaw.[6] Implementations since then have been rare.

zfp, a floating-point compression algorithm from the Lawrence Livermore National Laboratory, uses negabinary to store numbers. According to zfp's documentation:[7]

Unlike sign-magnitude representations, the leftmost one-bit in negabinary simultaneously encodes the sign and approximate magnitude of a number. Moreover, unlike two’s complement, numbers small in magnitude have many leading zeros in negabinary regardless of sign, which facilitates encoding.

Notation and use

[edit]

Denoting the base as r, every integer a can be written uniquely as

where each digit dk is an integer from 0 to r − 1 and the leading digit dn > 0 (unless n = 0). The base r expansion of a is then given by the string dndn−1...d1d0.

Negative-base systems may thus be compared to signed-digit representations, such as balanced ternary, where the radix is positive but the digits are taken from a partially negative range. (In the table below the digit of value −1 is written as the single character T.)

Some numbers have the same representation in base r as in base r. For example, the numbers from 100 to 109 have the same representations in decimal and negadecimal. Similarly,

and is represented by 10001 in binary and 10001 in negabinary.

Some numbers with their expansions in a number of positive and corresponding negative bases are:

Decimal Negadecimal Binary Negabinary Ternary Negaternary Balanced ternary Balanced negaternary Quaternary Negaquaternary
−15 25 −1111 110001 −120 1220 T110 11T0 −33 1301
−5 15 −101 1111 −12 21 T11 TT1 −11 23
−4 16 −100 1100 −11 22 TT 1T −10 10
−3 17 −11 1101 −10 10 T0 10 −3 11
−2 18 −10 10 −2 11 T1 11 −2 12
−1 19 −1 11 −1 12 T T −1 13
0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1
2 2 10 110 2 2 1T TT 2 2
3 3 11 111 10 120 10 T0 3 3
4 4 100 100 11 121 11 T1 10 130
5 5 101 101 12 122 1TT 11T 11 131
6 6 110 11010 20 110 1T0 110 12 132
7 7 111 11011 21 111 1T1 111 13 133
8 8 1000 11000 22 112 10T 10T 20 120
9 9 1001 11001 100 100 100 100 21 121
10 190 1010 11110 101 101 101 101 22 122
11 191 1011 11111 102 102 11T 1TT 23 123
12 192 1100 11100 110 220 110 1T0 30 110
13 193 1101 11101 111 221 111 1T1 31 111
14 194 1110 10010 112 222 1TTT TT1T 32 112
15 195 1111 10011 120 210 1TT0 TT10 33 113
16 196 10000 10000 121 211 1TT1 TT11 100 100
17 197 10001 10001 122 212 1T0T TT0T 101 101
18 198 10010 10110 200 200 1T00 TT00 102 102

Note that, with the exception of nega balanced ternary, the base r expansions of negative integers have an even number of digits, while the base r expansions of the non-negative integers have an odd number of digits.

Calculation

[edit]

The base r expansion of a number can be found by repeated division by r, recording the non-negative remainders in , and concatenating those remainders, starting with the last. Note that if a / b is c with remainder d, then bc + d = a and therefore d = abc. To arrive at the correct conversion, the value for c must be chosen such that d is non-negative and minimal. For the fourth line of the following example this means that

has to be chosen — and not nor

For example, to convert 146 in decimal to negaternary:

Reading the remainders backward we obtain the negaternary representation of 14610: 21102–3.

Proof: −3 · (−3 · (−3 · (−3 · ( 2 ) + 1 ) + 1 ) + 0 ) + 2 = (((2 · (−3) + 1) · (−3) + 1) · (−3) + 0) · (−3) + 2

= 14610. Reading the remainders forward we can obtain the negaternary least-significant-digit-first representation.

Proof: 2 + ( 0 + ( 1 + ( 1 + ( 2 ) · −3 ) · −3) · −3 ) · −3 = 14610.

Note that in most programming languages, the result (in integer arithmetic) of dividing a negative number by a negative number is rounded towards 0, usually leaving a negative remainder. In such a case we have a = (−r)c + d = (−r)c + dr + r = (−r)(c + 1) + (d + r). Because |d| < r, (d + r) is the positive remainder. Therefore, to get the correct result in such case, computer implementations of the above algorithm should add 1 and r to the quotient and remainder respectively.

Example implementation code

[edit]

To negabinary

[edit]
C#
[edit]
static string ToNegabinary(int val)
{
	string result = string.Empty;

	while (val != 0)
	{
		int remainder = val % -2;
		val = val / -2;

		if (remainder < 0)
		{
			remainder += 2;
			val += 1;
		}

		result = remainder.ToString() + result;
	}

	return result;
}
C++
[edit]
auto to_negabinary(int value)
{
    std::bitset<sizeof(int) * CHAR_BIT > result;
    std::size_t bit_position = 0;

    while (value != 0)
    {
        const auto div_result = std::div(value, -2);

        if (div_result.rem < 0)
            value = div_result.quot + 1;
        else
            value = div_result.quot;

        result.set(bit_position, div_result.rem != 0);

        ++bit_position;
    }

    return result;
}

To negaternary

[edit]
C#
[edit]
static string Negaternary(int val)
{
	string result = string.Empty;

	while (val != 0)
	{
		int remainder = val % -3;
		val = val / -3;

		if (remainder < 0)
		{
			remainder += 3;
			val += 1;
		}

		result = remainder.ToString() + result;
	}

	return result;
}
Python
[edit]
def negaternary(i: int) -> str:
    """Decimal to negaternary"""
    if i == 0:
        digits = ["0"]
    else:
        digits = []
        while i != 0:
            i, remainder = divmod(i, -3)
            if remainder < 0:
                i, remainder = i + 1, remainder + 3
            digits.append(str(remainder))
    return "".join(digits[::-1])
>>> negaternary(1000)
'2212001'
Common Lisp
[edit]
(defun negaternary (i)
  (if (zerop i)
      "0"
      (let ((digits "")
            (rem 0))
        (loop while (not (zerop i)) do
          (progn
            (multiple-value-setq (i rem) (truncate i -3))
            (when (minusp rem)
              (incf i)
              (incf rem 3))
            (setf digits (concatenate 'string (write-to-string rem) digits))))
        digits)))

To any negative base

[edit]
Java
[edit]
import java.util.ArrayList;
import java.util.Collections;
public ArrayList<Integer> negativeBase(int input, int base) {
    ArrayList<Integer> result_rev = new ArrayList<>();
    int number = input;
    while (number != 0) {
        int i = number % base;
        number /= base;
        if (i < 0) {
            i += Math.abs(base);
            number++;
        }
        result_rev.add(i);
    }
    return Collections.reverse(results_rev.clone());
}

The above gives the result in an ArrayList of integers, so that the code does not have to handle how to represent a base smaller than −10. To display the result as a string, one can decide on a mapping of base to characrters. For example:

import java.util.stream.Collectors;
final String alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_";
public String toBaseString(ArrayList<Integer> lst) {
    // Would throw exception if base is beyond the 64 possible characters
    return lst.stream().map(n -> alphabet[n]).collect(Collectors.joining(""));
}
AutoLisp
[edit]
(defun negabase (num baz / dig rst)
  ;; NUM is any number.
  ;; BAZ is any number in the interval [-10, -2]. (This is forced by how we do string notation.)
  ;;
  ;; NUM and BAZ will be truncated to an integer if they're floats (e.g. 14.25
  ;; will be truncated to 14, -123456789.87 to -123456789, etc.).
  (if (and (numberp num)
           (numberp baz)
           (<= (fix baz) -2)
           (> (fix baz) -11))
      (progn
        (setq baz (float (fix baz))
              num (float (fix num))
              dig (if (= num 0) "0" ""))
        (while (/= num 0)
               (setq rst (- num (* baz (setq num (fix (/ num baz))))))
               (if (minusp rst)
                   (setq num (1+ num)
                         rst (- rst baz)))
               (setq dig (strcat (itoa (fix rst)) dig)))
        dig)
      (progn
        (prompt
         (cond
           ((and (not (numberp num))
                 (not (numberp baz)))
            "\nWrong number and negabase.")
           ((not (numberp num))
            "\nWrong number.")
           ((not (numberp baz))
            "\nWrong negabase.")
           (t
            "\nNegabase must be inside [-10 -2] interval.")))
        (princ))))

Shortcut calculation

[edit]

The following algorithms assume that

  1. the input is available in bitstrings and coded in (base +2; digits in ) (as in most of today's digital computers),
  2. there are add (+) and xor (^) operations, which operate on such bitstrings (as in most of today's digital computers),
  3. the set of output digits is standard, i. e. with base ,
  4. the output is coded in the same bitstring format, but the meaning of the places is another one.

To negabinary

[edit]

The conversion to negabinary (base −2; digits in ) allows a remarkable shortcut (C implementation):

uint32_t toNegaBinary(uint32_t value) // input in standard binary
{
	uint32_t Schroeppel2 = 0xAAAAAAAA; // = 2/3*((2*2)^16-1) = ...1010
	return (value + Schroeppel2) ^ Schroeppel2; // eXclusive OR
	// resulting unsigned int to be interpreted as string of elements ε {0,1} (bits)
}

JavaScript port for the same shortcut calculation:

function toNegaBinary(value) {
    const Schroeppel2 = 0xAAAAAAAA;
    // Convert as in C, then convert to a NegaBinary String
    return ( ( value + Schroeppel2 ) ^ Schroeppel2 ).toString(2);
}

The algorithm is first described by Schroeppel in the HAKMEM (1972) as item 128. The Wolfram MathWorld documents a version in the Wolfram Language by D. Librik (Szudzik).[8]

To negaquaternary

[edit]

The conversion to negaquaternary (base −4; digits in ) allows a similar shortcut (C implementation):

uint32_t toNegaQuaternary(uint32_t value) // input in standard binary
{
	uint32_t Schroeppel4 = 0xCCCCCCCC; // = 4/5*((2*4)^8-1) = ...11001100 = ...3030
	return (value + Schroeppel4) ^ Schroeppel4; // eXclusive OR
	// resulting unsigned int to be interpreted as string of elements ε {0,1,2,3} (pairs of bits)
}

JavaScript port for the same shortcut calculation:

function toNegaQuaternary(value) {
    const Schroeppel4 = 0xCCCCCCCC;
    // Convert as in C, then convert to NegaQuaternary String
    return ( ( value + Schroeppel4 ) ^ Schroeppel4 ).toString(4);
}

Arithmetic operations

[edit]

The following describes the arithmetic operations for negabinary; calculations in larger bases are similar.

Addition

[edit]

Adding negabinary numbers proceeds bitwise, starting from the least significant bits; the bits from each addend are summed with the (balanced ternary) carry from the previous bit (0 at the LSB). This sum is then decomposed into an output bit and carry for the next iteration as show in the table:

Sum Output Comment
Bit Carry
−2 010−2 0 1 01−2 −2 occurs only during subtraction.
−1 011−2 1 1 01−2
0 000−2 0 0 00−2
1 001−2 1 0 00−2
2 110−2 0 −1 11−2
3 111−2 1 −1 11−2 3 occurs only during addition.

The second row of this table, for instance, expresses the fact that −1 = 1 + 1 × −2; the fifth row says 2 = 0 + −1 × −2; etc.

As an example, to add 1010101−2 (1 + 4 + 16 + 64 = 85) and 1110100−2 (4 + 16 − 32 + 64 = 52),

Carry:          1 −1  0 −1  1 −1  0  0  0
First addend:         1  0  1  0  1  0  1
Second addend:        1  1  1  0  1  0  0 +
               --------------------------
Number:         1 −1  2  0  3 −1  2  0  1
Bit (result):   1  1  0  0  1  1  0  0  1
Carry:          0  1 −1  0 −1  1 −1  0  0

so the result is 110011001−2 (1 − 8 + 16 − 128 + 256 = 137).

Another method

[edit]

While adding two negabinary numbers, every time a carry is generated an extra carry should be propagated to next bit. Consider same example as above

Extra carry:    1  1  1  0  1  0  0  0     
Carry:             0  1  1  0  1  0  0  0
First addend:         1  0  1  0  1  0  1
Second addend:        1  1  1  0  1  0  0 +
               --------------------------
Answer:         1  1  0  0  1  1  0  0  1

Negabinary full adder

[edit]

A full adder circuit can be designed to add numbers in negabinary. The following logic is used to calculate the sum and carries:[9]

Incrementing negabinary numbers

[edit]

Incrementing a negabinary number can be done by using the following formula:[10]

(The operations in this formula are to be interpreted as operations on regular binary numbers. For example, is a binary left shift by one bit.)

Subtraction

[edit]

To subtract, multiply each bit of the second number by −1, and add the numbers, using the same table as above.

As an example, to compute 1101001−2 (1 − 8 − 32 + 64 = 25) minus 1110100−2 (4 + 16 − 32 + 64 = 52),

Carry:          0  1 −1  1  0  0  0
First number:   1  1  0  1  0  0  1
Second number: −1 −1 −1  0 −1  0  0 +
               --------------------
Number:         0  1 −2  2 −1  0  1
Bit (result):   0  1  0  0  1  0  1
Carry:          0  0  1 −1  1  0  0

so the result is 100101−2 (1 + 4 −32 = −27).

Unary negation, x, can be computed as binary subtraction from zero, 0 − x.

Multiplication and division

[edit]

Shifting to the left multiplies by −2, shifting to the right divides by −2.

To multiply, multiply like normal decimal or binary numbers, but using the negabinary rules for adding the carry, when adding the numbers.

First number:                   1  1  1  0  1  1  0
Second number:                  1  0  1  1  0  1  1 ×
              -------------------------------------
                                1  1  1  0  1  1  0
                             1  1  1  0  1  1  0

                       1  1  1  0  1  1  0
                    1  1  1  0  1  1  0

              1  1  1  0  1  1  0                   +
              -------------------------------------
Carry:        0 −1  0 −1 −1 −1 −1 −1  0 −1  0  0
Number:       1  0  2  1  2  2  2  3  2  0  2  1  0
Bit (result): 1  0  0  1  0  0  0  1  0  0  0  1  0
Carry:           0 −1  0 −1 −1 −1 −1 −1  0 −1  0  0

For each column, add carry to number, and divide the sum by −2, to get the new carry, and the resulting bit as the remainder.

Comparing negabinary numbers

[edit]

It is possible to compare negabinary numbers by slightly adjusting a normal unsigned binary comparator. When comparing the numbers and , invert each odd positioned bit of both numbers. After this, compare and using a standard unsigned comparator.[11]

Fractional numbers

[edit]

Base r representation may of course be carried beyond the radix point, allowing the representation of non-integer numbers.

As with positive-base systems, terminating representations correspond to fractions where the denominator is a power of the base; repeating representations correspond to other rationals, and for the same reason.

Non-unique representations

[edit]

Unlike positive-base systems, where integers and terminating fractions have non-unique representations (for example, in decimal 0.999... = 1) in negative-base systems the integers have only a single representation. However, there do exist rationals with non-unique representations. For the digits {0, 1, ..., t} with the biggest digit and

we have

    as well as

So every number with a terminating fraction added has two distinct representations.

For example, in negaternary, i.e. and , there is

.

Such non-unique representations can be found by considering the largest and smallest possible representations with integer parts 0 and 1 respectively, and then noting that they are equal. (Indeed, this works with any integer-base system.) The rationals thus non-uniquely expressible are those of form

with

Imaginary base

[edit]

Just as using a negative base allows the representation of negative numbers without an explicit negative sign, using an imaginary base allows the representation of Gaussian integers. Donald Knuth proposed the quater-imaginary base (base 2i) in 1955.[12]

See also

[edit]

References

[edit]

Further reading

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
A negative base, also known as a negative radix, is a positional numeral system that employs a negative integer (typically with absolute value greater than 1) as its base, enabling the representation of all integers—positive, negative, and zero—using only non-negative digits without requiring a dedicated sign bit. The concept was first explored by Vittorio Grünwald in 1885. In such systems, a number is expressed as n=i=0kdibin = \sum_{i=0}^{k} d_i b^i, where b<0b < 0 is the base, each digit did_i satisfies 0di<b0 \leq d_i < |b|, and the powers bib^i alternate in sign due to the negative radix, inherently encoding both magnitude and sign within the digit sequence. This uniqueness of representation distinguishes negative bases from positive ones, as every integer has exactly one finite expansion without leading zeros. Prominent examples include negabinary (base −2), which uses digits 0 and 1 analogous to standard binary but with place values of powers of −2, and negadecimal (base −10), which mirrors decimal digits 0–9 while incorporating negative powers for signed values. Conversion to a negative base involves repeated division by the base, ensuring non-negative remainders (typically by adding |b| and adjusting the quotient if the remainder is negative), a process that guarantees completeness for integer representations. Arithmetic operations in negative bases, such as addition and multiplication, follow adapted rules similar to positive bases but account for the alternating signs in carries and borrows, often resulting in finite results for integer inputs despite potential infinite carries in some cases. These systems have been analyzed in theoretical computer science for their algebraic properties, particularly when the base relates to Pisot or Salem numbers, forming ring structures suitable for advanced numeration studies. Historically, negative bases like negabinary appeared in mid-20th-century computing explorations, such as the Polish BINEG computer (1957–1959), and continue to find niche applications in parallel computing algorithms and non-standard data representations that reduce the need for explicit sign handling.

Fundamentals

Definition and Properties

A negative base numeral system, also known as a negabase system, is a type of positional numeral system where the base β is a negative integer, typically β ≤ -2. Unlike traditional positive base systems, which require a separate sign indicator for negative numbers, negative base systems allow every integer—positive, negative, or zero—to be represented without a sign bit using only non-negative digits. The digits range from 0 to |β| - 1, matching the cardinality of the digit set in the corresponding positive base |β| system. In such a system, the value of a numeral represented as digits dndn1d1d0d_n d_{n-1} \dots d_1 d_0 in base β is given by the formula k=0ndkβk,\sum_{k=0}^{n} d_k \beta^k, where each 0dk<β0 \leq d_k < |\beta|. This formulation extends the standard positional notation used in positive bases, where the place values are successive powers of the base. A key property of negative base systems is that every integer has a unique representation, with no leading zeros, ensuring unambiguous encoding without the ambiguities sometimes found in balanced ternary or other signed-digit systems. The place values, being powers of β, alternate in sign: for even exponents, β^k is positive, and for odd exponents, it is negative (e.g., in base -2, the positions from right to left are ..., 16, -8, 4, -2, 1). This alternation inherently encodes the sign of contributions from each digit position, eliminating the need for explicit negative number handling during arithmetic operations. Compared to positive base systems, negative bases provide a symmetric treatment of positive and negative integers through their digit expansions, though the alternating signs in place values can lead to non-intuitive patterns in representations. For instance, while positive bases rely on a sign bit or complement methods for negatives, negative bases integrate signed values directly via the base's negativity, simplifying certain computational scenarios but requiring adjusted algorithms for conversion and arithmetic. Readers familiar with positive base positional notation will recognize the structural similarity, but the negative base introduces the novel feature of signless bidirectional number representation.

Basic Examples

One of the simplest negative bases is negabinary, or base −2, which uses digits 0 and 1 and alternates the sign of place values due to the powers of −2 (starting from the rightmost position as (+1), (−2), (+4), (−8), etc.). This system allows representation of both positive and negative integers without a separate sign bit. For example, the number 6 in negabinary is written as 11010211010_{-2}. To verify, expand it positionally from right to left: 1(2)4+1(2)3+0(2)2+1(2)1+0(2)0=168+02+0=6.\begin{align*} &1 \cdot (-2)^4 + \\ &1 \cdot (-2)^3 + \\ &0 \cdot (-2)^2 + \\ &1 \cdot (-2)^1 + \\ &0 \cdot (-2)^0 \end{align*} = 16 - 8 + 0 - 2 + 0 = 6. Negative numbers are represented similarly, without an explicit minus sign, as the alternating signs in the powers naturally accommodate them. For instance, −6 in negabinary is 111021110_{-2}. Expanding step by step: 1(2)3+1(2)2+1(2)1+0(2)0=8+42+0=6.\begin{align*} &1 \cdot (-2)^3 + \\ &1 \cdot (-2)^2 + \\ &1 \cdot (-2)^1 + \\ &0 \cdot (-2)^0 \end{align*} = -8 + 4 - 2 + 0 = -6. To illustrate the alternating signs further, consider these short examples in negabinary:
  • The number 2 is 1102110_{-2}: 1(2)2+1(2)1+0(2)0=42+0=2.1 \cdot (-2)^2 + 1 \cdot (-2)^1 + 0 \cdot (-2)^0 = 4 - 2 + 0 = 2.
  • The number 3 is 1112111_{-2}: 1(2)2+1(2)1+1(2)0=42+1=3.1 \cdot (-2)^2 + 1 \cdot (-2)^1 + 1 \cdot (-2)^0 = 4 - 2 + 1 = 3.
These demonstrate how even-position powers (0, 2, ...) contribute positively and odd-position powers contribute negatively. For comparison, the positive integer 10 is 101021010_2 in standard binary (base 2), equaling 123+022+121+020=8+0+2+0=101 \cdot 2^3 + 0 \cdot 2^2 + 1 \cdot 2^1 + 0 \cdot 2^0 = 8 + 0 + 2 + 0 = 10. In negabinary, however, it is 11110211110_{-2}: 1(2)4+1(2)3+1(2)2+1(2)1+0(2)0=168+42+0=10.\begin{align*} &1 \cdot (-2)^4 + \\ &1 \cdot (-2)^3 + \\ &1 \cdot (-2)^2 + \\ &1 \cdot (-2)^1 + \\ &0 \cdot (-2)^0 \end{align*} = 16 - 8 + 4 - 2 + 0 = 10. This highlights how representations differ between positive and negative bases, even for the same value.

Historical Context

Origins and Early Work

The concept of negative bases in numeral systems was first systematically explored in the late 19th century by Italian mathematician . In his 1885 monograph, Grünwald introduced the theoretical framework for representing numbers using negative integer bases, focusing on bases such as -10 with standard digits 0 through 9. He detailed methods for arithmetic operations, root extraction, divisibility tests, and conversions between positive and negative bases, demonstrating how such systems could uniquely represent all integers without a separate sign indicator. Published in the obscure Giornale di Matematiche di Battaglini, Grünwald's work emphasized the completeness of these representations but received little attention at the time. Interest in negative bases revived in the mid-20th century amid growing fascination with unconventional numeral systems in recreational mathematics. In 1955, Donald E. Knuth, then a high school student, submitted a paper to a science talent search that discussed negative-radix systems alongside generalizations to complex bases, highlighting their potential for efficient number representation. Knuth illustrated how negative bases allow every integer to have a unique finite digit expansion using non-negative digits, avoiding the ambiguities of positive-base signed representations. This exploration, later published in 1960, positioned negative bases as an intriguing alternative for computational and mathematical curiosity, though practical applications remained limited. In 1957, Zdzisław Pawlak and Andrzej Wakulicz published the paper "Use of expansion with negative base in the arithmetic of digital computer," which discussed the application of negative base expansions in digital computer arithmetic. This work contributed to the construction of the BINEG computer, the first known computer to utilize negabinary (base -2), operating from 1957 to 1959. The computer was based on ideas by Z. Pawlak and A. Lazarkiewicz from the Mathematical Institute in Warsaw, marking one of the earliest practical implementations of a negative base numeral system in computing. By the early 1960s, negative bases gained traction in computing contexts, particularly for handling signed numbers. George W. Reitwiesner introduced negabinary (base -2) in his 1960 paper on binary arithmetic, proposing it as a method to represent both positive and negative integers in a single unsigned format. Motivated by the challenges of two's complement arithmetic in early computers—which required special handling for overflow and sign extension—Reitwiesner argued that negabinary simplifies addition and subtraction by eliminating the need for sign bits or complement operations, as carries propagate naturally without altering the sign. He provided algorithms for these operations, noting their efficiency for hardware implementation in signed binary computations.

Key Developments

In the 1970s and 1980s, research on negative bases extended to practical computational applications, including explorations of general negative bases in error-detecting and error-correcting codes, where their unique representational properties allowed for novel encoding schemes in digital systems. In the 1980s and 1990s, advancements focused on computational implementations, such as negative base encoding in optical linear algebra processors and negabinary modular multiplication using digital partitioning techniques, enabling efficient arithmetic operations in specialized hardware like optical computing systems. The introduction of negative base expansions for real numbers, analogous to beta-expansions in positive bases, was pioneered by Shunji Ito and Taizo Sadahiro in their 2009 work, which characterized representations in bases −β (β > 1) and established foundational properties like the greedy and lazy algorithms for such expansions, bridging to broader non-integer base theory. In the , negative bases found applications in digital signal processing through balanced ternary-like systems, where signed-digit representations (equivalent to bases like −3 with digits 0,1,2) offered advantages in error characteristics, rounding, and parallelism for numerically intensive tasks such as filtering and multiplication in DSP subsystems. Recent developments from 2020 to 2025 have emphasized theoretical connections, including links between negative base expansions and Pisot numbers; for instance, a 2022 study showed that certain alternate bases involving negative components yield Pisot numbers when expansions are finite, with implications for unique representations. Additionally, a 2022 analysis explored tilings generated by Pisot numbers via beta-numeration. In 2024, work on binary numeration systems with alternating signed digits—effectively extending negabinary (base −2)—demonstrated efficient computation through unique representations and graph-theoretic models, reducing redundancy in encoding for . Overall, negative base research has evolved from practical implementations in the late to abstract in recent decades, with emerging ties to tiling applications that remain underexplored in standard literature.

Notation and Digit Usage

Standard Notation Conventions

In negative base numeral systems, the base β\beta (where β<0\beta < 0) is conventionally indicated by a subscript immediately following the sequence of digits, with the negative sign included in the subscript for clarity, such as 1012101_{-2} to denote a number in negabinary (base 2-2). This subscript notation parallels that used for positive bases but explicitly incorporates the negativity of the radix to distinguish it from standard positional systems. Digits in these systems are symbolized using the standard non-negative integers from 0 to β1|\beta| - 1, mirroring the digit sets of positive base systems with the same absolute value; for instance, bases like 10-10 employ digits 0 through 9, while higher absolute values may use letters A–F for values 10–15, though decimal digits are preferred in textual descriptions for simplicity and to avoid special symbols. No negative or signed digits are necessary, as the alternating signs in the place values (arising from powers of the negative base) inherently accommodate both positive and negative integers without a separate sign prefix. All integers possess unique finite representations under this convention, eliminating ambiguities from leading zeros or infinite expansions that can occur in other non-standard systems like . When printing or reading negative base numbers, the digits are arranged from most significant to least significant, read left-to-right as in decimal notation, with place values determined by successive integer powers of the base βk\beta^k for k=0,1,2,k = 0, 1, 2, \dots. For mixed or non-standard applications, such as varying radices within a single representation, the subscript convention is extended per position if needed, but uniformity is recommended; non-decimal digits are avoided in favor of explicit decimal equivalents to maintain readability across contexts.

Digit Sets and Constraints

In negative base numeral systems, where the base β is an integer of the form -r with r > 1, the standard digit set consists of non-negative integers satisfying 0 ≤ d < r, ensuring that each position contributes a value within the range needed for positional notation. This range, {0, 1, ..., r-1}, forms a complete residue system modulo r, which guarantees that every integer can be uniquely represented without leading zeros or redundant forms. The use of non-negative digits is essential for achieving unique representations of all integers, positive and negative alike, while covering the entire real number line without gaps or overlaps that would arise from allowing negative digits. Negative digits would introduce multiple equivalent expansions for the same number, complicating computations and storage, whereas the non-negative set eliminates such redundancy by aligning with the alternating sign pattern of the powers of β. For specific bases, the constraints adapt accordingly: in base -2 (negabinary), digits are restricted to {0, 1}, allowing binary-like hardware compatibility; in base -3, digits range from {0, 1, 2}. These limitations imply practical advantages in digital systems, such as the absence of a dedicated sign bit, since the negative base inherently encodes both positive and negative values through digit placement alone, simplifying representation in fixed-width registers. An edge case arises with the maximum digit r-1, which plays a key role in facilitating "borrowing" mechanisms during conversions and operations by providing sufficient range to adjust remainders without introducing negative values prematurely, though this maintains the overall non-negativity constraint.

Number Conversion

General Conversion Algorithm

The standard algorithm for converting an integer nn (positive, negative, or zero) to its representation in a negative base β\beta, where β<0\beta < 0 and β>1|\beta| > 1 is an integer, relies on repeated division while ensuring remainders are non-negative integers in the range 00 to β1|\beta| - 1. This approach adapts the classical division algorithm for positive bases to handle the negative divisor by adjusting any negative remainder, guaranteeing that each step produces a valid digit and reduces the magnitude of the quotient sufficiently for termination. The method ensures a unique representation for every integer without requiring a separate sign bit, as the alternating signs of the place values (βk\beta^k) naturally accommodate both positive and negative values. To perform the conversion, denote r=βr = |\beta|. Initialize an empty list to store the digits. While n0n \neq 0:
  • Compute the remainder rem=nmodβrem = n \mod \beta and quotient q=n/βq = \lfloor n / \beta \rfloor using the language's or system's modulo and division operations (which may yield a negative remainder if n<0n < 0).
  • If rem<0rem < 0, adjust it by adding rr to remrem and adding 1 to qq.
  • Append remrem to the list of digits (as the next least significant digit).
  • Update nn to qq.
The digits are collected from least to most significant, so reverse the list at the end to form the standard representation. For n=0n = 0, the representation is simply the digit 0. The following pseudocode illustrates the process (assuming integer division truncates towards zero, with adjustments for negative bases; adaptations may be needed for specific programming languages):

function toNegativeBase(n, beta): if n == 0: return [0] digits = [] while n != 0: rem = n % beta quotient = n // beta if rem < 0: rem -= beta # Equivalent to rem += |beta| since beta < 0 quotient += 1 digits.append(rem) n = quotient digits.reverse() return digits

function toNegativeBase(n, beta): if n == 0: return [0] digits = [] while n != 0: rem = n % beta quotient = n // beta if rem < 0: rem -= beta # Equivalent to rem += |beta| since beta < 0 quotient += 1 digits.append(rem) n = quotient digits.reverse() return digits

This algorithm terminates because each quotient satisfies q(n+r1)/r|q| \leq (|n| + r - 1)/r, and since r2r \geq 2, the absolute value of nn strictly decreases after finitely many steps until reaching zero. Uniqueness follows from the covering property: the digit set {0,1,,r1}\{0, 1, \dots, r-1\} ensures that every integer residue modulo rr is covered exactly once, and the negative base's powers generate all integers without gaps or overlaps in their finite expansions. For negative inputs, the process is symmetric due to the base's sign, producing a representation that evaluates to the negative value without an explicit minus sign; for example, converting 13-13 to base 10-10 yields digits 2,7 corresponding to the value 2(10)1+7(10)0=20+7=132 \cdot (-10)^1 + 7 \cdot (-10)^0 = -20 + 7 = -13.

Shortcut Methods for Specific Bases

For the negabinary system (base -2), efficient conversion from a two's complement binary representation to negabinary can be achieved using bitwise operations that adjust bit positions to account for alternating positive and negative powers of 2. One seminal method involves adding a mask consisting of 1s in the odd bit positions (e.g., binary ...10101010) to the input number, followed by an XOR operation with the same mask; this propagates carries to effectively convert powers of 2 at even positions to the corresponding negabinary values while flipping signs for odd positions. This approach, detailed in early computational hacks, enables single-pass conversion for fixed-width integers, such as 32-bit numbers using the mask 0xAAAAAAAA or 64-bit using 0xAAAAAAAAAAAAAAAA. An alternative hardware-oriented shortcut uses pattern recognition via selective bit complementation, starting from the least significant bit (LSB). For positive binary numbers, bits remain unchanged until a 1 appears at an odd position (0-based from LSB), after which all subsequent bits are complemented until a complemented 0 becomes 1 at an even position; the process repeats from the next bit. For negative numbers (in two's complement), the process starts similarly but triggers on a 1 at an even position, complementing until a 1 at an odd position. This method reduces conversion delay in VLSI implementations compared to ripple-carry alternatives, achieving operation at 50 MHz with lower power consumption. A simple iterative software method for negabinary conversion avoids complex division by extracting the least significant digit as the parity bit (num & 1) and updating the quotient as (num + (num & 1 ? 2 : 0)) // -2, ensuring integer arithmetic while adjusting for the negative base to keep remainders non-negative (0 or 1); this repeats until num reaches 0. These shortcuts offer computational advantages over general base-agnostic algorithms, particularly for fixed-width integers, by minimizing operations to O(1) per bit in hardware or logarithmic steps in software. For example, a bitwise method implementation in languages with fixed-width two's complement integers like C for 64-bit signed integers (assuming input fits in 64 bits) uses:

c

uint64_t mask = 0xAAAAAAAAAAAAAAAAULL; uint64_t adjusted = (n + mask) ^ mask;

uint64_t mask = 0xAAAAAAAAAAAAAAAAULL; uint64_t adjusted = (n + mask) ^ mask;

In Python, to simulate 64-bit two's complement:

python

def to_negabinary(n: int) -> str: if n == 0: return '0' width = 64 mask = (1 << width) // 3 * 2 # Equivalent to 0xAAAAAAAAAAAAAAAA n64 = n & ((1 << width) - 1) temp = (n64 + mask) % (1 << width) adjusted = temp ^ mask s = bin(adjusted)[2:] return s.lstrip('0') or '0'

def to_negabinary(n: int) -> str: if n == 0: return '0' width = 64 mask = (1 << width) // 3 * 2 # Equivalent to 0xAAAAAAAAAAAAAAAA n64 = n & ((1 << width) - 1) temp = (n64 + mask) % (1 << width) adjusted = temp ^ mask s = bin(adjusted)[2:] return s.lstrip('0') or '0'

For negaternary (base -4), which uses digits 0-3, a shortcut involves grouping pairs of negabinary digits—since (-2)^2 = 4—and mapping their values (ranging from -3 to 3) to standard non-negative digits with carry adjustments: values -3 and -2 map to 1 and 0 with a carry of -1 to the next group, while positive values map directly with no carry. This leverages an existing negabinary representation for efficiency in multi-base systems. For base -3 (digits 0-2), efficient conversion follows similar iterative division by -3, taking remainders adjusted to [0, 2] by adding 3 if negative and incrementing the quotient; no specialized bitwise shortcut exists beyond this rule, but it enables faster computation than arbitrary negative bases by limiting digit options.

Arithmetic Operations

Addition and Subtraction

Addition in negative base numeral systems follows a process analogous to standard positional addition, but adjusted for the negative radix β (where β < 0). Digits are added column by column from the least significant position, incorporating any incoming carry. The sum at each position is the digits plus the carry-in. To ensure the result digit remains in the valid range [0, |β| - 1], carries are propagated according to the base's sign: if the temporary sum s satisfies s ≥ |β|, subtract |β| and generate a carry of sign(β) (negative for negative bases); if s < 0, add |β| and generate a carry of opposite sign. For general β = -r (r > 1 ), the outgoing carry c_out = ( (s + carry_in) / r ) with sign adjustments, but carries alternate in sign due to the negative weights, often resulting in carries of -1 or +1 in practice for small r like 2. This ensures no negative digits appear. In negabinary (base β = -2), the algorithm simplifies due to digits limited to {0, 1}. Start from the rightmost digit with carry-in = 0. Compute s = a_i + b_i + c_in, where a_i, b_i ∈ {0, 1} and c_in ∈ {-1, 0, 1}. The result digit d_i and outgoing carry c_out are determined as follows:
  • If s = -1, then d_i = 1, c_out = 1 (since -1 = (-2) · 1 + 1).
  • If s = 0, then d_i = 0, c_out = 0.
  • If s = 1, then d_i = 1, c_out = 0.
  • If s = 2, then d_i = 0, c_out = -1 (since 2 = (-2) · (-1) + 0).
  • If s = 3, then d_i = 1, c_out = -1 (since 3 = (-2) · (-1) + 1).
This handling reflects the negative base, where a carry of -1 to the next position contributes positively due to multiplication by β = -2. The process continues until all digits and any final carry are processed, potentially extending the representation. The negabinary full adder can be implemented with a truth table accounting for the possible carries. Below is the truth table for inputs A, B (digits), C_in (carry-in), producing sum S and C_out (carry-out):
ABC_inSC_out
00-111
00000
00110
01-100
01010
0110-1
10-100
10010
1010-1
11-110
1100-1
1111-1
The sum S = A ⊕ B ⊕ (C_in + 1 mod 2) with adjustments for sign flips in carry logic, often realized using majority gates modified for negative propagation. Hardware implementations, such as those using binary logic with sign flips, enable efficient parallel addition. Example: Adding 6 + (-3) in negabinary.
The negabinary representation of 6 is 11010_{-2} (reading left to right as MSB to LSB: 1·16 + 1·(-8) + 0·4 + 1·(-2) + 0·1 = 6).
The representation of -3 is 1101_{-2} (1·(-8) + 1·4 + 0·(-2) + 1·1 = -3), padded to 01101_{-2} for alignment.
Aligning from LSB (right):

1 1 0 1 0 + 0 1 1 0 1 -----------

1 1 0 1 0 + 0 1 1 0 1 -----------

  • Position 0 (LSB): 0 + 1 + 0 = 1 → d_0 = 1, c = 0
  • Position 1: 1 + 0 + 0 = 1 → d_1 = 1, c = 0
  • Position 2: 0 + 1 + 0 = 1 → d_2 = 1, c = 0
  • Position 3: 1 + 1 + 0 = 2 → d_3 = 0, c = -1 (2 - 2 = 0, carry -1)
  • Position 4: 1 + 0 + (-1) = 0 → d_4 = 0, c = 0
Result: 00111_{-2} (or 111_{-2} after trimming leading zeros), which equals 1·4 + 1·(-2) + 1·1 = 3, as expected. Subtraction in negative bases is typically performed by computing the additive inverse of the subtrahend and then adding it to the minuend using the addition algorithm. The additive inverse of a number in negabinary (or general negative base) can be obtained using the standard conversion algorithm to represent the negated value; alternatively, a polarization operation reverses the sign by transforming the digit string via specific rules tailored to the base. This inverse is then added as described above. For negabinary, the polarization may involve complementing digits and propagating a carry to negate the value efficiently. A special case is incrementing (adding 1) in negabinary, which can propagate carries irregularly due to alternating positive and negative position weights. Starting from the LSB, adding 1 to a 1 produces 0 with carry -1 (since 1 + 1 = 2 = 0 + (-1)·(-2)). The carry -1 added to the next digit (weight -2) effectively adds +2, but if the next digit is 0, 0 + (-1) = -1 → 1 with carry +1 to the following position (weight +4), and so on. This zigzag propagation (negative carry becomes positive effect, then vice versa) can continue until a 0 is hit without further carry or extends the number, differing from the uniform ripple in positive bases. For example, incrementing {-2} (value 1) yields 110{-2} = 0·1 + 1·(-2) + 1·4 = -2 + 4 = 2. Such rules highlight the unique carry dynamics in negative bases.

Multiplication and Division

Multiplication in negative base numeral systems follows a shift-and-add approach analogous to positive bases, but adapted for the negative value of the base β, where β < 0. Each left shift by k positions multiplies the partial product by β^k, resulting in alternating signs due to the odd and even powers of the negative base. This can lead to sign flips in partial products, complicating the accumulation process as positive and negative contributions must be carefully added using the base's addition rules. For instance, in negabinary (base -2), the powers alternate between positive (even positions: (+1), (+4), (+16), ...) and negative (odd positions: (-2), (-8), (-32), ...), requiring adjustments during summation to handle carries that may propagate differently than in positive bases. A worked example in negabinary illustrates this: multiply 3 (represented as 111_{-2}) by 4 (100_{-2}). The multiplicand is 111_{-2}, and the multiplier 100_{-2} has a single '1' in the position corresponding to (-2)^2 = +4. Thus, the partial product is the multiplicand shifted left by 2 positions: 11100_{-2}. Evaluating 11100_{-2} = 1 \cdot (-2)^4 + 1 \cdot (-2)^3 + 1 \cdot (-2)^2 + 0 \cdot (-2)^1 + 0 \cdot (-2)^0 = 16 - 8 + 4 = 12_{10}, which is correct since 3 \times 4 = 12. The result 12 in negabinary is 11100_{-2}, confirming the computation. The alternating signs in the shifted terms (-8 from the second position) highlight the potential for sign flips that must be resolved during final addition. Booth's multiplication algorithm, originally designed for signed binary numbers, can be adapted for negative bases using non-negative digits (0 to |β|-1). The adaptation simplifies the recoding of the multiplier since digits are unsigned, reducing the number of partial additions compared to standard shift-and-add, though the negative base still introduces sign alternations in shifts. This is particularly useful for hardware implementations where minimizing additions improves efficiency. Division in negative bases employs long division with remainders constrained to be non-negative (0 ≤ r < |β|), similar to positive bases but with adjustments for the negative divisor. The quotient q is computed via repeated subtraction or estimation, ensuring the remainder satisfies the condition; if a negative remainder arises, it is incremented by |β| and the quotient decremented accordingly. A key formula for adjustment is q = \lfloor (n - r) / \beta \rfloor, where n is the dividend and r is chosen to keep 0 ≤ r < |β|, accounting for the floor function's behavior with negative β (towards negative infinity). This prevents invalid digits and maintains uniqueness. A divide-and-correct algorithm provides an efficient method for multiple-precision division: an initial quotient is estimated by dividing the dividend by the divisor (treating the base as positive for approximation), then corrected by adding or subtracting a factor based on the error, applicable to any negative base like -10. This approach is suitable for computational implementation, reducing iterations compared to naive long division. Challenges include handling the sign of partial remainders, which may require additional steps to ensure non-negative results without introducing negative digits.

Magnitude Comparison

To compare the magnitudes of two represented in the same negative base b=rb = -r (where r>1r > 1 is an ), align the representations by the shorter one with leading zeros to match the of the longer one. This ensures both numbers have the same number of digits, with place values starting from the least significant digit () as b0=1>0b^0 = 1 > 0, b1=b<0b^1 = b < 0, b2=b2>0b^2 = b^2 > 0, and so on, alternating signs with magnitudes increasing as rkr^k. Begin the comparison from the most significant digit (MSD, leftmost position). Proceed rightward until finding the first position where the digits differ. Let the place value at that position have sign s=(1)ks = (-1)^k (where kk is the power from the ). If the digit in the first number is larger than in the second and s>0s > 0, the first number is greater; if s<0s < 0, the first number is smaller. If all digits match, the numbers are equal. This method accounts for the alternating signs, as a larger digit in a positive place increases the value, while in a negative place it decreases it (making the number more negative). If the original representations have different lengths and the leading digits are nonzero, the longer representation's MSD position determines the initial difference after padding. For instance, in base 2-2, the sign of the highest power (2)n1(-2)^{n-1} is positive if nn (the length) is odd and negative if even. Thus, a longer odd-length number with a positive leading digit (>0) generally has larger magnitude than a shorter one, while an even-length longer number tends to have smaller magnitude, but the full digit-by-digit check confirms the order. Consider the example in base 2-2: compare 110102=1(2)4+1(2)3+0(2)2+1(2)1+0(2)0=1682=611010_{-2} = 1 \cdot (-2)^4 + 1 \cdot (-2)^3 + 0 \cdot (-2)^2 + 1 \cdot (-2)^1 + 0 \cdot (-2)^0 = 16 - 8 - 2 = 6 and 11102=1(2)3+1(2)2+1(2)1+0(2)0=8+42=61110_{-2} = 1 \cdot (-2)^3 + 1 \cdot (-2)^2 + 1 \cdot (-2)^1 + 0 \cdot (-2)^0 = -8 + 4 - 2 = -6. Pad the second to five digits: 01110201110_{-2}. The positions from left (powers 4 to 0: +16, -8, +4, -2, +1) are:
  • Position 4 (+16): 1 > 0, and positive place, so 110102>1110211010_{-2} > 1110_{-2} (i.e., 6 > -6).
A special case is identifying zero, which has the unique representation of all digits equal to 0, as any nonzero digit would contribute a nonzero value due to the strictly increasing magnitudes of place values despite alternating signs.

Fractional and Non-Integer Representations

Representing Fractions

In negative base systems, the radix point separates the integer part from the , with positions to the right of the radix point corresponding to successive negative powers of the base β (where β < 0 is an integer with |β| ≥ 2). The value of the is given by the sum k=1dkβk\sum_{k=1}^{\infty} d_k \beta^{-k}, where each digit dkd_k is an integer satisfying 0dk<β0 \leq d_k < |\beta|. Since β is negative, the powers βk\beta^{-k} alternate in sign, beginning with β1=1/β<0\beta^{-1} = 1/\beta < 0 for the first position after the radix point, followed by a positive value for β2\beta^{-2}, and so on. The conversion algorithm for representing a fraction ff (with 0f<10 \leq f < 1) in a negative base follows a process analogous to that for positive bases but accounts for the negative value of β. Start with the initial fractional value f0=ff_0 = f. For each step k=1,2,k = 1, 2, \dots, compute fk1βf_{k-1} \cdot \beta; the digit dkd_k is the non-negative integer part obtained by taking the remainder when dividing by |β| to ensure 0dk<β0 \leq d_k < |\beta|, and the next fractional value is fk=(fk1βdk)/βf_k = (f_{k-1} \cdot \beta - d_k) / \beta. Because multiplication by the negative base alternates the sign of the product, the integer part may temporarily be negative, requiring adjustment: if the floor of the product is negative, add |β| to the digit and subtract 1 from the quotient to keep the remainder non-negative and the process continuing with a fractional part in [0, 1). This repeated multiplication and digit extraction continues until the fractional part becomes zero (for terminating representations) or a repeating pattern emerges. The radix point is placed immediately after the integer digits, and the representation is read from left to right, with the base indicated by a subscript (e.g., 0.d1d2β0.d_1 d_2 \dots _\beta). For example, the fraction 1/31/3 in base -2 (negabinary, with digits 0 and 1) has the repeating representation 0.0120.\overline{01}_{-2}. This corresponds to the infinite sum 1(2)2+1(2)4+1(2)6+=14+116+164+\frac{1}{(-2)^2} + \frac{1}{(-2)^4} + \frac{1}{(-2)^6} + \cdots = \frac{1}{4} + \frac{1}{16} + \frac{1}{64} + \cdots, a geometric series with first term 1/41/4 and common ratio 1/41/4, summing to 1/411/4=1/43/4=1/3\frac{1/4}{1 - 1/4} = \frac{1/4}{3/4} = 1/3. Some fractions terminate in negative bases when the denominator (in lowest terms) divides a power of |β|, analogous to terminating decimals in base 10. For instance, in base -2, 1/4=1/22=0.0121/4 = 1/2^2 = 0.01_{-2}, since the second position contributes 1(2)2=1/41 \cdot (-2)^{-2} = 1/4 and all subsequent digits are zero. Other fractions, such as 1/31/3 above, exhibit repeating expansions due to the base's prime factors not fully dividing the denominator, similar to repeating decimals in positive bases but with the alternating sign pattern influencing the cycle length and form.

Non-Unique Representations

In negative base systems with integer base β<1\beta < -1 and standard digit set {0,1,,β1}\{0, 1, \dots, |\beta|-1\}, representations of integers are unique, but fractional parts can admit multiple expansions due to the alternating signs of the place values, which enable equivalent finite and infinite series similar to the duality in positive bases (e.g., 0.910=1100.\overline{9}_{10} = 1_{10}). This non-uniqueness arises because the negative powers βk\beta^{-k} for k1k \geq 1 form a geometric series with ratio 1/β<11/|\beta| < 1, allowing adjustments like borrowing or carrying across the radix point that equate different digit sequences. For instance, in base 2-2 (negabinary), the fraction 1/31/3 has at least two distinct representations: the repeating 0.012=k=1(2)2k=k=1(1/4)k=(1/4)/(11/4)=1/30.\overline{01}_{-2} = \sum_{k=1}^{\infty} (-2)^{-2k} = \sum_{k=1}^{\infty} (1/4)^k = (1/4)/(1 - 1/4) = 1/3 and the repeating 1.102=1+k=1(2)(2k1)=1k=1(1/2)2k1=1(1/2)/(11/4)=12/3=1/31.\overline{10}_{-2} = 1 + \sum_{k=1}^{\infty} (-2)^{-(2k-1)} = 1 - \sum_{k=1}^{\infty} (1/2)^{2k-1} = 1 - (1/2)/(1 - 1/4) = 1 - 2/3 = 1/3. Such dualities occur for rationals whose denominators divide some power of β|\beta|, leading to terminating or periodic expansions that can be rewritten equivalently. To resolve ambiguities, canonical forms are employed, often via the greedy algorithm, which selects the largest admissible digit at each position to produce the lexicographically largest expansion, or the lazy algorithm for the minimal one; these extremal representations stem from transformations of positive base-β2\beta^2 expansions and ensure uniqueness within admissible digit strings. This connects to broader beta-numeration theory, where for negative bases β-\beta with β>1\beta > 1, overlapping representation intervals cause non-uniqueness, but specific digit restrictions or base choices (e.g., Pisot numbers) can yield unique expansions for almost all reals. These multiple representations impact computational precision, as arithmetic operations may propagate different errors depending on the chosen form, necessitating standardized selections in applications like or error-correcting codes using negative bases. For β>1|\beta| > 1 , the uniqueness theorem holds strictly for but extends to fractions only under additional constraints like finite expansions or forbidden digit patterns.

Advanced and Theoretical Aspects

Complex and Imaginary Bases

Complex bases generalize negative base systems to the complex domain, where the radix is a , enabling positional representations of Gaussian integers ( with integer real and imaginary parts) using finite digit sets. Imaginary bases, specifically those that are purely imaginary such as i=eiπ/2i = e^{i\pi/2} or the negative imaginary i-i, allow encoding both real and imaginary components without separate sign indicators, leveraging the rotational properties of powers of the base. These systems typically employ digits from the set {0, 1} to cover all Gaussian integers, though uniqueness depends on the base's magnitude. In the case of base i-i, the place values follow the formula k=0dk(i)k\sum_{k=0}^{\infty} d_k (-i)^k, where dk{0,1}d_k \in \{0, 1\}. The powers cycle every four positions: (i)0=1(-i)^0 = 1, (i)1=i(-i)^1 = -i, (i)2=1(-i)^2 = -1, (i)3=i(-i)^3 = i, and then repeat, producing a phased alternation of signs for real and imaginary contributions that differs from the strict positive-negative oscillation in real negative bases. This cyclical structure interleaves real parts in even-powered positions (with signs +, -, +, -...) and imaginary parts in odd-powered positions (with signs -, +, -, +...), facilitating compact representations of complex numbers. While the base magnitude i=1|-i| = 1 ensures every Gaussian integer can be expressed, representations are generally not unique due to periodic relations like (i)4=1(-i)^4 = 1. For contrast, bases with magnitude greater than 1, such as the complex 1+i-1 + i (where 1+i=2|-1 + i| = \sqrt{2}
Add your contribution
Related Hubs
User Avatar
No comments yet.