On $q$-Quasiadditive and $q$-Quasimultiplicative Functions

In this paper, we introduce the notion of $q$-quasiadditivity of arithmetic functions, as well as the related concept of $q$-quasimultiplicativity, which generalise strong $q$-additivity and -multiplicativity, respectively. We show that there 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 to some 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 provides a general central limit theorem that includes both classical and new examples as corollaries.


Introduction
Arithmetic functions based on the digital expansion in some base q have a long history (see, e.g., [3][4][5][6][7][8]12]) The notion of a q-additive function is due to [12]: an arithmetic function (defined on nonnegative integers) is called q-additive if whenever 0 ≤ 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 whenever 0 ≤ b < q k . The class of (strongly) q-multiplicative functions is defined in an analogous fashion. Loosely speaking, (strong) q-additivity of a function means that it can be evaluated by breaking up the base-q expansion. Typical examples of strongly q-additive functions are the q-ary sum of digits and the number of occurrences of a specified nonzero digit.
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 block of digits in the q-ary expansion. This and other examples provide the motivation for the present paper, in which 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 (1) f (q k+r a + b) = f (a) + f (b) whenever 0 ≤ b < q k . Likewise, f is said to be q-quasimultiplicative if it satisfies the identity for some fixed nonnegative integer r whenever 0 ≤ 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 a weaker 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, but slightly weaker condition.
In the following section, we present a variety of examples of q-quasiadditive and q-quasimultiplicative functions. In Section 3, we give some general properties of such functions. Since most of our examples also belong to the related class of q-regular functions, we discuss the connection in Section 4. Finally, we prove a general central limit theorem for q-quasiadditive and -multiplicative functions that contains both old and new examples as special cases.

Examples of 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 digit is a typical example of a q-additive function. However, the number of occurrences of a given block B = ǫ 1 ǫ 2 · · · ǫ ℓ of digits in the expansion of a nonnegative integer n, which we denote by c B (n), does not represent a q-additive function. 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 occurrences that involve digits of both a and b are not.
However, if B is a block different from 00 · · · 0, then c B is q-quasiadditive: note that the representation of q k+ℓ a + b is of the form a 1 a 2 · · · a µ expansion of a 00 · · · 0 ℓ zeros b 1 b 2 · · · b ν expansion of b whenever 0 ≤ b < q k , so occurrences of the block B have to belong to either a or b only, implying 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 sequence of zeros, then the count needs to be adjusted by assuming the digital expansion of a nonnegative integer to be padded with zeros on the left and on the right. Indeed, the block B occurs three times in the expansion of 240150, which is 111010101000010110.
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 also equal to the number of runs (maximal sequences of consecutive identical digits) in the binary representations of n (counting the number of runs in the representation of 0 as 0); the sequence defined by h GRAY (n) is A005811 in Sloane's On-Line Encyclopedia of Integer Sequences [20]. An analysis of its expected value is performed in [10]. The function h GRAY is 2-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 interpreted as the total number of occurrences of the two blocks 01 and 10 in the binary expansion (considering binary expansions to be padded with zeros at both ends), so the argument of the previous example applies again and shows that f is 2-quasiadditive.
The nonadjacent form and its Hamming weight. The nonadjacent form (NAF) of a nonnegative integer is the unique base-2 representation with digits 0, 1, −1 (−1 is usually represented as 1 in this context) and the additional requirement that there may not be two adjacent nonzero digits, see [21]. For example, the NAF of 27 is 100101. It is well known that the NAF always has minimum Hamming weight (i.e., the number of nonzero digits) among all possible binary representations with this particular digit set, although it may not be unique with this property (compare, e.g., [21] with [17]).
The Hamming weight h NAF of the nonadjacent form has been analysed in some detail [14,23], and it is also an example of a 2-quasiadditive function. It is not difficult to see that h NAF is characterised by the recursions can be proved by induction. In Section 4, this example will be generalised and put into a larger context.
The number r OPT (n) of optimal representations of n is equal to u 1 (n).
This gives us the following result: Lemma 2. The number of optimal {0, 1, −1}-representations of a nonnegative integer is a 2quasimultiplicative function. Specifically, for any three nonnegative integers a, b, k with b < 2 k , we have Proof. We will prove a somewhat stronger statement by induction on t: write u(n) = (u 1 (n), u 2 (n), u 3 (n), u 4 (n), u 5 (n)) t .
We show that and for all a, b, k satisfying the conditions of the lemma, from which the desired result follows by considering the first entry of the vector u(2 k+3 a + b). Note first that both identities are clearly true for k = 0 in view of (3). For the induction step, we distinguish two cases: if b is even, we have by the induction hypothesis, as well as The case that b is odd is treated in an analogous fashion.
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 [22]: it is based on the binary representation, but could in principle also be generalised to other bases. Given a sequence s 1 , s 2 , . . ., its run length transform is obtained by the rule where L(n) is the multiset of run lengths of n (lengths of blocks of consecutive ones in the binary representation). For example, the binary expansion of 1910 is 11101110110, so the multiset L(n) of run lengths would be {3, 3, 2}, giving t(1910) = s 2 s 2 3 . A typical example is obtained for the sequence of Jacobsthal numbers given by the formula s n = 1 3 (2 n+2 −(−1) n ). The associated run length transform t n (sequence A071053 in the OEIS [20]) counts the number of odd coefficients in the expansion of (1+x+x 2 ) n , and it can also be interpreted as the number of active cells at the n-th generation of a certain cellular automaton. Further examples stemming from cellular automata can be found in Sloane's paper [22].
The argument that proved q-quasiadditivity of block counts also applies here, and indeed it is easy to see that the identity where 0 ≤ b < 2 k , holds for the run length transform of any sequence, meaning that any such transform is 2-quasimultiplicative. In fact, it is not difficult to show that every 2-quasimultiplicative function with parameter r = 1 is the run length transform of some sequence.

