Hyperbinary Expansions and Stern Polynomials

We introduce an infinite class of polynomial sequences a t (n; z) with integer parameter t 1, which reduce to the well-known Stern (diatomic) sequence when z = 1 and are (0, 1)-polynomials when t 2. Using these polynomial sequences, we derive two different characterizations of all hyperbinary expansions of an integer n 1. Furthermore, we study the polynomials a t (n; z) as objects in their own right, obtaining a generating function and some consequences. We also prove results on the structure of these sequences, and determine expressions for the degrees of the polynomials.

Within the framework of a more general study of binary partition functions, Reznick [13,Theorem 5.2] proved the following fundamental result.
Theorem 1.1 ( [13]).The number of hyperbinary expansions of an integer n 1 is given by a(n + 1), where {a(n)} is the Stern diatomic sequence.
While Theorem 1.1 has been refined by results that count hyperbinary expansions with certain properties (see [1], [10], [14]), one purpose of this paper is to prove results that give the actual set of all hyperbinary expansions of n.We begin by defining a proper hyperbinary expansion as one that has at least one repeated power of 2. Our first main result, which characterizes the hyperbinary expansions, can then be stated as follows.
Theorem 1.2.Let n 2 be an integer and denote by k 1 , . . ., k ν those integers 1 k n 2 for which n−k k is odd.Then each hyperbinary expansion of n corresponds to exactly one k j , j = 1, . . ., ν, as follows: The powers of 2 in the binary expansion of k j are exactly the repeated powers of 2 in a hyperbinary expansion of n.
We illustrate this result with an example.
The proof of Theorem 1.2 involves properties of a class of polynomial analogues of the Stern sequence, the introduction and study of which is the second main purpose of this paper.We define these polynomials as follows: Given an integer t 1, we set a t (0; z) = 0, a t (1; z) = 1, and for n 1 we let a t (2n; z) = a t (n; z t ), (1.2) a t (2n + 1; z) = z a t (n; z t ) + a t (n + 1; z t ). (1.3) For t = 2 this definition reduces to that of the Stern polynomials defined in [6], and polynomials closely related to a 1 (n; z) were studied in [1] and [14].
Comparing (1.2) and (1.3) with (1.1), we immediately see that for all integers t 1 and n 1 we have a t (n; 0) = 1, a t (n; 1) = a(n), (1.4) and by iterating (1.2) and considering (1.3) we see that The polynomials a t (n; z) for n 20 are listed in Table 1.
In Section 2 we derive further properties of the polynomials a t (n; z), mainly concerning their structure, and in Section 3 we use these results to establish a correspondence between these polynomials and hyperbinary expansions.In Section 4 we obtain an explicit formula for a t (n; z) and use it to prove Theorem 1.2 and a few additional results related to Theorems 1.1 and 1.2.In Section 5 we obtain a generating function and prove the electronic journal of combinatorics 22(2) (2015), #P2.24 some related identities, and in Section 6 we prove some further results on the structure of the polynomials a t (n; z).Finally, in Section 7 we obtain identities for the degrees of these polynomials, and we conclude this paper with some further remarks about Stern polynomials in Section 8.
2 The structure of the polynomials a t (n; z) Before we can state and prove results connecting hyperbinary expansions with the polynomials a t (n; z), we need to derive some properties of these polynomials.
Proposition 2.1.For integers t 2 and n 0, the coefficients of a t (n; z) are only 0 or 1.
Proof.This is easily obtained by induction on n.We note that a t (1; z) = 1, and suppose that the statement of the result is true up to index n − 1.If n is even, the induction step is given by (1.2).If n is odd, we use (1.3) and note that for t 2 the powers of z in the two terms on the right of (1.3) lie in two different residue classes modulo t; hence there is no overlap, and the coefficients remain 0 or 1.
When t = 1, this proof fails.In fact, the smallest counterexample is a 1 (5; z) = 2z + 1; see Table 1.The case t = 1 is of independent interest, as we will see in Section 3.
The next result complements Proposition 2.1 and further explains the structure of the entries in Table 1.
Proposition 2.2.For any integer n 1 we have where P n is a (possibly empty) set of a(n) − 1 distinct polynomials in t with coefficients 0 or 1.
Proof.We prove this by induction on n, using (1.2) and (1.3).For n = 1 we have a t (1; z) = 1, and so P 1 = ∅.Now suppose that the statement holds up to a certain n 1.
(i) By (1.2) and the induction hypothesis we have .
and therefore P 2n also has the desired properties.
(ii) By (1.3) and the induction hypothesis we have and therefore Since the elements in P n−1 and in P n are distinct, and those in the second and third sets above have constant coeffcicients 1, respectively 0, we see that all the elements in P 2n−1 are distinct.It is also clear that they have only coefficients 0 or 1.This completes the proof by induction.
We remark that this proof, along with (1.5), shows that P n is empty if and only if n is a power of 2.

