Next Article in Journal
Simplified Integrity Checking for an Expressive Class of Denial Constraints
Previous Article in Journal
A Data-Driven State Estimation Based on Sample Migration for Low-Observable Distribution Networks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automata and Arithmetics in Canonical Number Systems

by
Tamás Herendi
and
Viktória Padányi
*,†
Department of Computer Science, Faculty of Informatics, University of Debrecen, Kassai Str. 26, 4028 Debrecen, Hungary
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Algorithms 2025, 18(3), 122; https://doi.org/10.3390/a18030122
Submission received: 17 December 2024 / Revised: 13 February 2025 / Accepted: 18 February 2025 / Published: 20 February 2025
(This article belongs to the Section Algorithms for Multidisciplinary Applications)

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 A Z [ x ] 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 1 + i  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 P Z [ x ] be a monic polynomial, R = Z [ x ] / P Z [ x ] be the corresponding quotient ring, and let φ : Z [ x ] R be the homomorphism φ ( A ) = A mod P . Furthermore, let m > 1 , N = { n 1 , , n m } Z , and let N [ x ] Z [ x ] be the set of polynomials with all coefficients from N . The pair ( P , N ) is called a number system, if for any A Z [ x ] there exists a unique B N [ x ] , such that φ ( A ) = φ ( B ) .
The number system is called canonical, and  P ( x ) is called a CNS polynomial if N = { 0 , 1 , , m 1 } .
The length of the representation of A by P is L ( A ) = L ( A , P ) = deg ( B ) + 1 .
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 P ( x ) = x 3 since the unique root of x 3 is 3. In other words, the isomorphism arises because when we substitute x = 3 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 16 is obtained by dividing 16 by 3 repeatedly:
1. 
16 ÷ 3 = 5 with remainder 16 5 · 3 = 1 units digit is 1.
2. 
5 ÷ 3 = 1 with remainder 5 1 · 3 = 2 next digit is 2.
3. 
1 ÷ 3 = 0 with remainder 1 0 · 3 = 1 highest digit is 1.
So we obtain the digits 1 , 2 , 1 , i.e.,  16 = 121 3 .
(b) 
In the polynomial system with base x 3 , 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 B ( x ) = a 2 x 2 + a 1 x + a 0 (with a i { 0 , 1 , 2 } ) such that B ( 3 ) = 16 .
Analogously to the integer numeration system, we repeatedly divide 16 by x 3 .
1. 
To find the last digit, we execute the ’integer’ division 16 ÷ ( x 3 ) . Actually, we solve the equation 16 = q · ( x 3 ) + s · x + r , where r { 0 , 1 , 2 } . The only solution is q = 5 , s = 5 and r = 1 . Hence, the last digit is 1, and we should represent 5 x in the system.
2. 
For the second digit, we solve 5 = q · ( x 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 1 , s = 1 , and r = 2 .
3. 
Finally, we should solve 1 = q · ( x 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 0 , s = 0 , and r = 1 . Since s = 0 , thus there is no more carry in the computation, so the algorithm terminates.
Thus, the polynomial representation of 16 is x 2 + 2 x + 1 , 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 ( 3 ) number, which corresponds to the polynomial P ( x ) = x + 3 . This system has the same digits N = { 0 , 1 , 2 } , just like the base-3 system. We may observe that in the system with base ( 3 ) , 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 3 :
1. 
16 ÷ 3 = 5 with remainder 16 ( 5 ) · ( 3 ) = 1 units digit is 1.
2. 
5 ÷ 3 = 2 with remainder 5 2 · ( 3 ) = 1 next digit is 1.
3. 
2 ÷ 3 = 0 with remainder 2 0 · 3 = 2 highest digit is 2.
So we obtain the digits 2 , 1 , 1 , i.e.,  16 = 211 3 .
(b) 
In the polynomial system with base x + 3 , we execute similar steps to those in the previous example. Here, the constant 16 must be represented by a polynomial B ( x ) = a 2 x 2 + a 1 x + a 0 (with a i { 0 , 1 , 2 } ) such that B ( 3 ) = 16 .
1. 
To find the last digit, we solve the equation 16 = q · ( x + 3 ) + s · x + r , where r { 0 , 1 , 2 } . The only solution is q = 5 , s = 5 and r = 1 . Hence, the last digit is 1, and we should represent 5 x in the system.
2. 
For the second digit, we solve 5 = q · ( x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 2 , s = 2 , and r = 1 .
3. 
Finally, we should solve 2 = q · ( x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 0 , s = 0 , and r = 2 . Since s = 0 , thus there is no more carry in the computation, so the algorithm terminates.
Thus, the polynomial representation of 16   is  2 x 2 + x + 1 .
Remark 2. 
The system in Example 2 is indeed a valid number system since it can represent both positive and negative integers. For instance, 1 = 12 3 .
Remark 3. 
If ( P , N ) is a number system, then the reduced homomorphism φ : N [ x ] R 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 P Z [ x ] be a monic polynomial with deg ( P ) = d , and  P ( x ) = p d x d + + p 0 be such that 1 = p d p d 1 p 0 with 2 p 0 . If P is not divisible by a cyclotomic polynomial, then P is a CNS polynomial.
Example 3. 
Let P ( x ) = x 2 + x + 3 and let α be one of its roots. By Theorem 1, ( P , { 0 , 1 , 2 } ) is a canonical number system. The corresponding numeration system of Z [ α ] has the base α, with digits { 0 , 1 , 2 } . This polynomial defines a number system over the algebraic integers, extending the idea of canonical number systems to the algebraic integers Z [ α ] .
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 16 = q · ( x 2 + x + 3 ) + s · x + r , where r { 0 , 1 , 2 } . The only solution is q = 5 , s = 5 x 5 , and r = 1 . Hence, the last digit is 1, and we should represent 5 x 2 5 x in the system.
2. 
For the second digit, we solve 5 x 5 = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 2 , s = 2 x 3 , and r = 1 .
3. 
Next, we should solve 2 x 3 = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 1 , s = x + 3 , and r = 0 . This yields that the next digit is 0.
4. 
Now, we should solve x + 3 = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 1 , s = x , and r = 0 . Hence, the next digit is again 0.
5. 
Then, we solve x = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 0 , s = 1 , and r = 0 . The next digit is again 0.
6. 
In the next step we solve 1 = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 1 , s = x + 1 , and r = 2 . The next digit is 2.
7. 
Now, we solve x + 1 = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 0 , s = 1 , and r = 1 . The next digit is 1.
8. 
Finally, we should solve 1 = q · ( x 2 + x + 3 ) + s · x + r , with  r { 0 , 1 , 2 } . The only solution is q = 0 , s = 0 , and r = 1 . 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.
We obtain that the representation of 16 in the number system ( x 2 + x + 3 , { 0 , 1 , 2 } ) is 11 200 011 ( x 2 + x + 3 ) . Similarly, as before, if we set B ( x ) = x 7 + x 6 + 2 x 5 + x + 1 , then B ( α ) = 16 .
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 P ( x ) is a CNS polynomial, then all roots of P ( x ) lie outside the closed unit circle and all real roots of P ( x ) are less than 1 .
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 P ( x ) be a CNS polynomial of degree d, α 1 , , α d be the (not necessarily different) roots of P, and let A ( x ) Z [ x ] . We define the relative information quantity of A as
I ( A ) = I P ( A ) = max 1 i d A ( α i ) 0 log A ( α i ) log α i .
In the special case of A is divisible by P, we set I ( A ) = 0 .
Example 4. 
Let P ( x ) = x 4 + 2 . In the paper of A. Kovács [10], it is proven that P is a CNS polynomial. The roots of P are
2 3 4 2 + I 2 3 4 2 , 2 3 4 2 I 2 3 4 2 , 2 3 4 2 I 2 3 4 2 , 2 3 4 2 + I 2 3 4 2 ,
where I is the imaginary unit. The modulus of the roots are identical and equal to 2 3 4 2 + I 2 3 4 2 = 2 1 4 . 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, log 2 3 4 2 + I 2 3 4 2 = 1 4 (and the same is true for all the roots).
(a) 
Let A ( x ) = x 3 + x + 1 . Substituting the four roots to A and calculating the base-2 logarithm of the absolute value of A ( α ) , according to the order of the roots, we obtain the approximate values
1.0923 , 1.0923 , 1.2851 , 1.2851 .
Then, we obtain
I ( A ) = 1.2851 1 / 4 5.1406 .
(b) 
Let A ( x ) = x 4 + x + 1 . As before, execute the same operations. We obtain the logarithms of the absolute values of the substituted roots as
0.2246 , 0.2246 , 1.0171 , 1.0171 ,
whence
I ( A ) = 1.0171 1 / 4 4.0684 .
(c) 
Let A ( x ) = x 5 + x + 1 . Then, one can see that for I ( A ) , 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 α 4 = 2 , whence in case (b), A ( α ) = α 1 , while in case (c) A ( α ) = 2 · α + α 1 = α + 1 .
Lemma 1. 
Let P ( x ) be a CNS polynomial and A ( x ) , B ( x ) Z [ x ] . Then,
(i) 
0 I ( A ) ;
(ii) 
If φ ( A ) = φ ( B ) , then I ( A ) = I ( B ) ;
(iii) 
I ( A + B ) max { I ( A ) , I ( B ) } + I ( 2 ) ;
(iv) 
I ( A · B ) I ( A ) + I ( B ) ;
(v) 
I ( x · A ) = I ( A ) + 1 ;
(vi) 
I ( A n ) = n I ( A ) .
Proof. 
  
(i) Let P be an irreducible divisor of P of degree d , and for the sake of simplicity, assume that α 1 , , α d are the roots of P . Assume that A is not divisible by P .
Since P is a CNS polynomial, by Theorem 2, | α | > 1 for any root of P and hence for any root of P as well.
P is irreducible and does not divide A, thus the roots of P are not roots of A, whence A ( α i ) 0 for all i = 1 , , d .
By definition P Z [ x ] , consequently, P Z [ x ] , whence α 1 , , α d are algebraic integers. Since A Z [ x ] , the values A ( α 1 ) , , A ( α d ) are algebraic integers as well.
The roots α 1 , , α d form a complete set of algebraic conjugates over Q , which means that the set A ( α 1 ) , , A ( α d ) is also a complete set of algebraic conjugates over Q with each value appearing in the same number. This implies that
1 i d A ( α i ) Q .
The product of algebraic integers is an algebraic integer, hence, together with Equation (1),
0 1 i d A ( α i )
is a rational integer. If  | A ( α i ) | < 1 for all 1 i d , then
1 > 1 i d | A ( α i ) | ,
which is a contradiction, whence at least one of the roots α of P is such that | A α | 1 .
For this α , we have
0 log A ( α ) log α ,
whence by definition 0 I ( A ) .
(ii) If φ ( A ) = φ ( B ) , then A ( x ) B ( x ) mod P ( x ) , i.e.,  A ( x ) = Q ( x ) P ( x ) + B ( x ) with some Q Z [ x ] . This yields that A ( α ) = B ( α ) for any root of P, which implies I ( A ) = I ( B ) .
(iii) Let α be a root of P. In the general case, when we do not assume that φ ( A ) = φ ( B ) , we cannot state A ( α ) = B ( α ) . For the sake of simplicity, assume that | A ( α ) | | B ( α ) | . Then, log ( | A ( α ) + B ( α ) | ) log ( | A ( α ) | + | B ( α ) | ) log ( 2 | A ( α ) | ) = log ( 2 ) + log ( | A ( α ) | ) , which implies the statement.
(iv)–(vi) These statements can be proven by similar arguments using the additive property of the logarithm.
   □
Theorem 3. 
Let α C with 1 < | α | , and assume that α is not a positive real number. Then, there exists a constant c < 1 depending only on α such that for every 0 < N Z , and for any sequence a 0 , a 1 , of integers satisfying 0 a i N for all i = 0 , 1 , , we have
i = 0 k 1 a i α i c N | α | k | α | 1 ,
for any 1 < k Z .
Remark 4. 
In Theorem 3, we assume that 2 k , thus a natural lower bound on c can be obtained from inequality (2) if we set k = 2 . Then, we have
α + 1 c | α | 2 | α | 1 ,
which implies
α + 1 | α | 1 | α | 2 c .
To present this lower bound in a more expressive form, we multiply the left-hand side by | α | + 1 | α | + 1 . Then, we obtain
α + 1 | α | + 1 · ( | α | + 1 ) ( | α | 1 ) | α | 2 = α + 1 | α | + 1 · | α | 2 1 | α | 2 = α + 1 | α | + 1 · 1 1 | α | 2 c .
Since α is not a positive real number, thus α + 1 < | α | + 1 , 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, then
1 α k i = 0 k 1 α i = 1 α k α k 1 α 1 = 1 α 1 1 α k ( α 1 ) ,
where the last term of the right side approximates 0 as k increases and hence,
1 α 1 1 α k ( α 1 ) > c 1 α 1 ,
for any c < 1 , if k is big enough. If  a 0 = a 1 = = a k 1 = N , 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 b k 1 = b k 3 = = N , b k 2 = b k 4 = = 0 and let j = ( k + 1 ) mod 2 (i.e., j = 0 , if k is odd and j = 1 , if k is even). Furthermore, denote by x the integer part of x and set c = | α | | α | + 1 < 1 .
Because of the alternating sign of the powers of α, we have
i = 0 k 1 a i α i i = 0 k 1 b i α i α j i = 0 k 1 2 N α 2 i = α j N | α | 2 · k 1 2 + 1 1 | α | 2 1 α j N | α | 2 · k 1 2 + 1 | α | 2 1 = N | α | k + 1 ( | α | 1 ) ( | α | + 1 ) = c N | α | k | α | 1 .
(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 | α | > 1 , the modulus of the powers of α are increasing, and the arguments of the powers are integer multiples of the argument of α (denoted by arg ( α ) ).
If arg ( α ) π Q , then the sequence arg ( α 0 ) , arg ( α 1 ) , arg ( α 2 ) , arg ( α 3 ) , is periodic, otherwise, it is uniformly distributed in the interval [ 0 , 2 π ] and if arg ( α n ) = arg ( α k ) then n = k . It also implies that in the nonperiodic case, arg ( α n ) = 0 only if n = 0 ; in other words, α n R if and only if n = 0 .
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 0 , 1 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 r R < c with some constant c < 1 , depending only on α.
We will also use the observation that if we denote by M n and M k the maximum of i = 0 n 1 a i α i and i = 0 k 1 a i α i , respectively, then M k M n | α | k n .
Finally, the following property plays the most important role in proving the existence of the above-mentioned constant c < 1 . Assume we have an arbitrary finite set of nonzero complex numbers A = { α 1 , , α n } . Let B A , such that α B α is maximal, and let μ = α B α . Let e be the line with normal vector μ, i.e.,  e = β | | arg ( β ) arg ( μ ) | = π 2 . Then, B consist of those elements of A that lie on the same side of e as μ, i.e.,  α B if and only if | arg ( α ) arg ( μ ) | < π 2 . (see Figure 3. In the figure, μ is the sum of the complex numbers represented by solid lines.)
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 α C , with  1 < | α | , 1 < N Z , let 0 a 0 , a 1 , , a n 1 N be fixed integers, and 
M = max i = 0 n 1 b i · α i : 0 b 0 , b 1 , , b n 1 N , integers .
If
i = 0 n 1 a i · α i = M ,
then a n 1 0 .
Proof. 
Contrary, if  a n 1 = 0 , then
M = i = 0 n 2 a i · α i < α · i = 0 n 2 a i · α i = i = 1 n 1 a i 1 · α i M ,
which is a contradiction.    □
In the next lemma and the following corollary, we prove that if M r and M n denote the possible maximum of the modulus of different length geometric sums, then M r M n is nearly proportional to | α r | | α n | . In Lemma 2, we show this property when r < n , and in Corollary 1, we extend it for values greater than n.
Lemma 3. 
Let α C , with  1 < | α | , 1 < N Z , 0 < r < n be integers, and 
M n = max i = 0 n 1 b i · α i : 0 b 0 , b 1 , , b n 1 N , integers M r = max i = 0 r 1 b i · α i : 0 b 0 , b 1 , , b r 1 N , integers
Then, | α | n r · M r M n .
Proof. 
Let 0 a 0 , a 1 , , a r 1 N be integers, with 
i = 0 r 1 a i · α i = M r .
Then,
| α | n r · M r = α n r · i = 0 r 1 a i · α i = i = 0 r 1 a i · α n r + i = j = n r n 1 a j n + r · α j M n .
   □
Corollary 1. 
With the notations of Lemma 2, let 1 < k , n , with  k = q · n + r , where 0 r < n , and  0 a 0 , , a k 1 N are integers. Then
i = 0 k 1 a i · α i M | α | k | α | n 1 .
Proof. 
Assume first that k < n . Then, by Lemma 3,
i = 0 k 1 a i · α i M 1 | α | n k < M | α | k | α | n 1 .
Now, let k n . If 0 < r , then by Lemma 3,
i = 0 k 1 a i · α i i = 0 r 1 a i · α i + j = 0 q 1 | α | j · n + r i = 0 n 1 a j · n + r + i · α i | α | r n M + | α | r j = 0 q 1 | α | j · n M = M · | α | r n + | α | r | α | q · n 1 | α | n 1 = M · | α | r n · | α | n 1 | α | n 1 + | α | q · n + r | α | r | α | n 1 = M | α | r | α | r n + | α | q · n + r | α | r | α | n 1 = M | α | k | α | r n | α | n 1 M | α | k | α | n 1 .
If r = 0 , 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 α C , with  1 < | α | , 1 < N Z , let 0 a 0 , a 1 , , a n 1 N be integers, and 
M = max i = 0 n 1 b i · α i : 0 b 0 , b 1 , , b n 1 N , integers .
If i = 0 n 1 a i · α i = M , then a 0 , a 1 , , a n 1 { 0 , N } .
Proof. 
Let 0 j < n be such that a j 0 , and  μ = i = 0 n 1 a i · α i . Since M = | μ | , thus μ α j | μ | . Denote by x ¯ the complex conjugate of x. Then,
μ μ ¯ μ α ¯ j + μ ¯ α j + α j α ¯ j = ( μ α j ) ( μ ¯ α ¯ j ) = μ α j 2 | μ | 2 = μ μ ¯ ,
whence
μ α ¯ j + μ ¯ α j + α j α ¯ j 0 ,
which implies
0 < α j α ¯ j μ α ¯ j + μ ¯ α j .
Assume that a j < N . By the maximality of M, | μ + α j | M . Conversely, M 2 μ + α j 2 = ( μ + α j ) ( μ ¯ + α ¯ j ) = μ μ ¯ + α j α ¯ j + μ α ¯ j + μ ¯ α j > μ μ ¯ = | μ | 2 = M 2 , which is a contradiction.    □
We may summarize the previous results in the following corollary.
Corollary 2. 
With the notations of Lemma 2, there exist a 0 , a 1 , , a n 1 { 0 , 1 } such that
N i = 0 n 1 a i · α i = M ,
where a n 1 = 1 .
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 i t h power in this maximal modulus sum μ is nonvanishing if and only if α i and μ lie on the same side of the normal line e of μ . This property can be expressed by the relation | arg ( μ ) arg ( α i ) | < π 2 .
If we would like to represent this geometric property algebraically, we should observe that if β and γ are nonzero complex numbers, then | arg ( β ) arg ( γ ) | < π 2 if and only if R e β γ > 0 , or with another expression, β γ + β ¯ γ ¯ > 0 . Here, R e ( β ) is the real part of β .
Lemma 5. 
Let α C , with  1 < | α | , 1 < N Z , and 
M = max i = 0 n 1 b i · α i : 0 b 0 , b 1 , , b n 1 N , integers .
Furthermore, let the coefficients a 0 , a 1 , , a n 1 { 0 , 1 } be chosen such that
N i = 0 n 1 a i · α i = M , and let μ = i = 0 n 1 a i · α i .
Then, a j = 1 if and only if μ α j + μ ¯ α ¯ j > 0 .
Proof. 
Assume first, that a j = 1 . Then, | μ α j | | μ | , whence by (4),
μ α j + μ ¯ α ¯ j = μ α ¯ j + μ ¯ α j α j α ¯ j 1 .
Now, let a j 1 . Since a j can only be either 0 or 1, this means that a j = 0 . Then, | μ + α j | | μ | , whence 0 < α j α ¯ j μ α ¯ j + μ ¯ α j , and 
μ α j + μ ¯ α ¯ j = μ α ¯ j + μ ¯ α j α j α ¯ j 1 .
   □
Remark 6. 
By the proof of Lemma 5, there is no   0 j < n for which   μ α j + μ ¯ α ¯ j = 0 . In other words, if μ is the maximal modulus subsum, then there is no power of α, which is perpendicular to μ.
Let β , γ C { 0 } such that arg ( β ) arg ( γ ) . The two numbers determine two complementary sectors of the complex plane between β and γ , and counterwise (see Figure 4).
Corollary 3 states that if the left-hand side of inequality (2) is the maximal modulus sum μ , then there exist two different powers α k and α j such that all powers which are included in μ lie in the same sector defined by α k and α j , while the powers which are not included in μ lie in the other sector.
Corollary 3. 
With the notations of Lemma 2, let a 0 , a 1 , , a n 1 { 0 , 1 } such that
N i = 0 n 1 a i · α i = M , μ = i = 0 n 1 a i · α i ,
and denote by Im ( β ) be the imaginary part of β C . Then, there exist 0 j , k < n such that a i = 1 if and only if Im α i α j 0 and Im α i α k 0 , for all 0 i < n .
Proof. 
Let ⪯ be the binary relation on C { 0 } , where x y if and only if Im y x 0 . According to the notation of Figure 4, this means that x y if and only if y lies in the sector x x . Then, for any β C { 0 } , the relation ⪯ is transitive on the set
C β = γ : 0 β γ + β ¯ γ ¯ , and γ C { 0 } .
Let C μ = α i : 0 μ α i + μ ¯ α ¯ i , 0 i < n C μ . Clearly, a i = 1 if and only if α i C μ . Since C μ is a finite set, by the transitivity property, there exists not necessarily unique 0 j , k < n such that α j γ α k for all γ C μ . If a i = 0 , then α i C μ , and either α i α j or α k α i .    □
Now, we have collected everything necessary to prove Theorem 3.
Proof of Theorem 3. 
Let 0 < n be a sufficiently large integer, and according to the notation of Lemma 2, let
N i = 0 n 1 a i · α i = M , and μ = i = 0 n 1 a i · α i .
Let
c = μ α 1 α n 1 .
Since α is not a positive real number, by Lemma 5, at least for one i, the coefficient a i 1 , whence c < 1 . By Corollary 1,
i = 0 k 1 b i · α i M | α | k | α | n 1 = N c α n 1 α 1 | α | k | α | n 1 = c N | α | k | α | 1 .
   □
The following corollary is an asymptotic extension of Theorem 3.
Corollary 4. 
Let α C with 1 < | α | , and assume that α is not a positive real number. Let 0 < N Z and
M n = max i = 0 n 1 b i · α i : 0 b 0 , b 1 , , b n 1 N , integers ,
for all 0 < n Z . Then, there exists c < 1 depending only on α such that
lim n M n | α | n = c N | α | 1 .
Proof. 
By Theorem 3,
M n | α | n c 1 N | α | 1 ,
for all 0 < n Z with some c 1 < 1 depending only on α . By Lemma 3, | α | M n 1 M n . Hence, the sequence M n | α | n 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 C { 0 } , where x y if and only if either y = c · x with some 1 c R or Im y x > 0 .
Remark 7. 
If x , y C { 0 } , then x y means that either arg ( x ) arg ( y ) < arg ( x ) + π or arg ( x ) arg ( y ) + 2 π < arg ( x ) + π . If  arg ( x ) = arg ( y ) , then | x | | y | .
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
C 1 = α i : 0 α i + α ¯ i , 0 i < n , and C 1 = α i : 0 > α i + α ¯ i , 0 i < n .
Sort C 1 and C 1 by ⪯ and glue them at both ends. Then, we obtain a cyclically sorted set β 0 , , β n 1 of α 0 , , α n 1 , where the next of β n 1 is β n = β 0 . The property that β 0 , , β n 1 is sorted means that for a given β i the β i + 1 is such that 0 arg ( β i + 1 ) arg ( β i ) is the smallest possible, i.e., the β i ’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 Im ( α n ) is as small as it is possible.
To find c, we can use Algorithm 1 with O ( n ) 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 β i . Let us denote this subsum by μ i . By Lemma 5, the maximal modulus subsum of the set of β ’s will be one of μ 0 , , μ n 1 .
(2)
In the inner while loop, we rotate the half plane, and compute μ i + 1 from μ i by accumulating new β ’s at the end and eliminating β i from the front.
Algorithm 1: Calculating a proper constant c of Theorem 3
Algorithms 18 00122 i001
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 c 1 , c 2 , 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 P ( x ) = x d + p d 1 x d 1 + + p 0 be a CNS polynomial. Then, there exist effectively computable constants c 1 , c 2 such that
I ( A ) c 1 L ( A ) I ( A ) + c 2
holds for every A ( x ) Z [ x ] .
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 c 1 and c 2 . 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 c 1 and c 2 , leading to more exact results in the context of canonical number systems.
Let ( P , N ) be a CNS, with N = | N | and A ( x ) Z [ x ] with canonical representation
B ( x ) = b L 1 x L 1 + + b 0 N [ x ] ,
where L = L ( A ) = L ( B ) = deg ( B ) + 1 . Then, φ ( A ) = φ ( B ) , which means I ( A ) = I ( B ) . Assume that α is a root of P ( x ) . Then, by Theorem 3,
| B ( α ) | = | b L 1 α L 1 + b L 2 α L 2 + + b 0 | c · ( N 1 ) | α | L | α | 1 < c · N | α | L | α | 1 ,
where 0 < c < 1 depends only on α .
By Theorem 2, 0 < | α | 1 validates the last inequality and makes it possible to take the logarithm of both sides. Then, we obtain
log ( | B ( α ) | ) < log ( c ) + log ( N ) + L log ( | α | ) log ( | α | 1 ) .
Again by Theorem 2, we may have
log ( | B ( α ) | ) log ( | α | ) < L + log ( c ) + log ( N ) log ( | α | 1 ) log ( | α | ) and
log ( | B ( α ) | ) log ( | α | ) log ( c ) + log ( N ) log ( | α | 1 ) log ( | α | ) < L ,
which can be effectively bounded from below by some c 1 :
log ( | B ( α ) | ) log ( | α | ) c 1 < L .
Taking the maximum on all roots of P, we obtain the first inequality of (6).
I ( A ) c 1 L ( A ) .
For the proof of the second inequality, set k = I ( A ) , which denotes the upper integer part of I ( A ) , and let B ( x ) = x k B 1 ( x ) + B 0 ( x ) , where B 0 , B 1 N [ x ] and deg ( B 0 ) < k . Assume that α is a root of P. Then,
B 1 ( α ) = B ( α ) B 0 ( α ) α k and
| B 1 ( α ) | | B ( α ) | | α | k + | B 0 ( α ) | | α | k < | B ( α ) | | α | k + N | α | k 1 | α | k ( | α | 1 ) < | B ( α ) | | α | k + N | α | 1 .
The fraction c α · N | α | 1 can be bounded by an effectively computable constant depending only on P, and by the definition of k, | B ( α ) | | α | k = | A ( α ) | | α | k 1 . Hence, | B 1 ( α ) | c where c is a constant depending only on P. Since there exist only finitely many polynomials A Z [ x ] with deg ( A ) < d satisfying A ( α ) < c and these polynomials are effectively computable, we can determine
c α = max deg B : B N [ x ] , φ B = φ A , deg ( A ) < d , A ( α ) < c + 1 .
Let c 2 = 1 + max 1 i d c α i . Then
L ( A ) = deg ( B ) + 1 = k + deg ( B 1 ) + 1 k + c α I ( A ) + c 2 .

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 A = ( k , S , X , Y , s , δ ) is called a finite transducer automaton with k input tape if
  • k Z + ;
  • 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);
  • s S is the initial state;
  • δ : S × X k S × Y 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 a ¯ = ( a 0 a n 1 ) N * is a finite word, then we will use the notation Q a ( x ) = a n 1 x n 1 + + a 0 for the corresponding polynomial.
Theorem 5. 
Let ( P , N ) be a CNS. Then, there exists a finite transducer automaton A with two input tapes, such that c ¯ = A ( a ¯ , b ¯ ) for all a ¯ , b ¯ , c ¯ N * if φ ( Q c ) = φ ( Q a + Q b ) .
Remark 10. 
In Theorem 5, we assume that the length of the words a ¯ , b ¯ , c ¯ 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 A = ( 2 , S , X , Y , s , δ ) , where X = Y = N . We will define S N [ x ] and δ in an appropriate way, and we will prove that S is finite. Assume that N = N .
Let S be the smallest set such that
  • 0 S ;
  • if A S , B N [ x ] , b N , and 0 a < 2 N 1 such that φ x B ( x ) + b = φ A ( x ) + a then B S .
We define the transition function δ : S × N 2 S × N by δ A , a 1 , a 2 = B , b , if φ x B ( x ) + b = φ A ( x ) + a 1 + a 2 .
Let a ¯ , b ¯ N * , A 0 = 0 , and Q 0 = Q a + Q b . If 0 i , let A i + 1 be defined by δ A i , a i , b i = A i + 1 , c i , and Q i + 1 ( x ) = Q i ( x ) + ( c i a i b i ) x i . By the definition of δ , we have
φ Q i + 1 ( x ) + A i + 1 ( x ) x i + 1 = φ Q i ( x ) + A i ( x ) x i = φ Q a + Q b ,
for all 0 i .
Let n = 1 + max deg ( Q a ) , deg ( Q b ) and k = 1 + deg ( A i ) . Then, deg Q n < n , Q c = Q n + k = Q n + A n x n N [ x ] , and φ ( Q c ) = φ ( Q a + Q b ) .
Hence, by Theorem 4, and by Lemma 1(iii),
n + k = deg ( Q c ) + 1 = L ( Q c ) I ( Q c ) + C 2 max I ( Q a ) , I ( Q b ) + I ( 2 ) + C 2 = n + I ( 2 ) + C 2 ,
where C 2 is the constant c 2 in Theorem 4.
This yields that
deg A i < k I ( 2 ) + C 2 .
Since S is defined to be the smallest set satisfying (1) and (2), every A S may appear as the last carry A n . Thus, for all A S N [ x ] , deg A < I ( 2 ) + C 2 , which implies that S is finite. □
Remark 12. 
Observe now the properties of the states defined in the proof of Theorem 5. Let A ( x ) = a k x k + a k 1 x k 1 + + a 0 , where a k 0 and A ( x ) S . 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 a 0 a 1 a k . This means that different states represent different tail releases of the output, i.e., if the automaton is state B A , then the output without input is different to a 0 a 1 a k .
Theorem 6. 
The addition automaton, constructed in the proof of Theorem 5, is minimal.
Proof. 
In the definition of A in the proof of the previous theorem, S is the smallest possible set satisfying the given properties. This means that for any A S , there exist proper inputs a ¯ , b ¯ such that A ( a ¯ , b ¯ ) terminates in state A.
Let S = { A 1 , A 2 , , A n } and a ¯ 1 , a ¯ 2 , , a ¯ n , b ¯ 1 , b ¯ 2 , , b ¯ n are such that A ( a ¯ i , b ¯ i ) terminates in state A i for all i { 1 , , n } .
Assume that there exists an automaton A , which executes the same addition as A , but | S | < | S | , i.e., A has strictly fewer states. Then, by the pigeonhole principle, there exist 1 i < j n such that A ( a ¯ i , b ¯ i ) and A ( a ¯ j , b ¯ j ) terminates in the same states. By Remark 12, automaton A continues with different tail releases from the states A i and A j , but A continues in the same way if there are no more input digits. This is a contradiction because we assumed that A and A execute the same operation. Hence, the assumption of the existence of A is wrong. □
Although we can not be sure there is no linear time algorithm for multiplication, we have the following.
Theorem 7. 
Let ( P , N ) be a CNS. Then, there are no finite transducer automaton S with two input tapes, such that c ¯ = S ( a ¯ , b ¯ ) for all a ¯ , b ¯ , c ¯ N * if φ ( Q c ) = φ ( Q a · Q b ) .
Proof. 
On the contrary, assume that A = ( 2 , S , N , N , s , δ ) executes the multiplication, and N = N .
Let a ¯ , c ¯ N * satisfying φ ( Q c ) = φ Q a 2 . Then by Lemma 1(vi), and by Theorem 4,
deg Q c = L ( Q c ) 1 I Q c C 1 1 = 2 I Q a C 1 1 2 L Q a C 2 C 1 = 2 deg Q a 2 C 2 C 1 + 1 .
Set n = 1 + deg Q a , and Q i = c i x i + + c 0 for all 0 i . (If deg Q c < i , then Q i = Q c .) Since the automaton executes the multiplication, there exist s 0 , s 1 , S such that s 0 = s , and δ s i , a i , a i = s i + 1 , c i , for all 0 i .
If n i , then a i = 0 , and Q c , n ( x ) = Q c ( x ) Q n ( x ) x n is determined purely by s n . Since deg Q c , n n 2 C 2 c 1 + 1 , there are infinitely many different Q c , n , whence there are infinitely many different corresponding states. However, this is a contradiction since we assumed that A 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 x 2 + x + 2 , { 0 , 1 }

Let x 2 + x + 2 be the base polynomial and { 0 , 1 } is the digit set. By Theorem 1, we know that this is a CNS.
Let γ 1 = 110101 and γ 2 = 101111 be 6-bit long binary ‘numbers’ in the above CNS, and let γ = γ 1 + γ 2 . 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 1 ( 2 ) 2 = 1 · 2 1 + ( 2 ) · 2 0 = 0 (i.e., we use the x 2 polynomial as the base). In the present system, according to this observation, 1 1 2 x 2 + x + 2 = 0 .
The addition process works as follows:
  • Initialization
    The two numbers, γ 1 and γ 2 , are digit-wise added without any further computations. The result is γ = 211212 .
  • Reduction
    Starting from the least significant digit on the right, we reduce the augmented digits, which are not in the digit set { 0 , 1 } . 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 1 1 2 . The result is ( 1 ) ( 1 ) 0 , 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 ( 1 ) ( 1 ) .
    For the next digit, we add the carry arriving from the right to the value given at the position: 1 + ( 1 ) ( 1 ) = ( 1 ) 0 . Since 0 is a valid digit, we do not need any further operation at this position. The carry for the next position is ( 1 ) .
    The next augmented digit is 2. Adding the carry, we obtain 2 + ( 1 ) = 1 , 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.
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 ( C , d ) , where C 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.
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 N [ x ] . Since the degrees of the state polynomials are bounded by the constant c = I ( 2 ) + c 2 of Theorem 4, we may state the following simple result.
Theorem 8. 
Let ( P , N ) be a CNS, and A be the minimal automaton implementing the addition. Then, the number of states of A is bounded by | N | c .
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 1 = p d p d 1 p 0 = 2 .) 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 x 3 + 2 , x 3 + x 2 + x + 2 , and x 3 + 2 x 2 + 2 x + 2 . 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.
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 O ( n ) 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

  1. Knuth, D.E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms; Addison-Wesley: Boston, MA, USA, 1981. [Google Scholar]
  2. Kátai, I.; Szabó, J. Canonical number-systems for complex integers. Acta Sci. Math. 1975, 37, 255–260. [Google Scholar]
  3. Kátai, I.; Kovács, B. Canonical number systems in algebraic number fields. Acta Math. Hung. 1981, 37, 159–164. [Google Scholar] [CrossRef]
  4. Kovács, B. Integral domains with canonical number systems. Publ. Math. 1989, 36, 153–156. [Google Scholar] [CrossRef]
  5. 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]
  6. Kovács, B.; Pethő, A. On a representation of algebraic integers. Stud. Sci. Math. Hung. 1992, 27, 169–172. [Google Scholar]
  7. 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]
  8. Akiyama, S.; Pethő, A. On a canonical number systems. Theor. Comput. Sci. 2002, 270, 921–933. [Google Scholar] [CrossRef]
  9. Pethő, A.; Varga, P. Canonical number systems over imaginary quadratic Euclidean domains. Colloq. Math. 2016, 146, 1–22. [Google Scholar] [CrossRef]
  10. Kovács, A. Generalized binary number systems. Ann. Univ. Sci. Budapest, Sect. Comp 2001, 20, 195–206. [Google Scholar]
  11. Burcsi, P.; Kovács, A. Exhaustive search methods for CNS polynomials. Monatshefte Math. 2008, 155, 421–430. [Google Scholar] [CrossRef]
  12. 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]
  13. 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]
  14. Allouche, J.; Scheicher, K.; Tichy, R.F. Regular Maps in Generalized Number Systems. Math. Slovaca 2000, 50, 41–58. [Google Scholar]
  15. Scheicher, K.; Thuswaldner, J.M. Canonical Number Systems, Counting Automata Furthermore, Fractals. Math. Proc. Camb. Philos. Soc. 2007, 133, 163–182. [Google Scholar] [CrossRef]
  16. Samuel, E. Automata, Languages, and Machines; Academic Press: New York, NY, USA, 1974. [Google Scholar]
  17. Kuich, W.; Salomaa, A. Semirings, Automata, Languages; Springer: Berlin/Heidelberg, Germany, 1986. [Google Scholar]
  18. 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]
  19. Berthé, V.; Rigo, M. (Eds.) Combinatorics, Automata and Number Theory; Cambridge University Press: Cambridge, UK, 2015. [Google Scholar]