Elementary properties
Now that we have gathered some motivating examples for the concepts of q-quasiadditivity and q-quasimultiplicativity, let us present some simple results about functions with these properties. First of all, let us state an obvious relation between q-quasiadditive and q-quasimultiplicative functions: If a function f is q-quasiadditive, then the function defined by g(n) = c f (n) for some positive constant c is q-quasimultiplicative. Conversely, if f is a q-quasimultiplicative function that only takes 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: for some fixed nonnegative integer r whenever 0 ≤ b < q k , then it also satisfies

Corollary 5.
If two arithmetic functions f and g are q-quasiadditive functions, then so is any linear combination α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 both functions. The statement follows immediately.
Finally, we observe that q-quasiadditive and q-quasimultiplicative functions can be computed by breaking the q-ary expansion into pieces.
Proof. Assume first that f is q-quasiadditive. Setting a = b = 0 in the defining functional equation (1), we obtain f (0) = f (0) + f (0), and the first statement follows. Setting b = 0 while a is arbitrary, we now find that for all k ≥ 0. In particular, this also means that which proves the second statement. For q-quasimultiplicative functions, the proof is analogous (and one can also use Proposition 3 for positive functions).
Going from left to right, split the q-ary expansion of n into blocks by inserting breaks after each run of r or more zeros. If these blocks are the q-ary representations of n 1 , n 2 , . . . , n ℓ , then we have Moreover, if m i is the greatest divisor of n i which is not divisible by q for i = 1, . . . , ℓ, then

Analogous statements hold for q-quasimultiplicative functions, with sums replaced by products.
Proof. 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 2. In the same way, we consider the number of optimal representations r OPT , which is 2-quasimultiplicative with parameter r = 3. Consider for instance the binary representation of 204 280 974, namely 1100001011010001010010001110. We split into blocks:

q-Regular functions
In this section, we introduce q-regular functions and examine the connection to our concepts. See [2] for more background on q-regular functions and 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 Equivalently, a function f is q-regular if and only if f can be written as where n L · · · n 0 is the q-ary expansion of n.
The notion of q-regular functions is a generalisation of q-additive and q-multiplicative functions. However, 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 setting however, the values of f (n) can be chosen arbitrarily for those n whose q-ary expansion does not contain 0 r . Therefore a q-quasiadditive or -multiplicative function can grow arbitrarily fast.
We (5), leading zeros in the q-ary expansion of n do not change anything. We call a linear representation minimal if the dimension of the matrices M i is minimal among all linear representations of f .
Following [9], every q-regular function has a zero-insensitive minimal linear representation.