Hyperbinary expansions
The case t = 1 of the polynomials a t (n; z) has recently been studied in connection with hyperbinary expansions.Indeed, Theorem 1.1 was refined by Bates and Mansour [1] and by Stanley and Wilf [14] who proved results that are equivalent to the following.Theorem 3.1 ([1], [14]).Given an integer n 1, write Then for each j 0, c n,j is the number of hyperbinary expansions of n that have exactly The following result is similar to Theorem 1.2 in that it provides a complete characterization of all hyperbinary expansions of a positive integer n, thus vastly extends Theorem 3.1.Theorem 3.2.Given an integer n 1, let P n+1 be the set of exponents of z in a t (n+1; z), i.e., a t (n + 1; z) = 1 + Then each proper hyperbinary expansion of n corresponds to exactly one polynomial in P n+1 , as follows: If then exactly the powers 2 α 1 , . . ., 2 αr are repeated in the expansion.
In the following section we will see that Theorem 1.2 follows from Theorem 3.2.
Proof of Theorem 3.2.We first deal with the case n = 2 m − 1, m 0. Then by Theorem 1.1 and (1.5) there is only one hyperbinary expansion (HBE) of n, namely the binary expansion (this can also be seen directly).On the other hand, again by (1.5), P n+1 is empty and therefore Theorem 3.2 holds trivially in this case.For all other n, (1.5) implies that P n+1 is nonempty.(See also the remark a the end of Section 2).
We now proceed by induction on n, beginning with n = 2.In this case P n+1 = {1} = {t 0 }, which corresponds to the one proper HBE 1+1 of n = 2, and the induction beginning is established.
Suppose now that the result is true up to some integer k 1.We distinguish between two cases.
(a) Let n = 2k + 1 be odd.By the first paragraph of the proof we may assume that n + 1 is not a power of 2, and thus k + 1 is also not a power of 2. Clearly each HBE of n contains exactly one summand 2 0 .By subtracting this part and dividing the remainder by 2, we establish a bijection between the HBEs of k and those of 2k + 1.
On the other hand, by induction hypothesis all the proper HBEs of k correspond to the elements Now by (2.2), each element p(t) ∈ P k+1 corresponds to the element tp(t) = t α 1 +1 + • • • + t αr+1 ∈ P 2k+2 .But this was to be shown, since 2k + 2 = n + 1.Also note that the binary expansion of k corresponds to that of 2k + 1.
(b) Let n = 2k be even.Then the HBEs of n fall into the following two classes: (i) Those HBEs which contain no summand 2 0 ; this class contains the binary expansion of n.Then by dividing by 2 we establish a bijection between these and the HBEs of k.By induction hypothesis they are given by the binary expansion of k, along with the elements of P k+1 .
(ii) Those HBEs which contain 2 0 with multiplicity 2. Then by subtracting these two parts and dividing by 2, noting that (2k − 2)/2 = k − 1, we establish a bijection between these and the HBEs of k − 1.But by the induction hypothesis these latter HBEs are given by the binary expansion of k − 1, along with the elements of P k .Now we use (2.3) with k + 1 in place of n, obtaining We now see that the bijections in (i) and (ii) above are captured in this relation, with the exception of the binary expansion of n.But this is the statement of Theorem 3.2 for n = 2k.The proof by induction is now complete.
4 An explicit expansion, and a proof of Theorem 1.2 In connection with a wider study of certain polynomial sequences, Carlitz [3, p. 17] proved, in different notation, the following result.This indicates that it will be of interest to consider binomial coefficients (mod 2).For the remainder of this section we use the notation With this notation we can rewrite Proposition 4.1 as which was earlier obtained in [8, p. 319].A polynomial analogue of this identity was given in Proposition 6.1 of [6] in terms of Chebyshev polynomials of the second kind, U n (x).
A well-known explicit expansion of U n (x) (see, e.g., [3,Eqn.(2.16)]) then gives, in the notation of (1.2) and (1.3), The main result of this section is an analogue of (4.3) for a t (n + 1; z) with arbitrary integer parameters t 1.In order to state and prove this result, we require the following function.
Definition 4.1.Let n 0 be an integer, and let n = j 0 c j 2 j , c j ∈ {0, 1}, be the binary expansion of n.Then for integers t 1 we define See Table 2 for various small values of d t (n).The sequences d t (n), n 1, are in fact known for the first few t 1; see the last column in Table 2, where the reference numbers to the On-Line Encyclopedia of Integer Sequences [12] are given.In particular, d 1 (n) gives the binary weight or Hamming weight of n, and d 4 (n), n 1, is known as the Moser-deBrujn sequence.We are now ready to prove the following result.
Theorem 4.1.For integers t 1 and n 0 we have the electronic journal of combinatorics 22(2) (2015), #P2.24 Before proving this result, we derive some basic properties of the coefficients in the polynomials in (4.6).By a special case of a well-known congruence of Lucas (see, e.g., [9]) we have for nonnegative integers m, n and a, b ∈ {0, 1}, Hence we obtain (as also used by Carlitz [3, p.  Proof of Theorem 4.1.We denote the right-hand side of (4.6) by a t (n + 1; z) and show that these sums satisfy the same recursions as a t (n + 1; z), namely (1.2) and (1.3).The initial conditions a t (1; z) = a t (2; z) = 1 are trivially true.We now distinguish between two cases: (i) Let n be odd, say n = 2m − 1, m 2.Then, using (4.7), where we have used (4.7) again, as well as (4.5).
(ii) Let n be even, say n = 2m, m 1.We split the summation index into odd and even k and then use (4.7) and (4.5): The cases (i) and (ii), together with the initial conditions, complete the proof.
Proof of Theorem 1.We now consider the question of how many different integers n have the same number of hyperbinary expansions.The answer is easily obtained from the following fact about the Stern sequence a(n), which goes back to Stern's original paper [15, p. 202]; see also [11, p. 60].