Figure 1. Powers of a complex number.
Figure 1. Powers of a complex number.
Algorithms 18 00122 g001
Figure 2. Sum of powers.
Figure 2. Sum of powers.
Algorithms 18 00122 g002
Figure 3. Maximum of subsum. (1) μ is the sum of numbers (vectors) with solid lines. (2) e is perpendicular to μ .
Figure 3. Maximum of subsum. (1) μ is the sum of numbers (vectors) with solid lines. (2) e is perpendicular to μ .
Algorithms 18 00122 g003
Figure 4. Sectors of the complex plane.
Figure 4. Sectors of the complex plane.
Algorithms 18 00122 g004
Table 1. Steps for decomposing the number 16 in the number system ( x 2 + x + 3 , { 0 , 1 , 2 } ) .
Table 1. Steps for decomposing the number 16 in the number system ( x 2 + x + 3 , { 0 , 1 , 2 } ) .
Iter. N q s r
1165 5 x 5 1
2 5 x 5 2 2 x 3 1
3 2 x 3 1 x + 3 0
4 x + 3 1 x 0
5 x 0 1 0
6 1 -1 x + 1 2
7 x + 1 011
81001
Table 2. Computation in the binary number system.
Table 2. Computation in the binary number system.
γ 211212
C 0110−1−1000−1−1−10
C + γ 110−1−12111−102
mod 00+(112)−(112)0000−(112)
γ 0110101−1−10111−10−1−10
γ 101011100
Table 3. State transition table.
Table 3. State transition table.
State0−1−110−1111−10−1−2
Input0(0, 0)(10, 1)(1, 0)(11, 1)(0, 1 )(1, 1)(−1, 0)(10, 0)
1(0, 1)(−1, 0)(1, 1)(0, 0)(−1−1, 0)(−10, 0)(−1, 1)(10, 1)
2(−1−1, 0)(−1, 1)(10, 0)(0, 1)(−1−1, 1)(−10, 1)(−1−2, 0)(−1, 0)
Table 4. Number of states of addition automata.
Table 4. Number of states of addition automata.
DegMin. NoSMax. NoS
362125
42391195
5118513,037
66248155,765
733,3872,041,141
8185,69527,270,180
91,074,944370,005,950
106,419,041≥380,278,058
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.

Share and Cite

MDPI and ACS Style

Herendi, T.; Padányi, V. Automata and Arithmetics in Canonical Number Systems. Algorithms 2025, 18, 122. https://doi.org/10.3390/a18030122

AMA Style

Herendi T, Padányi V. Automata and Arithmetics in Canonical Number Systems. Algorithms. 2025; 18(3):122. https://doi.org/10.3390/a18030122

Chicago/Turabian Style

Herendi, Tamás, and Viktória Padányi. 2025. "Automata and Arithmetics in Canonical Number Systems" Algorithms 18, no. 3: 122. https://doi.org/10.3390/a18030122

APA Style

Herendi, T., & Padányi, V. (2025). Automata and Arithmetics in Canonical Number Systems. Algorithms, 18(3), 122. https://doi.org/10.3390/a18030122

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop