aa r X i v : . [ m a t h . C O ] M a y Proceedings of the 27th International Conference on Probabilistic, Combinatorialand Asymptotic Methods for the Analysis of AlgorithmsKraków, Poland, 4-8 July 2016 q -Quasiadditive Functions Sara Kropf , †§ , Stephan Wagner ‡§ Institut für Mathematik, Alpen-Adria-Universität Klagenfurt, Austria, [email protected] Institute of Statistical Science, Academia Sinica, Taipei, Taiwan, [email protected] Department of Mathematical Sciences, Stellenbosch University, South Africa, [email protected]
In this paper, we introduce the notion of q -quasiadditivity of arithmetic functions, as well as the related conceptof q -quasimultiplicativity, which generalises strong q -additivity and -multiplicativity, respectively. We show thatthere are many natural examples for these concepts, which are characterised by functional equations of the form f ( q k + r a + b ) = f ( a ) + f ( b ) or f ( q k + r a + b ) = f ( a ) f ( b ) for all b < q k and a fixed parameter r . In addition tosome elementary properties of q -quasiadditive and q -quasimultiplicative functions, we prove characterisations of q -quasiadditivity and q -quasimultiplicativity for the special class of q -regular functions. The final main result providesa general central limit theorem that includes both classical and new examples as corollaries. Keywords: q -additive function, q -quasiadditive function, q -regular function, central limit theorem Arithmetic functions based on the digital expansion in some base q have a long history (see, e.g., [3–8,11])The notion of a q - additive function is due to [11]: an arithmetic function (defined on nonnegative integers)is called q -additive if f ( q k a + b ) = f ( q k a ) + f ( b ) whenever ≤ b < q k . A stronger version of this concept is strong (or complete ) q -additivity: a function f is said to be strongly q -additive if we even have f ( q k a + b ) = f ( a ) + f ( b ) whenever ≤ b < q k . The class of (strongly) q - multiplicative functions is defined in an analogousfashion. Loosely speaking, (strong) q -additivity of a function means that it can be evaluated by breakingup the base- q expansion. Typical examples of strongly q -additive functions are the q -ary sum of digits andthe number of occurrences of a specified nonzero digit. † The first author is supported by the Austrian Science Fund (FWF): P 24644-N26. ‡ The second author is supported by the National Research Foundation of South Africa under grant number 96236. § The authors were also supported by the Karl Popper Kolleg “Modeling–Simulation–Optimization” funded by the Alpen-Adria-Universität Klagenfurt and by the Carinthian Economic Promotion Fund (KWF). Part of this paper was written while the secondauthor was a Karl Popper Fellow at the Mathematics Institute in Klagenfurt. He would like to thank the institute for the hospitalityreceived.
Sara Kropf, Stephan Wagner
There are, however, many simple and natural functions based on the q -ary expansion that are not q -additive. A very basic example of this kind are block counts : the number of occurrences of a certain blockof digits in the q -ary expansion. This and other examples provide the motivation for the present paper, inwhich we define and study a larger class of functions with comparable properties. Definition.
An arithmetic function (a function defined on the set of nonnegative integers) is called q - quasiadditive if there exists some nonnegative integer r such that f ( q k + r a + b ) = f ( a ) + f ( b ) (1)whenever ≤ b < q k . Likewise, f is said to be q - quasimultiplicative if it satisfies the identity f ( q k + r a + b ) = f ( a ) f ( b ) (2)for some fixed nonnegative integer r whenever ≤ b < q k .We remark that the special case r = 0 is exactly strong q -additivity, so strictly speaking the term“strongly q -quasiadditive function” might be more appropriate. However, since we are not considering aweaker version (for which natural examples seem to be much harder to find), we do not make a distinction.As a further caveat, we remark that the term “quasiadditivity” has also been used in [1] for a related, butslightly weaker condition.In the following section, we present a variety of examples of q -quasiadditive and q -quasimultiplicativefunctions. In Section 3, we give some general properties of such functions. Since most of our examplesalso belong to the related class of q -regular functions, we discuss the connection in Section 4. Finally, weprove a general central limit theorem for q -quasiadditive and -multiplicative functions that contains bothold and new examples as special cases. q -quasiadditive and q -quasimultiplicative functions Let us now back up the abstract concept of q -quasiadditivity by some concrete examples. Block counts
As mentioned in the introduction, the number of occurrences of a fixed nonzero digit is a typical exampleof a q -additive function. However, the number of occurrences of a given block B = ǫ ǫ · · · ǫ ℓ of digitsin the expansion of a nonnegative integer n , which we denote by c B ( n ) , does not represent a q -additivefunction. The reason is simple: the q -ary expansion of q k a + b is obtained by joining the expansions of a and b , so occurrences of B in a and occurrences of B in b are counted by c B ( a ) + c B ( b ) , but occurrencesthat involve digits of both a and b are not.However, if B is a block different from · · · , then c B is q -quasiadditive: note that the representationof q k + ℓ a + b is of the form a a · · · a µ | {z } expansion of a · · · | {z } ℓ zeros b b · · · b ν | {z } expansion of b whenever ≤ b < q k , so occurrences of the block B have to belong to either a or b only. This implies that c B ( q k + ℓ a + b ) = c B ( a ) + c B ( b ) , with one small caveat: if the block starts and/or ends with a sequenceof zeros, then the count needs to be adjusted by assuming the digital expansion of a nonnegative integerto be padded with zeros on the left and on the right. -Quasiadditive Functions B be the block in base . The binary representations of and are and , respectively, so we have c B (469) = 2 and c B (22) = 1 (note the occurrence of at thebeginning of if we assume the expansion to be padded with zeros), as well as c B (240150) = c B (2 ·
469 + 22) = c B (469) + c B (22) = 3 . Indeed, the block B occurs three times in the expansion of , which is . The number of runs and the Gray code
The number of ones in the Gray code of a nonnegative integer n , which we denote by h GRAY ( n ) , is alsoequal to the number of runs (maximal sequences of consecutive identical digits) in the binary representa-tions of n (counting the number of runs in the representation of as ); the sequence defined by h GRAY ( n ) is A005811 in Sloane’s On-Line Encyclopedia of Integer Sequences [17]. An analysis of its expectedvalue is performed in [10]. The function h GRAY is -quasiadditive up to some minor modification: set f ( n ) = h GRAY ( n ) if n is even and f ( n ) = h GRAY ( n ) + 1 if n is odd. The new function f can be inter-preted as the total number of occurrences of the two blocks and in the binary expansion (consideringbinary expansions to be padded with zeros at both ends), so the argument of the previous example appliesagain and shows that f is -quasiadditive. The nonadjacent form and its Hamming weight
The nonadjacent form (NAF) of a nonnegative integer is the unique base- representation with digits , , − ( − is usually represented as in this context) and the additional requirement that there may notbe two adjacent nonzero digits, see [18]. For example, the NAF of is . It is well known that theNAF always has minimum Hamming weight (i.e., the number of nonzero digits) among all possible binaryrepresentations with this particular digit set, although it may not be unique with this property (compare,e.g., [18] with [15]).The Hamming weight h NAF of the nonadjacent form has been analysed in some detail [13, 20], and itis also an example of a -quasiadditive function. It is not difficult to see that h NAF is characterised by therecursions h NAF (2 n ) = h NAF ( n ) , h NAF (4 n + 1) = h NAF ( n ) + 1 , h NAF (4 n −
1) = h NAF ( n ) + 1 togetherwith the initial value h NAF (0) = 0 . The identity h NAF (2 k +2 a + b ) = h NAF ( a ) + h NAF ( b ) can be proved by induction. In Section 4, this example will be generalised and put into a larger context. The number of optimal { , , − } -representations As mentioned above, the NAF may not be the only representation with minimum Hamming weight amongall possible binary representations with digits , , − . The number of optimal representations of a givennonnegative integer n is therefore a quantity of interest in its own right. Its average over intervals of theform [0 , N ) was studied by Grabner and Heuberger [12], who also proved that the number r OPT ( n ) ofoptimal representations of n can be obtained in the following way: Lemma 1 (Grabner–Heuberger [12]) . Let sequences u i ( i = 1 , , . . . , ) be given recursively by u (0) = u (0) = · · · = u (0) = 1 , u (1) = u (1) = 1 , u (1) = u (1) = u (1) = 0 , Sara Kropf, Stephan Wagnerand u (2 n ) = u ( n ) , u (2 n + 1) = u ( n ) + u ( n + 1) ,u (2 n ) = u ( n ) , u (2 n + 1) = u ( n ) ,u (2 n ) = u ( n ) , u (2 n + 1) = 0 ,u (2 n ) = u ( n ) , u (2 n + 1) = u ( n + 1) ,u (2 n ) = u ( n ) , u (2 n + 1) = 0 . The number r OPT ( n ) of optimal representations of n is equal to u ( n ) . A straightforward calculation shows that u (8 n ) = u (8 n ) = · · · = u (8 n ) = u (8 n + 1) = u (8 n + 1) = u ( n ) ,u (8 n + 1) = u (8 n + 1) = u (8 n + 1) = 0 . (3)This gives us the following result (see the full version of this extended abstract for a detailed proof): Lemma 2.
The number of optimal { , , − } -representations of a nonnegative integer is a -quasimulti-plicative function. Specifically, for any three nonnegative integers a, b, k with b < k , we have r OPT (2 k +3 a + b ) = r OPT ( a ) r OPT ( b ) . In Section 4, we will show that this is also an instance of a more general phenomenon.
The run length transform and cellular automata
The run length transform of a sequence is defined in a recent paper of Sloane [19]: it is based on the binaryrepresentation, but could in principle also be generalised to other bases. Given a sequence s , s , . . . , itsrun length transform is obtained by the rule t ( n ) = Y i ∈L ( n ) s i , where L ( n ) is the multiset of run lengths of n (lengths of blocks of consecutive ones in the binary rep-resentation). For example, the binary expansion of is , so the multiset L ( n ) of runlengths would be { , , } , giving t (1910) = s s .A typical example is obtained for the sequence of Jacobsthal numbers given by the formula s n = (2 n +2 − ( − n ) . The associated run length transform t n (sequence A071053 in the OEIS [17]) countsthe number of odd coefficients in the expansion of (1 + x + x ) n , and it can also be interpreted as thenumber of active cells at the n -th generation of a certain cellular automaton. Further examples stemmingfrom cellular automata can be found in Sloane’s paper [19].The argument that proved q -quasiadditivity of block counts also applies here, and indeed it is easy tosee that the identity t (2 k +1 a + b ) = t ( a ) t ( b ) , where ≤ b < k , holds for the run length transform of any sequence, meaning that any such transformis -quasimultiplicative. In fact, it is not difficult to show that every -quasimultiplicative function withparameter r = 1 is the run length transform of some sequence. -Quasiadditive Functions Now that we have gathered some motivating examples for the concepts of q -quasiadditivity and q -quasi-multiplicativity, let us present some simple results about functions with these properties. First of all, letus state an obvious relation between q -quasiadditive and q -quasimultiplicative functions: Proposition 3.
If a function f is q -quasiadditive, then the function defined by g ( n ) = c f ( n ) for somepositive constant c is q -quasimultiplicative. Conversely, if f is a q -quasimultiplicative function that onlytakes positive values, then the function defined by g ( n ) = log c f ( n ) for some positive constant c = 1 is q -quasiadditive. The next proposition deals with the parameter r in the definition of a q -quasiadditive function: Proposition 4.
If the arithmetic function f satisfies f ( q k + r a + b ) = f ( a ) + f ( b ) for some fixed nonnega-tive integer r whenever ≤ b < q k , then it also satisfies f ( q k + s a + b ) = f ( a ) + f ( b ) for all nonnegativeintegers s ≥ r whenever ≤ b < q k .Proof. If a, b are nonnegative integers with ≤ b < q k , then clearly also ≤ b < q k + s − r if s ≥ r , andthus f ( q k + s a + b ) = f ( q ( k + s − r )+ r a + b ) = f ( a ) + f ( b ) . Corollary 5.
If two arithmetic functions f and g are q -quasiadditive functions, then so is any linearcombination αf + βg of the two.Proof. In view of the previous proposition, we may assume the parameter r in (1) to be the same for bothfunctions. The statement follows immediately.Finally, we observe that q -quasiadditive and q -quasimultiplicative functions can be computed by break-ing the q -ary expansion into pieces. A detailed proof can be found in the full version: Lemma 6. If f is a q -quasiadditive ( q -quasimultiplicative) function, then • f (0) = 0 ( f (0) = 1 , respectively, unless f is identically ), • f ( qa ) = f ( a ) for all nonnegative integers a . Proposition 7.
Suppose that the function f is q -quasiadditive with parameter r , i.e., f ( q k + r a + b ) = f ( a ) + f ( b ) whenever ≤ b < q k . Going from left to right, split the q -ary expansion of n into blocksby inserting breaks after each run of r or more zeros. If these blocks are the q -ary representations of n , n , . . . , n ℓ , then we have f ( n ) = f ( n ) + f ( n ) + · · · + f ( n ℓ ) . Moreover, if m i is the greatest divisor of n i which are not divisible by q for i = 1 , . . . , ℓ , then f ( n ) = f ( m ) + f ( m ) + · · · + f ( m ℓ ) . Analogous statements hold for q -quasimultiplicative functions, with sums replaced by products. Sara Kropf, Stephan WagnerProof.
This is obtained by a straightforward induction on ℓ together with the fact that f ( q h a ) = f ( a ) ,which follows from the previous lemma. Example . Recall that the Hamming weight of the NAF (which is the minimum Hamming weight ofa { , , − } -representation) is -quasiadditive with parameter r = 2 . To determine h NAF (314 159 265) ,we split the binary representation, which is , into blocks by insertingbreaks after each run of at least two zeros: | | | | . The numbers n , n , . . . , n ℓ in the statement of the proposition are now , , , , respectively,and the numbers m , m , . . . , m ℓ are therefore , , , , . Now we use the values h NAF (1) = 1 , h NAF (5) = 2 , h NAF (27) = 3 and h NAF (87) = 4 to obtain h NAF (314 159 265) = 2 h NAF (1) + h NAF (5) + h NAF (27) + h NAF (87) = 11 . Example . In the same way, we consider the number of optimal representations r OPT , which is -quasimultiplicative with parameter r = 3 . Consider for instance the binary representation of
204 280 974 ,namely . We split into blocks: | | | . The four blocks correspond to the numbers
48 = 16 · ,
360 = 8 · ,
328 = 8 · and
14 = 2 · . Since r OPT (3) = 2 , r OPT (45) = 5 , r OPT (41) = 1 and r OPT (7) = 1 , we obtain r OPT (204 280 974) = 10 . q -Regular functions In this section, we introduce q -regular functions and examine the connection to our concepts. See [2] formore background on q -regular sequences.A function f is q -regular if it can be expressed as f = u t f for a vector u and a vector-valued function f , and there are matrices M i , ≤ i < q , satisfying f ( qn + i ) = M i f ( n ) (4)for ≤ i < q , qn + i > . We set v = f (0) .Equivalently, a function f is q -regular if and only if f can be written as f ( n ) = u t L Y i =0 M n i v (5)where n L · · · n is the q -ary expansion of n .The notion of q -regular functions is a generalisation of q -additive and q -multiplicative functions. How-ever, we emphasise that q -quasiadditive and q -quasimultiplicative functions are not necessarily q -regular:a q -regular sequence can always be bounded by O ( n c ) for a constant c , see [2, Thm. 16.3.1]. In our settinghowever, the values of f ( n ) can be chosen arbitrarily for those n whose q -ary expansion does not contain r . Therefore a q -quasiadditive or -multiplicative function can grow arbitrarily fast. -Quasiadditive Functions ( u , ( M i ) ≤ i Let f be a q -regular sequence with zero-insensitive minimal linear representation (5) . Thenthe following two assertions are equivalent: • The sequence f is q -quasimultiplicative with parameter r . • M r = vu t .Example { , , − } -representations) . The number of optimal { , , − } -repre-sentations as described in Section 2 is a -regular sequence by Lemma 1. A minimal zero-insensitive linearrepresentation for the vector ( u ( n ) , u ( n ) , u ( n ) , u ( n + 1) , u ( n + 1) , u ( n + 1)) t is given by M = , M = , u t = (1 , , , , , and v = (1 , , , , , t .As M = vu t , this sequence is -quasimultiplicative with parameter , which is the same result as inLemma 2. Remark. The condition on the minimality of the linear representation in Theorem 8 is necessary as illus-trated by the following example:Consider the sequence f ( n ) = 2 s ( n ) where s ( n ) is the binary sum of digits function. This sequenceis -regular and -(quasi-)multiplicative with parameter r = 0 . A minimal linear representation is givenby M = 1 , M = 2 , v = 1 and u = 1 . As stated in Theorem 8, we have M = vu t = 1 .If we use the zero-insensitive non-minimal linear representation defined by M = (cid:0) (cid:1) , M = (cid:0) (cid:1) , v = (1 , t and u t = (1 , instead, we have rank M r = 2 for all r ≥ . Thus M r = vu t . q -regular function q -quasiadditive? The characterisation of q -regular functions that are also q -quasiadditive is somewhat more complicated.Again, we consider a zero-insensitive (but not necessarily minimal) linear representation. We let U be thesmallest vector space such that all vectors of the form u t Q i ∈ I M n i lie in the affine subspace u t + U t ( U t is used as a shorthand for { x t : x ∈ U } ). Such a vector space must exist, since u t is a vector of thisform (corresponding to the empty product, where I = ∅ ). Likewise, let V be the smallest vector spacesuch that all vectors of the form Q j ∈ J M n j v lie in the affine subspace v + V . Sara Kropf, Stephan Wagner Theorem 9. Let f be a q -regular sequence with zero-insensitive linear representation (5) . The sequence f is q -quasiadditive with parameter r if and only if all of the following statements hold: • u t v = 0 , • U t is orthogonal to ( M r − I ) v , i.e., x t ( M r − I ) v = x t M r v − x t v = 0 for all x ∈ U , • V is orthogonal to u t ( M r − I ) , i.e., u t ( M r − I ) y = u t M r y − u t y = 0 for all y ∈ V , • U t M r V = 0 , i.e., x t M r y = 0 for all x ∈ U and y ∈ V .Example . For the Hamming weight of the nonadjacent form, a zero-insensitive (and also minimal) linearrepresentation for the vector ( h NAF ( n ) , h NAF ( n + 1) , h NAF (2 n + 1) , t is M = , M = , u t = (1 , , , and v = (0 , , , t .The three vectors w = u t M − u t , w = u t M − u t and w = u t M M M − u t are linearlyindependent. If we let W be the vector space spanned by those three, it is easily verified that M and M map the affine subspace u t + W t to itself, so U = W is spanned by these vectors.Similarly, the three vectors M v − v , M v − v and M M M v − v span V .The first condition of Theorem 9 is obviously true. We only have to verify the other three conditionswith r = 2 for the basis vectors of U and V , which is done easily. Thus h NAF is a -regular sequence thatis also -quasiadditive, as was also proved in Section 2.Finding the vector spaces U and V is not trivial. But in a certain special case of q -regular functions,we can give a sufficient condition for q -additivity, which is easier to check. These q -regular functions areoutput sums of transducers as defined in [14]: a transducer transforms the q -ary expansion of an integer n (read from the least significant to the most significant digit) deterministically into an output sequence andleads to a state s . The output sum is then the sum of this output sequence together with the final output ofthe state s . This defines the value of the q -regular function evaluated at n . The function h NAF discussedin the example above, as well as many other examples, can be represented in this way. Proposition 10. The output sum of a connected transducer is q -additive with parameter r if the followingconditions are satisfied: • The transducer has the reset sequence r going to the initial state, i.e., reading r zeros always leadsto the initial state of the transducer. • For every state, the output sum along the path of the reset sequence r equals the final output of thisstate. • Additional zeros at the end of the input sequence do not change the output sum. -Quasiadditive Functions q -quasiadditive and -multiplicativefunctions In this section, we prove a central limit theorem for q -quasimultiplicative functions taking only positivevalues. By Proposition 3, this also implies a central limit theorem for q -quasiadditive functions.To this end, we define a generating function: let f be a q -quasimultiplicative function with positivevalues, let M k be the set of all nonnegative integers less than q k (i.e., those positive integers whose q -aryexpansion needs at most k digits), and set F ( x, t ) = X k ≥ x k X n ∈M k f ( n ) t . The decomposition of Proposition 7 now translates directly to an alternative representation for F ( x, t ) :let B be the set of all positive integers not divisible by q whose q -ary representation does not contain theblock r , let ℓ ( n ) denote the length of the q -ary representation of n , and define the function B ( x, t ) by B ( x, t ) = X n ∈B x ℓ ( n ) f ( n ) t . We remark that in the special case where q = 2 and r = 1 , this simplifies greatly to B ( x, t ) = X k ≥ x k f (2 k − t . (6) Proposition 11. The generating function F ( x, t ) can be expressed as F ( x, t ) = 11 − x · − x r − x B ( x, t ) (cid:16) x + · · · + x r − ) B ( x, t ) (cid:17) = 1 + (1 + x + · · · + x r − ) B ( x, t )1 − x − x r B ( x, t ) . Proof. The first factor stands for the initial sequence of leading zeros, the second factor for a (possiblyempty) sequence of blocks consisting of an element of B and r or more zeros, and the last factor for thefinal part, which may be empty or an element of B with up to r − zeros (possibly none) added at theend.Under suitable assumptions on the growth of a q -quasiadditive or q -quasimultiplicative function, wecan exploit the expression of Proposition 11 to prove a central limit theorem in the following steps (fullproofs can again be found in the full version). Definition. We say that a function f has at most polynomial growth if f ( n ) = O ( n c ) and f ( n ) = Ω( n − c ) for a fixed c ≥ . We say that f has at most logarithmic growth if f ( n ) = O (log n ) .Note that our definition of at most polynomial growth is slightly different than usual: the extra condition f ( n ) = Ω( n − c ) ensures that the absolute value of log f ( n ) does not grow too fast. Lemma 12. Assume that the positive, q -quasimultiplicative function f has at most polynomial growth.There exist positive constants δ and ǫ such that • B ( x, t ) has radius of convergence ρ ( t ) > q whenever | t | ≤ δ . Sara Kropf, Stephan Wagner • For | t | ≤ δ , the equation x + x r B ( x, t ) = 1 has a complex solution α ( t ) with | α ( t ) | < ρ ( t ) and noother solutions with modulus ≤ (1 + ǫ ) | α ( t ) | . • Thus the generating function F ( x, t ) has a simple pole at α ( t ) and no further singularities ofmodulus ≤ (1 + ǫ ) | α ( t ) | . • Finally, α is an analytic function of t for | t | ≤ δ . Lemma 13. Assume that the positive, q -quasimultiplicative function f has at most polynomial growth.With δ and ǫ as in the previous lemma, we have, uniformly in t , [ x k ] F ( x, t ) = κ ( t ) · α ( t ) − k (cid:0) O ((1 + ǫ ) − k ) (cid:1) for some function κ . Both α and κ are analytic functions of t for | t | ≤ δ , and κ ( t ) = 0 in this region. Theorem 14. Assume that the positive, q -quasimultiplicative function f has at most polynomial growth.Let N k be a randomly chosen integer in { , , . . . , q k − } . The random variable L k = log f ( N k ) hasmean µk + O (1) and variance σ k + O (1) , where the two constants are given by µ = B t (1 /q, q r and σ = − B t (1 /q, q − r +1 ( q − − + 2 B t (1 /q, q − r +1 ( q − − − B t (1 /q, q − r ( q − − − rB t (1 /q, q − r + B tt (1 /q, q − r − B t (1 /q, B tx (1 /q, q − r − . (7) If f is not the constant function f ≡ , then σ = 0 and the normalised random variable ( L k − µk ) / ( σ √ k ) converges weakly to a standard Gaussian distribution. Corollary 15. Assume that the q -quasiadditive function f has at most logarithmic growth.Let N k be a randomly chosen integer in { , , . . . , q k − } . The random variable L k = f ( N k ) hasmean ˆ µk + O (1) and variance ˆ σ k + O (1) , where the two constants µ and σ are given by the sameformulas as in Theorem 14, with B ( x, t ) replaced by ˆ B ( x, t ) = X n ∈B x ℓ ( n ) e f ( n ) t . If f is not the constant function f ≡ , then the normalised random variable ( L k − ˆ µk ) / (ˆ σ √ k ) converges weakly to a standard Gaussian distribution.Remark. By means of the Cramér-Wold device (and Corollary 5), we also obtain joint normal distributionof tuples of q -quasiadditive functions.We now revisit the examples discussed in Section 2 and state the corresponding central limit theorems.Some of them are well known while others are new. We also provide numerical values for the constantsin mean and variance. Example . The number of blocks occurring in the binary expansion of n is a -quasiadditive function of at most logarithmic growth. Thus by Corollary 15, the standardised randomvariable is asymptotically normally distributed, the constants being ˆ µ = and ˆ σ = . -Quasiadditive Functions Example . The Hamming weight of the nonadjacent form is -quasiadditive withat most logarithmic growth (as the length of the NAF of n is logarithmic). Thus by Corollary 15, thestandardised random variable is asymptotically normally distributed. The associated constants are ˆ µ = and ˆ σ = . Example . The number of optimal { , , − } -representations is -quasimultiplicative.As it is always greater or equal to and -regular, it has at most polynomial growth. Thus Theorem 14implies that the standardised logarithm of this random variable is asymptotically normally distributed withnumerical constants given by µ ≈ . , σ ≈ . . Example . Suppose that the sequence s , s , . . . satisfies s n ≥ and s n = O ( c n ) for aconstant c ≥ . The run length transform t ( n ) of s n is -quasimultiplicative. As s n ≥ for all n , wehave t ( n ) ≥ for all n as well. Furthermore, there exists a constant A such that s n ≤ Ac n for all n , andthe sum of all run lengths is bounded by the length of the binary expansion, thus t ( n ) = Y i ∈L ( n ) s i ≤ Y i ∈L ( n ) ( Ac i ) ≤ ( Ac ) n . Consequently, t ( n ) is positive and has at most polynomial growth. By Theorem 14, we obtain an asymp-totic normal distribution for the standardised random variable log t ( N k ) . The constants µ and σ in meanand variance are given by µ = X i ≥ (log s i )2 − i − and σ = X i ≥ (log s i ) (cid:0) − i − − (2 i − − i − (cid:1) − X j>i ≥ (log s i )(log s j )( i + j − − i − j − . These formulas can be derived from those given in Theorem 14 by means of the representation (6), andthe terms can also be interpreted easily: write log t ( n ) = P i ≥ X i ( n ) log s i , where X i ( n ) is the numberof runs of length i in the binary representation of n . The coefficients in the two formulas stem from mean,variance and covariances of the X i ( n ) .In the special case that s n is the Jacobsthal sequence ( s n = (2 n +2 − ( − n ) , see Section 2), we havethe numerical values µ ≈ . , σ ≈ . . References [1] Jean-Paul Allouche and Olivier Salon, Sous-suites polynomiales de certaines suites automatiques , J.Théor. Nombres Bordeaux (1993), no. 1, 111–121.[2] Jean-Paul Allouche and Jeffrey Shallit, Automatic sequences: Theory, applications, generalizations ,Cambridge University Press, Cambridge, 2003.[3] Nader L. Bassily and Imre Kátai, Distribution of the values of q -additive functions on polynomialsequences , Acta Math. Hungar. (1995), no. 4, 353–361.[4] Richard Bellman and Harold N. Shapiro, On a problem in additive number theory , Ann. of Math.(2) (1948), no. 2, 333–340.2 Sara Kropf, Stephan Wagner [5] Emmanuel Cateland, Suites digitales et suites k-régulières , 1992, Doctoral thesis, Université deBordeaux.[6] Hubert Delange, Sur les fonctions q -additives ou q -multiplicatives , Acta Arith. (1972), 285–298.[7] , Sur la fonction sommatoire de la fonction “somme des chiffres” , Enseignement Math. (2) (1975), 31–47.[8] Michael Drmota, The distribution of patterns in digital expansions , Algebraic Number Theory andDiophantine Analysis (F. Halter-Koch and R. F. Tichy, eds.), de Gruyter (Berlin), 2000, pp. 103–121.[9] Philippe Dumas, Asymptotic expansions for linear homogeneous divide-and-conquer recurrences:Algebraic and analytic approaches collated , Theoret. Comput. Sci. (2014), 25–53.[10] Philippe Flajolet and Lyle Ramshaw, A note on Gray code and odd-even merge , SIAM J. Comput. (1980), 142–158.[11] A. O. Gel ′ fond, Sur les nombres qui ont des propriétés additives et multiplicatives données , ActaArith. (1967/1968), 259–265.[12] Peter J. Grabner and Clemens Heuberger, On the number of optimal base 2 representations of inte-gers , Des. Codes Cryptogr. (2006), no. 1, 25–39.[13] Clemens Heuberger and Sara Kropf, Analysis of the binary asymmetric joint sparse form , Combin.Probab. Comput. (2014), 1087–1113.[14] Clemens Heuberger, Sara Kropf, and Helmut Prodinger, Output sum of transducers: Limiting distri-bution and periodic fluctuation , Electron. J. Combin. (2015), no. 2, 1–53.[15] Marc Joye and Sung-Ming Yen, Optimal left-to-right binary signed digit recoding , IEEE Trans.Comput. (2000), no. 7, 740–748.[16] Peter Kirschenhofer, Subblock occurrences in the q -ary representation of n , SIAM J. AlgebraicDiscrete Methods (1983), no. 2, 231–236.[17] The On-Line Encyclopedia of Integer Sequences , http://oeis.org , 2016.[18] George W. Reitwiesner, Binary arithmetic , Advances in Computers, Vol. 1, Academic Press, NewYork, 1960, pp. 231–308.[19] Neil J. A. Sloane, The number of ON cells in cellular automata , arXiv:1503.01168 [math.CO].[20] Jörg M. Thuswaldner, Summatory functions of digital sums occurring in cryptography , Period. Math.Hungar.38