Proposition 4.2 ([15]
).Given an integer m 2, the number of integers j in the interval 2 m−1 j 2 m for which a(j) = m is ϕ(m), where ϕ denotes Euler's totient function.Furthermore, it is the same number in any subsequent interval between two consecutive powers of 2.
These ϕ(m) numbers may be odd (e.g., a(2 m−1 + 1) = a(2 m − 1) = m, which is easy to see by induction), or they may be even, in which case we divide by the appropriate power of 2, keeping (1.1) in mind.With Theorem 1.1 we now get the following result.This last identity holds also in general, with the range of r appropriately adjusted.
We conclude this section with a few more observations related to Theorem 1.2.First, let m 2 be given, and let 2h r + 1, r = 1, . . ., ϕ(m) be the odd integers for which a(2h r + 1) = m.Proof.We let h stand for an arbitrary h r , and we rewrite (4.2) by splitting the summation index into k = 2j + 1 and k = 2j; this is followed by applying (4.7): the electronic journal of combinatorics 22(2) (2015), #P2.24 where we have used (4.2) again.From this it is also clear that the number of odd k (resp.even k) for which 2h−k k is odd is exactly a(h) (resp.a(h + 1)).To complete the proof, we note that a(h) and a(h + 1) must be relatively prime (as already shown by Stern [15, p. 199]; see also [11, p. 60]), their sum is m, and they lie between 1 and m − 1.But this means that both a(h) and a(h + 1) traverse a reduced residue system modulo m as h takes on the values h r , 1 r ϕ(m).
It is clear from the proof that Proposition 4.4 could also be stated in terms of even k.To return to our running example n = 12: In Example 1 we saw that there are two odd k for which 12−k k is odd, and indeed, a(6) = 2.For n = 10, 16 and 30 (see Example 4), the corresponding numbers of odd k are a(5) = 3, a(8) = 1 and a(15) = 4, respectively.
Finally, since the odd integers k 1 are exactly those which have the power 2 0 = 1 in their binary expansions, Theorem 1.2 and the proof of Proposition 4.4 immediately gives the following consequence.Proposition 4.5.Among the hyperbinary expansions of the positive even integer n = 2h, exactly a(h) have a repeated 1.

