The maximal order of hyper-($b$-ary)-expansions

Using methods developed by Coons and Tyler, we give a new proof of a recent result of Defant, by determining the maximal order of the number of hyper-($b$-ary)-expansions of a nonnegative integer $n$ for general integral bases $b\geqslant 2$.


Introduction
If b 2 is a positive integer and n 0 is a nonnegative integer, then a hyper-(bary)-expansion of n is an expansion where a i ∈ {0, 1, . . . , b} and a i = 0 for all but finitely many indices i. In contrast, the standard base-b expansion requires a i ∈ {0, 1, . . . , b − 1}.
Recently, answering a question of Calkin and Wilf [3], Coons and Tyler [4] determined the maximal order of Stern's diatomic sequence. Very recently, Defant [5] gave an extension of their result to the functions s b (n). In this short paper, we use a slight variant of the method of Coons and Tyler, to give a new (and much shorter) proof of Defant's result.
Lemma 1 (Defant). Let k 2 and n be positive integers. Then Moreover, if a k denotes the smallest n in the interval [b k−2 , b k−1 ) for which this maximum is attained, then Thus by definition s b (a k ) = F k . We note that a k has the base b-expansion ((10) ℓ−1 1) b for k = 2ℓ and ((10) ℓ−1 11) b for k = 2ℓ+1, therefore this Lemma follows from a result of Defant [5, Proposition 2.1], however, this lemma can also be proven directly from the corresponding statement for Stern's sequence (see Lehmer [6] and Lind [7]). To do so, one need only notice that the Stern sequence is a subsequence of {s b (n)} n 0 and that the maximal values occur in this subsequence first. Explicitly, if we define ψ b : N → N by

then setting
From this identity it follows at once that Moreover, the matrices A i are nonnegative and A i is bounded componentwise by A 1 for i 2. Replacing any such matrix A i with i 2 by A 1 therefore does not decrease the value of the product in (2). This proves that whereε i = min(ε i , 1). Therefore numbers with only zeros and ones in their base-b expansions dominate the sequence s b (n), that is, for every n there is an m n with only zeros and ones in its base-b expansion such that s b (m) s b (n).
In the following lemma, we collect some necessary properties of h(x).
. . of slopes of the line segments is nonincreasing. In particular, the function h is concave in R 1 .
Proof. The statements in the first sentence follow directly from the definition.
To establish the validity of Equation (4), it is enough to realise that on the interval [ã k ,ã k+1 ], both sides are linear functions, which coincide at the endpoints, The proof of (5) is by inserting the definition ofã k into the equation Finally, it is an easy consequence of Binet's formula that the sequence of slopes is nonincreasing.
The piecewise linear function h(x) thus satisfies a recurrence relation resembling that of s b (n). Using this recurrence, we show that h(n) is, in fact, an upper bound for s q (n), which is the main tool of our proof. Moreover, Proof. The limit result (7) follows from the first statement, which yields the inequality " ", together with the equality s b (a 2k ) = h(a 2k ) that holds for all k 0. It is sufficient to prove the assertion (6) for such m whose b-ary expansion consists only of zeros and ones, as for each n there is such an m with m n and s b (n) s b (m); see the comments just before Definition 1 for details.
We prove the lemma using induction, however, we have to strengthen the induction hypothesis by the additional property that (Remark: in fact we are working with a strictly weaker bound than Coons and Tyler [4] did for the case b = 2. They defined the function h by just connecting the maxima at the positions a k . Our function h hits only those maxima (a k , F k ) where 2 | k, and the others lie to the right of h, shifted by b/(b + 1). Therefore our induction hypothesis has to be stronger, but as an exchange for this additional difficulty the tedious proof of Lemma 2.1 in the cited paper can be dispensed with, since our bound h is easier to work with.) To get the proof started, we first verify the statement for the sixteen integers m given by the b-ary expansions (ε 3 ε 2 ε 1 ε 0 ) b , where ε i ∈ {0, 1}. The case that ε i = 0 for all i ∈ {0, 1, 2, 3} is trivial. Concerning the other fifteen indices, by monotonicity of h we only have to consider those positions where a new maximum is attained: and these values do not appear before. Clearly s b (1) = 1 = h(ã 2 ) = h(1) and (8) is satisfied for these latter two positions. Finally, we have s b (b 3 + 1) = 4 and by (5) it is not difficult to show that h(b 3 + 1) = 5 − 2/b 2 4.
For the induction step, let k 5 and assume that (6) and (8) hold for all m < b k−1 having only zeros and ones as b-ary digits. Let b k−1 m < b k , where m satisfies the same digit restriction. We distinguish between six cases. If m = bj, where j 1, then s b (bj) = s b (j) h(j) h(bj), where the last inequality is true by the monotonicity of h(x). The case for m = bn+1 for some n is more involved, and it is this case for which we need the special form of the function h. We start with the case m ≡ 1 mod b 3 , that is, m = b 3 j + 1, where j b since m b 4 . Using the recurrence for s b , the induction hypothesis, monotonicity of h and the identity (4), in this order, we obtain The first case m ≡ 1 mod b 3 is finished as soon as we prove that this last expression is bounded from above by This estimate follows from the concavity of h in R 2 , comparing the arguments of the function h: we have j b 2, and therefore bj − j b = b 2 j + b + 1/(b + 1) − (b 2 + 1/(b + 1)), which yields the statement.
By a very similar argument we treat the case m = b 4 j + b + 1, however we consider the case j = 1 separately. Using (3) and (5), we get in this case as required by (8). Assume now that j 2. We have (note that the argument leading to the second row works equally well for b = 2) and an analogous argument as before, using the concavity of h, shows that this can be estimated by The remaining three cases are simpler as we do not need the concavity of h for them. We have which settles the cases m ≡ b 3 + b + 1 mod b 4 , m ≡ b 2 + 1 mod b 3 and m ≡ b 2 + b + 1 mod b 3 respectively. Note that all of these calculations are also valid for b = 2.
The residue classes considered cover the set of nonnegative integers with b-ary expansions containing only zeros and ones, and therefore for all m 0. Proof. Leth(x) be the piecewise linear function satisfyingh(ã k ) = ϕ k / √ 5 for k 0, and setH