4.1.
When is a q-regular function q-quasimultiplicative? We now give a characterisation of q-regular functions that are q-quasimultiplicative.
Theorem 8. Let f be a q-regular sequence with zero-insensitive minimal linear representation (5).
Then the following two assertions are equivalent: • The sequence f is q-quasimultiplicative with parameter r.
Proof. Let d be the dimension of the vectors. We first prove that the set of vectors u t i∈I M ni | n i ∈ {0, . . . , q − 1}, I finite is a generating system of the whole d-dimensional vector space. This is done by contradiction: assume that there is a coordinate transformation such that the first d 0 < d unit vectors form a basis of the transformed space spanned by {u t i∈I M ni | n i ∈ {0, . . . , q − 1}, I finite}. This coordinate transform defines a different linear representation of f with matricesM i and vectorŝ u andv. However, only the first d 0 coordinates of any vector u t i∈I M ni are nonzero. Thus we can reduce the dimension of the matrices and vectors from d to d 0 to obtain a new linear representation of f . This contradicts the minimality of the original linear representation.
The q-quasimultiplicativity of f (n) with parameter r is equivalent to the identity for all finite tuples (n i ) i∈I and (n j ) j∈J . Since both {u t i∈I M ni } and { j∈J M nj v} are generating systems of the entire vector space, this is equivalent to x t (M r 0 − vu t )y = 0 for all vectors x and y, which in turn is equivalent to M r 0 = vu t . Example 3 (The number of optimal {0, 1, −1}-representations). The number of optimal {0, 1, −1}representations as described in Section 2 is a 2-regular sequence by Lemma 1. A minimal zeroinsensitive linear representation for the vector (u 1 (n), u 2 (n), u 3 (n), u 1 (n + 1), u 4 (n + 1), u 5 (n + 1)) t is given by As M 3 0 = vu t , this sequence is 2-quasimultiplicative with parameter 3, which is the same result as in Lemma 2.
Remark. The condition on the minimality of the linear representation in Theorem 8 is necessary as illustrated by the following example: Consider the sequence f (n) = 2 s2(n) , where s 2 (n) is the binary sum of digits function. This sequence is 2-regular and 2-(quasi-)multiplicative with parameter r = 0. A (1-dimensional) minimal linear representation is given by M 0 = 1, M 1 = 2, v = 1 and u = 1. As stated in Theorem 8, we have When is a q-regular function q-quasiadditive? The characterisation of q-regular functions that are also q-quasiadditive is somewhat more complicated. Again, we consider a zeroinsensitive (but not necessarily minimal) linear representation. We let U be the smallest vector space such that all vectors of the form u t i∈I M ni 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 this form (corresponding to the empty product, where I = ∅). Likewise, let V be the smallest vector space such that all vectors of the form j∈J M nj v lie in the affine subspace v + V .
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: x t M r 0 y = 0 for all x ∈ U and y ∈ V . Proof. The first statement u t v = 0 is equivalent to f (0) = 0, which we already know to be a necessary condition by Lemma 6. Note also that u t M r 0 v = u t v = 0 by the assumption that the linear representation is zero-insensitive. For the remaining statements, we write the quasiadditivity condition in terms of our matrix representation as we did in the quasimultiplicative case: Specifically, when J = ∅, we get Setting also I = ∅ gives us u t (M r 0 − I)v = 0, so together we obtain Since U t is spanned by all vectors of the form u t i∈I M ni − u t , the second statement follows. The proof of the third statement is analogous. Finally, if we assume that the first three statements hold, then we find that Thus q-quasiadditivity is equivalent to being valid for all choices of I, J, n i and n j . The desired fourth condition is clearly equivalent by definition of U and V . The three vectors w 1 = u t M 1 − u t , w 2 = u t M 2 1 − u t and w 3 = u t M 1 M 0 M 1 − u t are linearly independent. If we let W be the vector space spanned by those three, it is easily verified that M 0 and M 1 map the affine subspace u t + W t to itself, so U = W is spanned by these vectors.
Similarly, the three vectors The first condition of Theorem 9 is obviously true. We only have to verify the other three conditions with r = 2 for the base vectors of U and V , which is done easily. Thus h NAF is a 2-regular sequence that is also 2-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 qregular functions are output sums of transducers as defined in [15]: a transducer transforms the q-ary expansion of an integer n deterministically into an output sequence. We are interested in the sum of this output sequence. Before we can state our condition, we introduce our notation more precisely.
A transducer consists of a finite number of states, an initial state, the input alphabet {0, . . . , q − 1}, an output alphabet, which is a subset of the real numbers, and transitions between two states with labels ε | δ for ε an input letter and δ an output letter. We assume that the transducer is complete and deterministic, that is for every state s and input letter ε, there exists exactly one transition leaving state s with input label ε. Additionally every state has a final output.
The transducer reads the q-ary expansion of an integer n, starting from the least significant digit, as input, which defines a unique path starting at the initial state with the given input as input label. The output of the transducer is the sequence of output labels along this path together with the final output of the final state of this path. The output sum is then the sum of this output sequence.
The function h NAF , see Example 5, as well as many other examples, can be represented in this way.
This output sum of a transducer is a q-regular sequence [15]. To obtain a linear representation, we define the matrix N ε for ε ∈ {0, . . . , q − 1} to be the adjacency matrix of the transducer where we only take into account transitions with input label ε. Note that because our transducer is complete and deterministic, there is exactly one entry 1 in every row. Without loss of generality, we say that the initial state corresponds to the first row and column. Furthermore, the i-th entry of the vector δ ε is the output label of the transition starting in state i with input label ε. We define the matrices where I is an identity matrix of the correct size, and we set u t = (1, 0, . . . , 0) and where the entries of b(0) are the final outputs of the states.
Example 5. The output sum of the transducer in Figure 1 is exactly the Hamming weight of the nonadjacent form h NAF (n) (see, e.g., [15]). The matrices and vectors corresponding to this transducer are To state our condition, we also introduce the notion of a reset sequence: a reset sequence is an input sequence which always leads to the same state no matter in which state of the transducer we start. Not every transducer has a reset sequence, not even every strongly connected transducer has one. In many cases arising from combinatorics and digit expansions the reset sequence consists only of zeros.
Proposition 10. The output sum of a connected transducer is q-additive with parameter r if the following conditions are satisfied: • The transducer has the reset sequence 0 r leading to the initial state.
• For every state, the output sum along the path of the reset sequence 0 r equals the final output of this state. • Additional zeros at the end of the input sequence do not change the output sum.
Proof. Let f (n) be the vector corresponding to the linear representation (u, (M ε ) 0≤ε<q , v) as defined in (4). By induction, we obtain that the middle coordinate of f (n) is always 1 and the coordinates below are always 0 if n ≥ 1. We denote the coordinates above by b(n). The output sum of the transducer is the first coordinate of b(n). By (4), we obtain the recursion The third condition ensures that leading zeros does not change anything. Thus the connectivity of the underlying graph implies that (6) also holds for qn + ε = 0. Thus, the last coordinates of v are zero and we could reduce the dimension of the linear representation.
Let J be finite and n j ∈ {0, . . . , q − 1} for j ∈ J. The first condition implies that and the second condition implies that Using (6) recursively together with these two conditions gives for all n with q-ary digit expansion (n k−1 · · · n 0 ) and all m. This implies that the first coordinate of b(n) is q-quasiadditive.
Example 6. We now continue Example 5 and check whether the conditions of Proposition 10 are satisfied for the transducer given in Figure 1. First, a reset sequence is 00 (i.e., r = 2) and leads to the initial state. Second, the output sum along the path of the reset sequence is 0, 0 and 1 for the left, the middle and the right state, respectively, which is exactly the final output of the corresponding state. Furthermore, leading zeros do not change the output sum. Thus we have another proof that h NAF (n) is a 2-quasiadditive function with parameter r = 2.

