Abstract
In this paper, we discuss canonical number systems (CNSs), which are generalizations of positional number systems to polynomials over the integers. We defined the information quantity of a polynomial relative to the base of the CNS and proved that it has a strong relation with the length of the representation in the number system. Based on this result, we showed that for every CNS polynomial P, there exists a finite transducer automaton executing the addition operation of polynomials in canonical representation of base P. Finally, we observed the size—i.e., the number of states—of such automata.
1. Introduction
In their first appearance, canonical number systems (CNSs) were natural generalizations of the positional numeral systems of rational integers to algebraic integers. D. E. Knuth, in his famous book [1] (Ch. 4), studied the history of the radix representation of integers. He described various canonical number systems, and he proved that the complex number is a possible base of the number system representing Gaussian integers. His result was further generalized by I. Kátai and J. Szabó. In [2], they proved the existence of other bases, but still in the set of Gaussian integers. Later, I. Kátai and B. Kovács in [3], B. Kovács in [4], and B. Kovács and A. Pethő in [5] and [6] extended the concept of canonical number systems for the ring of algebraic integers and they proved their existence in some particular cases. In [7], A. Pethő first used the notion, and S. Akiyama and A. Pethő in [8] continued the development of results of CNSs over polynomials. A. Pethő and P. Varga in [9] dealt with canonical number systems over Euclidean domains.
In [4], a simple condition is given for the construction of CNSs, but in general, they are not easy to find. A. Kovács [10] presented a complete description of binary canonical number systems of degrees not greater than 8. Later, P. Burcsi and A. Kovács [11] extended the results for CNSs of degrees 9, 10, and 11.
The arithmetic in a canonical number system is similar to that of rational integers within the classical digit representation. However, calculating the digits requires a more complex reduction operation.
P. J. Grabner, P. Kirschenhofer, and H. Prodinger in [12] introduced the concept of counting automata (increasing by 1) for Gaussian integers, which was generalized to quadratic number fields by J. M. Thuswardner [13]. J. Allouche, K. Scheicher, and R. F. Tichy in [14] proved the existence of addition and multiplication by a constant in algebraic number fields. K. Scheicher and J. M. Thuswaldner in [15] introduced a fractal approach for the detailed analysis of counting automata.
Transducers were extensively studied by S. Eilenberg in Automata, Languages and Machines [16], and further developed by W. Kuich and A. Salomaa in Semirings, Automata, Languages [17].
In the present paper, we prove that for every CNS polynomial, an automaton can be constructed to perform digit-wise addition (Theorem 5). This relies on several assertions, which are detailed in Section 2. We implement a program for the calculation of addition automata in binary CNSs and summarize our experiments in Section 4.
The rest of the paper is organized as follows.
In Section 2, we introduce the concepts and key results related to canonical number systems. We also define a useful measure for the information quantity of a polynomial and outline its fundamental properties. One of the main results of the section is Theorem 3, which establishes a general bound on geometric sums of complex numbers with modulus greater than 1, under the condition that is not a positive real number. The proof of this statement requires some further lemmas concerning the behavior of geometric sums, which we address in the subsequent paragraphs. Using these lemmas, we present an algorithm, which is designed to calculate a reasonably small constant appearing in Theorem 3. In the last part of the section, we prove Theorem 4, which discusses the relationship between the length of a polynomial A in canonical representation and the information quantity of A. The constants referenced in this theorem are derived using Theorem 3, and thus can be calculated by an algorithm explained after the theorem.
In Section 3, we define the concept of finite transducer automata. In Theorem 5, we show that for every canonical number system, there exists a transducer automaton executing the addition operation for polynomials in canonical representation. The proof is constructive, and the automaton produced is minimal (Theorem 6). Using arguments from the previous results, in Theorem 7, we show that there is no finite transducer automaton capable of performing multiplication in canonical number systems.
In the final section, we present our experimental results regarding the construction of minimal addition automata in particular canonical number systems.
2. Definitions and Results Related to Canonical Number Systems
Definition 1.
Let be a monic polynomial, be the corresponding quotient ring, and let be the homomorphism . Furthermore, let , , and let be the set of polynomials with all coefficients from . The pair is called a number system, if for any there exists a unique , such that .
The number system is called canonical, and is called a CNS polynomial if .
The length of the representation of A by P is .
Example 1.
Let us consider the number system corresponding to the base-3 system.
The base-3 numeration system is, in fact, isomorphic to the polynomial system based on since the unique root of is 3. In other words, the isomorphism arises because when we substitute into any polynomial, we recover the standard evaluation in base-3.
Let us illustrate this with the constant 16 as an example:
- (a)
- In the classical base-3 system, the representation of is obtained by dividing 16 by 3 repeatedly:
- 1.
- with remainder units digit is 1.
- 2.
- with remainder next digit is 2.
- 3.
- with remainder highest digit is 1.
So we obtain the digits , i.e., . - (b)
- In the polynomial system with base , we essentially perform the same ’division with remainder’ process, but in the context of polynomials. Here, the constant 16 must be represented by a polynomial (with ) such that .Analogously to the integer numeration system, we repeatedly divide 16 by .
- 1.
- To find the last digit, we execute the ’integer’ division . Actually, we solve the equation , where . The only solution is , and . Hence, the last digit is 1, and we should represent in the system.
- 2.
- For the second digit, we solve , with . The only solution is , , and .
- 3.
- Finally, we should solve , with . The only solution is , , and . Since , thus there is no more carry in the computation, so the algorithm terminates.
Thus, the polynomial representation of 16 is , exactly as in the classical base-3 system.
Remark 1.
Note that the system in Example 1 is not a number system in the general sense of Definition 2 since negative integers cannot be represented.
Example 2.
Now, consider the base system () number, which corresponds to the polynomial . This system has the same digits , just like the base-3 system. We may observe that in the system with base , we can represent all integers, both negative and non-negative.
Express 16 once more in this numeration system:
- (a)
- Again, we execute repeated division by :
- 1.
- with remainder units digit is 1.
- 2.
- with remainder next digit is 1.
- 3.
- with remainder highest digit is 2.
So we obtain the digits , i.e., . - (b)
- In the polynomial system with base , we execute similar steps to those in the previous example. Here, the constant 16 must be represented by a polynomial (with ) such that .
- 1.
- To find the last digit, we solve the equation , where . The only solution is , and . Hence, the last digit is 1, and we should represent in the system.
- 2.
- For the second digit, we solve , with . The only solution is , , and .
- 3.
- Finally, we should solve , with . The only solution is , , and . Since , thus there is no more carry in the computation, so the algorithm terminates.
Thus, the polynomial representation of is .
Remark 2.
The system in Example 2 is indeed a valid number system since it can represent both positive and negative integers. For instance, .
Remark 3.
If is a number system, then the reduced homomorphism is an isomorphism.
B. Kovács in [4] proved that if the coefficients of P are increasing, then there exists a corresponding canonical number system. We reformulate it in the following theorem.
Theorem 1.
Let be a monic polynomial with , and be such that with . If P is not divisible by a cyclotomic polynomial, then P is a CNS polynomial.
Example 3.
Let and let α be one of its roots. By Theorem 1, is a canonical number system. The corresponding numeration system of has the base α, with digits . This polynomial defines a number system over the algebraic integers, extending the idea of canonical number systems to the algebraic integers .
Now, we consider the only case when calculating the digits in the polynomial number system. Again, we want to express 16 in this system.
- 1.
- To find the last digit, we solve the equation , where . The only solution is , , and . Hence, the last digit is 1, and we should represent in the system.
- 2.
- For the second digit, we solve , with . The only solution is , , and .
- 3.
- Next, we should solve , with . The only solution is , , and . This yields that the next digit is 0.
- 4.
- Now, we should solve , with . The only solution is , , and . Hence, the next digit is again 0.
- 5.
- Then, we solve , with . The only solution is , , and . The next digit is again 0.
- 6.
- In the next step we solve , with . The only solution is , , and . The next digit is 2.
- 7.
- Now, we solve , with . The only solution is , , and . The next digit is 1.
- 8.
- Finally, we should solve , with . The only solution is , , and . Hence, the first digit is again 1, and the algorithm terminates.
The iterations of the algorithm are displayed in Table 1. Column N refers to the remaining value we should represent in the system, while q, s, and r are as in the description.
Table 1.
Steps for decomposing the number 16 in the number system .
We obtain that the representation of 16 in the number system is . Similarly, as before, if we set , then .
The above example illustrates how numbers in this algebraic number system can be expressed as polynomials, extending the classical notion of number systems into the realm of algebraic integers.
A. Pethő in [7] and later Akiyama et al. [18] have stated a necessary condition for CNS polynomials.
Theorem 2.
If is a CNS polynomial, then all roots of lie outside the closed unit circle and all real roots of are less than .
Now, we define the information quantity of a polynomial. Later, at the end of this section, we will show the relation between the information quantity and the length of the canonical representation of a polynomial in Theorem 4. In Section 3, we will use this definition in Theorem 5 for the proof of the existence of addition automata in canonical number systems.
Definition 2.
Let be a CNS polynomial of degree d, be the (not necessarily different) roots of P, and let . We define the relative information quantity of A as
In the special case of A is divisible by P, we set .
Example 4.
Let . In the paper of A. Kovács [10], it is proven that P is a CNS polynomial. The roots of P are
where I is the imaginary unit. The modulus of the roots are identical and equal to . Based on the properties of the logarithm, any base of the logarithm provides the same value for the relative information quantity; thus, for the sake of simplicity, let log be the base-2 logarithm. Then, (and the same is true for all the roots).
- (a)
- Let . Substituting the four roots to A and calculating the base-2 logarithm of the absolute value of , according to the order of the roots, we obtain the approximate valuesThen, we obtain
- (b)
- Let . As before, execute the same operations. We obtain the logarithms of the absolute values of the substituted roots aswhence
- (c)
- Let . Then, one can see that for , we obtain get exactly the same value as in case (b).
The equality of case (b) and (c) can be seen if we notice that if α is one of the roots of P, then , whence in case (b), , while in case (c) .
Lemma 1.
Let be a CNS polynomial and . Then,
- (i)
- ;
- (ii)
- If , then ;
- (iii)
- ;
- (iv)
- ;
- (v)
- ;
- (vi)
- .
Proof.
(i) Let be an irreducible divisor of P of degree , and for the sake of simplicity, assume that are the roots of . Assume that A is not divisible by .
Since P is a CNS polynomial, by Theorem 2, for any root of P and hence for any root of as well.
is irreducible and does not divide A, thus the roots of are not roots of A, whence for all .
By definition , consequently, , whence are algebraic integers. Since , the values are algebraic integers as well.
The roots form a complete set of algebraic conjugates over , which means that the set is also a complete set of algebraic conjugates over with each value appearing in the same number. This implies that
The product of algebraic integers is an algebraic integer, hence, together with Equation (1),
is a rational integer. If for all , then
which is a contradiction, whence at least one of the roots of is such that .
For this , we have
whence by definition .
(ii) If , then , i.e., with some . This yields that for any root of P, which implies .
(iii) Let be a root of P. In the general case, when we do not assume that , we cannot state . For the sake of simplicity, assume that . Then, , which implies the statement.
(iv)–(vi) These statements can be proven by similar arguments using the additive property of the logarithm.
□
Theorem 3.
Let with , and assume that α is not a positive real number. Then, there exists a constant depending only on α such that for every , and for any sequence of integers satisfying for all , we have
for any .
Remark 4.
In Theorem 3, we assume that , thus a natural lower bound on c can be obtained from inequality (2) if we set . Then, we have
which implies
To present this lower bound in a more expressive form, we multiply the left-hand side by . Then, we obtain
Since α is not a positive real number, thus , whence the left-hand side of inequality (3) is a product of two positive numbers both less than 1. This means that there is an infimum of the possible values of c.
The proof of Theorem 3 is presented later in this section, and based on the proof, we will construct an algorithm to find a proper c close to the above-mentioned infimum.
Remark 5.
We consider three cases illustrating inequality (2).
- (i)
- (This case is excluded from Theorem 3)If α is a positive real number, thenwhere the last term of the right side approximates 0 as k increases and hence,for any , if k is big enough. If , then inequality (2) cannot hold for suitably large k’s.
- (ii)
- In the opposite extremal case, when α is a negative real number, the left-hand side of inequality (2) is maximal if we sum up the members with the same sign only.To estimate this maximum, set , and let (i.e., , if k is odd and , if k is even). Furthermore, denote by the integer part of x and set .Because of the alternating sign of the powers of α, we have
- (iii)
- For the third case, when α is a nonreal complex number, we need some geometric considerations. In Figure 1, we can see an example of the first four powers of a particular complex number. Since , the modulus of the powers of α are increasing, and the arguments of the powers are integer multiples of the argument of α (denoted by ).Figure 1. Powers of a complex number.If , then the sequence is periodic, otherwise, it is uniformly distributed in the interval and if then . It also implies that in the nonperiodic case, only if ; in other words, if and only if .For the proof of Theorem 3, we study first the maximum of the left-hand side of inequality (2).One immediate thing we find is that if the left-hand side is maximal, then the coefficient of the largest power in the sum cannot be 0, and if a coefficient is nonzero, then it should be N (i.e., maximal itself). The latter means that to prove the general statement, it is enough to deal with geometric sums with coefficients and multiply this by N at the end.We may geometrically depict the theorem as in Figure 2. Then, the statement can be interpreted as with some constant , depending only on α.Figure 2. Sum of powers.We will also use the observation that if we denote by and the maximum of and , respectively, then .Finally, the following property plays the most important role in proving the existence of the above-mentioned constant . Assume we have an arbitrary finite set of nonzero complex numbers . Let , such that is maximal, and let . Let e be the line with normal vector μ, i.e., . Then, B consist of those elements of A that lie on the same side of e as μ, i.e., if and only if . (see Figure 3. In the figure, μ is the sum of the complex numbers represented by solid lines.)Figure 3. Maximum of subsum. (1) is the sum of numbers (vectors) with solid lines. (2) e is perpendicular to .
Before we turn to the proof of Theorem 3, we prove some lemmas, according to our observations of case (iii) of Remark 5.
First, we show that if we want to have a maximal value of the left-hand side of inequality (2), then the most significant power of cannot vanish.
Lemma 2.
Let , with , , let be fixed integers, and
If
then .
Proof.
Contrary, if , then
which is a contradiction. □
In the next lemma and the following corollary, we prove that if and denote the possible maximum of the modulus of different length geometric sums, then is nearly proportional to . In Lemma 2, we show this property when , and in Corollary 1, we extend it for values greater than n.
Lemma 3.
Let , with , , be integers, and
Then, .
Proof.
Let be integers, with
Then,
□
Corollary 1.
With the notations of Lemma 2, let , with , where , and are integers. Then
Proof.
Assume first that . Then, by Lemma 3,
Now, let . If , then by Lemma 3,
If , then the proof is similar but even simpler. □
In Lemma 4, we show that the left-hand side of inequality (2) is maximal if the nonvanishing coefficients are maximal.
Lemma 4.
Let , with , , let be integers, and
If , then .
Proof.
Let be such that , and . Since , thus . Denote by the complex conjugate of x. Then,
whence
which implies
Assume that . By the maximality of M, . Conversely, , which is a contradiction. □
We may summarize the previous results in the following corollary.
Corollary 2.
With the notations of Lemma 2, there exist such that
where .
Now, we turn to the proof of our last observation of case (iii) of Remark 5. Namely, if the left-hand side of inequality (2) is maximal, then the coefficient of the power in this maximal modulus sum is nonvanishing if and only if and lie on the same side of the normal line e of . This property can be expressed by the relation .
If we would like to represent this geometric property algebraically, we should observe that if and are nonzero complex numbers, then if and only if , or with another expression, . Here, is the real part of .
Lemma 5.
Let , with , , and
Furthermore, let the coefficients be chosen such that
Then, if and only if .
Proof.
Assume first, that . Then, , whence by (4),
Now, let . Since can only be either 0 or 1, this means that . Then, , whence , and
□
Remark 6.
By the proof of Lemma 5, there is no for which . In other words, if μ is the maximal modulus subsum, then there is no power of α, which is perpendicular to μ.
Let such that . The two numbers determine two complementary sectors of the complex plane between and , and counterwise (see Figure 4).
Figure 4.
Sectors of the complex plane.
Corollary 3 states that if the left-hand side of inequality (2) is the maximal modulus sum , then there exist two different powers and such that all powers which are included in lie in the same sector defined by and , while the powers which are not included in lie in the other sector.
Corollary 3.
With the notations of Lemma 2, let such that
and denote by be the imaginary part of . Then, there exist such that if and only if and , for all .
Proof.
Let ⪯ be the binary relation on , where if and only if . According to the notation of Figure 4, this means that if and only if y lies in the sector . Then, for any , the relation ⪯ is transitive on the set
Let . Clearly, if and only if . Since is a finite set, by the transitivity property, there exists not necessarily unique such that for all . If , then , and either or . □
Now, we have collected everything necessary to prove Theorem 3.
Proof of Theorem 3.
Let be a sufficiently large integer, and according to the notation of Lemma 2, let
Let
Since is not a positive real number, by Lemma 5, at least for one i, the coefficient , whence . By Corollary 1,
□
The following corollary is an asymptotic extension of Theorem 3.
Corollary 4.
Let with , and assume that α is not a positive real number. Let and
for all . Then, there exists depending only on α such that
Proof.
By Theorem 3,
for all with some depending only on . By Lemma 3, . Hence, the sequence is an increasing bounded sequence, which implies the corollary. □
As is explained in Remark 4, there is an exact lower bound on the possible values of the constant c in Theorem 3. Based on the previous results, we can construct a fast algorithm to find a good approximation of the value of this constant. First, we slightly modify the definition of the relation introduced in the proof of Corollary 1.
Definition 3.
Let ⪯ be the binary relation on , where if and only if either with some or .
Remark 7.
If , then means that either or . If , then .
Remark 8.
This ⪯ is a total ordering on any open half-plane (the boundary line is excluded from the plane).
Choose a sufficiently large n and let
Sort and by ⪯ and glue them at both ends. Then, we obtain a cyclically sorted set of , where the next of is . The property that is sorted means that for a given the is such that is the smallest possible, i.e., the ’s are in increasing order by their argument. (If they have the same argument, then they are sorted by their modulus.)
If we want to have better constants, then we have to find an n such that is as small as it is possible.
To find c, we can use Algorithm 1 with operations on complex numbers.
The idea of the algorithm is the following:
- (1)
- In the outer while loop for a given i, we compute the sum of the consecutive ’s which are contained in the open half-plane started from . Let us denote this subsum by . By Lemma 5, the maximal modulus subsum of the set of ’s will be one of .
- (2)
- In the inner while loop, we rotate the half plane, and compute from by accumulating new ’s at the end and eliminating from the front.
| Algorithm 1: Calculating a proper constant c of Theorem 3 |
![]() |
In the following theorem, we prove a relation between the relative information quantity described in Definition 2 and the length of a polynomial in a CNS representation explained in Definition 1. For the calculations of the constants , we use estimates on geometric sums of complex numbers, where Theorem 3 plays an important role. Theorem 4 will be used in Section 3 for the proof of the existence of an addition automaton in a canonical number system.
Theorem 4.
Let be a CNS polynomial. Then, there exist effectively computable constants such that
holds for every .
Proof.
The proof is based on the idea of [6]. The new theorem is a more generalized form of the previous result, and its proof introduces a refined method for calculating the constants and . This refinement allows for more precise constants compared to earlier approaches.
Specifically, we have extended the theorem by B. Kovács and A. Pethő, offering a new method for calculating these constants with greater accuracy. The key contribution of this work is the development of an improved algorithm for determining and , leading to more exact results in the context of canonical number systems.
Let be a CNS, with and with canonical representation
where . Then, , which means . Assume that is a root of . Then, by Theorem 3,
where depends only on .
By Theorem 2, validates the last inequality and makes it possible to take the logarithm of both sides. Then, we obtain
Again by Theorem 2, we may have
which can be effectively bounded from below by some :
For the proof of the second inequality, set , which denotes the upper integer part of , and let , where and . Assume that is a root of P. Then,
The fraction can be bounded by an effectively computable constant depending only on P, and by the definition of k, . Hence, where c is a constant depending only on P. Since there exist only finitely many polynomials with satisfying and these polynomials are effectively computable, we can determine
Let . Then
□
3. Automata and Canonical Number Systems
As we have seen before, adding and multiplying by a constant are implementable with automata in CNSs. In this section, we prove that an automaton exists that executes the digit-wise addition. The existence of such an automaton is not obvious since the length of the sum of two algebraic integers represented in the canonical number system may have a shorter length than the summands’.
Definition 4.
The 6-tuple is called a finite transducer automaton with k input tape if
- ;
- S is a finite, non-empty set of states;
- X is a finite set of at least two elements (the input alphabet);
- Y is a finite set of at least two elements (the output alphabet);
- is the initial state;
- is a unique mapping.
Remark 9.
We follow the convention for extending the transducer automaton to operate on words of the input alphabet and having the result as a word of the output alphabet.
In the following, if is a finite word, then we will use the notation for the corresponding polynomial.
Theorem 5.
Let be a CNS. Then, there exists a finite transducer automaton with two input tapes, such that for all if .
Remark 10.
In Theorem 5, we assume that the length of the words are equal. If not, we extend them with the necessary amount of 0s on the right.
Remark 11.
In [19], there is a similar result, but the proof there is not constructive. Furthermore, based on our proof, we can state the minimality of our construction, as it is done in Theorem 6.
Proof of Theorem 5.
We prove the statement by constructing the addition automaton , where . We will define and in an appropriate way, and we will prove that S is finite. Assume that .
Let S be the smallest set such that
- ;
- if , , , and such that then .
We define the transition function by , if .
Let , , and . If , let be defined by , and . By the definition of , we have
for all .
Let and . Then, , , and .
Hence, by Theorem 4, and by Lemma 1(iii),
where is the constant in Theorem 4.
This yields that
Since S is defined to be the smallest set satisfying (1) and (2), every may appear as the last carry . Thus, for all , , which implies that S is finite. □
Remark 12.
Observe now the properties of the states defined in the proof of Theorem 5. Let , where and . Assume that the automaton is in state A, and there are no more digits arriving from the input. Then, by the definition of the transition function δ, the output of the automaton starting from this state is the sequence . This means that different states represent different tail releases of the output, i.e., if the automaton is state , then the output without input is different to .
Theorem 6.
The addition automaton, constructed in the proof of Theorem 5, is minimal.
Proof.
In the definition of in the proof of the previous theorem, S is the smallest possible set satisfying the given properties. This means that for any , there exist proper inputs such that terminates in state A.
Let and , are such that terminates in state for all .
Assume that there exists an automaton , which executes the same addition as , but , i.e., has strictly fewer states. Then, by the pigeonhole principle, there exist such that and terminates in the same states. By Remark 12, automaton continues with different tail releases from the states and , but continues in the same way if there are no more input digits. This is a contradiction because we assumed that and execute the same operation. Hence, the assumption of the existence of is wrong. □
Although we can not be sure there is no linear time algorithm for multiplication, we have the following.
Theorem 7.
Let be a CNS. Then, there are no finite transducer automaton S with two input tapes, such that for all if .
Proof.
On the contrary, assume that executes the multiplication, and .
Let satisfying . Then by Lemma 1(vi), and by Theorem 4,
Set , and for all . (If , then .) Since the automaton executes the multiplication, there exist such that , and , for all .
If , then , and is determined purely by . Since , there are infinitely many different , whence there are infinitely many different corresponding states. However, this is a contradiction since we assumed that is a finite automaton. □
4. Estimation of the Number of States of an Addition Automaton
In this section, we show an example of how to execute addition and how to construct the addition automaton based on the addition algorithm in a given polynomial CNS. We also provide the result of an experiment where we determined the addition automata for different CNSs.
4.1. Example of the Computation in the Number System
Let be the base polynomial and is the digit set. By Theorem 1, we know that this is a CNS.
Let and be 6-bit long binary ‘numbers’ in the above CNS, and let . The calculation of the digits of is similar to the usual binary arithmetic, but the carry propagation is a bit more advanced. In the classical binary system, we use the fact that (i.e., we use the polynomial as the base). In the present system, according to this observation, .
The addition process works as follows:
- InitializationThe two numbers, and , are digit-wise added without any further computations. The result is .
- ReductionStarting from the least significant digit on the right, we reduce the augmented digits, which are not in the digit set . In this CNS, this is the only value 2. However, as in the classical binary systems, we have to take into account the possible carries, arriving from lower digits. How can we calculate this carry?In the case of the last digit, we assume that there is no carry; more precisely, the value of the carry is 0. To eliminate the last digit 2, we should subtract . The result is , which is split into two parts: the calculated digit at the given position and the carry for the next position. In our case, the digit is 0, while the carry is .For the next digit, we add the carry arriving from the right to the value given at the position: . Since 0 is a valid digit, we do not need any further operation at this position. The carry for the next position is .The next augmented digit is 2. Adding the carry, we obtain , so the next calculated digit is 1, and the carry is 0.We continue the iteration until is completely processed and the carry becomes 0.
The algorithm described above can be visualized by Table 2.
Table 2.
Computation in the binary number system.
Based on the algorithm for calculating the sum, we may construct the corresponding addition automaton. The states of the automaton are the possible carries during the computation. We start from the carry 0 and calculate the transition according to the possible inputs (augmented digit). The value of the transition is a pair , where is the next carry and d is the output digit. The new carries are added to the automaton, and until we have unexplained transitions, we continue the construction of the automaton.
The process generates the transition function of the automaton, as illustrated in Table 3.
Table 3.
State transition table.
The values of the cells in the table contain pairs: the next state (carry) and the output (digit), according to the present state (carry) and the input (augmented digit). If a new unexplored carry appears in the transition value, then a new column is added to the table. We continue to fill out the table until no new carry appears. By Theorem 5, the algorithm will terminate in finitely many steps.
4.2. Analysis of Binary Polynomial CNS’s
As we have observed before, the states of the addition automaton may represent the possible carries. According to construction, these are polynomials in . Since the degrees of the state polynomials are bounded by the constant of Theorem 4, we may state the following simple result.
Theorem 8.
Let be a CNS, and be the minimal automaton implementing the addition. Then, the number of states of is bounded by .
We have made an experiment on the construction of addition automata for different CNS polynomials. We determined and counted the number of states for binary Kovács-type CNS polynomials of different degrees. (i.e., the coefficients of P have the property .) A. Kovács in [10] listed the canonical polynomials of binary number systems until degree 8. According to this result, we know, for instance, that the only binary CNS polynomials of degree 3 satisfying the conditions of Theorem 1, are , and . Using the construction of the proof of Theorem 5, we implemented a computer program to calculate the addition automaton for a given CNS polynomial. We determined all different CNS polynomials of degrees from 3 to 10 in the form given in Theorem 1, and constructed the corresponding addition automaton. We collected the size of these automata, which are expressed by the number of states. The results are summarized in Table 4. The table contains the size (number of states) of the smallest and largest automata for different degree CNS polynomials.
Table 4.
Number of states of addition automata.
As we advanced to higher degree CNS polynomials, the experiment ran into memory limitations. When we computed the transition function of the automaton in question, we had to store the states and the effect of the input digits. To save some space, we did not care about the output, and we just represented the state transitions. Since the number of states was increasing exponentially with the degree of the CNS polynomials, even for degree 10, we ran out of memory during the tests. The experiment was executed on a computer with an Intel Core i9-9900K CPU on 3.60GHz equipped with 64 GB of RAM. The running time did not limit the computation since it took only some hours.
5. Conclusions
The presented research demonstrates the feasibility of constructing finite transducer automata for digit-wise addition of polynomials in canonical number systems (Theorem 5). The constructive proof provided also establishes that the resulting automata are minimal (Theorem 6). The proof of Theorem 5 is based on the relation between the length of a polynomial A in canonical representation and the information quantity of A (Theorem 4), as well as on the additive property of the information quantity (Lemma 1(iii)). For practical applications, it is reasonable to compute the constants appearing in Theorem 4 with a reasonably good approximation of the possible minimum values. To achieve this, we developed Algorithm 1, which is based on an improved upper bound for geometric sums (Theorem 3).
The study also exposed a fundamental limitation: as is proven in Theorem 7, no finite transducer automaton can be created for the multiplication of polynomials in canonical representation. At present, we do not know whether an algorithm exists that can execute the multiplication of n digit numbers (or analogously degree n polynomials) in time; however, based on the above result, we cannot do this with constant memory usage.
Author Contributions
The authors T.H. and V.P. equally contributed to every component of the research, writing, reviewing and management of the manuscript. All authors have read and agreed to the published version of the manuscript.
Funding
This research was partially supported by the project TKP2021-NKTA of the University of Debrecen, Hungary. Project no. TKP2021-NKTA-34 has been implemented with the support provided by the Ministry of Culture and Innovation of Hungary from the National Research, Development and Innovation Fund, financed under the TKP2021-NKTA funding scheme. The APC was funded by the University of Debrecen.
Data Availability Statement
There were no new data created, and there were no particular data used during the research.
Conflicts of Interest
The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.
References
- Knuth, D.E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms; Addison-Wesley: Boston, MA, USA, 1981. [Google Scholar]
- Kátai, I.; Szabó, J. Canonical number-systems for complex integers. Acta Sci. Math. 1975, 37, 255–260. [Google Scholar]
- Kátai, I.; Kovács, B. Canonical number systems in algebraic number fields. Acta Math. Hung. 1981, 37, 159–164. [Google Scholar] [CrossRef] [Scilit]
- Kovács, B. Integral domains with canonical number systems. Publ. Math. 1989, 36, 153–156. [Google Scholar] [CrossRef] [Scilit]
- Kovács, B.; Pethő, A. Number systems in integral domains, especially in orders of algebraic number fields. Acta Sci. Math. 1991, 55, 287–299. [Google Scholar]
- Kovács, B.; Pethő, A. On a representation of algebraic integers. Stud. Sci. Math. Hung. 1992, 27, 169–172. [Google Scholar]
- Pethő, A. On a polynomial transformation and its application to the construction of a public key cryptosystem. In Computational Number Theory: Proceedings of the Colloquium on Computational Number Theory held at Kossuth Lajos University, Debrecen, Hungary, 4–9 September 1989; Pethő, A., Pohst, M.E., Williams, H.C., Zimmer, H.G., Eds.; De Gruyter: Berlin, Germany; New York, NY, USA, 1991; pp. 31–44. [Google Scholar]
- Akiyama, S.; Pethő, A. On a canonical number systems. Theor. Comput. Sci. 2002, 270, 921–933. [Google Scholar] [CrossRef] [Scilit]
- Pethő, A.; Varga, P. Canonical number systems over imaginary quadratic Euclidean domains. Colloq. Math. 2016, 146, 1–22. [Google Scholar] [CrossRef] [Scilit]
- Kovács, A. Generalized binary number systems. Ann. Univ. Sci. Budapest, Sect. Comp 2001, 20, 195–206. [Google Scholar]
- Burcsi, P.; Kovács, A. Exhaustive search methods for CNS polynomials. Monatshefte Math. 2008, 155, 421–430. [Google Scholar] [CrossRef] [Scilit]
- Grabner, P.J.; Kirschenhofer, P.; Prodinger, H. The sum-of-digits function for complex bases. J. Lond. Math. Soc. 1998, 57, 20–40. [Google Scholar] [CrossRef] [Scilit]
- Thuswaldner, J.M. Elementary properties of the sum of digits function in quadratic number fields. In Applications of Fibonacci Numbers; Et Al Bergum, G.E., Ed.; Kluwer Academic Publisher: Alphen aan den Rijn, The Netherlands, 1998; Volume 7, pp. 405–414. [Google Scholar]
- Allouche, J.; Scheicher, K.; Tichy, R.F. Regular Maps in Generalized Number Systems. Math. Slovaca 2000, 50, 41–58. [Google Scholar]
- Scheicher, K.; Thuswaldner, J.M. Canonical Number Systems, Counting Automata Furthermore, Fractals. Math. Proc. Camb. Philos. Soc. 2007, 133, 163–182. [Google Scholar] [CrossRef] [Scilit]
- Samuel, E. Automata, Languages, and Machines; Academic Press: New York, NY, USA, 1974. [Google Scholar]
- Kuich, W.; Salomaa, A. Semirings, Automata, Languages; Springer: Berlin/Heidelberg, Germany, 1986. [Google Scholar]
- Akiyama, S.; Borbély, T.; Brunotte, H.; Pethő, A.; Thuswaldner, J.M. On a generalization of the radix representation—A survey. Fields Inst. Commun. 2004, 41, 19–27. [Google Scholar]
- Berthé, V.; Rigo, M. (Eds.) Combinatorics, Automata and Number Theory; Cambridge University Press: Cambridge, UK, 2015. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).