Generating function
A well-known property of the Stern sequence, first obtained by Carlitz [4], is the generating function ( In this section we are going to prove the general case. Proposition 5.1.For integers t 1, the Stern polynomials a t (n; z) have the generating function Special cases of (5.2) were given in [1] for t = 1 and in [6] for t = 2.
Proof of Proposition 5.1.For a fixed t 1, we set Now by (1.2) we have the electronic journal of combinatorics 22(2) (2015), #P2.24 Similarly, by (1.3) we have Adding (5.3) and (5.4), we obtain and upon iterating this functional equation we get We are done if we can show that for sufficiently small x and z we have (5.6) then (5.5) becomes the desired identity (5.2) as N → ∞.
To prove (5.6), we use the following estimate on the size of the polynomials a t (n; z): where the first inequality in (5.7) follows from (1.4), and the second inequality can be found in [13, p. 472 (5.8) then we see that for any |z| 1 and |x| 1 − ε for some ε > 0, the sum in parentheses on the right of (5.8) remains bounded due to (5.7).But then, since x 2 N +1 → 0 as N → ∞, we immediately get (5.6).This completes the proof.
We finish this section with what can be considered a finite analogue of the generating function.One of the properties of the Stern polynomials a 2 (n; z) derived in [6] is the identity valid for all integers N 1.Using a different method of proof, we can obtain the following generalization.
Proposition 5.2.For all integers t 1 and N 1 we have n=2 N +1 a t (n; z). (5.10) Before proving this result, we note that in addition to obtaining (5.9) for t = 2, the case t = 1 immediately gives which can be viewed as an apparently new property of the q-hyperbinary sequence (with q = z) studied in [1] and [14].Another immediate consequence of (5.10), obtained by setting z = 1 and using (1.4), is the well-known identity for the Stern sequence; see, e.g., [11].The proof of Proposition 5.2 relies on the following property of the Stern polynomials a t (n; z).Proposition 5.3.For all integers t 1, N 0 and 0 j 2 N we have (5.12) To prove Proposition 5.2, we first sum both sides of (5.12) over all j, 1 j 2 N , obtaining (5.13) The desired identity (5.10) now follows by induction: For the base case N = 1 we note that a t (3; z) + a t (4; z) = 2 + z; see Table 1.Assuming now that (5.10) holds for some N 1, (5.13) shows that it also holds for N + 1, which concludes the proof.
Proof of Proposition 5.3.We prove this by induction on N .When N = 0, we have for j = 0, 1, which is easy to verify with Table 1.Now suppose that (5.12) holds up to some N − 1, and for all j with 0 j 2 N −1 .To prove (5.12) for N , we first assume that j is even, say j = 2 .Then by (1.2) we have but this is true by the induction hypothesis.When j is odd, we proceed analogously, using (1.3) and the induction hypothesis.This completes the proof.
the electronic journal of combinatorics 22(2) (2015), #P2.24 6 Further results on the structure of a t (n; z) While Section 2 is concerned with the "large structure" of the polynomials a t (n; z), in this section we prove some results on the finer structure of the polynomials.We start with the observation that, for t 2, all a t (2n + 1; z) begin with 1 + z and all a t (2n; z) contain no z term; see Table 1.Similarly, we observe a periodicity with period 4 which can be stated as follows: For all integers t 2 and k 1 we have In general, we have the following result.
Proposition 6.1.Let t 2 and N 0 be integers.Then for all n 2 N we have Proof.We prove this by induction on N .The base case N = 0 reduces to But this is obvious since all a t (n; z) have constant coefficient 1 for n 1.Now suppose that (6.1) holds up to some N 0 and for all n 2 N .We first replace z by z t in (6.1) and apply (1.2) to both sides, to obtain Using this and (1.3) with (1.2), we get for some polynomials f and g, and valid for n − 1 2 N .But this, together with (6.2), means that for all n 2 N +1 we have which completes the proof by induction.
The following result, which is similar in nature to Proposition 5.3, can be seen as supplementing Proposition 6.1.Indeed, it exhibits the exact remainder when n is restricted to 2 N n 2 N +1 .Here we find it convenient to shift the parameters by setting j = n − 2 N .the electronic journal of combinatorics 22(2) (2015), #P2.24Proposition 6.2.For all integers t 1, N 0 and 0 j 2 N we have a t (2 N +1 + j; z) = a t (2 N + j; z) + z t N a t (j; z).(6.3) Proof.We prove this again by induction on N .The base case N = 0 is a t (2 + j; z) = a t (1 + j; z) + za t (j; z) for j = 0, 1, which is obvious from Table 1.The induction step is now very similar to the proof of Proposition 5.3.
Related to the previous results is a regularity in the growth in the terms of certain subsequences of the polynomials a t (n; z), as seen in the following Example 5.
This progression is explained by the following easy extension of Proposition 6.2.It can be obtained by replacing N by N + ν in (6.3) and summing over all ν, 0 ν K − 1. Proposition 6.3.For all integers t 1, N 0, K 1, and 0 j 2 N we have This shows that the polynomials a t (2 N +K + j; z) change in a very regular way for fixed N and j, as K grows.
While Propositions 6.2 and 6.3 deal with indices n in a t (n; z) that are a fixed integer j above a power of 2, the following result deals with those that lie j units below a power of 2. Proposition 6.4.Let the integers t 1 and j 1 be given, and let N be the smallest exponent for which 2 N j.Then for all K 1 we have Proof.In (5.12) and ( 6.3) we replace j by 2 N − j, obtaining the term a t (3 • 2 N − j; z) in both identities.If we eliminate this term, we get This identity remains valid if we replace N by N + 1, . . ., N + K − 1.Then, iterating (6.6), we obtain (6.5).
In closing this section we note that the sequences of polynomials in Examples 5 and 6, as well as (6.4) and (6.5), suggest the existence of analytic functions (for |z| < 1) as limiting cases, as K → ∞.
7 The degrees of a t (n; z) The main goal of this section is to obtain explicit expressions for the degrees of the polynomials a t (n; z).To this end we need to derive certain supporting identities.We begin with some preliminary results on the differences in the degrees of successive polynomials.
Furthermore, for any integer k 1 and any odd integer n 1 we have Proof.Slightly rewriting (1.3), we have Since the coefficients of all these polynomials are nonnegative, there is no cancellation on the right-hand side of (7.3).Therefore, comparing this with (1.2), we immediately obtain (7.1).Now, given an odd n 1, we get with (1.2) and (1.3), We first let k = 0. Since n is odd, by (7.1) the degree of (7.4) in this case is the same as the degree of the first term on the right-hand side of (7.4).Thus, by (7.5), we have shown that deg a t (2n + 1; z) − deg a t (2n ; z) = 1, which is (7.2) for k = 1.
the electronic journal of combinatorics 22(2) (2015), #P2.24 This now serves as the base case of the general proof by induction on k.Thus, suppose that (7.2) holds up to a certain k 1.Since by the induction hypothesis we have Hence, with (7.5) and the induction hypothesis we get which is (7.2) with k + 1 in place of k.This completes the proof.
To obtain an explicit expression for the degrees of the polynomials a t (n; z), we require the function d t (n), which was defined in (4.4).Proposition 7.2.Let e(n) be the highest power of 2 dividing n.Then for integers t 1 and n 1 we have and in particular, Proof.We prove (7.6)If n is even, then by (7.2) the maximum is attained by the second term on the right-hand side of (7.8).Therefore, by (7.8), the induction hypothesis, and by the first part of (4.Since n is odd, we have e(n) = 0, so that 2 e(n)+1 − 1 = 1 = 2 e(2n+1) , and once again we obtain (7.9), as required.The proof is now complete.
We note that in the case t = 2, Proposition 7.2 above reduces to Proposition 2.1 in [6].For fixed t = 2, Table 2 with (7.7) seems to indicate that the sequence of the degrees are rather irregular.However, it is clear from Definition 2 that all degree polynomials in t actually occur, and moreover they do so in their lexicographic order for a t (2n + 1; z), n 1.For instance, up to n = 7 the degrees are 1, t, t + 1, t 2 , t 2 + 1, t 2 + t, and t 2 + t + 1.

Further Remarks
Since this paper deals with Stern polynomials, it should be mentioned that a polynomial extension of the Stern sequence, different from that in [6], was independently introduced by S. Klavžar et al. [10].Interestingly, their sequence of polynomials, which are not (0, 1)polynomials, is also related to hyperbinary expansions of n.In fact, the kth coefficient of the (n+1)th Stern polynomial in the sense of [10] is the number of hyperbinary expansions of n with exactly k digits 1.
The Stern polynomials introduced in [6], which are the special case t = 2 of the polynomials a t (n; z), have been investigated in greater detail in [5] and [7].The result of Carlitz, quoted in the present paper as Proposition 4.1, was also stated in [6] as Corollary 6.2; however, it contains a misprint: a(n) should be replaced by a(n + 1).
In closing we mention that in addition to Theorem 1.1, another remarkable property of the Stern (diatomic) sequence {a(n)} is the fact that the quotients a(n)/a(n + 1), n 1, give an enumeration without repetitions of all the positive rationals; see, e.g., [2].

Proposition 4 . 1 (
[3]).For a fixed n 0, the number of odd binomial coefficients n−k k is given by the Stern number a(n + 1).

2 .
Note that by Proposition 2.2 and Theorem 4.1, the elements of P n+1 are exactly those d t (k) for which 1 k n 2 and n−k k * = 1, i.e., n−k k is odd.Now, by the definition (4.4) of d t (k), there is a one-to-one correspondence between the powers of t in d t (k) and the powers of 2 in the binary expansion of k.The result now follows from Theorem 3.2.the electronic journal of combinatorics 22(2) (2015), #P2.24

Proposition 4 . 4 .
Let m 2 and h r , 1 r ϕ(m), be as above.If µ r is the number of odd k, 1 k h r , for which 2hr−k k is odd, then {µ r | 1 r ϕ(m)} is a reduced residue system modulo m.

Proposition 7 . 1 .
Let t 1 be a fixed integer.Then for any integer n 1 we have deg a t (2n − 1; z) deg a t (2n; z).
repeated powers of 2.