Lemma 4. If
Then H(x) is a concave function that passes through the points ã k , ϕ k / √ 5 . It follows thath(x) H (x) for x 0, where we have equality when x =ã k . Moreover, ifã k x ã k+1 , by Binet's formula |h(x) − h(x)| ϕ −k / √ 5. Furthermore, the mean value theorem gives |H(x) − H(x)| Cx −η for some C and some η > 0. Combining these three estimates yields the first statement.

Concluding remarks
In this paper, we gave a short proof determining the maximal order of the number s b (n) of hyper-(b-ary)-expansions of a nonnegative integer n − 1 for general integral bases b 2. Our proof was based on considering the finite number of specific recurrences satisfied by s b (n) over arithmetic progressions bn + i, and constructing a piecewise linear function approximating those recurrences.
Functions satisfying recurrences like those satisfied by s b (n) are plentiful in the literature, and often given special attention by number theorists and theoretical computer scientists; see Allouche and Shallit's work on b-regular sequences [1,2] for a general treatment and several specific examples. The recurrences satisfied by b-regular sequences lead to a matrix classification, which has proven to be very useful; here the usefulness comes by recognising that the Stern sequence s 2 (n) is the dominating subsequence of s b (n) (for each b 2), and that the growth properties of the Stern sequence determine the growth properties of s b (n).
We end by pointing the interested reader to the extremely useful result of Allouche and Shallit [1, Theorem 2.2], which formalises this relationship.
Theorem 2 (Allouche and Shallit). The integer sequence {f (n)} n 0 is b-regular if and only if there exist positive integers m and d, matrices A 0 , . . . , A b−1 ∈ Z d×d , and vectors v, w ∈ Z d such that where n = (i s · · · i 0 ) b .