A central limit theorem for q-quasiadditive and -multiplicative functions
In this section, we prove a central limit theorem for q-quasimultiplicative functions taking only positive values. 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 positive values, let M k be the set of all nonnegative integers less than q k (i.e., those positive integers whose q-ary expansion needs at most k digits), and set 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 the block 0 r , let ℓ(n) denote the length of the q-ary representation of n, and define the function B(x, t) by We remark that in the special case where q = 2 and r = 1, this simplifies greatly to Proposition 11. The generating function F (x, t) can be expressed as Proof. The first factor stands for the initial sequence of leading zeros, the second factor for a (possibly empty) sequence of blocks consisting of an element of B and r or more zeros, and the last factor for the final part, which may be empty or an element of B with up to r − 1 zeros (possibly none) added at the end.
Under suitable assumptions on the growth of a q-quasiadditive or q-quasimultiplicative function, we can exploit the expression of Proposition 11 to prove a central limit theorem.
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 ≥ 0. 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.
Proof. The polynomial growth of f implies that C −1 φ −ℓ(n) ≤ f (n) ≤ Cφ ℓ(n) for some positive constants C and φ. Moreover, B contains O(β ℓ ) elements whose q-ary expansion has length at most ℓ, where β < q is a root of the polynomial x r − (q − 1)x r−1 − · · · − (q − 1)x − (q − 1). This implies that B(x, t) is indeed an analytic function of x for |x| < β −1 φ δ whenever |t| ≤ δ. For suitably small δ, β −1 φ δ is greater than 1 q , which proves the first part of our statement. Next note that and it follows by an easy calculation that Hence α(0) = 1 q is the only solution of the equation x + x r B(x, 0) = 1, and it is a simple root. All remaining statements are therefore simple consequences of the implicit function theorem.
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, for some function κ. Both α and κ are analytic functions of t for |t| ≤ δ, and κ(t) = 0 in this region.
Proof. This follows from the previous lemma by means of singularity analysis, see [11,Chapter VI].
If f is not the constant function f ≡ 1, then σ 2 = 0 and the normalised random variable (L k − µk)/(σ √ k) converges weakly to a standard Gaussian distribution.
Proof. The moment generating function of L k is [x k ]F (x, t)/q k . Hence the statement follows from Lemma 13 by means of the Quasi-power theorem, see [16] or [11,Chapter IX.5]. The only part that we actually have to verify is that σ 2 = 0 unless f is constant. Assume that σ 2 = 0. We first consider the case that log α(t) is not a linear function. Let s be the least integer greater than 1 such that t s occurs with a nonzero coefficient in the Taylor expansion of log α(t) at t = 0, i.e., log α(t) = log α(0) + at + bt s + O(t s+1 ).
Note that a = −µ. Moreover, by the assumption that σ 2 = 0, we must have s ≥ 3. Since α(0) = 1 q and κ(0) = 1, it follows that Considering the normalised version R k = L k −µk k 1/s of the random variable L k , we get for fixed τ . So for every complex τ , we have lim k→∞ E(exp τ R k ) = exp(−bτ s ), which is a continuous function. By Lévy's continuity theorem, this would imply convergence in distribution of R k to a random variable with moment generating function M (τ ) = exp(−bτ s ). However, there is no such random variable: all derivatives at τ = 0 are finite and the second derivative of exp(−bτ s ) at τ = 0 is 0, thus the second moment is 0. A random variable whose second moment is 0 is almost surely equal to 0 and would thus have moment generating function 1.
The only remaining possibility is that log α(t) is linear: log α(t) = log α(0) + at, thus α(t) = α(0)e at = e at /q. If we plug this into the defining equation of α(t), we obtain identically for |t| ≤ δ. However, the right side of this identity has strictly positive second derivative for real t unless a = 0 and f (n) = 1 for all n ∈ B (in which case f (n) = 1 for all n). Thus σ 2 = 0 unless f ≡ 1.
If f is not the constant function f ≡ 0, 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 distribution of 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 constants in mean and variance.
Example 7 (see also [8,18]). The number of blocks 0101 occurring in the binary expansion of n is a 2-quasiadditive function of at most logarithmic growth. Thus by Corollary 15, the standardised random variable is asymptotically normally distributed, the constants beingμ = 1 16 andσ 2 = 17 256 . Example 8 (see also [14,23]). The Hamming weight of the nonadjacent form is 2-quasiadditive with at most logarithmic growth (as the length of the NAF of n is logarithmic). Thus by Corollary 15, the standardised random variable is asymptotically normally distributed. The associated constants areμ = 1 3 andσ 2 = 2 27 . Example 9 (see Section 2). The number of optimal {0, 1, −1}-representations is 2-quasimultiplicative. As it is always greater or equal to 1 and 2-regular, it has at most polynomial growth. Thus Theorem 14 implies that the standardised logarithm of this random variable is asymptotically normally distributed with numerical constants given by µ ≈ 0.060829, σ 2 ≈ 0.038212.
Example 10 (see Section 2). Suppose that the sequence s 1 , s 2 , . . . satisfies s n ≥ 1 and s n = O(c n ) for a constant c ≥ 1. The run length transform t(n) of s n is 2-quasimultiplicative. As s n ≥ 1 for all n, we have t(n) ≥ 1 for all n as well. Furthermore, there exists a constant A such that s n ≤ Ac n for all n, and the sum of all run lengths is bounded by the length of the binary expansion, thus Consequently, t(n) is positive and has at most polynomial growth. By Theorem 14, we obtain an asymptotic normal distribution for the standardised random variable log t(N k ). The constants µ and σ 2 in mean and variance are given by These formulas can be derived from those given in Theorem 14 by means of the representation (7), and the terms can also be interpreted easily: write log t(n) = i≥1 X i (n) log s i , where X i (n) is the number of 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).
Let us finally show that the central limit theorem holds in a slightly more general version, where we pick an integer uniformly at random from the set {0, 1, 2, . . . , K − 1} (K not necessarily being a power of q any longer). We first state and prove our result for q-quasiadditive functions; it automatically transfers to q-quasimultiplicative functions by Proposition 3.
Theorem 16. Assume that the q-quasiadditive function f has at most logarithmic growth, and that f is not the constant function f ≡ 0. Let M K be a randomly chosen integer in {0, 1, . . . , K − 1}.
The random variable where the two constantsμ andσ 2 are the same as in Corollary 15, converges weakly to a standard Gaussian distribution.
Proof. Let L 1 and L 2 be the largest integers for which we have q L1 < K/ log 2 K and q L2 < K/ log K, respectively. For each nonnegative integer m < K, we consider (if it exists) a representation of the form where b < q k and L 1 ≤ k ≤ L 2 . If there are two or more such representations for a specific m, we take the one for which k is maximal so as to obtain a unique representation. If m does not have a representation of this form, then it does not have r consecutive zeros in its q-ary representation anywhere in the block ranging from the (L 1 + 1)-th to the (L 2 + r)-th digit, counting from the least significant digit. The proportion of such integers is since we assumed f to have at most logarithmic growth. For given a and k, b can be any integer in the set {0, 1, . . . , q k − 1}, unless a = ⌊K/q k+r ⌋. In the former case, we can identify b with N k , the random variable defined in Theorem 14 and Corollary 15. The latter case, however, is negligible, since it only accounts for a proportion of at most values of m. Now we condition on the event that the random integer M K has a representation of the form (9) for certain fixed k and a = ⌊K/q k+r ⌋. For every real number x, we have (10) P f (M K ) ≤μ log q K + xσ log q K q k+r a ≤ M K < q k+r a + q k = P f (N k ) ≤μ log q K + xσ log q K − f (a) = P f (N k ) −μ log q K − f (a) σ log q K ≤ x .
Note that k = log q K + O(log log K), so Let Φ(x) = 1 √ 2π x −∞ e −t 2 /2 dt denote the distribution function of a standard Gaussian distribution. By Corollary 15, and because Φ is continuous, we have and this holds uniformly in x, a and k as K → ∞ (in fact, one can make the speed of convergence explicit by means of the Quasi-power theorem). Summing (10)  where the two constants µ and σ 2 are the same as in Theorem 14, converges weakly to a standard Gaussian distribution.